PO Print SAP scripts:Grand total field -- High priority

Hi experts
In a PO print out, For example in one line item ,I have conditions printed as below
Line iem 1.
Gross price -- 1000
VAT% 40
Service Tax -
123.36
Net. Incl. Disc. 1163.36
Line iem 2.
Gross price -- 500
VAT% 20
Service Tax -
61.8
Net. Incl. Disc. 581.8
Grand total----
1500
(desired tgrand total 1163.36+581.8)
I have many line items like this and the total of all conditions at individual line item printed is correct.
But at the bottom of the PO print, in the "Grand Total" the sum of only the Gross values is printed (Not the total of the Net. Incl. vlaues of line items).
I got info from our developer that we are using SAP scripts (not smart forms).
Please guide me if anyone has come accros a issue like this and got the answer. This is urgent.
Thank you
MRao

To calculate grand totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window where ever that value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name>
/:USING &KOMVD-KBERT&
/:CHANGING &TOT_PRICE&
/:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly grant total will be in footer window)
Then create subroutine pool program and you have to write the following code.
FORM F_GET_PRICE tables int_cond structure itcsy
                                           outt_cond structure itcsy.
data : value type kbert.
statics   value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
I have given a rough example,
Note:Int_cond-value and outt_cond-value are characters.
Close the thread once your question is answered.
Regards,
SaiRam

