CALCULATION IN THE HEADER IN SAP SCRIPT!

friends...
i have designed a form z_pm_common..which i have copied from standard.pm_common. i have made some changes to the layout.
now at the header i have a field :
DURATION OF JOB  :&AFVGD-ARBEI& &AFVGD-ARBEH&
AFVGD-ARBEI IS WORK DURATION.I.E 6.3
AFVGD-ARBEH IS UNIT. IN HOURS.
THE WORK ENTERED IN IW33 ARE 1.0 , 2.0 , 6.3 AND UNIT IS H(hours)
WHEN IAM USING  &AFVGD-ARBEI& &AFVGD-ARBEH&
IAM GETTING ONLY THE LAST WORK I.E ( 6.3 H ).
WHT I WANT TO DO IS CALCULATE 1.0 + 2.0 + 6.3 = 9.3. AND I WANT THE UNIT TO BE IN MINUTES. I.E THE O/P SHOULD BE LIKE 09:03 M(MINUTES).
NOW HOW DO I MAKE THIS POSSIBLE ALSO HOW DO I PERFORM SUBROUTINE IN THIS CASE..PLZ TELL ME THE COMPLETE STEPS WITH CODING.
I GUESS  IT WOULD BE PERFORM Z_PM_COMMON IN PROGRAM ZPMINCLUDE USING &WHAT&  CHANGING &WHAT?&
THEN IN SUBROUTINE IT WOULD BE
FORM Z_PM_COMMON WORKCONV_UNIT
    TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.
     NOW WHT DO I DO....
PLEASE SEND ME THE COMPLETE CODE....WHICH WORKS.......I WOULD BE GREATFULLL.
I'LL GIVE U FULL POINTS IF I GET THE RIGHT SOLUTION..PLEASE HURRY.
REGARDS
ESSAM ([email protected])

Hi
  You can try the following
Code in Sapscript
PERFORM Z_PM_COMMON IN PROGRAM ZPMINCLUDE USING &AFVGD-ARBEI& CHANGING &AFVGD-ARBEI& &AFVGD-ARBEH&..
&AFVGD-ARBEI& &AFVGD-ARBEH&.
code inside the perform
data : temp type AFVGD-ARBEI,
         value type AFVGD-ARBEI.
clear temp.
FORM Z_PM_COMMON tables int_cond structure itcsy
out_cond structure itcsy.
Read int_cond table with KEY name = AFVGD-ARBEI.
clear value.
value = int_cond-value.
temp = temp + value.
Read out_cond table with KEY name = AFVGD-ARBEI.
out_cond-value = temp.
Modify out_cond index 1.
Read out_cond table with KEY name = AFVGD-ARBEH.
out_cond-value = 'M'.
Modify out_cond index 2.
ENDFORM.
If your query is resolved kindly close the thread and award points
cheers
shafiq

