cancel
Showing results for 
Search instead for 
Did you mean: 

problem in sapscript

Former Member
0 Kudos

Hi,

I have problem with sapscript. The sapscript is customized by coping standard PO, RFQ etc printing sapscript, MEDRUCK. The print(driver) program is still standard.

My problem is when all the line items are printed, i need to print a text at last. This text should be in MAIN window.

The last thing which is getting print in each line item is Item Text by using standard Text Element.

When i put the text after line item in MAIN window, it printed that Text in all the pages. But my requirement is to print the Text only in last page.

Can anyone please give me any idea on how can i proceed for this problem.

Thank you in Advance!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Define a smaller area that's just below the main window and add the nextpage condition there. In the main area nextpage isn't zero because it's still printing the main area.

Answers (3)

Answers (3)

Former Member
0 Kudos

I don't think this problem can be solved in SAPSCRIPT! How can the last page be detected in SAPSCRIPT when it's unknown how many more windows and text elements are to be written by ABAP?

If it were me, I would copy the standard print program (or make an enhancement or modification if it's okay). Add another text element in your MAIN window with your text and in the ABAP, call FM WRITE_FORM for that text element before the CLOSE_FORM is called ito write the text on the last page.

Edited by: Erik Peterson on Jan 28, 2010 8:28 AM

Former Member
0 Kudos

Hi,

I asked my end users that if i can create a last page and put the text there. They agreed on that, so i put the code to create new-page in LAST text element.

Thanks u all for help.

mala...

Former Member
0 Kudos

HI mala_swa,

Try to use this.....this may resolve ur problem....

Code it in main window.

/: If &nextpage& = 0

  • Include ur text

/:endif

Thanks

Ganesh

Former Member
0 Kudos

HI Ganesh/ Greg,

Thank you both for your response...

I tried both the ways but its not working..

In MAIN window, when i wrote this statement &SAPSCRIPT-FORMPAGES& with command line value /: ,

And after that when i debug that sapscript i found &SAPSCRIPT-FORMPAGES& = 0. Which is not true becoz i know thr is total no of pages is 1.

In MAIN window, when i wrote this statement &NEXTPAGE& with command line value /: ,

And after that when i debug that sapscript i found &NEXTPAGE& ='2'. Which is not true becoz i know thr is only one page and nextpage shud be 0.

When i write same code with command line value * then only i see &SAPSCRIPT-FORMPAGES& = 1 and &NEXTPAGE& ='0'.

So it means &SAPSCRIPT-FORMPAGES& and &NEXTPAGE& is not giving correct value when i am writing these in command line /:

But becoz i have to write IF statement so i have to use command line value /:

Don't know what to do now....

Please help!!!

thanks.

Former Member
0 Kudos

Hi,

I'm not very familiar with sapscripts, but I think this can help (in MAIN window):

IF &PAGE& EQ &SAPSCRIPT-FORMPAGES&
/* your text include here
ENDIF

.

Best regards,

Greg