Application Development and Automation 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: 
Read only

lOOP statment error

Ranjith_D_Reddy
Participant
0 Likes
792

The mentioned is the LOOP statement i am using in the customised function module

DATA: i_ltz_val_area TYPE STANDARD TABLE OF selopt,

LOOP AT im_appl_scope ASSIGNING <fs_applscp>
WHERE val_area EQ c_opngr OR
val_area
EQ c_imngr OR
val_area
EQ c_opgha OR
val_area
EQ c_imgha OR                                                       val_area IN i_ltz_val_area OR

                                val_area EQ c_aggha.

The above LOOP statement is executed even though there are no records in val_area  & i_ltz_val_area

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
764

val_area IN i_ltz_val_area  is not correct IN operator cannot be used.

So it is treating it as val_area = ' ' so LOOP is Executing it is allowing without any value


7 REPLIES 7
Read only

Former Member
0 Likes
765

val_area IN i_ltz_val_area  is not correct IN operator cannot be used.

So it is treating it as val_area = ' ' so LOOP is Executing it is allowing without any value


Read only

0 Likes
764

thanks Sai

then how can i execute that LOOP statement?

Any suggestion for that execution.

Read only

Former Member
0 Likes
764

IN does not work if your driver table is empty. Means Since it is empty it returns the check as TRUE. Do the check inside the loop.

Read only

uppu_narayan
Active Participant
0 Likes
764

Hi Ranjith,

     It will be executed because you are using an OR condition......so here the other parameters are satisfying the condition.......................

thanks and regards,

narayan

Read only

0 Likes
764

their the condition is not accepting any condition mentioned in LOOP statement

Read only

Former Member
0 Likes
764

Hi,

if you want to use the same you can do this by using select-option .

eg.

Select-option S_field for <Data element reference> no-diplay.

s_field-Low = 'value1'

s_field-Sign = 'I'

s_field-Option = 'EQ'

Append s_field

s_field-Low = 'value2'

s_field-Sign = 'I'

s_field-Option = 'EQ'

Append s_field

LOOP AT im_appl_scope ASSIGNING <fs_applscp>
WHERE val_area = s_field-low.

endloop.

Check and revert.

May be you have to do this .

loop at s_field.

LOOP AT im_appl_scope ASSIGNING <fs_applscp>
WHERE val_area = s_field-low.

endloop.

endloop.

Regards,

Rahul Singh

Read only

Former Member
0 Likes
764

Instead of doing coding in this way collect all val_area in one range table say it_valarea.

it_valarea will have fields sigh,option,low high.

Delete the data from internal table where val_area not in it_valarea.

and then u can do your work on this internal table.