on 12-02-2010 12:20 PM
Hi all,
Have created a new window in one of the scripts recently.
I was asked to display this window( with some data) only for company code NL01.
So I kept the condition , IF reguh-zbukr = 'NL01'..and wrote the code..
Now Im asked to extend the functionality to some other company codes..
I have written code lke this..pls suggest whether it is correct or not...( I cant test this now..but no test data available as of now..so need your help..Thanks)
/:IF ®UH-ZBUKR& = 'NL01' OR ®UH-ZBUKR& = 'BE01' OR
/= ®UH-ZBUKR& = 'BE02'
ZI Sold to
/: ENDIF
Hi
Your code is ok, but you don't use /=, you should write the IF condition on the same line:
/: IF ®UH-ZBUKR& = 'NL01' OR ®UH-ZBUKR& = 'BE01' OR ®UH-ZBUKR& = 'BE02'
ZI Sold to
/: ENDIF
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Max notes correctly...but you might also consider:
/: DEFINE &CO_SWITCH& = ' '
/:PERFORM CHECK_COCO IN PROGRAM(your routines program)
/:USING ®UH-ZBUKR&
/:CHANGING &CO_SWITCH&
/:ENDPERFORM.
/: IF &CO_SWITCH& eq 'X'
ZI Sold to
. . . .
/: ENDIF.
Your CHECK_COCO routine would examin the value passed in and determine whether or not to set &CO_SWITCH ON or OFF. This would allow you to read rows of customizing table or variables table, or apply logic to determine on/off, and you would not have to change your SAPScript in the future if the requirements changed.
Hi,
If it was working before with one company and u just want to add more companies to the IF sentence, what u r doing is correct.
just OR..company OR..company..
That's all.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.