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

INTERNAL TABLE UPDATION

Former Member
0 Likes
944

I have the following piece of code:

select * from zconfig

into table i_zconfig

where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table i_ordtyp.

endloop.

endif.

The internal table i_zconfig has 2 records. In the first loop, it gets splitted and stored into i_ordtyp. In the second loop, the contents get overwritten. How can I append the second loop data to the i_ordtyp keeping the previous data?

Plz suggest!

9 REPLIES 9
Read only

Former Member
0 Likes
925

Declare temporary internal table similar to I_ORDTYP say I_ORDTYP1.


select * from zconfig
  into table i_zconfig
  where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.
  loop at i_zconfig.
     split i_zconfig-zto at ',' into table i_ordtyp1.
     append lines of i_ordtyp1 to i_ordtyp.
  endloop.
endif.

Read only

Former Member
0 Likes
925

Hi Santo,

Use append i_ordtyp in the loop.

EX;.

select * from zconfig

into table i_zconfig

where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table i_ordtyp.

<b>append i_ordtyp</b>

endloop.

endif.

<b>plz reward if useful</b>

Regards,

sunil kairam

Read only

Former Member
0 Likes
925

hI,

DATA:I_ORD LIKE I_ORDTYP OCCURS 0 WITH HEADER LINE.

select * from zconfig

into table i_zconfig

where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table i_ordtyp.

APPEND LINES OF I_ORDTYP TO I_ORD.

endloop.

endif.

Reward if helpful

Regards

Vodka.

Read only

dhruv_shah3
Active Contributor
0 Likes
925

Hi,

You can use append table or use the modify table transporting that field.

HTH

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
925

Hi,

Use APPEND i_ordtyp. statement after split,to append the data.

Regards,

Chandu

Read only

Former Member
0 Likes
925

split into two variables, and then append these variabels to ur interanal table.

Madhavi

Read only

Former Member
0 Likes
925

Thx

Read only

Former Member
0 Likes
925

select * from zconfig

into table i_zconfig

where ZKEY = 'ZI2X11'.

***make a temp_tab(temparay table)

data: temp_tab like i_ordtyp.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table temp_tab.

append temp_tab to i_ordtyp.

clear:temp_tab.

endloop.

endif.

Read only

Former Member
0 Likes
925

Declare another internal table i_ordtyp1 and use it .

select * from zconfig

into table i_zconfig

where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table i_ordtyp1.

loop at i_ordtyp1.

i_ordtyp = i_ordtyp1.

append i_ordtyp.

clear i_ordtyp1.

endloop.

endloop.

endif.