Similar Messages

  • Hide grand total field on ALV report, But keep the sub total fields

    Dear Experts,
    1) How to hide grand total field on ALV report, But keep the sub total fields.
    2) How to populate rate per ton & calculate total price according to the qty in delivering document.

    Dear Experts,
    1) How to hide grand total field on ALV report, But keep the sub total fields.
    2) How to populate rate per ton & calculate total price according to the qty in delivering document.

  • Printing sap script to spool by skipping print parameter window

    Hi all,
    I am trying to print an output (derived from sap script) directly from program to spool and then fetch the spool request and download it to PDF. This should happen automatically when the end user executes the program by giving required inputs. Can any one guide me on this ?
    Rgds,
    Praveen

    Hi all,
    I got the problem solved. Thanks for all who replied and supported me. This is how i solved it. This is not the full code. I am not giving declaration part here. But this is the main blocks which is going to work.
    Data: purdocno TYPE string,
                        v_len_in TYPE i.
    PERFORM open_from.
        LOOP AT it_itab.
          ON CHANGE OF it_itab-ebeln.  
              PERFORM start_form.
              PERFORM write_form.
              PERFORM end_form.
          END ON.
        ENDLOOP.
    PERFORM close_form.
    PERFORM convpdf.
    FORM convpdf.
        CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
           format                      = 'PDF'
    *       MAX_LINEWIDTH               = 132
    *       ARCHIVE_INDEX               = ' '
    *       COPYNUMBER                  = 0
    *       ASCII_BIDI_VIS2LOG          = ' '
           PDF_DELETE_OTFTAB           = 'X'
         IMPORTING
           BIN_FILESIZE                = v_len_in
    *       BIN_FILE                    =
          TABLES
            otf                         = i_otf
            lines                       = i_pdf
         EXCEPTIONS
           ERR_MAX_LINEWIDTH           = 1
           ERR_FORMAT                  = 2
           ERR_CONV_NOT_POSSIBLE       = 3
           ERR_BAD_OTF                 = 4
           OTHERS                      = 5.
        purdocno = s_ebeln+3(10).
        concatenate 'c:\' purdocno '.pdf' INTO purdocno.
        CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
    *      BIN_FILESIZE                    =
          filename                        = purdocno
          FILETYPE                        = 'BIN' " important
    *    IMPORTING
    *      FILELENGTH                      =
         tables
           data_tab                        = i_pdf
         EXCEPTIONS
           FILE_WRITE_ERROR                = 1
           NO_BATCH                        = 2
           GUI_REFUSE_FILETRANSFER         = 3
           INVALID_TYPE                    = 4
           NO_AUTHORITY                    = 5
           UNKNOWN_ERROR                   = 6
           HEADER_NOT_ALLOWED              = 7
           SEPARATOR_NOT_ALLOWED           = 8
           FILESIZE_NOT_ALLOWED            = 9
           HEADER_TOO_LONG                 = 10
           DP_ERROR_CREATE                 = 11
           DP_ERROR_SEND                   = 12
           DP_ERROR_WRITE                  = 13
           UNKNOWN_DP_ERROR                = 14
           ACCESS_DENIED                   = 15
           DP_OUT_OF_MEMORY                = 16
           DISK_FULL                       = 17
           DP_TIMEOUT                      = 18
           FILE_NOT_FOUND                  = 19
           DATAPROVIDER_EXCEPTION          = 20
           CONTROL_FLUSH_ERROR             = 21
         OTHERS                            = 22.
        IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ENDFORM.

  • Printing sap script for multiple customers

    Hi,
    I have a requiremnt to print the form for multiple customers. How should i use the sap script function modules? i.e. in which sequence?
    for example customer A has 5 pages. customer B has 4 pages.
    after printing 5 pages of the customer A, it should print 4 pages of the customer B.
    regards,
    CK

    To print accroding to your requirment you should modify your driver program like this...
    Sort <Internal table by KUNNR.
    LOOP AT <internal table>
    AT NEW KUNNR. "Customer..
    **Call Function module OPEN_FORM
    END AT.
    AT END OF KUNNR.
    ***Call function CLOSE_FORM
    ENDAT.
    ***Call all your Write_FORM
    ENDLOOP.
    Regards,
    SaiRam

  • Problem in multiple page printed (SAP Script )

    Hi Experts ,
    In SAP Script print ,
    First page print is perfect on preprinted stationary ,but
    Second page data is getting printed 2-3 cm up.
    Please tell me various reason for this ...
    Thanks
    Sonal

    Hi Sonal ,
    This happens with your predefined stationary .
    Are you declaring it in the same window where your declaring your data ?
    If yes, Try taking another variable window and keep all your predefined sationary there and then call it evry time you call your window with data .
    Or, It can be with the Text element try giving 2 empty lines before the text element it solves your problem!
    Hope it helps!
    Much Regards,
    Amuktha .
    Edited by: Amuktha Naraparaju on Feb 9, 2009 9:57 AM

  • Junk Characters on first two pages of Cheque Printing SAP Script.

    Hi All
    I implementing cheque printing for one of our client's Oman based subsidiary. I have copied the standard SAP Script F110_PRENUM_CHCK into a Z-Form and maintained its original language as EN. I have commented out all the unnecessary peices of information in all the windows and customised as per my requirement.
    Now the problem that i am facing is that when i execute this script through the standard driver program RFFOUS_C, i am getting junk characters on first two pages of the script. The info displayed comes in the HEADER and MAIN Windows. The desired output is coming in the 3rd, 4th and 5th pages.
    Please let me know how should i get rid of these junk characters.
    Regards
    Harsh
    PS: All info printed is in English only.

    Hi
    Thanks for your response.
    Yes, the remittance advice header info is getting printed in the HEADER Window and its contents in the tabular structure are in the MAIN Window.
    I am passing EN as the language.
    Adding to this, the report RFFOUS_C gets executed and i am checking the spool that is created which has the junk characters on the first two pages.
    Regards
    Harsh

  • Problem while printing SAP Script

    Hi All,
    I have one scenario, in which I have to copy the Standard SAP Script  form (HR_ALL_FIX) client '000' and import in the development server as custom SAP script(ZHR_ALL_FIX)  and making change in main window the text. Instead of  "Yours Faithfully" text I have changed it to 'Warm Regards'.
    When I try to view the print preview of the script from PP40 tcode,  the output is overlapped.
    Instead of 'warm regards' to be displayed at the end of the page, its being printed in between somewhere.
    No other changes I have made.
    Any inputs and help will be really helpful.
    Thanks in advance

    I am still facing the problem . tried everything. Have only changed the language while copying from DE to EN.
    Also, just creating a Z form without ANY change at all( even the printer used to check print preview is the same)... and attaching it to OOVM transaction and then checking the print preview - TEXT comes randomly (in different order)
    Any help will be really appreciated and rewarded..
    Awaiting help.
    Edited by: HeenaChampaneri on Apr 15, 2010 8:39 AM

  • Question on Printing SAP Script

    Hi Group,
    I have an urgency in printing a SAPScript. I would like to know how to change the printer settings to hold the page of a particular size for printing.
    Please let me know the procedure to achieve this and also the transaction(s) relating to this configuration.
    My requirement:
    I want to create some settings to a SAP Script page and I want to use the same configuration (of the page) while running the driver program.
    My Issue is:
    I have a page(SAP Script) in which I want to print exactly 3 cheques for the page.
    But, currently, I am able to get only one cheque getting printed and remaining 2/3 of the page is getting wasted. So I want to do the configuration accordingly to achieve my task.
    Please let me know your valuable inputs.
    Thanks & Regards,
    Vishnu.

    We don't include the audit trail content in the specification print out.   I recommend using a BI Publisher contextual report that you can launch from the specification.  You can learn more about custom reporting in the extensibility pack reporting guide.

  • Error in printing SAP Script

    Dear All,
    I need some help frm u gurus.
    Theres a Z-SAP Script that I made.........the same is running fine in quality but when transported to production client it gives error in PERFORM START_FORM USING FORMNAME LANG 'MAIN'. saying that the form doesnot exist in language 'EN'.
    What can be the problem?? Any suggestion....?
    Thnx.

    just check it out whether you will have properly released and whether it is reached to the destination client.
    one more thing check in language option of that script in se71 screen in language option whether english is maintained.
    if further information please reply
    rewards points if useful

  • Sap Script: dynamic hide fields.

    Hi,
    I have a question about how to hide some no value fields.Need your help
    Now,in form ,I write:
    Description1:&text1&
                       &text2&
                       &text3&
    Result: ok.
    if all three fields have value,no problem,but if &text2&,&text3& are empty,the layout is:
    Description1: aaaaaaaaaa
    (blank)
    (blank)
    Result: ok.
    I want to hide two blank lines,show like this:
    Description1: aaaaaaaaaa
    Result: ok.
    How do I implement it?

    Hi,
    Try this :It will ensure no blank lines are printed irrespective of their position.
    IF &text1& <> ' '
    Description1:&text1&
    ELSEIF &text2& <> ' '
    &text2&
    ELSEIF &text3& <> ' '
    &text3&
    endif
    Result: ok.
    Hope this helps!
    Sandeep

  • Printing SAP Script from PCUI

    Hi,
      How shall we print Sapscripts from PCUI.
    Thanks and Regards,
    Abdul Raheem .S

    Abdul, is it not a valid option to translate your SAPScript to a Smartform? This is much easier to handle and also follows SAP's future development. Tiest.

  • Problem in printing SAP Script Page Numbering

    Hi All,
    Am facing a problem like : Page Numbering in one of my form is getting printed from 0 (I mean initializing from 0).
    Eg : Page 000 of 003
           Page 001 of 003
           Page 002 of 003
    I want to get printed as :
          Page  001 of 003
           Page 002 of 003
           Page 003 of 003
    Could you pls help me in this regard.
    Thanks In Advance.
    Thanks,
    Madhu.

    Hi,
    You can solve this problem by setting the page counter mode to "start" and the numbering type as "Arabic", in the page attributes.
    Regards,
    Ajith V

  • Spell check on abap fields : High priority

    Hi ,
         I  looked at this thread it exactly suits to my requirement but in this how to download the testspellcheck.zip .
         Can any one tell me where to get that zip file .
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/technologies/ms%20word-like%20spell%20checker%20for%20sap%20gui%20fields.
    Thanks in Adv.
    Varma

    hii
    just click on the hyperlink or right click and say save target as
    it will do
    reward if useful
    vikaas

  • Unicode Sap Scripts - Print preview contains overwriting

    Hi All ,
    After doing unicode test, the program output when i see in print preview gives me unreadable charecters and overwritings . Earlier version 4.6 c did not had this problem ... i am new to sap scripts any  help is highly appreciated.
    regards,
    Amarnath Reddy.

    Amarnath Reddy,
    SAP GUI code page you can check in the following way:
    open SAP GUI, put cursor on your system item, click 'properties', 'change' or 'settings' (not sure how it is called) and you will get it.
    I am not an expert in basis but to check application server code page you can run report RSPARAM1 and search for parameter that contain 'codepage' in its name (for example install/codepage/appl_server).
    Perhaps that the reason of your problem,
    Kind regards,
    Tomasz Kozerski

  • This is regarding totals and sub totals in sap-scripts

    Hi to all...............
    1...How to print totals and subtotals in sap-scripts? where we have to code the logic.what sort of logic is needed to print the same?
    regards,
    swaminath.

    Hi
    HI,
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
    outt_cond structure itcsy. data : value type kbert.
    statics value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    To know more, have a look at this thread ..
    Re: SAP Script: Display Total calculated  on page 2 in page 1
    <b>Reward if usefull</b>

Maybe you are looking for