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

Reg Hardcoding

Former Member
0 Likes
751

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

5 REPLIES 5
Read only

Former Member
0 Likes
707

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

Read only

Former Member
0 Likes
707

you can use option 'between':

knodm-low = 'I2'

knodm-high = 'I7'

knodm-sign = 'I'.

knodm-option = 'BT'

append knodm

Read only

venkata_ramisetti
Active Contributor
0 Likes
707

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

Read only

Former Member
0 Likes
707

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

Read only

Former Member
0 Likes
707

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