Query Regarding SAP SCRIPT

I have a normal report output with a field "HIDE" to make it interactive. When clicked on any of the values of this field(s), the value (say VBELN) has to be passed to SAP SCRIPT and all the SELECT QUERIES needs to be written in SAP SCRIPT to get the desired output.
How do i get this feature?

hi
U have to call perform in SAP script '/:'.
In that u have to pass parameter and get(changing) parameter.
FORM get_value  TABLES  inpar  STRUCTURE itcsy
                                outpar STRUCTURE itcsy.
u have to read value from inpar and append value in outpar into the form.
Hope thiw will be useful.
regards
vinod

Similar Messages

  • Select query in SAP SCRIPT

    Dear Experts,
    In printing of MB23n , I need to print STR_SUPPL1 and STR_SUPPL2 from ARDC table. I already have ADDRNUMBER.
    We are using SAP SCRIPT.
    Please guide me how to insert the following query in SAP SCRIPT.
    tables: lfa1, adrc.
    data: begin of it_test occurs 0 ,
    str_suppl1 like adrc-str_suppl1,
    str_suppl2 like adrc-str_suppl2,
    end of it_test.
    select str_suppl1 str_suppl2 into corresponding fields of table it_test from adrc addrnumber = lfa1-adrnr.
    Please hekp me to solve the issue.
    Thanks in advance.
    Regards
    Ankur

    Hi,
    In Script - Page Window -
         PERFORM <form name> IN PROGRAM <Program Name>
         USING &VBDKR-VBELN_VL&
         USING &VBDKR-VBELN_VAUF&
         CHANGING &ADDR_LINE1&
         CHANGING &ADDR_LINE2&
         CHANGING &ADDR_LINE3&
         CHANGING &ADDR_LINE4&
         CHANGING &ADDR_LINE5&
         ENDPERFORM
                         &ADDr_line1&&ADDR_LINE3& &ADDr_line2&
         &ADDR_LINE4&
         PROTECT
         &ADDR_LINE5&
         ENDPROTECT
    In SE38 - Create Prog as Subroutine pool --> Write a Form with same name
    SELECT SINGLE adrnr INTO twlad-adrnr FROM twlad WHERE werks = lips-werks AND
                                                              lgort = lips-lgort.
        IF sy-subrc = 0.
          CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'
            EXPORTING
              address_type            = '1'
              address_number          = twlad-adrnr
            IMPORTING
              address_printform_table = lt_address.

  • Help regarding SAP SCRIPT

    Hi!
      can any one help me regarding SAP SCRIPT. i unable to write a print program for sap script . can any one can send me sample code using ITCSY structure.
    Thanks in advance.
    Thanks & Regads,
    DurgaPrasad.k

    Hi,
    refer this to write print program:
    <b>The Print Program</b>
    Structure of a print program
    OPEN_FORM function
    CLOSE_FORM function
    WRITE_FORM
    START_FORM function
    END_FORM function
    CONTROL_FORM function
    The 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.
    <b>Function modules in a printprogram:</b>
    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.
    <b>Structure of a print program</b>
    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.
    <b>Some important parameters:</b>
    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
    <b>The print program</b>
    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'
      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'.
    rgds,
    latheesh
    Message was edited by: Latheesh Kaduthara

  • Hi i am new to SCN. I want a help regards SAP-PM . Where to post any query regards SAP PM

    Hi i am new to SCN. I want a help regards SAP-PM . Where to post any query regards SAP PM

    Please check this link SAP Portfolio and Project Management (SAP RPM, cProjects) and cFolders
    Please check scn index to find relevant forum link.
    SCN Site Index

  • Regarding SAP Scripts

    Hi All,
    I have issue in SAP Scripts.
    Issue is : I am calling a BOX command in my Layout set as follows : <b>BOX WIDTH '18.75' CM HEIGHT L_SY_TABIX1 CM FRAME 10 TW</b>
    I that <b>L_SY_TABX1</b> i need to get the value form Print Program,
    Can anybody clarify how can i make varaible L_SY_TABIX1 with value <b>'17.75'</b> with in single quotes.
    shall i need to decalre the L_SY_TABIX1 as &L_SY_TABIX1& & then how can i get single quotes on it.
    Please clarify.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    You dont have to concatenate quotes.
    You can dynamically put any value into a character variable, say,  ht, in your print program.
    Data : ht(10) type c.
    This variable should be within &, in the script. The program takes the value of height without rounding the decimals.
    BOX XPOS 0 CH YPOS '+1.5' LN WIDTH 30 CH HEIGHT &HT& CH FRAME 10 TW
    Thanks,
    Susmitha

  • Regarding SAP SCRIPTS - NEXT PAGE FUNCTIONALITY

    Hi all,
    Can anybody tell me how to get NEXT PAGE FUNCTIONALITY   in SAP SCRIPTS. Means if Data in 1st page does not fit it should go to next page and print.
    I had declared 2 PAGES already in my LAYOUT SET.
    How can i achieve above functionality.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi Rich heilman,
    I had declared first page as PAGE1 & its Next Page attribute as PAGE2 which is also declared already.
    But still it is not showing second page when there is over flow of data.
    does we need to write following code any where in layout.
    IF &PAGE& EQ = 1
    NEXT-PAGE
    ENDIF
    please solve my issue.
    Thanks & Regards,
    Rayeez.

  • Issue regarding sap script pages

    Hi all ,
       my issue is regarding the medruck. when i click on the print preview option on me23n, the sap script attached(that is medurck) will be printed. in my case the sap script is zmm_medruck(the zcopy of medruck). now, the print out of the sap script is 2 or  3 or 5 paged depending upon the p.o. number given.
    for example for a p.o. number 2100001564, the sap script contains 4 pages. now, my issue is , the print out should contain only last 2 pages or only 3 rd page.(that is without all pages, we want only specific pages of the sap script to be printed). how to do this. plz reply fast. points will awarded.
    this is urgent issue.
    thanking u in advance,
    sreenu.

    Hi all ,
       my issue is regarding the medruck. when i click on the print preview option on me23n, the sap script attached(that is medurck) will be printed. in my case the sap script is zmm_medruck(the zcopy of medruck). now, the print out of the sap script is 2 or  3 or 5 paged depending upon the p.o. number given.
    for example for a p.o. number 2100001564, the sap script contains 4 pages. now, my issue is , the print out should contain only last 2 pages or only 3 rd page.(that is without all pages, we want only specific pages of the sap script to be printed). how to do this. plz reply fast. points will awarded.
    this is urgent issue.
    thanking u in advance,
    sreenu.

  • Regarding SAP SCRIPT output

    Hi,
    I have some requirement in SAP SCRIPT.
    When i will generate print preview for some specific document Ex:Purchase Order using its respective Transaction Code[ME22N], That Print Preview[output] need to be stored other formats such as [PDF,.doc,... etc].
    How can we do it!
    By using some settings!
    Without writing any code[Function Module] from ABAP[SE38]. 
    Can any body solve my problem!
    Thanks & Regards,
    Rayeez.

    Hi,
    You can convert a spool request to pdf format using report RSTXPDFT4 without writing any code.
    Svetlin

  • Regarding SAP Script Output validation in Layout set

    Hi All,
    I have a issue in SAP Script Output.
    I have a <b>Standard Print Program</b>. and layout set.
    I can do validations only in Layout set.
    The actual issue is i have a <b>internal table field</b> in <b>print program</b> that i am displaying in <b>layout set</b>. Now i want it to be subtracted with number <b>20</b>, since i can not edit code in <b>Print Program</b>. i want to subtract that internal table field with 20 in layout set itself.
    Can anybody tell me how can i solve this issue.
    <b>Note:</b>  I need to do calculation only in layout set.
    Can anybody give me the solution.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi,
    Thanks for that reply.
    so with <b>SUMMING</b> command i can do calculation.
    I am already having <b>i_tab1-sum</b> coming from print program and i have declared one symbol using
    DEFINE &v_val& = 20 in layout set.
    Then i want to subtract &v_val& with &i_tab1-sum&.
    using the follow syntax tell me wether syntax is correct or not.
    SUMMING &i_tab1-sum&-&v_val& INTO &i_tab1-sum&.
    will it work.
    once again thanks for that reply.
    Thanks & Regards,
    Rayeez.

  • Problem regarding SAP SCRIPT

    can anyone send me a sample program for downloading sapscript into pdf ?
    in details

    Hello,
    please try out the Code in Topic: Regarding Converting Report Outputs & SAP Script Outputs to PDF Format.
    Regards
    Gregor

  • Query on SAP-scripts

    Hi friends
    What's the functionality of 'CONTROL_FORM' function module in SAP-scripts.
    Thanks
    Suren

    Hi
    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'.

  • Regarding sap script spool no

    Hi All ,
    When i print a SAP script then in spool request it is completed but no print is actually printed from printer . So what's reason for that ???.
    I have spool no now what i do for printing in my printer?????
    Give me suggetion
    Thanks

    Hi,
       As above said, check you spool no and print output in SP01 or SP02.
    But just check whether you printer settings. By Sysytem->User Profile->Own Data hereselect tab defaults then enter Spool Control data. Now you will get output at printer.
    TCode: su3.
    If useful, Rewards points
    Thanks,
    Sam

  • Regarding SAP SCRIPT COMMAND

    Hi all,
    Can anyone tell me the which command i use in sap script for &itab-kunnr&.
    so many command are there so please suggest me...........
    and give command tutorial or link also....
    Zenithi.

    hi
    good
    check out all these SAP SCRIPT commands
    New-page <page name> Prints the text following this command on a new page (when a page name is specified then that page is taken as the next page)
    Protect ….. Endprotect This acts like a conditional page break. Putting the text within this command prevents the breaking of the text across multiple pages. If there is not enough space for the entire paragraph to be printed in the space remaining on the page, then the entire paragraph is printed on the next page
    Box <xpos> <ypos> <width> <height> <frame> <intensity>
    Position <xorigin> <yorigin> <window> <page>
    Size <width> <height> <window> <page>
    The BOX command draws a box as per the specifications. The x y co-ordinates are for the upper left corner relative to the values in the position command.
    POSITION command is used to set the x y co-ordinates with respect to the start position of the window.
    SIZE command is used to specify the size of the box that we need to draw.
    Varying these parameters also helps to draw a line instead of a box.
    IF ….. END IF This allows the conditional printing of the text on the output document. The various conditional operators that can be used are as follows
    = EQ Equal to
    < LT Less than
    > GT Greater than
    <= LE Less than or equal to
    >= GE greater than or equal to
    <> NE not equal to
    The logical operators that can be used are as follows
    NOT, AND, OR
    reward point if helpful.
    thanks
    mrutyun^

  • Regarding SAP Scripts and SF

    Hi Experts,
    What is the procedure we have to follow to transfer the scripts and smartforms once created ?
    Regards
    Raghavendra.D.S

    Hi,
       Nothing to take care about this, the only thing is if the script or smartform has any standard texts, even if you save those, they are not saved under any request. So what you can do, execute the program 'RSTXTRAN' and add standard text to the corresponding script or smartform request.
    Rgds,
    Bujji

  • Regarding sap script

    How to Modify the standard invoice and sales order form to generate purchase order for printing and upload the company logo. plz mention the detail coding
    Thanks,
    Priya Ranjan

    Hi,
    To create a logo in SAP printouts just do the following
    1. Save a Logo using Imaging, Paint shop Pro or Corel Draw as Tiff file.
    2. Run program RSTXLDMC and enter the following parameters
    Enter file name C:\COMPLOGO.TIF
    UOM CM
    Line width for text 132
    Text name ZHEX-MACRO-COMPLOGO
    Text ID ST
    Text language = E
    Number of Tiff gray levels (2,4,9) 2
    3. Then Create a new window 'COMP' with attributes;
    Window COMP description Company Logo
    Left margin 7.00 CH window width 10.00 CH
    Upper margin LN window height 8.00 LN
    Finally in the text element, mention
    /: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.
    Please note that if object name is not indicated as 'ZHEX...’ the logo may not be printed!
    You will not be able to see the logo in a test print. The same will be printed in actual printout.
    Regards,
    Satish

Maybe you are looking for

  • Change the size of Scrollbar in JComboBox

    Hello, I want to change the width of Scrollbar that appears in JComboBox....any idea?

  • The maximum size of an SQL statement has been exceeded.

    In ST22, abap dump shows that one of the possible reason was "The maximum size of an SQL statement has been exceeded." How can I know what's the maximum size and how to compute that size had been reached? Is this shown anywhere in the log?

  • After using the cable to charge my iPad I can't sync my iPod touch

    I just got the iPad 2 and I have been using my old USB cable to charge it on my laptop and on the adapter it came with. Now when I use the USB cable to connect my iPod touch to my laptop to sync, it doesn't show up in the devices column. I don't know

  • B&W photos turn into negatives

    I transferred some photos, some black and white, to iPhoto8 and when I double click them to enlarge them in iPhoto a few of the B&W photos turn into negatives. When I first transferred them the icons were black; I updated the icons and got the pictur

  • Master / detailed saving problem

    Hi I create one master datablock and two detailed datablocks ( on tabs ). The viewing is ok but when I every form (master + 2 x detailed) and i try to save (commit) I get this error message: FRM-40508 : Unable to insert record. But when I fill only a