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 entrys frim itab by condition

Former Member
0 Kudos

Hello All...

some coding

LOOP AT t_fkkcoll.

  • Check Amount border low <= BETRW

If ht_betrw_range-LOW <= t_fkkcoll-BETRW and h_count = 1.

h_count = h_count + 1.

delete t_fkkcoll[].

clear t_fkkcoll.

endif.

endloop.

Clear h_count.

-


t_fkkcoll

Key Value

001 100

002 200

003 500

-


my Questions:

-


How can i leave the Loop at the Value 500 and delete all other entry from the l_tkkcol ???

my goal.

-


1. each individual voucher of a VK/a GP does not lie below the border -- a delivery

2. mind. 1 voucher lies over the lower bound -- all vouchers are delivered

BSp : The Border ist 5 the values are 1 2 3 4 - do nothing

The Border ist 5 the values are 1 3 5 6 - all vouchers are delivered

Thanks for Help.

Chris

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi. It might be easier to move the record to a temporary area once you find the one that you want, clear the table, and then move it back. Here is what I mean:

LOOP AT t_fkkcoll.

IF t_fkkcoll-value = '500'.

wa_fkkcoll = t_fkkcoll. "saves the record you want

EXIT.

ENDIF.

ENDLOOP.

CLEAR t_fkkcoll. "clears the header line

CLEAR t_fkkcoll[]. "clears the table rows

APPEND wa_fkkcoll TO t_fkkcoll. "moves your record back in

I hope this helps.

- April King

3 REPLIES 3

Former Member
0 Kudos

Hi Christian ,

I couldn' t get your problem right but if you want to delete records from your internal table from certain point you can use like


delete itab from 3 ." here 3 can be your index 

Regards

Caglar

Former Member
0 Kudos

And you can leave the loop as


loop at t_fkkcoll.
if t_fkkcoll-value = 500.
exit.
endif.
endloop.

Regards

Caglar

Message was edited by:

Caglar Ozkor

Former Member
0 Kudos

Hi. It might be easier to move the record to a temporary area once you find the one that you want, clear the table, and then move it back. Here is what I mean:

LOOP AT t_fkkcoll.

IF t_fkkcoll-value = '500'.

wa_fkkcoll = t_fkkcoll. "saves the record you want

EXIT.

ENDIF.

ENDLOOP.

CLEAR t_fkkcoll. "clears the header line

CLEAR t_fkkcoll[]. "clears the table rows

APPEND wa_fkkcoll TO t_fkkcoll. "moves your record back in

I hope this helps.

- April King