01-08-2015 4:12 AM
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
01-08-2015 8:43 AM
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.
01-08-2015 4:47 AM
Hi Lucy,
Please check if you have put your code to display these lines in Protect endprotect .
01-08-2015 4:53 AM
Hi Archana,
thanks for ur reply.. but, its not inside Protect endprotect .
01-08-2015 4:57 AM
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.
01-08-2015 5:01 AM
Also, check if Page protection is checked in the paragraph format that you are using to display this text.
01-08-2015 5:41 AM
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.
01-08-2015 5:47 AM
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?
01-08-2015 5:59 AM
01-08-2015 6:18 AM
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.
01-08-2015 6:31 AM
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.
01-08-2015 6:39 AM
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.
01-08-2015 7:55 AM
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.
01-08-2015 8:06 AM
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.
01-08-2015 8:08 AM
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.
01-08-2015 8:13 AM
01-08-2015 8:26 AM
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.
01-08-2015 8:31 AM
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.
01-08-2015 8:43 AM
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.
01-08-2015 8:51 AM
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.
01-08-2015 8:57 AM
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.
01-08-2015 10:23 AM
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
01-08-2015 11:37 AM