10-23-2006 4:16 PM
I can declare:
FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
But this <fs>[] doesn't have a headline. How can I declare this <fs> with a header line?
Thanks.
10-23-2006 4:17 PM
I would suggest not using a header line. Use a seperate work area instead. Here is an example.
report zrich_0001 .
Types: begin of ttab,
fld1 type c,
fld2 type c,
end of ttab.
data: itab type table of ttab.
data: WA like line of itab.
field-symbols: <fs> type standard table.
field-symbols: <fs_wa>.
wa-fld1 = 'A'.
wa-fld2 = '1'.
append wa to itab.
wa-fld1 = 'B'.
wa-fld2 = '2'.
append wa to itab.
assign itab to <fs>.
assign wa to <fs_wa>.
loop at <fs> into <fs_wa>.
write:/ <fs_wa>.
endloop.
Regards,
Rich Heilman
Message was edited by: Rich Heilman
10-23-2006 4:17 PM
I would suggest not using a header line. Use a seperate work area instead. Here is an example.
report zrich_0001 .
Types: begin of ttab,
fld1 type c,
fld2 type c,
end of ttab.
data: itab type table of ttab.
data: WA like line of itab.
field-symbols: <fs> type standard table.
field-symbols: <fs_wa>.
wa-fld1 = 'A'.
wa-fld2 = '1'.
append wa to itab.
wa-fld1 = 'B'.
wa-fld2 = '2'.
append wa to itab.
assign itab to <fs>.
assign wa to <fs_wa>.
loop at <fs> into <fs_wa>.
write:/ <fs_wa>.
endloop.
Regards,
Rich Heilman
Message was edited by: Rich Heilman
10-23-2006 4:19 PM
You can't.
field-symbol is like the pointer in C language. Try to implement code like this one:
create data w_field like line of <internal_table_field>.
assign w_file->* to <structure_field>.
where w_field is "type ref to data".
Fred
10-23-2006 4:19 PM
hi,
example
DATA : IT_QALS LIKE i_QALS OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS <FS> LIKE i_QALS.
ASSIGN i_QALS TO <FS>.
10-23-2006 4:31 PM
In this case, you can try this
FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
FIELD-SYMBOLS : <FS_LINE> LIKE LINE OF <FS>.
Regards,
Ravi
Note : Please mark all the helpful answers