About Sapscript SE71

Dear Experts,
I modify text element in SE71 , and then SAVE and ACTIVE ,
but when I debug it ,  the text element isn't the new version ,
What step do I lose?
(Sorry, I  know nothing for Sapscript, kindly help me how to solve it.)
Thanks a lot.
Yacoa

sap-script forms are client dependant, maybe you are debugging in another client than you develop?
Or maybe you are debugging in another language which you didnt already change.

Similar Messages

  • About SAPscripts and smartforms

    Hi all,
             I am working on SAPscripts and i have one doubt.
    I want to know the concepts how data is communicated between SAP scripts and print program.Suppose I am writing one subroutine. Can i write the form statements in the print program of the script or I have to write it in another program.
             I want whether SAPscript is calling the print program or vice versa.
             Please tell me the same concepts regarding smartforms.
             Please experts provide me a vivid idea so that I can get the concepts clear.
        With regards,
          Abir.

    HI
    GOOD
    AS PER YOUR REQUIREMENT HERE I AM GIVING SOME POINTS RELATING TO SAP SCRIPT AND DRIVER PROGRAM
    WHEN YOU R CREATING A SAPSCRIPT FORM IT CANT ABLE TO EXECUTE OF ITSELF, FOR EXECUTION IT NEEDS HELP .THAT IS THE REASON YOU R CREATING A DRIVER PROGRAM.
    IF YOU GO THROUGH A DRIVER PROGRAM YOU CAN FIND OUT THAT YOU R PASSING THE SAP SCRIPT NAME AS A PARAMTER.SO YOUR DRIVER PROGRAM IS CALLING YOUR SAP SCRIPT FORM.
    USING THE DRIVER PROGRAM YOU ARE PASSING THE APPROPRIATE VALUE FOR THE VARIBALE THAT YOU R GOING TO PRINT IN THE SAP SCRIPT FORM.
    =============================
    SMARTFORM CONCEPT=>
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name    Type assignment   Reference type
    ITAB1               TYPE                  Table Structure
    Global definitions
    Variable name    Type assignment   Reference type
    ITAB2               TYPE                  Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g.  HD_GEN for printing header details,
            IT_GEN  for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    THANKS
    MRUTYUN

  • Hi, everyone, a question about sapscript?

    Hi, everyone,
    My sapscript have one page and next page is the same as the first page, the page have two window, a var window and a main window, in the main window there is a command at the top that is "/: BOX FRAME 10 TW". and when I preview the form there is two page and in page 1 there is frame but the next page doesn't have frame, I don't know why, can anyone tell me why? thank you in advance!
    Kind regards
    Dawson

    hi,
    The box will not be carried by the main window to the other page this is because, the main window will be having the changing content, and as we define the main window only once the box appears only once. the remaining data in the main window will increase according to the content in it. so prepare your box in a variable window and define it in all the pages so your box will be coming in all the pages. overlay the variable window on the main window. with the same size..
    you can refer to the link with same kind of query
    [BOX IN SAP SCRIPTS|Re: sapscript box nto printed on all pages]
    have a good day,
    regards,
    sarves

  • Question about Sapscript

    Hi, i want to know if i have a program with print button, call a sapscript two times.
    The first call for obtain the otf data and download to PC and the second call for show the print preview screen.
    I tried to do the two activities at the same time.
    itcpo-tdnoprev   = ' '.
    itcpo-TDGETOTF = 'X'.
    CALL FUNCTION 'OPEN_FORM'
           EXPORTING form = tnapr-fonam
                     language = ekko-spras
                     options = itcpo
    CALL FUNCTION 'CLOSE_FORM'
      IMPORTING
         RESULT                         = RESULT
         RDI_RESULT                     =
       TABLES
         OTFDATA                        = DATAB[]
    But it didn´t work, i got the otf data, but no print preview screen; so i suppose to call the sapscript two times will resolve my problem.
    Thanks

    Hi Jos,
    No need of calling the sapscript two times...What you have declared is correct
    itcpo-tdnoprev = ' '.
    itcpo-TDGETOTF = 'X'.
    [Converting SAP Script outputs to PDF file|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556]
    Regards,
    Sravanthi

  • About SAPSCRIPT-SUBRC

    I've been asked to output the item text of a PO according the language, when there is French text in system, print out directly, if not ,print the English version as well,
    i am in the French version of the SAPscript ,and the original code is :
    INCLUDE &EKPO-EMATN& OBJECT MATERIAL ID BEST PARAGRAPH TX
    then i changed to
    INCLUDE &EKPO-EMATN& OBJECT MATERIAL ID BEST PARAGRAPH TX
    IF  &SAPSCRIPT-SUBRC&  ne  0
    INCLUDE &EKPO-EMATN& OBJECT MATERIAL ID BEST PARAGRAPH TX LANGUAGE 'E'
    ENDIF
    after that i opened the scipt debug to track ,it seems too strange that whether SAPSCRIPT-SUBRC equals 0 or not ,the second include command always runs out .
    why there is no use of if condition
    appreciate your help  urgently

    Hi,
    Did you give the IF condition as a control command...meaning did you give /:
    Also try giving = 4 instead of NE 0
    /: IF &SAPSCRIPT-SUBRC& = 4
    /:INCLUDE &EKPO-EMATN& OBJECT MATERIAL ID BEST PARAGRAPH TX LANGUAGE 'E'
    /:ENDIF
    Thanks
    Naren

  • About SAPScript Error

    Hi All,
    I don't know what exactly i done while working with scripts, later on when ever i create and activating a new script[testing purpose] my driver program is not recognizing that.. saying that script is not available/active.
    Before that am making sure my scrit is perfect including the texts and definations.
    Can any one guide me how to rectify the problem.
    Since i feel this problem is not related for ABAP programming am posting it here.
    Regards
    Shinoy.

    Hi N Regula,
    In your case can occur the next case:
    1.- When you use the function that call the form, maybe the name of Report that you are using as parameter is not on CAPS.
    2.- Remenber that must load the form after call it.
    3.- Check if did not delete the principal window whose name is MAIN, because it have especial attributes.
    4.- Verify your control program and check your spelling when call the form.
    If it have been help you, reward and close the question.
    Regards,
    Yuhalbert Graterol

  • About  Sapscript - Page selection

    I made a Sapcript. When I start to 'print preview', I found that there were 13 pages.
    Back to print option view ,   I set the value of "Page selection"  1 and print preview. But there were still 13 pages be printed , why?  I think that  1 page should be printed .
    thanks for your help~

    hi,
    the field Page selection is foer the print options not for the print priveiw. So the value in the field will not be considered for the print preview.

  • About SapScript

    hi all..
    i want to display the sales doc. no.(vbeln) in a script for a particular customer(kunnr), while checking the o/p for my print program it displaying each different vbeln in a separate page instead of step by step with in a main window of script. can any one pls guide me how to display.
    Below am enclosing what i coded..
    DRIVER PROGRAM.
    CALL FUNCTION 'OPEN_FORM'
    LOOP AT ITAB.
    SELECT...
    CALL FUNCTION 'START_FORM'.
    CALL FUNCTION 'WRITE_FORM'.
    CALL FUNCTION 'END_FORM'.
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'
    CODED IN SCRIPT IN MAIN WINDOW.
    /E ELE1
       &itab-VBELN&,,,,,,&itab-ERDAT&,,,,&itab-NETWR&
    THANX IN ADVANCE.
    REGARDS
    SHINOY.

    Hi,
    Its just a simple change to your code...juzt put the 'WRITE FORM' in the loop instead of putting the whole start , write and close form in the loop.
    Do the select before itself and poupulate itab.
    call function ' OPEN_FORM'.
    LOOP AT ITAB.
    CALL FUNCTION 'WRITE_FORM'.
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'
    Hope it helps. Revert bac incase of any doubts

  • SAPscript print program

    Hi All
    I have the SAPscript form name. I need to find out the name of the print program.
    The table TNAPR gives the standard program name attached to the SAPscript.
    But, I need to find out the Z* program name associated with the SAPscript.
    Pls do help on this.
    Thanks,
    Zahabia.

    hI
    Sapscripts are client dependend and smartforms are client independet.
    SAPscript are CLient Dependent, SmartForms are Client Independent. The reason why SmartForms are client independent is because when you activate a SMartForm, SAP actually generates a Function Module (which as you know is client independent). The Print Program (or as SAP likes to refer to them these days - Application Program) calls your generated FM.
    In the "smartforms" transaction, when you are viewing a smartform, you can go to the Environment->Function Module Name menu path to see the FM name.
    Look at the "Application Program" for the Invoice SmartForm (RLB_INVOICE):
    determine smartform function module for invoice
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING formname = lf_formname
    variant = ' '
    direct_call = ' '
    IMPORTING fm_name = lf_fm_name
    EXCEPTIONS no_form = 1
    no_function_module = 2
    OTHERS = 3.
    call smartform invoice
    CALL FUNCTION lf_fm_name
    EXPORTING
    archive_index = toa_dara
    archive_parameters = arc_params
    control_parameters = ls_control_param
    mail_appl_obj =
    mail_recipient = ls_recipient
    mail_sender = ls_sender
    output_options = ls_composer_param
    user_settings = space
    is_bil_invoice = ls_bil_invoice
    is_nast = nast
    is_repeat = repeat
    importing document_output_info =
    job_output_info =
    job_output_options =
    EXCEPTIONS formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    Difference with SMARTFORMS vs. SapScript (SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    Contributed by : SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    i) The main difference is that SAP script is client-dependant, while smartform is independent. Also there are some advanced and intreractive features available in smartforms.
    You can use an External subroutine-call in sapscript editor like:
    /: perform <form_name> in program <program_name>
    /: using <var1>
    /: using <var2>
    /: changing <return1>
    /: changing <return2>
    /:endperform

  • Diffrence b/w sapscript & smart forms?

    hi
    wat is the diffrence b/w sapscript & smart forms?
    deepak

    Hi Deepak,
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Thanks,

  • Smartform and sapscript..

    in which scenario v prefer smartform over sapscripts and in which scenarios sapscript over smartforms?

    Hi,
    Smartforms are better to use than scripts as they provide more facility like color, graphical user interface etc, but scripts are the oldest form of layout available in SAP. There is no advantage of using script over smartform. This entirely depends on the choice in case of new developments. However, if you have to change/customize existing script then you have to deal with scripts only.
    Difference with SMARTFORMS vs SapScript(SE71).
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Smartforms generates a function module when activated.
    d) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    e) In smartforms there is only one main window.
    In scripts we can create 99 main windows.
    f) Smartforms are client independent. but scripts are client dependent.
    g) we can execute smartforms directly without driver program. But it is not possible in script.
    h) peform statement is possible in script but not in smartforms.
    i) loop statement is possible in smartforms.
    In script for every data record controls moves from
    script to driver program and to script.
    In smrtforms this is not rquired.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    i) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    Check the link,
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Conversion of SAPSCRIPT to SMARTFORMS
    SAP provides a conversion for SAPscript documents to SMARTforms.
    This is basically a function module, called FB_MIGRATE_FORM. You can start this function module by hand (via SE37), or create a small ABAP which migrates all SAPscript forms automatically.
    You can also do this one-by-one in transaction SMARTFORMS, under
    Utilities -> Migrate SAPscript form.
    Regards,
    Richa

  • SAPscript ,  Smartforms

    Hi All
    I am totally new in this field and at present m on training.
    i wann study SAPscript and Smartforms.
    Can anybody suggest me how to proceed or how to start as at present i don know anything about SAPscript and smartforms
    Thanks in advance

    Hi
    As per your question suggest you need some practical classes to know smthing about sapscript and smartforms.
    Anyway if you have SAP at your home or institute you follow this process.
    SAP SCRIPT
    1- GO TO SE71
    2- Set the Character format
    3- Set the paragraph format
    4- Open the layout set.
    5- Design the form as per your requirements.
      Main window
      Constant Window
      Variable Window
    6-go to se38
    7- write a driver program
    8- use the minimum function module of the sap script
       OPEN_FORM
       WRITE_FORM
       CLOSE_FORM.
    Here is a driver program you can use this for your reference
    ============
    *& Report  ZTRIPATHY_SCRIPT                                            *
    REPORT  ZTRIPATHY_SCRIPT                        .
    TABLES: ZSCRIPT_TAB.
    data: itab type standard table of ZSCRIPT_TAB with header line.
    select * from ZSCRIPT_TAB into corresponding fields of table itab.
    DATA: VALUE TYPE I.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
       DEVICE                            = 'PRINTER'
       DIALOG                            = 'X'
       FORM                              = 'ZPS_MROF1'
       LANGUAGE                          = SY-LANGU
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
      CANCELED                          = 1
      DEVICE                            = 2
      FORM                              = 3
      OPTIONS                           = 4
      UNCLOSED                          = 5
      MAIL_OPTIONS                      = 6
      ARCHIVE_ERROR                     = 7
      INVALID_FAX_NUMBER                = 8
      MORE_PARAMS_NEEDED_IN_BATCH       = 9
      SPOOL_ERROR                       = 10
      OTHERS                            = 11
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'TEXT1'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      OTHERS                         = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at itab.
    VALUE = VALUE + ITAB-MY_INCOME.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'TEXT2'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      OTHERS                         = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endloop.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'TEXT3'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
    EXCEPTIONS
      ELEMENT                        = 1
      FUNCTION                       = 2
      TYPE                           = 3
      UNOPENED                       = 4
      UNSTARTED                      = 5
      WINDOW                         = 6
      BAD_PAGEFORMAT_FOR_PRINT       = 7
      SPOOL_ERROR                    = 8
      OTHERS                         = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        command         = 'NEW-PAGE'
    EXCEPTIONS
      UNOPENED        = 1
      UNSTARTED       = 2
      OTHERS          = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
       UNOPENED                       = 1
       BAD_PAGEFORMAT_FOR_PRINT       = 2
       SEND_ERROR                     = 3
       SPOOL_ERROR                    = 4
       OTHERS                         = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *FORM ADD_INCOME USING INCOME TYPE ZSHAIL_TAB1-MY_INCOME CHANGING VAL.
    *VAL = VAL + INCOME.
    *ENDFORM.
    SMARTFORMS
    1-GO SMARTFORM TCODE
    2-GIVE THE APPROPRIATE DATA IN THE
      Form attributes
      Form interface
      Global Definition
    3- Use the windows,tables,texts as per your requirements.
    4-go to se38
    5-write the driver program
    here i am giving a sample driver program you can follow this
    TABLES : vbrk,
             vbrp,
             kna1.
    TYPES  : BEGIN OF t_vbrk,
             vbeln TYPE vbrk-vbeln,
             fkart TYPE vbrk-fkart,
             kunag TYPE vbrk-kunag,
             END OF t_vbrk.
    TYPES  : BEGIN OF t_vbrp,
             vbeln TYPE vbrp-vbeln,
             fkimg TYPE vbrp-fkimg,
             cmpre TYPE vbrp-cmpre,
             netwr TYPE vbrp-netwr,
             END OF t_vbrp.
    TYPES  : BEGIN OF t_kna1,
             kunnr TYPE kna1-kunnr,
             name1 TYPE kna1-name1,
             adrnr TYPE kna1-adrnr,
             ort01 TYPE kna1-ort01,
             pstlz TYPE kna1-pstlz,
             regio TYPE kna1-regio,
             END OF t_kna1.
    TYPES  : BEGIN OF t_final.
              INCLUDE STRUCTURE ZINVOICE.
            vbeln TYPE vbrk-vbeln,
            fkart TYPE vbrk-fkart,
            kunag TYPE vbrk-kunag,
            fkimg TYPE vbrp-fkimg,
            cmpre TYPE vbrp-cmpre,
            netwr TYPE vbrp-netwr,
            name1 TYPE kna1-name1,
            adrnr TYPE kna1-adrnr,
            ort01 TYPE kna1-ort01,
            pstlz TYPE kna1-pstlz,
            regio TYPE kna1-regio,
    types:     END OF t_final.
    DATA  : i_vbrk TYPE TABLE OF t_vbrk,
            i_vbrp TYPE TABLE OF t_vbrp,
            i_kna1 TYPE TABLE OF t_kna1,
            i_final TYPE TABLE OF t_final.
    data  : v_fnam type rs38l_fnam.
    DATA  : wa_vbrk TYPE t_vbrk,
            wa_vbrp TYPE t_vbrp,
            wa_kna1 TYPE t_kna1,
            wa_final TYPE t_final.
    *START-OF-SELECTION
    SELECT-OPTIONS : s_vbeln FOR vbrk-vbeln.
    START-OF-SELECTION.
      SELECT vbeln
             fkart
             kunag
        INTO TABLE i_vbrk FROM vbrk
        WHERE vbeln IN s_vbeln.
      SELECT vbeln
             fkimg
             cmpre
             netwr
        INTO TABLE i_vbrp FROM vbrp
        FOR ALL ENTRIES IN i_vbrk
        WHERE vbeln = i_vbrk-vbeln.
      SELECT kunnr
             name1
             adrnr
             ort01
             pstlz
             regio
        INTO TABLE i_kna1 FROM kna1
        FOR ALL ENTRIES IN i_vbrk
        WHERE kunnr = i_vbrk-kunag.
      LOOP AT i_vbrk INTO wa_vbrk.
        wa_final-vbeln = wa_vbrk-vbeln.
        wa_final-fkart = wa_vbrk-fkart.
        wa_final-kunag = wa_vbrk-kunag.
        LOOP AT i_vbrp INTO wa_vbrp WHERE vbeln = wa_vbrk-vbeln.
          wa_final-fkimg = wa_vbrp-fkimg.
          wa_final-cmpre = wa_vbrp-cmpre.
          wa_final-netwr = wa_vbrp-netwr.
        ENDLOOP.
       LOOP AT i_kna1 INTO wa_kna1 WHERE kunnr = wa_vbrk-kunag.
         wa_final-name1 = wa_kna1-name1.
         wa_final-adrnr = wa_kna1-adrnr.
         wa_final-ort01 = wa_kna1-ort01.
         wa_final-pstlz = wa_kna1-pstlz.
         wa_final-regio = wa_kna1-regio.
       ENDLOOP.
        APPEND wa_final TO i_final.
      ENDLOOP.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'ZINVOICE_FORM'
        VARIANT                  = ' '
        DIRECT_CALL              = ' '
       IMPORTING
         FM_NAME                  = V_FNAM
       EXCEPTIONS
         NO_FORM                  = 1
         NO_FUNCTION_MODULE       = 2
         OTHERS                   = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION V_FNAM
      EXPORTING
        ARCHIVE_INDEX              =
        ARCHIVE_INDEX_TAB          =
        ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         =
        MAIL_APPL_OBJ              =
        MAIL_RECIPIENT             =
        MAIL_SENDER                =
        OUTPUT_OPTIONS             =
        USER_SETTINGS              = 'X'
    IMPORTING
        DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            =
        JOB_OUTPUT_OPTIONS         =
        TABLES
          i_final                    = i_final.
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    I hope this will help you to solve your problem
    Thanks
    Mrutyunjaya Tripathy

  • Carried forward of  total in sapscript

    Hi Expert:
    For a multiple-page invoice, I want to print the current total as carry forward amount or subtotal on the current page and on the subsequent page.
    Please note down I am talking about SAPSCRIPT only.
    Eventhough I tried to do it by using summing  but it gives short dump .
    Appreciation for your urgent reply and thanks in advance.
    Regards
    Shashi

    hi shashi,
    just check this ..
    Summing a Program Symbol: SUMMING The SUMMING command is used for accumulating a total value for a program symbol. The command should be specified just once. Then, each time the specified program symbol is formatted, its current value is added into the total symbol. Several program symbols may all be added into a single total symbol. Syntax: /: SUMMING program_symbol INTO total_symbol SAPscript cannot create the field for the total dynamically. The symbol used must be defined in a TABLES structure in the calling program.
    For details on summing and carrying forward, see Summing and Carrying Forward is Incorrect. 6.21.1 Summing and Carrying Forward is Incorrect Assume that for a multiple-page invoice, you want to print the current total as carry forward amount or subtotal on the current page and on the subsequent page. However, the carry forward amount is incorrect or missing. The following causes are possible: • You do not use program symbols with Dictionary reference for totalling. • You place the carry forward amount into the BOTTOM area. SAPscript processes the BOTTOM area at the beginning of a page; therefore it is not suited for carry forward amounts. • If you place the carry forwards amount into the TOP area of the main window on the subsequent page, the carry forward amount may be higher than it should be: This happens if the last part of text of the previous page does not fit onto the page, but the text is held together, for example, by a PROTECT command. In this case, a local text symbol must receive the carry forward amount. You must place the carry forward amount on the current page into a window of type VAR. On the subsequent page, use a local text symbol to print the amount in the TOP area of the main window: 1. At the beginning of the form main text (before printing the first text element), define the amount variable and the total variable (both must be program symbols or Dictionary amount fields). In the example below, we use the SUMMING command to determine that for each output of &SUMTAB-AMOUNT& the system automatically sums up the amount in the total variable &SUMTAB-TOTAL&. At the end of the page, &SUMTAB-TOTAL& contains the carry forward amount of the current page or the grand total, respectively. In this example, we also define a local symbol &LASTPAGE& to print the grand total on the last page.
    /: SUMMING &SUMTAB-AMOUNT& INTO &SUMTAB-TOTAL& /: DEFINE &LASTPAGE& = ‘ ‘
    2. At the end of the form main text (when printing the last text element of the main window), set the local textsymbol &LASTPAGE& to a different value, such as ‘X’:
    /: DEFINE &LASTPAGE& = ‘X’
    3. To print the carry forward amount in the TOP area of the subsequent page including the pre-text 'Carry forward' and a tab, we use the local text symbol &CARRY. The corresponding text element is also defined in the main window:
    /E CARRY
    &’Carry forward:,,’CARRY&
    (CALL FUNCTION WRITE_FORM EXPORTING ELEMENT = ‘CARRY’ TYPE = ‘TOP’) 4. Define the carry forward window on the current page as type VAR and position it at the end of the main window of the page. Print the carry forward amount there and define the local text symbol &CARRY& to print the amount again in the TOP area of the subsequent page. Use the local text symbol &LASTPAGE& to print the grand total on the last page. The carry forward window then contains the following text (define it as paragraph T1 with tab):
    /: IF &LASTPAGE& = ‘X’ T1 <H>Grand total:,,&SUMTAB-TOTAL&</> /: ELSE T1 <H>Carry forward:,,&SUMTAB-TOTAL&</> /: DEFINE &CARRY& = &SUMTAB-TOTAL& /: ENDIF
    hope this helps
    regards,
    vijay

  • SAPScript: manual counting of Total pages

    Hi All,
    in my requirement I have to print a Back page with Terms & conds on each page of the form, but the Back page is increasing a counter, so I want to calculate total pages manually, is it possible?
    In SDN I have found that system always count total no of pages in window type final.
    but this is form SmartForms, what about SAPScript?
    What system variable stores window type?
    more about the problem how Back page is increasing a counter:
    [BACK page is increasing a counter?|BACK page is increasing a counter?]
    Thanks and best regards,
    Mindaugas
    Edited by: Mindaugas Kazlauskas on Nov 17, 2008 6:02 PM

    Hi Sanjay,
       In your case where you want to increment the value of the total number of pages always use <b>&SAPSCRIPT-JOBPAGES&</b> and for the individual page <b>&PAGE&</b>.
    Since you have to increment the value of the total number of pages, pass the value to a variable increment the variable and then display that variable.
    :   PERFORM CHECK_PAGE IN PROGRAM Z_SCRIPT
    :   USING &SAPSCRIPT-JOBPAGES&               
    :   CHANGING &WS_PAGE&                           
    :   ENDPERFORM                                
    FORM check_page TABLES p_page STRUCTURE itcsy
                           p_page1 STRUCTURE itcsy.
      READ TABLE p_page INDEX 1.
      IF sy-subrc = 0 .
        p_page1-value = p_page-value + 1.
        MODIFY p_page1 INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "check_page
    Now your total number of pages would have been increased by 1 and display this variable in the script. But one point is <b>dont declare</b> the variable <b>WS_PAGE</b> in the driver program. If you declare the value will be reset. It will work believe me it works.
    Reward if helpful.
    Regards,
    Tushar

  • What is the diff b/w Sap Scripts and Smart Forms

    Hi,
          Whats the diff b/w SAP Scripts and Smart Forms..
             I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st  and SIMILARLY FOR SMARTFORMS WHETHER FM'S  R FORMS.
    Thanks & Regards,
    Gopi.

    Hi
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Regards,
    Swathi.

Maybe you are looking for