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.
cancel
Showing results for 
Search instead for 
Did you mean: 

second page not triggering in SAP script

Former Member
0 Kudos
252

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.

6 REPLIES 6

Former Member
0 Kudos
82

you need not to do start_form and END_form for each page. Just comment the start_form and try.

regards,

Gagan

0 Kudos
82

yeah i tried that way...but it din't do any good....

so i used start_form and end_form again for second page

0 Kudos
82

Does table itab have enough data for 2 pages ?

0 Kudos
82

yes it has........

0 Kudos
82

Well, Did you comment out start_form, end_form for both pages. Don't use start_form End_form at all. There is no need of using this for triggering the page. If you have main window on both pages data overflows from one page to another if there is enough data for two pages.

Former Member
0 Kudos
82

Hi Scientila Choudary,

Your problem will be cleared once you remove start_form and end_form as these are not necessary.we have to use start_from and end_from when we are operating on different forms.Presently we are operating on only no need to use this.

Once your problem is solved please close this.