2013 Apr 18 11:07 AM
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
2013 Apr 18 11:46 AM
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
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
2013 Apr 18 11:46 AM
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
2013 Apr 18 12:11 PM
thanks Sai
then how can i execute that LOOP statement?
Any suggestion for that execution.
2013 Apr 18 11:55 AM
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.
2013 Apr 18 12:14 PM
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
2013 Apr 18 12:18 PM
their the condition is not accepting any condition mentioned in LOOP statement
2013 Apr 18 12:16 PM
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
2013 Apr 18 2:30 PM
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.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |