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

scripts

How to add extra functionality to a standard print program with out touching the print program?

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 08:27 AM

    hi murali,

    Thru subroutine programs .

    cheers!

    sri

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2007 at 08:29 AM

    Use the concept of PERFORMS in script text elements:

    See this link:

    http://help.sap.com/saphelp_47x200/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 08:31 AM

    hi,

    use subroutines in the text editor.

    e.g

    perform <form name> in program <zreport>

    regards,

    pankaj singh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 08:53 AM

    Create a subroutine pool in se38 and call it in u r script .

    <b>Definition in the SAPscript form:

    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

    /: USING &PAGE&

    /: USING &NEXTPAGE&

    /: CHANGING &BARCODE&

    /: ENDPERFORM

    / &BARCODE&</b>

    In the textelement of sapscript i am calling subroutine GET_BARCODE present in program QCJPERFO and passing PAGE , NEXTPAGE as input parameters and Barcode as changing parameter (output)

    <b>Coding of the calling ABAP program ( Subroutine pool ):</b>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

    // Here in_par is table for input parameters is of type itcsy , so contains name and value as fields.

    // 1st record of in_par in_par-name = PAGE in_par-value = the current page number

    // (eq. 1 or 2 etc ... )

    // 2nd record of in_par in_par-name = NEXTPAGE in_par-value = the Next page //number (eq. if page = 1 then next page = 2 etc ... )

    // Here out_par is table for changing parameters ( output ) is of type itcsy .

    // since i am passing only one changing parameter it contains only one record

    // 1st record of out_par out_par-name = BARCODE out_par-value = ...(some value)

    READ TABLE IN_PAR WITH KEY ‘PAGE’.

    // reading the records from in_par where field name is PAGE , so first record is selected from our table

    CHECK SY-SUBRC = 0.

    PAGNUM = IN_PAR-VALUE.

    // Page number is stored in variable PAGNUM

    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.

    // reading the records from in_par where field name is NEXTPAGE , so second record is selected from our table

    CHECK SY-SUBRC = 0.

    NEXTPAGE = IN_PAR-VALUE.

    // Next Page number is stored in variable NEXTPAGE

    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.

    // reading the records from out_par where field name is BARCODE , so first record is selected from our table

    CHECK SY-SUBRC = 0.

    IF PAGNUM = 1.

    OUT_PAR-VALUE = ‘|’. "First page

    // if the variable PAGNUM value is one then i am storing | in OUT_PAR-VALUE ie, BARCODE

    ELSE.

    OUT_PAR-VALUE = ‘||’. "Next page

    // if the variable PAGNUM value is not one then i am storing || in OUT_PAR-VALUE ie, BARCODE

    ENDIF.

    IF NEXTPAGE = 0.

    // if the variable NEXTPAGE value is Zero then i am storing L in OUT_PAR-VALUE ie, BARCODE

    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page

    ENDIF.

    MODIFY OUT_PAR INDEX SY-TABIX.

    // After changing the field value of output table , i am modifying to reflect the changes.

    // Now barcode contains the changed value ie, either | or || or L depending on the condition satified

    ENDFORM.

    That changed value i am printing in sapscript

    / &BARCODE&

    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.