‎2006 Jul 06 9:09 PM
Dear All,
I am working on SAP Script.
I have to print so
<b>invoice Number Doc type invoice date .....</b>
so I have used &bseg-belnr&,,XXXXX,,&BSID-BLDAT&
Now my question is in what should I enter in XXXXX place.
Actually there is a condiation there.
if bseg-bschl = 01 then INV,
if bseg-bschl = 04 then DED
if bseg-bschl = 06 then DED
if bseg-bschl = 11 then CR
if bseg-bschl = 15 then PAY
ELSE
ADJ.
At first my Intension was doing So.
if bseg-bschl = 01 then INV
&bseg-belnr&,,INV,,&BSID-BLDAT&
elseif
&bseg-belnr&,,DED,,&BSID-BLDAT&
AND SO ON .......
But I have condition on &BSID-BLDAT& Field also !!....and what if I have conditions on other fields in same row ?
How Should I go ahead .. Please advice me ..
Actually I am trying to use this in SAP SCript Editor only, Should I try in print program.
Please advice me ...
Thanks & Regards
Venkat.
‎2006 Jul 06 9:13 PM
If your conditions are somewhat complex, I usually do this stuff in the print program as opposed to the sapscript editor. Like in your case I would use a variable here. In my print program is where I would do the conditions and fill this variable there. That way all i need in my sapscript editor is this..
&bseg-belnr&,,&VARIALBE&,,&BSID-BLDAT&
Regards,
Rich Heilman
‎2006 Jul 06 9:13 PM
If your conditions are somewhat complex, I usually do this stuff in the print program as opposed to the sapscript editor. Like in your case I would use a variable here. In my print program is where I would do the conditions and fill this variable there. That way all i need in my sapscript editor is this..
&bseg-belnr&,,&VARIALBE&,,&BSID-BLDAT&
Regards,
Rich Heilman
‎2006 Jul 06 9:31 PM
Hi Rich,
Thanks for quick reply.
with your reply I got other doubt, Can I use a variable in SAP Script Editor only.
I am sorry if this sounds silly,
Thanks & Regards
Venkat
‎2006 Jul 06 9:35 PM
Yes, you can, but then you still have all of that logic cluttering up the form. This is just my opinion, but if you have control over the form and the print program, meaning they are custom, then I always suggest to have your logic separated from the layout. Meaning, put your logic in the print program, leave the sapscript editor for taking care of the layout. Yes, there are some exceptions, and again just my opinion. I think it is easier to read/maintain later.
By the way you use the keyout DEFINE in the sapscript editor.
Regards,
Rich Heilman
‎2006 Jul 06 9:37 PM
‎2006 Jul 06 10:04 PM
if &bseg-bschl& = 01 (Condition 1 )
if condition2 = true (condition for BLDAT)
&bseg-belnr&,,INV,,&BSID-BLDAT&
else
&bseg-belnr&,,INV,,
endif.
elseif
&bseg-belnr&,,DED,,&BSID-BLDAT&
SO ON...
‎2006 Jul 06 10:25 PM
Dear Rich and Others,
Thanks for your inputs, I will follow your suggestions and go ahead and work with it.
hopw this is not going to be a big problem. Meanwhile I wil allot points for your time and concern.
Thanks & Regards
Venkat.