2 weeks ago
Hello,
I need inputs on below scenario:
I have a changing parameter in the method of a Class which is table <ch_table_name> where I would like to process records in this table. The entries in the table are of same type with different data like, every 19 entries, type of data is same but values will be different.
I would like to delete data in this table if it meets the condition. suppose, continuously for couple of times if condition is satisfied.
I will delete these entries and loop iteration HAS to start from beginning to check data again. Is it possible, if Yes, How can I achieve this?
say,
LOOP <ch_table_name> ASSIGNING <fs_> WHERE <condition>.
IF <cond>.
<logic to check entries and set index lv_start and lv_end to delete data>.
ELSE.
DELETE <ch_table_name> FROM lv_start TO lv_end.
<logic to start iteration from beginning> . ""=> How to handle this?
ENDIF.
ENDLOOP.
Thanks in Advance!!
Request clarification before answering.
Either find a logic that doesn't require a news loop (not enough information provided there, so I'm unable to understand your logic)
Else set a flag to indicate a new loop and exit current one
doitagain = abap_true.
WHILE doitagain = abap_true.
doitagain = abap_false.
LOOP AT <ch_table_name> ASSIGNING <fs> WHERE <condition>.
" some logic triggers the do it again loop
doitagain = abap_true.
EXIT.
" some other logic doesn't
ENDLOOP.
ENDWHILE.
Numerous code variants are available, taking care not to trigger infinite loops.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.