Skip to Content
0
Former Member
Mar 22, 2006 at 11:05 AM

delete

24 Views

In this code when the bolded if condition fails i want to delete that record. I tried "delete struct1 index sy-tabix" but that record is not deleted.

I tried "clear struct1 ". its deletes the current record.

but in some field its getting zero value & it is appending as a additional record.

Please help me.

loop at cdhdr.

if ( it1-tcode = 'FSS0' or it1-tcode = 'FS00' ).

w1_saknr = it1-objectid+4(10).

w_orgid = it1-objectid+14(4).

loop at it_cdpos where changenr eq it1-changenr

and objectid eq it1-objectid

and objectclas eq it1-objectclas.

<b>If w_orgid in r_orgid.</b>

IF ( it_CDPOS-FNAME = 'XLOEV' AND it_cdpos-value_new eq 'X' ).

replace struct1-change_ind with 'D' into struct1-change_ind.

struct1-bukrs = w_orgid.

struct1-cost = space.

struct1-plant = space.

append struct1.

else.

struct1-bukrs = w_orgid.

struct1-change_ind = w_chngid.

struct1-cost = space.

struct1-plant = space.

append struct1.

endif.

<b>else.

delete struct1 index sy-tabix.</b>

endif.

append struct1.

endloop.

endif.

endloop.