Skip to Content
0
Former Member
Aug 04, 2005 at 06:44 PM

second page not triggering in SAP script

60 Views

plz help me in this too

The code below is for two pages.

Problem is that...My second page is not triggering.

In the layout

for Fist page

attributes.

page: FIRST

next page: SECOND

for second page

attributes.

page:SECOND

next page: SECOND

REPORT ZNEW1 .

TABLES: MARA.

DATA: BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

LAEDA LIKE MARA-LAEDA,

END OF ITAB.

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF table ITAB

WHERE VPSTA = 'K'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

*DEVICE = ' '

DIALOG = 'X'

FORM = 'ZNEWLAY1'

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

call function 'START_FORM'

EXPORTING

FORM = 'ZNEWLAY1'

  • LANGUAGE = ' '

STARTPAGE = 'FIRST'

  • PROGRAM = ' '

  • MAIL_APPL_OBJECT =

  • IMPORTING

  • LANGUAGE =

  • EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HEADER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'HEADER'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'LOGO'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'LOGO'

EXCEPTIONS

UNOPENED = 4

OTHERS = 9.

LOOP AT ITAB.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2

.

ENDLOOP.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'FOOTER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'FOOTER'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

call function 'END_FORM'

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

OTHERS = 3.

call function 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

FORM = 'ZNEWLAY1'

  • LANGUAGE = ' '

STARTPAGE = 'SECOND'

  • PROGRAM = ' '

  • MAIL_APPL_OBJECT =

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

call function 'END_FORM'

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

OTHERS = 3.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.