cancel
Showing results for 
Search instead for 
Did you mean: 

new page in sap script.

Former Member
0 Kudos

I am displaying sap script for dunnign letter for 3 levels.

First level I have only one page data.

For second level I have two pages of data first page contains company address and line items and second page contains disclaim letter I need to print it in second page.

Here 2nd level is executing in Text element 512 here I written NEW-PAGE = &PAGE2& command and written text after the command this text will display in next page.

But my problem is in first page only 512 text element only executing remaing text elements are executing thats why Iam missing data in first page and second page total data is displaying.

Please guide me how i will display disclaimer letter separately in second page.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Here you can do it 2 ways.

1) Declare the new-page command in another text element and call it in the driver program separately.

Define like this in script

/E Test1
/: NEW-PAGE SECOND" -> Page name
/E TEXT512

CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      element = 'TEST1'
      window  = 'MAIN'.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      element = 'TEXT512'
      window  = 'MAIN'.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

2) Use the function module CONTROL_FORM in the driver program and pass the command parameter as NEW_PAGE SECOND

CALL FUNCTION 'CONTROL_FORM'
  EXPORTING
    COMMAND         = 'NEW-PAGE SECOND'
 EXCEPTIONS
   UNOPENED        = 1
   UNSTARTED       = 2
   OTHERS          = 3
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Regards

Sarves