Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to append to dynamic table

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This should work.

append <fs_2> to <fs_1>.

Regards,

Rich Heilman

Former Member
0 Kudos

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