cancel
Showing results for 
Search instead for 
Did you mean: 

Script window problem...

Former Member
0 Kudos

HI all...

I have a requirement in script ...

I have a footer which covers 30% of the form...

I have to print the footer only on the last page.

The main window can accomdate only 23 rows ...

if the entries in the main window are less than 22 rows..i need to print the footer in the first page only

if the entries are more than 22 entries i need to accomdate the place for main window in the first page and so on.

Example: I have the Page which has the main address and footer ..the footer covers 30% of page.

if i have the 150 line items in the main window the last page may go upto 7 to 8 pages

in that case i only need the footer which has covered 30% of the form in the last page only.

and i will be able to accomdate the maximum place for the line items in the main window

<removed_by_moderator>

Thanks

Edited by: Julius Bussche on Oct 7, 2008 3:57 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

These kind of scenario are normally dealt with the help of SAPSCRIPT system Variables/Control Commands.

Looks you are using a secondary window to print the footer, you can compare the value in SAPscript symbol PAGE with SAPSCRIPT-FORMPAGES. When they are equal, have the text print; otherwise, have nothing print.

/: IF &PAGE& = &SAPSCRIPT-FORMPAGES&

  • [your END OF PAGE text here]

/: ENDIF

Another option is to simply check if &NEXTPAGE& ='0'. This should achieve the same results.

Former Member
0 Kudos

Hi ..Thanks for reply

The solution you are provided for the Footer.

This is what i did:

I designed the Main window (Max available space) with additional windows Logo and footer.

I put Table to show the line items material quantity etc...

I coded BOTTOM, ENDBOTTOM of the main window and placed my text there.

My question here is ..i want to show Only line items in Main window if the pages are more than 1.

when the all line items are displayed in Main window then i will place my Text at the end of line items.

In the footer i will show page numbers if the pages are more than 1 ..if only one page printed then i will show Address in the footer...

If i put BOTTOM, ENDBOTTOM in main window ..The text will be shown in each page of main window??? or only in the last page's main window??

Please let me know

Answers (1)

Answers (1)

Former Member
0 Kudos

If you can modify the print program you can move your footer into a text element in window MAIN that is called only once at the end of the print.

Former Member
0 Kudos

Thanks for your reply

I can't modify since its a SAP print program.

Moreover iam not concerned about the footer...All i need to show the line items in the main window till the last page...

when line items in the Main window reach the last page then i would like to show the Text or Text elements at the end of the Main window's bottom which is Fixed text...

for example if the selection reaches 5 pages i would like to print only line items in the Main window till the 5th page ..on the 5th page's main window's Bottom ..i want to show the Text(Fixed)..

Separate window might work in this scenario if there are more entries ... but i dont know how to proceed..

Please let me know if you know the solution.

Former Member
0 Kudos

Hi Madhu,

In Script you can control the situation by this condition

if &NEXT-PAGE& = 0.

print footer.

endif.

Let say for header 15%, Main Window should be 55% and Footer should be 30%. for all Pages.

Hope this will resolve your problem.

Regards,

sg

Former Member
0 Kudos

Suneel

Thanks for your reply ..but i need a confirmation on this.

Does &NEXT-PAGE& value will be shown in runtime when the form puts the first line item into the main window?

Iam assuming the the &NEXT-PAGE& parameter result will be driven after all the line items come into the main window...

In the footer we can control by this &NEXT-PAGE& but what about the main window? coz the form always put record by record then how its going to know the value of &NEXT-PAGE&??

Again..iam not considering footer at all..all i need to put some fixed text in main window if there are few line items ...if there are more line items which fits into 2 pages then i would put only line items in the first main window and in the second main window i will be able to print the rest of the line items with the fixed text after all line items printed.

I hope you understand my point.

Please reply or correct if iam wrong

Thanks

Former Member
0 Kudos

Hi Madhu...

I understood your point.... ok let say in main window 10 line items can print... after that u need to print fixed text rite(in first page only)??

If at all you have 11 line items in main window then, in the first page you will print 10 line items(no fixed text in first page rite ??) and 1 line item will print in second page with fixed text rite???

then wht is the problem... when a line item comes to second page then the &NEXT-PAGE& value is '0'.

Have you tried with Next-page ??? this has to work out..

Regards,

sg

Former Member
0 Kudos

Suneel

You are almost close....

but the fixed text iam not printing in the firstpage...

The fixed text should be printed after the last line item.

so in this case first page only have line items then second page willl have the remaining line items with fixed text

Please advise...if pages will go upto 10 then the last page(10) should only has the fixed text remaining 9 pages only should have line items

Thanks

Former Member
0 Kudos

Hi Madhu,

From my case as I understood is .. the Fixed text should print in third page rite ???

If that is the case I think this will not work out in Script as the total no. of pages depends on Main window line items.

I am not sure but just try out with &NEXT-PAGE& = 1.

Regards,

sg.

Former Member
0 Kudos

Hi

Ok..forget about the fixed text..

if i want to continously print the line items in main window ....if the main window exceeds.. Do i need to code any extra other than WRITE_FORM in main window to get push to the next page?

Thanks

Former Member
0 Kudos

Hi Madhu..

Nothing to be coded extra line items will automatically go to second page but U need to do only is...

In standard attributes of First page :

Page : First

Next Page : Last

In standard attributes of Second page :

Page : Last

Next Page : Last

That's it need to do...

Regards,

sg.