Application Development and Automation 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: 
Read only

SAPScript Page-Break

Former Member
0 Likes
1,390

Hello Gurus !!...Does anyone know how to change this SAPScript to page break when &GS_OUTTAB-KUNNR changes ?  It's not printing KUNNR, but it's a part of the GS_OUTTAB table.  I tried inserting ON CHANGE OF followed by NEW-PAGE followed by ENDON.  It doesn't seem to work.  I haven't used SAPScript in a long while....

Thanks....Mike

***Start of new code for load sheet

,,&OUTTAB-KDMAT&,,&OUTTAB-MAKTX&,,&OUTTAB-KWMENG&,,&OUTTAB-VRKME&

,,,,UT:

<B>Even,,Odd,,Product,,Product Description,,Producing Plant,,Total U</>

<B>nits,,Adjustments</>

&GS_OUTTAB-EVEN&       &GS_OUTTAB-ODD&                  &GS_OUTTAB-MATNR(C)&         

&GS_OUTTAB-ARKTX(C)&,,,,&GS_OUTTAB-PROD_PLANT(C)&

&GS_OUTTAB-ARKTX(C)&        &GS_OUTTAB-EAN11(C)&    &GS_OUTTAB-KWMENG&           &GS_OUTTAB-MATNR(C)&            ___________

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
903

Hi,

If you want to achieve page on change of kunnr you may use AT END OF VBELN event along with page break.

Below is one sample code which I had written for printing on the sale document header item on one page and item page on next page and then again header followed by Item details on different pages.

** Start looping to start printing the sap script

LOOP AT IT_VBAP.

** On change of VBELN start new page.

  AT NEW VBELN.

    CALL FUNCTION 'START_FORM'

      EXPORTING

        FORM      = 'ZC101_CSD107'

        STARTPAGE = 'P1'.

       

    CALL FUNCTION 'WRITE_FORM'

      EXPORTING

        ELEMENT  = 'E1'

        FUNCTION = 'SET'

        TYPE     = 'BODY'

        WINDOW   = 'HEADER'.

  ENDAT.

** Calling function for printing the item details

  CALL FUNCTION 'WRITE_FORM'

    EXPORTING

      ELEMENT  = 'E2'

      FUNCTION = 'SET'

      TYPE     = 'BODY'

      WINDOW   = 'MAIN'.

** Calling function for ending the form.

  AT END OF VBELN.

    CALL FUNCTION 'END_FORM'.

  ENDAT.

ENDLOOP.

Regards,

Praveen Chitturi

7 REPLIES 7
Read only

Former Member
0 Likes
903

Hi

Use the Commnad NEW-PAGE to generate a page break.

/: NEW-PAGE

  • THIS IS DISPLAYED IN NEW PAGE

Thanks

Sravanthi

Read only

0 Likes
903

Thanks Sravanthi.....Mike

Read only

vinoth_aruldass
Contributor
0 Likes
903

when you are using page break option use your driver program .

CALL FUNCTION 'CONTROL_FORM'

  EXPORTING

      COMMAND   = 'NEW-PAGE'

  EXCEPTIONS

      UNOPENED  = 1

      UNSTARTED = 2

      OTHERS    = 3.

Read only

0 Likes
903

Thanks Vinoth......Mike

Read only

Former Member
0 Likes
904

Hi,

If you want to achieve page on change of kunnr you may use AT END OF VBELN event along with page break.

Below is one sample code which I had written for printing on the sale document header item on one page and item page on next page and then again header followed by Item details on different pages.

** Start looping to start printing the sap script

LOOP AT IT_VBAP.

** On change of VBELN start new page.

  AT NEW VBELN.

    CALL FUNCTION 'START_FORM'

      EXPORTING

        FORM      = 'ZC101_CSD107'

        STARTPAGE = 'P1'.

       

    CALL FUNCTION 'WRITE_FORM'

      EXPORTING

        ELEMENT  = 'E1'

        FUNCTION = 'SET'

        TYPE     = 'BODY'

        WINDOW   = 'HEADER'.

  ENDAT.

** Calling function for printing the item details

  CALL FUNCTION 'WRITE_FORM'

    EXPORTING

      ELEMENT  = 'E2'

      FUNCTION = 'SET'

      TYPE     = 'BODY'

      WINDOW   = 'MAIN'.

** Calling function for ending the form.

  AT END OF VBELN.

    CALL FUNCTION 'END_FORM'.

  ENDAT.

ENDLOOP.

Regards,

Praveen Chitturi

Read only

0 Likes
903

Thanks Praveen......I have it working now thanks to all who answered !!!......Mike

Read only

0 Likes
903

Thats great Mike.

Keep Posting!!!