cancel
Showing results for 
Search instead for 
Did you mean: 

Condition text on last page of Main window of a SAPSCRIPT

Former Member
0 Kudos

Hi,

I want to print some condition text in last page of a Main window of my custom sapscript, we can't use &NEXTPAGE& in Main window. Is there any other method to identify the last page.

Accepted Solutions (0)

Answers (4)

Answers (4)

Jelena
Active Contributor
0 Kudos

Use Google before posting:

"Q: In an SAPscript, some "END OF PAGE" text should be printed on the last page below the footer and it is not. How can I proceed?

EXPERT RESPONSE

In SAPscript, there are a few ways to print text only on the last page. The logical approach depends on whether you are using the MAIN window or a secondary window to print the text. If you are printing this text in the MAIN window, then simply put the words in a text element which prints last."

Source: http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_gci1219845,00.html

Former Member
0 Kudos

Hi Venu gopal,

In the print program use the control break statement.

Refer this code

*AT LAST* 

 call function 'WRITE_FORM'
       exporting
       element                          = 'GRAND_TOTAL'
*   FUNCTION                            = 'SET'
*   TYPE                                = 'BODY'
         window                         = 'MAIN'

Regards,

Sravanthi

h_senden2
Active Contributor
0 Kudos

Handle it in the printprogram instead of the layout.

Former Member
0 Kudos

What if the print program is a SAP standard program. We cannot edit it, the only thing we can do is for SAPSCRIPT form???

Former Member
0 Kudos

In the program you can check when the loop ends and then activate a different element of the sapscript main window. This will print in the main window just after the main data loop.