2008 Jul 17 10:34 AM
Hi Gurus,
I am new to SAP Scripts. I have created a form which contains a set of boxe as the fig below.
________________________________________________________________
DocNum | Total Amount | |
_________________________________ | _____________________________ | |
_________________ | _________________________ | ___________________ |
________________________________________________________________
Bank Adress | Cust Bank Details |
_____________________________________________ | _________________ |
Customer Adress | |
_____________________________________ |
I am printing this top side of the page for a single invoice. If I want to print this for multiple invoices, for example if I am having 3 invoices then it should print 3 times on the same page.
like
Invoce 1
Invoice 2
Invoice 3.
Can any body please let me know how to print the same form on a single page multiple times.
Thanks,
Deepak.
2008 Jul 17 10:40 AM
find out how many invoice u have to print according to that...
use do statement like this......
do 3 times
perform write_form
endo.
this will work.....
Regards
Anbu
2008 Jul 17 10:56 AM
Hi Anbu/Pawan,
Actually it is a standard program. I can not do internally any thing in the program.
Only what ever I can do is in the form. Let me tell you how I designed the form.
First I designed the boxes as below
BOX HEIGHT '0.7' CM WIDTH '3.4' CM FRAME 10 TW
BOX XPOS '3.4' CM HEIGHT '0.7' CM WIDTH '6.2' CM FRAME 10 TW
BOX XPOS '9.6' CM HEIGHT '0.7' CM WIDTH '3.4' CM FRAME 10 TW
BOX YPOS '0.7' CM HEIGHT '0.7' CM WIDTH '6.5' CM FRAME 10 TW
BOX XPOS '6.5' CM YPOS '.7' CM HEIGHT '.7' CM WIDTH '6.5' CM FRAME 10 TW
BOX YPOS '2.6' CM HEIGHT 1 CM WIDTH '9.6' CM FRAME 10 TW
BOX XPOS '9.6' CM YPOS '2.6' CM HEIGHT 1 CM WIDTH '3.4' CM FRAME 10 TW
BOX YPOS '3.8' CM HEIGHT '1.5' CM WIDTH 9 CM FRAME 10 TW
Then I fixed the texts and its values in each box by setting the positions.
Can you please tell me how to create these boxes multiple times with out chaging the print program.
DO I can use any loop statement.
2008 Jul 17 11:00 AM
debug the sapscript.. find the element which is being called for each Invoice.. put you code under that element.
2008 Jul 17 11:20 AM
Hi Pawan,
I am doing all this in Main window.
The position of the Main Window and boxes are fixed. Even the boxes are printing second time, but those are on the same position duplicating. Please tell me, how to change the position of this Main window for each invoice.
2008 Jul 17 10:41 AM
you have to call FM in this order..
OPEN_FORM "do not specify the form name
START_FORM "specify form name here for Invoice 1
END_FORM
START_FORM "specify form name here for Invoice 2
END_FORM
START_FORM "specify form name here for Invoice 3
END_FORM
CLOSE_FORM
You can continue using START_FORM and END_FORM as many time as you want to append output in single spool.
OPEN_FORM and CLOSE_FORM is used to open spool and close spool, however if you happens to have one form (sapscrpt) then you can specify formname in OPEN_FORM . However in you case you need use above FM START_FORM and END_FORM