1
*&--------------------------------------------------------------------*
2
*& Form BUILD_VALTAB_HFIELDS *
3
4
* build value tab ignoring hidden fields using structure table *
5
6
FORM build_valtab_hfields.
7
8
DATA: fieldname TYPE fnam_____4.
9
FIELD-SYMBOLS: <value> TYPE ANY, <valfld> TYPE ANY,
10
<value_tab> TYPE x.
11
CLEAR value_tab.
12
ASSIGN value_tab TO <value_tab> CASTING.
13
LOOP AT structure_table.
14
IF x_header-bastab NE space AND x_header-texttbexst NE space AND
15
structure_table-tabname EQ x_header-texttab.
16
* texttabfield
17
ASSIGN COMPONENT structure_table-fieldname
18
OF STRUCTURE <vim_ext_txt_struc> TO <value>.
19
* READ TABLE x_namtab WITH KEY viewfield = structure_table-fieldname
20
* texttabfld = 'X'.
21
ELSE.
22
* viewfield
23
LOOP AT x_namtab WHERE viewfield = structure_table-fieldname AND
24
( texttabfld = space OR keyflag = space ).
25
26
OF STRUCTURE <vim_extract_struc> TO <value>.
27
EXIT.
28
ENDLOOP.
29
ENDIF.
30
CHECK <value> IS ASSIGNED.
31
CONCATENATE structure_table-tabname structure_table-fieldname
32
INTO fieldname SEPARATED BY '-'.
33
ASSIGN <value_tab>+structure_table-offset(structure_table-intlen)
34
TO <valfld> CASTING TYPE (fieldname).
35
MOVE <value> TO <valfld>.
36
* CHECK sy-subrc EQ 0.
37
* MOVE extract+x_namtab-position(x_namtab-flength)
38
* TO value_tab+structure_table-offset(structure_table-intlen).
39
40
APPEND value_tab.
41
ENDFORM. "build_valtab_hfields