Skip to Content
Former Member
Jul 12, 2007 at 12:04 AM



Hi ,

I added this code to delete the records if they are with S, T or K and also with A , D & E.

but my issue is ...when the commented lines were uncommented...the lines in the loop did not work but the when the sy-subrc was there.

I just wanted to know the reason...for this

<b> DATA : lt_tb_all_data LIKE tb_all_data OCCURS 0 WITH HEADER LINE.

DATA : lw_data LIKE lt_tb_all_data.

lt_tb_all_data[] = tb_all_data[].

LOOP AT lt_tb_all_data WHERE zttype = 'T'

OR zttype = 'K'

OR zttype = 'S'.

LOOP AT tb_all_data INTO lw_data

WHERE lifnr = lt_tb_all_data-lifnr

AND matnr = lt_tb_all_data-matnr

AND werks NE lt_tb_all_data-werks

AND ( zttype = 'A' OR zttype = 'D'

OR zttype = 'E' ).

  • if sy-subrc = 0 .

lw_data-flag_type = 'X'.

MODIFY tb_all_data FROM lw_data

INDEX sy-tabix TRANSPORTING flag_type.

CLEAR lw_data.

  • endif.



DELETE tb_all_data WHERE flag_type = 'X'.</b>