Skip to Content
author's profile photo Former Member
Former Member

How to add a report into the SAP-SCRIPT .using PERFORM ......ENDPERFORM

My question is that How to add a report into the SAP-SCRIPT .

by using PERFORM ......ENDPERFORM

I don't know how to used it .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2008 at 12:45 PM

    creat a z report like this....................

    REPORT zmmgl_picklist1.

    TABLES : likp,ltap,ltak.

    data : lv_NUM1 type c .

    data : lv_NUM type c.

    &----


    *& Form get_data1

    &----


    text

    -


    -->IN_DATA text

    -->OUT_DATA text

    -


    FORM get_data1 TABLES in_data STRUCTURE itcsy

    out_data STRUCTURE itcsy.

    READ TABLE in_data WITH KEY name = 'LTAP-VBELN'.

    lv_NUM = lv_NUM1 + 1.

    out_data-name = 'lv_NUM'.

    out_data-value = lv_NUM .

    APPEND out_data.

    endform.

    &----


    *& Form get_data

    &----


    This form is to read details from LIKP *

    -


    -->IN_DATA text

    -->OUT_DATA text

    -


    FORM get_data TABLES in_data STRUCTURE itcsy

    out_data STRUCTURE itcsy.

    READ TABLE in_data WITH KEY name = 'LTAK-VBELN'.

    Select single bldat from likp into likp-bldat where lgnum = ltap-lgnum.

    out_data-name = 'LIKP-BLDAT'.

    out_data-value = likp-bldat.

    APPEND out_data.

    READ TABLE in_data WITH KEY name = 'LTAK-VBELN'.

    Select single vstel from likp into likp-vstel where lgnum = ltak-lgnum .

    out_data-name = 'LIKP-VSTEL'.

    out_data-value = likp-vstel.

    APPEND out_data.

    READ TABLE in_data WITH KEY name = 'LTAK-VBELN'.

    Select single kunnr from likp into likp-kunnr where lgnum = ltap-lgnum.

    out_data-name = 'LIKP-KUNNR'.

    out_data-value = likp-kunnr.

    APPEND out_data.

    ENDFORM. "get_data.

    se71

    after this go to the script editor......

    /: perform get_data in program zmmgl_picklist1.

    /: using &ltap-vbeln& (Reference field.this field should be there in both program and script.....)

    /:changing &likp-bldat&

    /:changing &likp-vstel&

    /:changing &likp-kunnr&

    Regards

    Anbu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2008 at 12:46 PM

    Hi Sandeep,

    Please check this link

    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

    http://www.allinterview.com/showanswers/37425.html

    Calling ABAP Subroutines: PERFORM

    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.

    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.

    Syntax in a form window:

    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    ......
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    ......
    /: ENDPERFORM

    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:

    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    
    ...
    ENDFORM.

    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.

    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.

    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.

    Definition in the SAPscript form:

    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    /
    
    / &BARCODE&

    Coding of the calling ABAP program:

    REPORT QCJPERFO.
    
     
    
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    
    DATA: PAGNUM LIKE SY-TABIX, "page number 
    NEXTPAGE LIKE SY-TABIX. "number of next page
    
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page 
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page 
    ENDIF.
    
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    
    ENDIF.
    
    MODIFY OUT_PAR INDEX SY-TABIX.
    
    ENDFORM.

    Best regards,

    raam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 10, 2008 at 12:49 PM

    Hi,

    you can't add it.

    You can call it like this:

    /: PERFORM <form> IN PROGRAM <prog>

    /: USING &INVAR1&

    /: USING &INVAR2&

    ......

    /: CHANGING &OUTVAR1&

    /: CHANGING &OUTVAR2&

    ......

    /: ENDPERFORM

    It is described in SAP Script documentation

    Regards

    Walter Habich

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2008 at 12:52 PM

    Hi,

    /:PERFORM GET_PONO IN PROGRAM ZFRCHQPO

    /: USING &REGUP-BUKRS&

    /: USING &REGUP-BELNR&

    /: USING &REGUP-GJAHR&

    /: USING &GROSS_AMT&

    /: USING &GROSS_AMTL&

    /: USING &REGUP-UMSKZ&

    /: USING &DEC_WT_QBSHB&

    /: CHANGING &MEBELN&

    /: CHANGING &GROSS_AMTL&

    /: CHANGING &GROSS_AMTL1&

    /: CHANGING &DEC_WT_QBSHBL&

    /: CHANGING &GROSS_AMT&

    /: CHANGING &DEC_WT_QBSHB&

    /: ENDPERFORM

    Thanks

    Nayan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      /:PERFORM GET_PONO IN PROGRAM ZFRCHQPO

      /: USING &REGUP-BUKRS&

      /: USING &REGUP-BELNR&

      /: USING &REGUP-GJAHR&

      /: USING &GROSS_AMT&

      /: USING &GROSS_AMTL&

      /: USING &REGUP-UMSKZ&

      /: USING &DEC_WT_QBSHB&

      /: CHANGING &MEBELN&

      /: CHANGING &GROSS_AMTL&

      /: CHANGING &GROSS_AMTL1&

      /: CHANGING &DEC_WT_QBSHBL&

      /: CHANGING &GROSS_AMT&

      /: CHANGING &DEC_WT_QBSHB&

      /: ENDPERFORM

      Give me the subroutinue program of GET_PONO

      ASAP .

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 12:18 PM

    thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.