‎2006 Oct 19 1:10 PM
Hi all,
I have declared Material pricing group "knodm" as ranges and what i need to do is to remove the hard coding from the below code with this range field. doesnt that be a too long code if i individually assisn low value with each constant? if there is any other option plz reply
IF int_mvke-kondm = 'I2'
OR int_mvke-kondm = 'I3'
OR int_mvke-kondm = 'I5'
OR int_mvke-kondm = 'I6'
OR int_mvke-kondm = 'I7'
OR int_mvke-kondm = 'M4'
OR int_mvke-kondm = 'M2'
OR int_mvke-kondm = 'M3'
OR int_mvke-kondm = 'N1'
OR int_mvke-kondm = 'S2'.
regards
‎2006 Oct 19 1:13 PM
This would be a lil better:
IF int_mvke-kondm in('I2',
'I3',
'I5',
'I6',
'I7',
'M4',
'M2',
'M3',
'N1',
'S2')
endif.
or else: use ranges:
IF SFLIGHT_WA-FLDATE IN S_FLDATE. ... ENDIF.
regards
ravi
‎2006 Oct 19 1:15 PM
you can use option 'between':
knodm-low = 'I2'
knodm-high = 'I7'
knodm-sign = 'I'.
knodm-option = 'BT'
append knodm
‎2006 Oct 19 1:16 PM
Hi, YOu can modify your code like following.
RANGES: R_KONDM FOR MVKE-KONDM.
R_KONDM-LOW = 'I2'.
R_KONDM-SIGN = 'I'.
R_KONDM-OPTION = 'BT'.
APPEND R_KONDM.
R_KONDM-LOW = 'I3'.
APPEND R_KONDM.
R_KONDM-LOW = 'I5'.
APPEND R_KONDM.
R_KONDM-LOW = 'I6'.
APPEND R_KONDM.
R_KONDM-LOW = 'I7'.
APPEND R_KONDM.
R_KONDM-LOW = 'M4'.
APPEND R_KONDM.
R_KONDM-LOW = 'M2'.
APPEND R_KONDM.
R_KONDM-LOW = 'M3'.
APPEND R_KONDM.
R_KONDM-LOW = 'N1'.
APPEND R_KONDM.
R_KONDM-LOW = 'S2'.
APPEND R_KONDM.
IF int_mvke-kondm IN R_KONDM.
ENDIF.
Thanks,
ramakrishna
‎2006 Oct 19 1:17 PM
you can define the range as below
rkondm
sign option low high
I BT I2 I7
I BT M2 M4
I EQ N1
I EQ S2
‎2006 Oct 19 1:33 PM
Hi Ganesh
Alternatively, you can even define this as a select-option in the selection screen incase of a report and give values to identify the values to be excluded or included.
The advantage with the above method is, no changes needed even a new value has to be added at a later stage, just changing the variant and including the value will work.
Kind Regards
Eswar