Application Development 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: 

delete itab

Former Member
0 Kudos
77

Hi experts,

Iam having itab like this.


VBELN      VKBUR KUNNR      AUART AUDAT    FBUDA   
                                                   
100000001|9003 |0000110065|ZR01 |20060207|20060208|
100000001|9003 |0000110065|ZR01 |20060207|00000000|
100000006|9003 |0000110065|ZR01 |20060208|00000000|
100000007|9003 |0000110065|ZR01 |20060207|20060208|
100000008|9003 |0000110065|ZR01 |20060207|20060208|
100000009|9003 |0000110065|ZR01 |20060208|20060208|

If any one of the FBUDA is not having value i want to delete all VBELNs.

So my output should be like this.


100000007|9003 |0000110065|ZR01 |20060207|20060208|
100000008|9003 |0000110065|ZR01 |20060207|20060208|
100000009|9003 |0000110065|ZR01 |20060208|20060208|

For example

I have values


 VBELN                                     FBUDA
100000001|9003 |0000110065|ZR01 |20060207|20060208|
100000001|9003 |0000110065|ZR01 |20060207|00000000|

since 100000001 having FBUDA value 00000000, i want to delete <b>all 100000001</b>.

Can any one tell me how can i do this?

Reward guaranteed

thanks

kaki

1 ACCEPTED SOLUTION

former_member186741
Active Contributor
0 Kudos
57

Loop at itab where fbuda = '00000000'.

delete itab where vbeln = itab-vbeln.

endloop.

5 REPLIES 5

Former Member
0 Kudos
57

Kaki,

Did you try

Delete itab where FBUDA is initial.

If this doesn't work

DELETE ITABE where FBUDA = '00000000'.

Regards,

Ravi

Former Member
0 Kudos
57
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
END OF itab.

LOOP AT itab.
IF FBUDA IS INITIAL.
itab1-vbeln = itab-vbeln.
APPEND itab1.
DELETE ADJACENT DUPLICATES FROM itab1.
ENDLOOP.

LOOP AT itab1.
DELETE itab WHERE vbeln = itab1-vbeln.
ENDLOOP.

Former Member
0 Kudos
57

Hi kaki,

i think you cannot use

<b> delete itab where ..</b>

for initial values..

so

loop at itab.
 if itab-FBUDA is initial.
 delete itab where vbeln eq itab-vbeln.
endif.
endloop.

regards

satesh

former_member186741
Active Contributor
0 Kudos
58

Loop at itab where fbuda = '00000000'.

delete itab where vbeln = itab-vbeln.

endloop.

0 Kudos
57

Thanks for all the replies...

points alloted.

kaki