Skip to Content
author's profile photo Former Member
Former Member

display total in sapscript

sir, i like to know how can print total in sapscript, is it using separate variable for print total and also know how calculation performed in sapscript .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Nov 24, 2007 at 04:08 AM

    You can calculate the total in the separate variable and print it out in the SAPScript.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 04:10 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 11:20 AM

    Hi Sandeep,

    First of all you have to see wheather any variable/parameter is available in the Main window for printing total.

    If Available then

    You have to fill that by developing subroutine (as a seperate executable progam ) which you can call in the form by PERFORM <FORM NAME> IN PROGRAM <PROGRAM NAME> ENDPERFORM. If your driver program is standard one. If your driver program is Z program then you dont have to develop subroutine, you can develop logic in driver program itself....

    If Not Available then

    You have to define one variable at the end of the loop to add the all values in the total field. This has to be calculated in the subroutine again as stated above.

    If any other query please let me know for more clarification ..

    Reward Points....

    Cheers....

    Sagun Desai

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2007 at 06:20 AM

    Hi

    Yes, you can define a variabe in your print program and pass it to the SAPScript.

    LIKE:

    Define L_SUM in the Global data.

    DATA: L_SUM TYPE BSEG-DMBTR.

    LOOP AT ITAB.

    L_SUM = L_SUM + ITAB-AMOUNT.

    ENDLOOP.

    CALL FUNCTION 'WRITE_FORM'

    WINDOW = 'MAIN'

    ELEMENT = 'TOTAL'.

    Now, in your SAPScript, create a text element in MAIN window

    /E TOTAL

    • Total,, &L_SUM&.

    Go through below link

    http://sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.