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

sap script

IN a sap script i want to print 10 records in main window, there are header, main, and footer window, in main window there is a condition that only 8 records is limited and then the second page will print 2 records and the remaining space should not be shown and footer should come after the 10th record of the 2nd page how 2 handle this?

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 01:53 PM

    Hi Chandra,

    You can not have dynamic windows in scripts, so it is not possible to have footer window after your 10th record.

    The alternative is to have a place of 10 records in the first window itself.

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 01:58 PM

    Hi!

    You might try out to fill your internal table with pseudo (blank) lines.

    1.line - 1. item

    2.line - 2. item

    3.line - 3. item

    4.line - 4. item

    5.line - 5. item

    6.line - 6. item

    7.line - 7. item

    8.line - 8. item

    9.line -

    10.line -

    And don't skip only the empty lines, but print them out.

    Just clear your work area and use the APPEND command to enter it as a new line to your internal table.

    Regards

    Tamá

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 02:17 PM

    The number of records that print in a main window of sapscript depends on the length of the window, and how many printed lines each record takes. This can vary if lines are in a PROTECT ENDPROTECT grouping that requires them to stay together.

    To vary where the footer prints, you need to either:

    1. Print it in the MAIN window after the final record is printed (together with any boxes, etc); or

    2. Have FOOTER window overlap MAIN from end of first record, and print appropriate number of blank lines in this widow before any text / boxes so that start of footer information is below last printed detail in MAIN window. So to print after 2 records, would include 1 record worth of blank lines.

    Andrew

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 05:23 PM

    Hi Chandra Sekhar..

    This is very easy..

    Do like this:

    1) In the MAIN window itself, use a text element..

    /E FOOTER.. this will not allow the system to automatically print the contents of this text element..

    2) In your driver program , you will be calling WRITE_FORM function, in a loop at the internal table conatining the data items..

    3) After the loop gets over, call function WRITE_FORM with window MAIN and element FOOTER.

    This will print the footer just below your last line item...

    If you want to have the footer window on all pages, then let it be as it is.. But the text that you are printing there make it in a condition..

    IF &w_last_page& NE 'X'.

    print this..

    ENDIF..

    Now, in the driver program, after the ENDLOOP, check this flag.

    w_last_flag = 'X'.

    This will solve your problem

    Thanks and Best Regards,

    Vikas Bittera.

    **Reward if useful**

    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.