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

How to page split in script

ram_sahoo
Participant
0 Likes
2,534

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
Read only

Former Member
0 Likes
2,330

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.

Read only

ram_sahoo
Participant
0 Likes
2,330

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,

Read only

Former Member
0 Likes
2,330

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.

Read only

0 Likes
2,330

Hi Krishna,

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

Thanks,

Read only

Former Member
0 Likes
2,330

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

Read only

0 Likes
2,330

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,

Read only

Former Member
0 Likes
2,330

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

Read only

0 Likes
2,330

Hi Krishna,

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

Thanks,

Read only

VenkatRamesh_V
Active Contributor
0 Likes
2,330

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.

Read only

0 Likes
2,330

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,

Read only

0 Likes
2,330

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.