Similar Messages

  • What are the components of sap script?

    what are the components of sap script?

    SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. - Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program. Components of scripts are Layout sets, SAPScripts text, ABAP print program, symbols, function module like open form, start form, write form.
    Please have a look at below links, might be useful for you.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRRDI/BCSRVSCRRDI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCREDIT/BCSRVSCREDIT.pdf
    Also have a look at below links:
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf.
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    I hope it helps.
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • How to get the last page  SAP Script form

    How to get the last page  SAP Script form.
    I want to print a specific information in the last page of SAP form (Script). Please tell me how to get the last page number.
    Regards

    Hi
    You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
    From SAP Help:
    This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
    Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
    /: IF &NEXTPAGE& = '0'
       Last page
    /: ENDIF
    Max

  • Driver program for the Dunning letter SAP Script

    Hello All,
    Can someone please tell me how to find the "Driver program for the Dunning letter SAP Script". I checked the Transaction OB96 but I dont find any Dunning scripts here i.e., the standard Dunning letter SAP Script F150_DUNN_01.
    Is there any Transaction like NACE of logistics for FI module to find the Driver programs. My requirement is to find the Driver program for the Dunning letter SAP Script and have a new Driver program instead of the standard SAP given driver program. Example is in transaction NACE we can change the driver program for Invoice like from RVADIN01 to ZRVADIN01.
    Thanks and Regards,
    SNK.

    Yes you can, using FIBF, change the FM associated with event 1720 like when SapScript is replaced with SmartForms. Look at [Define Dunning Forms (with SAP Smart Forms)|http://help.sap.com/saphelp_46c/helpdata/es/7d/c7a0a535e1d311ba4d0800060d888b/content.htm] for reference.
    But notice
    - PRINT_DUNNING_NOTICE call many FM of the same FG which share the same global data area.
    - During following upgrades of your system you will have to manage a copy of standard.
    Regards,
    Raymond

  • How to insert the style in sap-script? and in smart form?

    how to insert the style in sap-script? and in smart form?

    Hi..,
    For SAP scripts u need to create them in SE72 ...
    and u can include them in the script editor as..
    /: STYLE <STYLE-NAME>
    P1 text...............  (*** P1 is the Paragraph format created in SE72 )
    /: STYLE *
    For smartforms u need to go for the transaction (tcode) SMARTSTYLES... here u can create paragraph and character formats globally...
    <b>Sunil, plz do remember to close all your threads, when ur problem is solved !!</b>
    reward all helpful answers,
    sai ramesh

  • How to save the output of sap script to pdf document in sap

    hi abapers
    how to save the output of sap script in sap so that can retrieve the saved document later.
    i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
    how to use dms

    Hi deepika,
    This thread will solve ur problem OTF  -> PDF
    Regards,
    Pravin

  • How to save the output of sap script in sap so that can be retrieved later

    hi abapers
    how to save the output of sap script in sap so that can retrieve the saved document later.
    i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
    how to use dms
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Dec 26, 2008 11:01 AM

    Hi Deepika,
    Look into this link https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/401cca81-b861-2910-ada2-f416dfb3b3fe
    Regards,
    Pravin

  • If i got incorrect characters in the output of sap script? HOW TO CORRECT I

    If i got incorrect characters in the output of sap script? HOW TO CORRECT IT?

    Hi Sunil,
    Debug the script and check where exactly those are getting populated. Definately you will get it. Check the conversion parts means character to numeric conversion.
    If your version is 4.7E then select unicode check box in the reports attributes. It will display the error message so that we can solve very easily.Hope this helps you, reply for queries, Shall post you the updates.
    Regards. 
    Kumar. .

  • How to put footer in the Delivery note  sap script form.

    Hi All,
      i am new to SAP SCRIPT , can any one guide us how to Create a footer in the Delivery note sap  script.
      I need to put  some message if the stock of the material is "0"(zero).
           can anyone  tell me the process to do this.
    Thanks
    Channappa Sajjanar

    Hi,
    U create a window in script (Footer), and in the Driver program call this window at last..
    eg:
    create a window in script and call it at the end in the layout..
    /E FOOTER
    P1 'Write Required text what u want to display;.
    now in print program, after printing all the line items in ur internal table call the FM write_form to print the footer...
    LOOP AT itab.
      call function 'WRITE_FORM'
        exporting
         window = 'MAIN'
        exceptions
          others = 1.
    endloop.
    now call, FM write_form to print the footer
    IF stock EQ 0.
    call function 'WRITE_FORM'
        exporting
         window = 'FOOTER'
          element = 'FOOTER'
        exceptions
           others = 1.
    endif.
    Hope it helps!!
    Rgds,
    Pavan

  • Change the package of SAP script

    How to change the package of SAP script from local to other package?

    Hi Manish,
    Check this one:
    Change of package for Sap script
    Regards,
    Chandra Sekhar

  • What is the form name (SAP script name ) for KO02 output .

    Hai ,
    what is the form name (SAP script name ) for KO02 output . and also pl guide how to customize that.
    thank u in advance

    spro---->controlling ->internal Order->Order Master Data----> Prepare Output and see the documentation of this.
    Regards
    Peram

  • Calculation in header in sap script!

    friends...
    i have designed a form z_pm_common..which i have copied from standard.pm_common. i have made some changes to the layout.
    now at the header i have a field :
    DURATION OF JOB :&AFVGD-ARBEI& &AFVGD-ARBEH&
    AFVGD-ARBEI IS WORK DURATION.I.E 6.3
    AFVGD-ARBEH IS UNIT. IN HOURS.
    THE WORK ENTERED IN IW33 ARE 1.0 , 2.0 , 6.3 AND UNIT IS H(hours)
    WHEN IAM USING &AFVGD-ARBEI& &AFVGD-ARBEH&
    IAM GETTING ONLY THE LAST WORK I.E ( 6.3 H ).
    WHT I WANT TO DO IS CALCULATE 1.0 + 2.0 + 6.3 = 9.3. AND I WANT THE UNIT TO BE IN MINUTES. I.E THE O/P SHOULD BE LIKE 09:03 M(MINUTES).
    NOW HOW DO I MAKE THIS POSSIBLE ALSO HOW DO I PERFORM SUBROUTINE IN THIS CASE..PLZ TELL ME THE COMPLETE STEPS WITH CODING.
    I GUESS IT WOULD BE PERFORM Z_PM_COMMON IN PROGRAM ZPMINCLUDE USING &WHAT& CHANGING &WHAT?&
    THEN IN SUBROUTINE IT WOULD BE
    FORM Z_PM_COMMON WORKCONV_UNIT
    TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.
    NOW WHT DO I DO....
    PLEASE SEND ME THE COMPLETE CODE....WHICH WORKS.......I WOULD BE GREATFULLL.
    I'LL GIVE U FULL POINTS IF I GET THE RIGHT SOLUTION..PLEASE HURRY.
    REGARDS
    ESSAM ([email protected])

    Hi
    You can try the following
    Code in Sapscript
    PERFORM Z_PM_COMMON IN PROGRAM ZPMINCLUDE USING &AFVGD-ARBEI& CHANGING &AFVGD-ARBEI& &AFVGD-ARBEH&..
    &AFVGD-ARBEI& &AFVGD-ARBEH&.
    code inside the perform
    data : temp type AFVGD-ARBEI,
    value type AFVGD-ARBEI.
    clear temp.
    FORM Z_PM_COMMON tables int_cond structure itcsy
    out_cond structure itcsy.
    Read int_cond table with KEY name = AFVGD-ARBEI.
    clear value.
    value = int_cond-value.
    temp = temp + value.
    Read out_cond table with KEY name = AFVGD-ARBEI.
    out_cond-value = temp.
    Modify out_cond index 1.
    Read out_cond table with KEY name = AFVGD-ARBEH.
    out_cond-value = 'M'.
    Modify out_cond index 2.
    ENDFORM.
    If your query is resolved kindly close the thread and award points
    cheers
    shafiq

  • How to Fix the row in sap script, its urgent......

    Hi Experts,
    first i explain my sap script, i have print void check in my script client give readymade format means box are there, lines are there. i have to fix in box and line data form database table. everthing is working fine. i got all data. i have total 6 window in my script .but i have one issue  In my sap script in header window total five rows... like below
    Check voucher no:8888
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    now sometime check voucher is balnk....
    Check voucher no: BLANK/NULL
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    because of that all rows are move up side and all window also move up side and so script not fix to the box and line all data are seen not perfectly... so guru`s how to fix the row and window in script....
    its urgent...
    Waiting for ur reply
    Thanks & regards
    Jigar

    Hi,
    Follow the below steps . Definately your issue will bve resolved.
    Let us suppose you are printing following fields
    PH &v_text&
    PH &v_text1&
    PH &v_text2&
    you will get the output as you expected.
    and if you have any conditions  for these fileds
    /: if v_text is not initial.
    PH &v_text&
    /: endif
    PH &v_text1&
    PH &v_text2&
    if you have data in each field then you will get output as expected .
    But when v_text is initial.
    the data will be moved up wnhich is happening in your case.
    so what you need to do is?
    /: if v_text is not initial.
    PH &v_text&
    /: else
    PH  (Here you need to mention empty line with same paragraph format
    /: endif.
    PH &v_text1&
    PH &v_text2&
    Reward points if useful
    Regards,
    Nageswar

  • How to print the Totals in SAP Scripts..?

    Hi,
    I have an SAP Script layout. Currently I am displaying the Line items in the layout. The new requirement has come up to display the TOTAL of the amount value in the layout at the end of the line items. Can someone tell me how to display the Sum of the Amount value at the end of the Line items in an SAP Script.
    The Print program for this layout is standard program. Can this be handled within the layout..? Someone please provide me some sample code if available.
    Thanks in advance.
    Best regards,
    Paddu.

    Hi,
    Thank you for your reply.
    My Standard print program doesn't provide the total value.  Could you please tell me where exactly we need to write the logic in the Layout. I mean, do we need to write under separate element..? and in the External subroutine, how would be the logic. It would be greatful if you provide some sample code.
    Thanks & Regards,
    Paddu.

  • How to set the position in SAP Script

    Hi Professionals,
    Can anyone tell me that How can I set the position of an bitmap Image (after inserting) in SAP Script ?
    by default position is in Left, I need to align it in center or somewhere else.
    Anybody knows, kindly reply!
    Thanks
    Devinder

    Hi,
    But Can we assign a window under another window. Because I want to insert a bmp picture on particular position.
    example:- there is a digital signature and wanted to insert upon a name.
    So, there is a text (which is customer name) and digital signature (in bmp picture format) upon it.
    Thanks
    Devinder

Maybe you are looking for

  • Itunes doesn't recognize Ipod Touch 4g

    I purchased my daughter a brand new Ipod Touch 4G last weekend.   When we connect the new Ipod Touch to my daughters computer, Itunes won't recognize her Ipod Touch.   However, I can attach her Ipod Touch to two other computers and it recognizes with

  • Table control program

    hai I have problem in table control in 'se80'  create table control in screen painter and the program is follow,,,,,, __1.include__ TABLES SPFLI. CONTROLS MYTABLE TYPE TABLEVIEW USING SCREEN 110. DATA: ITAB LIKE SPFLI OCCURS 0 WITH HEADER LINE. 2.flo

  • Uninstall IE10 script or other remote command

    Hi, Please note that I originally submitted this under Internet Explorer category and was told to move it here. Obviously on a localised, single PC, to uninstall IE10 and revert to IE8 you would simply go into Control Panel, Programs & Features, View

  • For Anyone who has Blackberry Connect WITH OTA Con...

    I've tried with an E61i, E90, and now E51, all with the latest firmware and latest Blackberry Connect software, and nothing I do on the device allows me to be able to do OTA sync of our corporate Exchange, (Outlook), Contacts. I only have the standar

  • Upgrading Installations that use Standby Databases

    I have applied patch 6810189 and upgraded Oracle10g Database on my local machine, Now I am planing to apply it on test machine for that I need additional steps for upgrading Physical Standby database as said in README.html of p6810189_10204_Win32.zip