2008 Jul 14 4:02 AM
Hello,
I want to write a very complex logic to achieve certain reuirement.
I have an internal table i_tab with following values. Now when I loop at i_tab, whenever value is equal to or greater then '001', perform A. Just before when next value will be 001 perform C.
001 -> perform A
002 -> perform A
003 -> perform A. perform C(because the next value is going to be 001)
001 -> perform A
002 -> perform A perform C
001 -> perform A
002 -> perform A
003 -> perform A
004 -> perform A peform C
001
:
:
So how can I find the next value of i_tab when I am looping because based on next value in i_tab , I have to perform a function during its previous value.
Regards,
Rajesh,
2008 Jul 14 4:09 AM
dummy_i_tab[] = I_tab[].
loop at i_tab.
read dummy_itab with table index = current index of i_tab + 1.
if dummy_itab = 001
perform A. perform C
else.
perform A.
endif.
endloop.
thanks.
james.
2008 Jul 14 4:07 AM
Hi,
Use ON CHANGE OF event and inside this event, check the value, if it is 001, include the stmt. PERFORM C.
This should work.
Regards,
Subramanian
2008 Jul 14 4:09 AM
dummy_i_tab[] = I_tab[].
loop at i_tab.
read dummy_itab with table index = current index of i_tab + 1.
if dummy_itab = 001
perform A. perform C
else.
perform A.
endif.
endloop.
thanks.
james.