2008 Feb 20 7:07 AM
Hi Experts,
I am having small doubt.
1).I need to write one condition for sales org 'US11' and divisions '20' or '40'. So the below logic is correct or not.
if vbdkr-vkorg = 'US11' and and vbdkr-vtweg = '20' or vbdkr-vtweg = '40'.
select........
endif.
2). i need th print these variables in script. can i use the logic like this.
if &vbdkr-vkorg& = 'US11' and and &vbdkr-vtweg& = '20' or &vbdkr-vtweg& = '40'.
&zkbetr1/ zpery1&
else.
&zkbetr/ zpery& (This is for sales org other than US11)
endif.
Thanks & Regards,
Ramana.
2008 Feb 20 7:18 AM
Hi,
I think your condition would be more apt if you code this way:
IF vbdkr-vkorg EQ 'US11' AND ( vbdkr-vtweg EQ '20' OR vbdkr-vtweg EQ '40' ).
ENDIF.
Also, look at putting the code into a subroutine called from your driver or subroutine program and then returning the value. The "logic" for determining the value to be printed can then be performed within the subroutine rather than the SAP script.
Cheers,
Aditya
2008 Feb 20 7:18 AM
Hi,
I think your condition would be more apt if you code this way:
IF vbdkr-vkorg EQ 'US11' AND ( vbdkr-vtweg EQ '20' OR vbdkr-vtweg EQ '40' ).
ENDIF.
Also, look at putting the code into a subroutine called from your driver or subroutine program and then returning the value. The "logic" for determining the value to be printed can then be performed within the subroutine rather than the SAP script.
Cheers,
Aditya
2008 Feb 20 8:31 AM
Hi Aditya,
Thanks for your reply. I have given the points.
Regards,
Ramana.