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

move and delete

Former Member
0 Likes
634

hi,

is it possible to move and delete with a single keyword?

can show me the correct syntax.

loop at itab

if not itab-fieldX is initial.

move the record to another internal table.

delete this record from itab.

endif.

endloop.

thanks

hi,

is it possible to move and delete with a single keyword?

can show me the correct syntax.

loop at itab

if not itab-fieldX is initial.

move the record to another internal table.

delete this record from itab.

endif.

endloop.

thanks

3 REPLIES 3
Read only

Former Member
0 Likes
580

Hi,

You change the code as below :

loop at itab

if not itab-fieldX is initial.

move the itab to another_internal_table.

delete itab.

append another_internal_table.

clear another_internal_table

clear itab.

endif.

endloop.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
580

itab2[] = itab1[]

all data will be populated to itab2 from itab1.

refresh itab. or clear itab[] deletes all value from itab.

Reward if useful

Regards

ANUPAM

Read only

Former Member
0 Likes
580

hi,

I could not get your requirement properly.

But for moving data to another internal table.

for MOVE.

here, let wa_matnr1 be the work area for it_mara1 and wa_matnr2 be work area of it_mara2.

then,

move: wa_matnr1-matnr to wa_matnr2-matnr.

append wa_matnr2 to it_mara2.

if it_mara1 and it_mara2 dont have workarea then,

move: it_mara1-matnr to it_mara2-matnr.

append: it_mara2.

for DELETE.

let it_mara be the internal table which has unique field called MATNR where wa_mara is the work area for it_mara.

DELETE TABLE it_mara WITH TABLE KEY matnr = wa_mara-matnr.

if it_mara has no work area but only header line then,

DELETE TABLE it_mara WITH TABLE KEY matnr = it_mara-matnr.

hope this helps.