‎2008 May 02 6:48 AM
There are few records in ITAB, I want to loop it twice in order to pick correct answer where S = 'X'. Once I completed 1st loop I shud loop from second loop in same loop.
I am using loop at itab into wa from index.
How to loop it correctly.
Following table is to be looped, twice.
where S is is my correct answer.
"1st loop.
TYPE ID TEXT S
Qesn q1 Best PM of India
Ans id_47d61fa77bc600ece1008 Manmohan singh1 -
Ans id_47d61fc27bc600ece1008 N Ra0 X
Ans id_47d61fcd7bc600ece1008 Vajpayee -
Ans id_47d621b57bc600ece1008 Rajiv gandhi -
Ans id_47d6248b7bc600ece1008 IGandhi -
"second loop.
Qesn id_47dee7d3499f008de10080 who is the best FM
Ans id_47dee7e0499f008de10080 Yashwant Sinha X
Ans id_47dee800499f008de10080 Chidambram - Any clarrification is appreciated.
I need to pick correct answer where S = 'X'.
My 1st loop data shud be.
Qesn q1 Best PM of India
Ans id_47d61fc27bc600ece1008 N Ra0 X
second table data shud be
Qesn id_47dee7d3499f008de10080 who is the best FM
Ans id_47dee7e0499f008de10080 Yashwant Sinha X
‎2008 May 02 7:16 AM
Hi Anee,
Here is the solution,from wat Iunderstood ur problem.
Loop at itab where type = 'Qesn'.
read table itab with key S = 'X'.
if sy-subrc = 0.
do ur logic.
modify itab with s= 'space.' this is to pick the correct record for next read.
endif.
endloop.
‎2008 May 02 7:16 AM
Hi Anee,
Here is the solution,from wat Iunderstood ur problem.
Loop at itab where type = 'Qesn'.
read table itab with key S = 'X'.
if sy-subrc = 0.
do ur logic.
modify itab with s= 'space.' this is to pick the correct record for next read.
endif.
endloop.
‎2008 May 05 1:37 PM