Application Development and Automation 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: 
Read only

how to append data into table using field symbol

Former Member
0 Likes
35,287

Dear friends,

i m using two internal tables. i take data from one internal tabel using field symbol to the the second table's field symbol.

i want to append data to the second table. can i use append statement with field symbol????? tell e right way in order to solve the problem..

Thanking You,

Sunil Sharma

1 ACCEPTED SOLUTION
Read only

Former Member
10,829

Hi Sunil,

You can APPEND by this way - - "APPEND <field-symbol> TO internal_table."

before that you need to assign the field-symbol.

You can try this code -

DATA : t_itab1 TYPE TABLE OF spfli,
       t_itab2 TYPE TABLE OF sflight,
       wa_sflight TYPE sflight.
FIELD-SYMBOLS : <fs_spfli> TYPE spfli,
     <fs_sflight> TYPE sflight.
SELECT * FROM spfli INTO TABLE t_itab1.

ASSIGN wa_sflight TO <fs_sflight>.
LOOP AT t_itab1 ASSIGNING <fs_spfli>.
  MOVE-CORRESPONDING <fs_spfli> TO <fs_sflight>.
  APPEND <fs_sflight> TO t_itab2.
ENDLOOP.

Regards

Pinaki

4 REPLIES 4
Read only

Former Member
0 Likes
10,829

Press F1 on ASSIGN.

Read only

Former Member
0 Likes
10,829

ASSIGN COMPONENT MATNR OF STRUCTURE <itab1> TO < itab2>.

Read only

Former Member
0 Likes
10,829

HI

u can try for range

its may solve ur problem

thanks

anurag

Read only

Former Member
10,830

Hi Sunil,

You can APPEND by this way - - "APPEND <field-symbol> TO internal_table."

before that you need to assign the field-symbol.

You can try this code -

DATA : t_itab1 TYPE TABLE OF spfli,
       t_itab2 TYPE TABLE OF sflight,
       wa_sflight TYPE sflight.
FIELD-SYMBOLS : <fs_spfli> TYPE spfli,
     <fs_sflight> TYPE sflight.
SELECT * FROM spfli INTO TABLE t_itab1.

ASSIGN wa_sflight TO <fs_sflight>.
LOOP AT t_itab1 ASSIGNING <fs_spfli>.
  MOVE-CORRESPONDING <fs_spfli> TO <fs_sflight>.
  APPEND <fs_sflight> TO t_itab2.
ENDLOOP.

Regards

Pinaki