Skip to Content
0
Former Member
Jan 14, 2008 at 12:20 PM

loop in select option.

21 Views

Hi Experts,

I have to avoid the loop andloop in the below codes.S_CHANGE is select option which may have -ve and +values, intervals and also exclues.i_prd_3 is my internal table.

For each value of s_change, the internal table has to be looped and its value should be retieved...but i shouldn't use nested loop.is there any way.,,

sort i_prd_3.

if s_change <> ' '.

loop at s_change.

if s_change-sign = 'I'.

loop at i_prd_3.

case s_change-option.

when 'EQ'.

delete i_prd_3 where v_perc <> s_change-low.

when 'NE'.

delete i_prd_3 where v_perc = s_change-low.

when 'LT'.

delete i_prd_3 where v_perc GE s_change-low.

when 'GT'.

delete i_prd_3 where v_perc LE s_change-low.

when 'GE'.

delete i_prd_3 where v_perc LT s_change-low.

when 'LE'.

delete i_prd_3 where v_perc GT s_change-low.

when 'BT'.

delete i_prd_3 where v_perc LT v_low or v_perc GT v_high.

when 'NB'.

delete i_prd_3 where v_perc GE v_low and v_perc LE v_high

.

when others.

MESSAGE i000 WITH 'Enter an input,Please check your entry!'

.

endcase.

endloop.

endif.

if s_change-sign = 'E'.

loop at i_prd_3.

case s_change-option.

when 'EQ'.

delete i_prd_3 where v_perc = s_change-low.

when 'NE'.

delete i_prd_3 where v_perc <> s_change-low.

when 'LT'.

delete i_prd_3 where v_perc LT s_change-low.

when 'GT'.

delete i_prd_3 where v_perc GT s_change-low.

when 'GE'.

delete i_prd_3 where v_perc GE s_change-low.

when 'LE'.

delete i_prd_3 where v_perc LE s_change-low.

when 'BT'.

delete i_prd_3 where v_perc GE v_low and v_perc LE v_high

.

when 'NB'.

delete i_prd_3 where v_perc LT v_low or v_perc GT v_high.

when others.

MESSAGE i000 WITH 'Enter an input,Please check your entry!'

.

endcase.

endloop.

endif.

endloop.

then i tried with the below coding but this too doesnt worked

sort i_prd_3.

if s_change <> ''.

loop at i_prd_3.

if s_change-sign = 'I'.

if not i_prd_3-v_perc in s_change.

delete i_prd_3.

endif.

elseif s_change-sign = 'E'.

if i_prd_3-v_perc in s_change.

delete i_prd_3.

endif.

endif.

endloop.

endif.

Please reply soon if u have any idea/////on this..thanks n advance