Program variable used in sap script

Hi all,
   I am trying to use program variable in sapscript with format &wa_ekpo-ematn&. I am sure in the program the field wa_ekpo-ematn has a value. But when I trying to call function write_form. All the text is displayed but all the program symbol just like &wa_ekpo-ematn& are missing.Anyone can tell me how to include program variable into sapscript? Thanks a lot.
Edited by: Alex Zhang on May 26, 2009 5:08 AM

Hi Alex,
Can you be a bit clear, how are you passing &wa_ekpo-ematn& to SAP Script in driver program(could be helpful if u can paste piece of code) and Where do you want to print &wa_ekpo-ematn& (I mean in which Window, with what element) in SAP Script (how).
Is that totally customizied Script or Standard Script made to Customized.
Regards,
Suneel G

Similar Messages

  • How to list ABAP programs that uses a SAP script form?

    Hello everybody.
    Can you please tell me how to list all ABAP programs that uses a particular SAPscript forms? That is, given a form name, I can then list all programs that uses that form.
    Thanks in advance. I'm trying to Google this same info but I'm having a hard time formulating my search terms.
    Thanks.
    -- Carl

    Hi Carl,
      You can get them from table TNAPR,
      Give the FORM NAME and all the programs are listed
    check this table also TTFXP ,   TTXFPT
    Message was edited by: Chandrasekhar Jagarlamudi
    Message was edited by: Chandrasekhar Jagarlamudi

  • What are the different functions used in sap script?

    Hi,
    What are the different functions used in sap script? What are the parameters used in each Function?
    Regards,
    Mahesh

    he print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options.
    Function modules in a printprogram:
    When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine forms into a single spool request use START_FORM and END_FORM.
    To print textelements in a form use WRITE_FORM. The order in which the textelements are printed, is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you can also use the WRITE_FORM_LINES function module.
    To transfer control command to a form use CONTROL_FORM.
    Structure of a print program
    Read data
    Tables: xxx.
    SELECT *
    FROM xxx.
    Open form printing - Must be called before working with any of the other form function modules.
    Must be ended with function module CLOSE FORM
    call function 'OPEN_FORM'.....
    To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM
    call funtion 'START_FORM'.....
    Write text elements to a window of the form
    call function 'WRITE_FORM'.....
    Ends spool request started with START_FORM
    call funtion 'END_FORM'.....
    Closes form printing
    call function 'CLOSE_FORM'...
    OPEN_FORM function
    Syntax:
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      DIALOG                            = 'X'
      FORM                              = ' '
      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.
    Some important parameters:
    FORM      Name of the form
    DEVICE      
    PRINTER : Print output using spool
    TELEFAX: Fax output
    SCREEN: Output to screen
    OPTIONS      Used to control attrubutes for printing or faxing (Number of copies, immediate output....
    The input for the parameter is structure ITCPO.
    CLOSE_FORM function
    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.
    Paramerters:
    RESULT      Returns status information and print/fax parameters after the form has been printed. RESULT is of structure ITCPP.
    WRITE_FORM function
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT                        = ' '
      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.
    Some important parameters:
    ELEMENT      Specifies which textelement is printed
    WINDOW      Specifies which window is printed
    TYPE      Specifies the output area of the main window. This can be:
    TOP - Used for headers
    BODY
    BOTTOM - Used for footers
    FUNCTION      Specifies whether text is to be appended, replaced or added
    Example of how to use the WRITE_FORM function module together with a script.
    Form layout of the MAIN window
    /E INTRODUCTION
    Dear Customer
    /E ITEM_HEADER
    IH Carrier, Departure
    /E ITEM_LINE
    IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
    /E CLOSING_REMARK
    The print program
    Writing INTRODUCTION
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
              ELEMENT                  = 'INTRODUCTION'
              FUNCTION                 = 'SET'
              TYPE                     = 'BODY'
              WINDOW                   = 'MAIN'
        EXCEPTIONS
             OTHERS                   = 8
    Writing ITEM_HEADER
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
              ELEMENT                  = 'ITEM_HEADER'
              FUNCTION                 = 'SET'
              TYPE                     = 'BODY'
              WINDOW                   = 'MAIN'
        EXCEPTIONS
             OTHERS                   = 8
    Set ITEM_HEADER into TOP area of main window for subsequent pages
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
              ELEMENT                  = 'ITEM_HEADER'
              FUNCTION                 = 'SET'
              TYPE                     = 'TOP'
              WINDOW                   = 'MAIN'
        EXCEPTIONS
             OTHERS                   = 8
    Write ITEM_LINE
    LOOP AT .....
       CALL FUNCTION 'WRITE_FORM'
            EXPORTING
                 ELEMENT               = 'ITEM_LINE'
                 FUNCTION              = 'SET'
                 TYPE                  = 'BODY'
                 WINDOW                = 'MAIN'
           EXCEPTIONS
                OTHERS                 = 8.
    ENDLOOP.
    Delete ITEM_HEADER from TOP area of main window
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
              ELEMENT                  = 'ITEM_HEADER'
              FUNCTION                 = 'DELETE'
              TYPE                     = 'TOP'
              WINDOW                   = 'MAIN'
        EXCEPTIONS
             OTHERS                    = 8
    Print CLOSING_REMARK
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
              ELEMENT                  = 'CLOSING_REMARK'
              FUNCTION                 = 'SET'
              TYPE                          = 'BODY'
              WINDOW                   = 'MAIN'
        EXCEPTIONS
             OTHERS                    = 8
    START_FORM function
    CALL FUNCTION 'START_FORM'
    EXPORTING
      ARCHIVE_INDEX          =
      FORM                   = ' '
      LANGUAGE               = ' '
      STARTPAGE              = ' '
      PROGRAM                = ' '
      MAIL_APPL_OBJECT       =
    IMPORTING
      LANGUAGE               =
    EXCEPTIONS
      FORM                   = 1
      FORMAT                 = 2
      UNENDED                = 3
      UNOPENED               = 4
      UNUSED                 = 5
      SPOOL_ERROR            = 6
      OTHERS                 = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    END_FORM function
    CALL FUNCTION 'END_FORM'
    IMPORTING
      RESULT                         =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SPOOL_ERROR                    = 3
      OTHERS                         = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CONTROL_FORM function
    The CONTROL_FORM function module alows you to create SapScript control statements from within an APAB program.
    Syntax:
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        command         =
    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.
    Example:
    Protecting the text element ITEM_LINE
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        COMMAND = 'PROTECT'.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        TEXELEMENT = 'ITEM_LINE'.
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        COMMAND = 'ENDPROTECT'.

  • Is it possible to use same sap script for different comp code with difflogo

    I have 3 company codes. I need to use same sap script to all  but each company code has different logo. I dnt want to go for 3 different sap script. Is it possible to change in coding
    like this
    If comp code = '100'
    print ' logo1'
    If comp code = '200'
    print ' logo2'
    If comp code = '300'
    print ' logo3'
    in same sapscript.If yes how ?

    Hi,
    Yes you can do it.
    In Sap Script use:-
    /: If Comp code='100'
       INCLUDE ZHEX-LOGO100 OBJECT TEXT ID ST LANGUAGE EN
    /:Elseif comp code = '200'
    INCLUDE ZHEX-LOGO200 OBJECT TEXT ID ST LANGUAGE EN
    /:Else
    INCLUDE ZHEX-LOGO300 OBJECT TEXT ID ST
    LANGUAGE EN
    /:Endif
    I hope this helps,
    Regards
    Raju Chitale

  • How to clear fields used in SAP SCRIPT

    hi all,
       i want to clear all fields which i have printed on my sap script.
    i have passed the values to these  fields by useing function module
    'TEXT_SYMBOL_SETVALUE' in se38 abap program.
    i have also used clear statement in my abap program to clear those fields but it cant working. is there any statement in SAPSCRIPT to clear fields.
    if so then please give me its an urgent. 
    thanks in advance.
    Vinod.

    hey,
    I understand that in a text-symbol when u set the values once, then u print them. for the second time when u want to print with diff values, then it will automatically get refreshed when u open it again.
    So use code like this.
    PERFORM OPEN_FORM USING FORMNAME.
    PERFORM WRITE_FORM USING TEXT_SYM.
    PERFORM CLOSE_FORM
    for the next run...
    at this instant all the text elements will get refreshed.
    PERFORM OPEN_FORM USING FORMNAME.
    PERFORM WRITE_FORM USING TEXT_SYM.
    PERFORM CLOSE_FORM
    Cheers,
    Sam

  • Variable window in SAP script

    Hello Friends,
    I have a problem in SAP scripts while printing an internal table data in to a variable window. It is overwriting the contents.
    Ex:
    In my internal table (itab) with only one filed (text) have the below data.
    Firt line
    second line
    third line
    fourth line
    I am looping the internal table and within the loop I am calling the write form.
    In script I am writing like below
    &itab-text&
    In the output I am getting only last line.
    Output:
    fourth line.
    But I need to print all lines one by one.
    Please help me.
    Regards.
    Krishna.

    You can't print internal table data in Variable window, you have to print them in Main window
    The function module WRITE_FORM_LINES allows multiple lines to be APPENDED to a non-main window. You should note that the text lines must have the SAPscript ITF format. In the absence of other information, the system uses identically named formatting attributes (character and paragraph formats) of the form to format the content of the text lines.
    Here is an approach which allows multiple records / lines to be output in a variable window.
    If you transfer your information from the internal table into the text lines, complete with appropriate formatting symbols, you will find that the text lines are output nicely formatted in your non-Main window.
    loop at internal table into WCSCATALOG.
    clear tline.
    tline-tdformat = 'S1'.
    concatenate '<B>' WCSCATALOG-CODEX '</> ,, ' WCSCATALOG-STXT into ltline-tdline.
    append tline to tlines.
    endloop.
    call function 'WRITE_FORM_LINES'

  • Problem in using the sap script from 1 client to another

    Hi,
    I am working on a sap script which is developed in the 555 cliet(Quality) but now the error comes change to repository or cross client is not allowed.
    In order to change the script which i am working on i tried to copy that script in 333 client and created with the orignal script. I tried to copy the modified script (developed in 555) but it is copying that script.
    Plzz proivde me guideliness how to solve this problem.

    >
    ricx .s wrote:
    > Hi,
    >
    > I am working on a sap script which is developed in the 555 cliet(Quality) but now the error comes change to repository or cross client is not allowed.
    >
    > In order to change the script which i am working on i tried to copy that script in 333 client and created with the orignal script. I tried to copy the modified script (developed in 555) but it is copying that script.
    >
    > Plzz proivde me guideliness how to solve this problem.
    Hi there,
    Are clients 555 and 333 both on DEV Server? If so you may use transaction SCC1 to copy the form from one client to another. Just run SCC1 on the client where the sapscript form will be copied, indicate the source client, and search for the transport request number that contains your form.
    Also, where did you develop your form?
    Let me know.
    Regards.

  • Is it possible to can a program (report output) from SAP Script?

    Hi,
    From SAP Script I would like to call a report output (without displaying the selection screen).
    Is this possible. If so, how can I do this?
    Thanks.

    H i kumar g,
    why not?
    In script you can call external subroutine. You must define the subroutine in a program, there you can do a SUBMIT or whatever you want.
    See online docu for further explanation.
    Regards,
    Clemens

  • Which programming is used in SAP HANA? confused b/w ABAp or java?

    Can anyone just tell me As a programmer in which language i have to work on SAp HANA

    Hi Jagaa,
    that really depends on what you'd like to do. But a brief answer:
    a) If you develop ABAP applications - use ABAP (as for other databases) and Open SQL / CDS, and if additional HANA functionality is needed maybe a bit of native SQL (ADBC or ABAP Managed DB Procedures).
    b) If you develop natively on the database please contact the experts on SAP HANA Developer Center.
    Cheers,
    Jasmin

  • How to fetch Print program name of a SAP script?

    Hi abapers,
    Could you please tell me how to fetch the name of a script's print program with the help of the script's name?
    I have tried with table TNAPR and T-code NACE,it didnt help.
    Is there any function module that returns the print program's name.
    Please reply.
    Thanks,
    Suchi.

    hi ,
    GOTO SE71 Txn
    Enter standard script name.
    Click on Display.
    "in menu bar
    "form------>Check--->text ----->press enter
    Now you can view the standard print program name
    Thanks & Regards

  • How to use a sap scripts for  multiple languages

    hi gurus
    what are main events in that are used in ALV reports.........
    regards
    baskar

    Hi Bhaskar,
    in the alvs these are the main events.
    1.slis_t_listheader,
    2.slis_t_fieldcat_alv.
    3.slis_t_sortinfo
    4.slis_t_events
    5.slis_t_print_alv.
    6.slis_t_layout_alv.
    and also used these two events.
    1. top-of-page.
    2.top-of-list.

  • Passing data to SAP script from print program-VF03

    Hi All,
    I have a stand alone print program which ahs the invoice number in its selection screen which when entered displays the layout of invoice by using a sap script.
    Now since I have to get this layout displayed from VF03, I have added the program, sap script name and a subroutine which contains the code which was initially there under the start-of-selection event in the stand alone program, in NACE. I have replaced the selection screen parameter for invoice number in my program with nast-objky which contains the invoice entered in vf03.
    But when I am entering the invoice in vf03 and selecting print preview, the data is getting captured in the internal table defined in my program but the same is not getting reflected in the layout displayed. So I am always getting the blank values in the output though I did not modify the original sap script at all. Pls help.

    Keep a breakpoint in your print program and see if your program is being triggered indeed. Do not forget to start Update debugging, otherwise it will not stop in your print program.
    Regards,
    Ravi

  • Fixing Program symbols in SAP Scripts

    Dear All
    I am new to SAP Scripts, Can any one tell me how to set or fix the position of program symbols in an SAP Script at particular coloumn. For example, i have to print 6 program symbols, prog symb "Documnet Num" has to be printer on 20 coloumn of the paper, how can we do this?
    Thank you

    Hi,
    Create new paragraph and in secion 'tabs', define columns and their positions. In your window you can use that new paragraph in the following way:
    XX &var1&,,&var2&,,&var3&,,
    XX stands for paragraph name
    ,, stands for a tab defined in paragraph XX

  • To replace SAP script with smartform in customer statement using t-code F.27

    Hi, I have a requirement to replace SAP script while generating a customer statement form using F.27 with Smartform. The standard program which triggers the SAP script is RFKORD11. Can anyone tell me how can we achieve this. Thanks in advance. BR, Karthik.

    Hi
    do you find a solution for your issue? Or did anyone else know how to send raw data instead of the pdf or fixed file from transaction F.61?
    Thanks for any ideas or help
    Axel

  • How do we identify the standard texts used in a sap script?

    Hi,
    Is there any way that i can identify the standard texts used in SAP scripts?
    Not manually going to each window in the script and checking.
    Will there be any table where I can look ?
    Thanks,
    krishna.

    Hi,
    GO to the forminfo of the sapscript in SE71..and then search for INCLUDE
    after displaying the form...utilities->form info..
    hope this works..
    Thanks
    Naren

Maybe you are looking for

  • Planned Delivery time in case of Scheduling Agreement

    Hi All, Does system consider the planned delivery time in case of Scheduling Agreement for Vendor like in normal Purchase order and requisition? I am doing the MRP run, but system is taken planned delivery time into consideration. I have one material

  • How do I stop my mouse's middle click button to go back one page in Firefox?

    When I click my mouse wheel or middle button on an empty space, it should let me place a scroll the page marker so then I can scroll the page up or down depending on where I move my mouse. It still does that but now it also make me go back one page.

  • BODS 4.0 and Windows 8.1

    Does anyone know if Data Services 4.0 is compatible with Windows 8 and/or 8.1?

  • Image resize is less than acceptable

    I really like Motion, but am dissapointed in its ability to resize image elements. When you get down to a small percentage the quality goes downhill. I'm guessing that the resampling is not the best. On a PSA tag I wanted a logo to start at bug size

  • Cookbook for SAP BUSINESS WORKFLOW

    hi all can anyone please send me the cookbook for SAP BUSINESS WORKFLOWS which may include the scenarios and technical details of creation of workflow. my id is : [email protected] full points will be rewarded regards ashish