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: 

How to page split in script

ram_sahoo
Participant
0 Kudos

Hi Experts,

I have a requirement to do page split in sap script means, in main window each header data 10 line items is there suppose one header under 10 line item was showed then for next header data have not proper  space  in first page for 10 line items then it should show next page all second header data plus all line item data under header data.But i have used protect..endprotect command for this requirement its not working. Anyone can help me for this requirement.

Thanks,

11 REPLIES 11

Former Member
0 Kudos

Hi Ram,

To split page you can use code as mentioned.

CALL FUNCTION 'CONTROL_FORM'
  EXPORTING
  COMMAND = 'NEW-PAGE'
  EXCEPTIONS
  UNOPENED = 1
  UNSTARTED = 2
  OTHERS = 3.

ram_sahoo
Participant
0 Kudos

Hello Experts,

Exact requirement is here i am explaining please follow the  below screen shot.

This is the requirement to show the batch line items in next page if in first page not enough space for all line items.here HWGL03B003 is first batch and HWGL03B004 is second batch.

This is the logic where i have used PROTECT...ENDPROTECT command but its not working.

Anyone can help me for this requirement.

Thanks,

Former Member
0 Kudos

Hi Ram,

Try to remove PROTECT...ENDPROTECT and let the content be printed.

When ever you need page split use command

CALL FUNCTION 'CONTROL_FORM'
  EXPORTING
  COMMAND = 'NEW-PAGE'
  EXCEPTIONS
  UNOPENED = 1
  UNSTARTED = 2
  OTHERS = 3.

It will automatically print new content in next page.

0 Kudos

Hi Krishna,

Can you let me know where i will use this command driver program and script.

Thanks,

Former Member
0 Kudos

In Driver program you can use it in loop where you are getting batch number

0 Kudos

Hi Krishna,

I have need while for batch all line item enough space is not availabe in first page then only it should goto next page otherwise it will showfirst page only.

Thanks,

Former Member
0 Kudos

You can trigger CONTROL_FORM when batch changes.It means new batch will come in new page.Also remove Protect...Endprotect in code.

0 Kudos

Hi Krishna,

I have used as per your suggestion but its not working.

Thanks,

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Ram,

For printing heading in second page.

you can add conditions.

IF &PAGE& NE '1'.

Pass the heading for n pages.

ENDIF.


Hope it helpful.



Regards,

Venkat.

0 Kudos

Hi,

So always it will go to next page that heading part but i have requirement if batch line item is less and in first page available space for second batch line item that time it don't go second page the second batch line item will show in first page only. the second batch will start next page while in that page is not enough space for all second batch line items.

Thank,

0 Kudos

Hi ram,

Page number is assigned at run time, if the content is  more it will go to next page .

&Page&--->Current Page number

&SAPSCRIPT-FORMPAGES& -->total pages

Hope it helpful.

Regards,

Venkat.