‎2006 Jul 25 8:23 PM
In Script editor, How can I write code for the below calculation? Because I could not write code in driver program which is standard program .
<b>B1 ®UP-BELNR&,,®UP-XBLNR&,,®UP-BLDAT&,,
®UP-WAERS&,,
= net</b>
I mean <b>net</b> = <b>®UP-WRBTR& - ®UP-QBSHB& - ®UP-WSKTO&</b>
Is it possible to take a variable to catch the value of ®UP-WRBTR& - ®UP-QBSHB& - ®UP-WSKTO&
Please help me. It is urgent.
‎2006 Jul 25 9:07 PM
Try to define a perform in your driver program like this:
/: PERFORM calculate_net IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM calculate_net TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
*-Define your logic for Net
...
ENDFORM.
‎2006 Jul 25 9:00 PM
‎2006 Jul 25 9:06 PM
You cant operate text elements in SAP scripts..
the alternate way is copy the standard program into zprogram and add a subroutine for ur calculations and pass it to sap script.
‎2006 Jul 25 9:07 PM
Try to define a perform in your driver program like this:
/: PERFORM calculate_net IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM calculate_net TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
*-Define your logic for Net
...
ENDFORM.
‎2006 Jul 25 9:10 PM
Naresh has show you how to call a PERFORM in your script, since you are working with a standard print program, you can not put this FORM in your driver program, all you need to do is create a "Z" program and put this FORM in it, and then reference the "Z" program in the PERFORM statement in your sapscript.
REgards,
Rich Heilman
‎2006 Jul 25 9:55 PM
‎2006 Jul 25 10:33 PM
Hi Kumar,
I guess you dont need to do any caluculations, Netamount Which is Standard had a field, Please just use that field.
I guess it is Regud-swnes.
Let me know, if your problem is solved.
Thanks & Regards
Venkat