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: 

SAPSCRIPT - Data jumping to next page even if first page is having space to display

Former Member
0 Kudos

Dear Experts,

I am working on a sapscript in which I need to display a balance table below the main item table in the main window.

I want the balance table to display data on the first page as much as possible. For example, if the balance table is having 4 line items, but

there is only 1 line space left in the main window, 1 line of the balance table should be displayed in the first page & the remaining 3 lines on the next page. But, currently, it is displaying data on the first page only if there is 4 lines of space in the first page, else it jumps to the second page and dispays the whole balance on the second page.

Kindly help me in achieving this functionality.

Best regards,

Lucy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Lucy,

Just check for condition before printing the heading details of a main table. So that it could be printed only on first page.You can something as &Page& EQ 1. So that it won't print again on second page.

Regards,

Chakradhar.

21 REPLIES 21

archanapawar
Contributor
0 Kudos

Hi Lucy,

Please check if you have put your code to display these lines in Protect endprotect .

0 Kudos

Hi Archana,

thanks for ur reply.. but, its not inside  Protect endprotect .

0 Kudos

Ok. What is the size of your main window? Can you please post your code here?

It should display the lines on first page as well if its not in protect endprotect.

0 Kudos

Also, check if Page protection is checked in the paragraph format that you are using to display this text.

0 Kudos

Checked those points.. all is fine.. main window is also having enough space. If the main item table is having more lines, they are displayed as much as possible in the first page only.

But the next balance table is behaving like it has been kept inside protect endprotect.

0 Kudos

ok if your main table goes on page 2, then also your balance table is getting displayed on next page?

Just give it a try.

Also, are you using 2 different table to display main items and balance items?

0 Kudos

0 Kudos

Hi Lucy,

You just posted screenshots, no description?

I can see that main item table on page 1 is extended to page 2 and balance table is getting displayed on page 2 itself after main item table.

So, it should be space issue when you are displaying all data on page1.

0 Kudos

Hi Archana,

sorry i was in a hurry.

Plz check these pages.. 1st is having space, so at least 1 line of the balance table should be displayed in the first page. But the whole table moves to the 2nd page.

0 Kudos

Hi Lucy,

On you second page, you can see header of both tables are getting displayed. Even when your main table is finished on page 1, header is getting displayed on page 2. I think something is wrong here. You will have to debug and check why its getting displayed again on page 2. That might the reason your balance table is getting displayed on page 2, as it doesn't have space to print header as well as items.

0 Kudos

Hi Archana,

Thanks for ur support.

My problem is almost solved now.

Actually i m using copy of SAP standard print program as my print program.

Inside the print program, Perform protect was used. I commented that perform.

But now still I am getting the heading of the main table in the next page & the items are of the Balance table.. So its looking weird. (plz check the image below).

I tried to fix this issue but couldnt find any way to stop that main table heading from getting displayed.

Kindly advise if possible.

0 Kudos

Hi Lucy,

Check how main table header is displayed in the script. I think they are displaying it on all pages. It needs debugging. When items that are displayed on page 1, check if header is getting called again. Standard scripts are very tedious to debug. May be you can put a condition at header

if &PAGE& EQ &SAPSCRIPT-FORMPAGES&. Then only display it. Just try out see if it works.

0 Kudos

I will just put my new requirement in a more clear way :

Kindly advise if it is possible to hide the Item table header if there are no items in that table.

0 Kudos

yes it is possible, I have already mentioned the ways above.

0 Kudos

Thanks for your support Archana, I just checked by putting that code given by you, but then it doesnt display the table header at the first page also.

0 Kudos

Hi Lucy,

It should be if &PAGE& EQ 1. So, it will display header only on page 1. You can check value of PAGE in debug mode.

Former Member
0 Kudos

Hi Lucy,

Just check for condition before printing the heading details of a main table. So that it could be printed only on first page.You can something as &Page& EQ 1. So that it won't print again on second page.

Regards,

Chakradhar.

0 Kudos

Hi Chakri / Archana,

I want to remove the header only when the main item table is empty.

If the main iteem table is having data till next page, then it should display the header in the next page too.

0 Kudos

It has been taken care of in standard script already which you have copied into Z script. Now, your question remains, why header is getting displayed on page 2 even when there is no data in main item table.

For this you will have to debug the code, we can just pass on the suggestions. We don't know what is written in standard script.

0 Kudos

Hi Archana,

I applied an IF condition and finally this issue is resolved.

Thanks for your time and kind support.

I have marked ur last reply as correct answer, hope u will get points through this.. If u don't get, please let me know how to award points.

Best Regards,

Lucy

0 Kudos

Great that your issue is resolved. All the best.