Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

sap script

Former Member
0 Kudos

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?


Former Member
0 Kudos

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.



Former Member
0 Kudos


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.



Former Member
0 Kudos

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.


Former Member
0 Kudos

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


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**