‎2007 Jan 02 3:14 PM
Hi All,
I have a internal table with the following fields
VAL_LOW , VAL_HIGH
and contains the following values
01 10
25 35
A1 A10
A25 A35
I have selection screen field with value 09 I need to validate this value with above the internal table that the value 09 is in VAL_LOW and VAL_HIGH.
Thanks
aRs.
‎2007 Jan 02 3:24 PM
try this...
loop at itab.
if p_field ge itab-val_low and
p_field ge itab-val_high.
* field is within range
exit.
endif.
endloop.
‎2007 Jan 02 3:33 PM
Dear aRs,
You want to validate --> Event :
AT SELECTION-SCREEN.
Populate the Internal Table IT_TAB with the values (01,10), (25,35) ....
Validate whether the Selection Screen field (P_FIELD) contains any values in
the IT_TAB.
LOOP AT IT_TAB INTO WA_TAB.
IF P_FIELD GE WA_TAB-VAL_LOW AND
P_FIELD LE WA_TAB-VAL_HIGH.
Message ---> "Present".
ELSE.
Message --> " Not Present ".
ENDIF.
ENDLOOP.
Regards,
Abir
***********************************
Don't forget to award Points *
‎2007 Jan 02 3:39 PM
Hi,
Thanks for your replies.
The internal table contains 1.7 million reocrds .
I feel by using loop will have impact in the performance.Is there any way to validate this by not using LOOP statement?
Thanks
aRs
‎2007 Jan 02 4:05 PM
TYPES: BEGIN OF ty_range,
val_low type i,
val_high type i,
END OF ty_range.
DATA: gt_range type table of ty_range,
wa_range type ty_range.
PARAMETERS: p_num TYPE <....>.
AT-SELECTION-SCREEN.
LOOP AT gt_range INTO wa_range.
IF p_num GT wa_range-val_low AND p_num LT wa_range-val_high.
WRITE: 'Present in Range'.
ELSE.
WRITE: 'Not Present in Range'.
ENDIF.
Reward Points if HELPFUL.
‎2007 Jan 02 4:12 PM
Hi Vijay,
Due to bulk volume of data in the internal table I could not able to use LOOP statement for validation purpose.
Thanks
aRs