‎2008 Mar 26 6:32 AM
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!
‎2008 Mar 26 6:38 AM
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.
‎2008 Mar 26 6:38 AM
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
‎2008 Mar 26 6:39 AM
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.
‎2008 Mar 26 6:39 AM
Hi,
You can use append table or use the modify table transporting that field.
HTH
Regards,
Dhruv Shah
‎2008 Mar 26 6:40 AM
Hi,
Use APPEND i_ordtyp. statement after split,to append the data.
Regards,
Chandu
‎2008 Mar 26 6:42 AM
split into two variables, and then append these variabels to ur interanal table.
Madhavi
‎2008 Mar 26 6:45 AM
‎2008 Mar 26 6:46 AM
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.
‎2008 Mar 26 6:46 AM
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.