06-02-2005 3:24 PM
hi, everyone
I want to append some data to a dynamic internal table.
I have some code like following:
form dyna using itab.
DATA: NEW_LINE type ref to data.
FIELD-SYMBOLS: <FS_1> type any table,
<FS_2>,
<FS_3>.
assign itab to <FS_1>.
create data NEW_LINE like line of <FS_1>.
assign NEW_LINE->* to <FS_2>.
assign component 1 of structure <FS_2> to <FS_3>.
<FS_3> = 'I'.
assign component 2 of structure <FS_2> to <FS_3>.
<FS_3> = 'ABC'.
.......
then <FS_2> is the entry I want to append now
append ???
endform.
What I want to know is how to append the <FS_2> to the dynamic table. I require the entry can be append, and return out of this form.
Any suggestion and answer is welcome
Hope your reply, thanks a lot
06-02-2005 4:10 PM
Hi,
try out like this.
data: begin of itab occurs 0,
val1 type c,
val2(3) type c,
end of itab.
data ws_itab like itab.
DATA: NEW_LINE type ref to data.
FIELD-SYMBOLS: <FS_1> type standard table,
<FS_2>,
<FS_3>.
assign itab[] to <FS_1>.
create data NEW_LINE like line of <FS_1>.
assign NEW_LINE->* to <FS_2>.
assign component 1 of structure <FS_2> to <FS_3>.
<FS_3> = 'I'.
assign component 2 of structure <FS_2> to <FS_3>.
<FS_3> = 'ABC'.
append <FS_2> to <FS_1>.
Regards,
Jagath
06-02-2005 4:08 PM
06-02-2005 4:10 PM
Hi,
try out like this.
data: begin of itab occurs 0,
val1 type c,
val2(3) type c,
end of itab.
data ws_itab like itab.
DATA: NEW_LINE type ref to data.
FIELD-SYMBOLS: <FS_1> type standard table,
<FS_2>,
<FS_3>.
assign itab[] to <FS_1>.
create data NEW_LINE like line of <FS_1>.
assign NEW_LINE->* to <FS_2>.
assign component 1 of structure <FS_2> to <FS_3>.
<FS_3> = 'I'.
assign component 2 of structure <FS_2> to <FS_3>.
<FS_3> = 'ABC'.
append <FS_2> to <FS_1>.
Regards,
Jagath