cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple letters to be printed in single run

Former Member
0 Kudos

Hi,

I have a requirement, where in on the given input date, I need to fetch all payments made back to customer (refund) and then a letter intimating each one of them about the refund made by the co. will be sent.

From the date I can fetch all the required details for the letter to be printed for each customer, but in sap script I have never come across a case where in, in a single run (with date) multiple letters are created in spool.

I have developed many scripts where in a single execution provides single letter. or user uses the script program multiple times, but in the above payment case nos. can exceed into thousands so multiple runs of the script program for each customer is actually not feasible.

Request to provide a solution for the situation.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Navin,

If u want Multiple letters to be printed in single run first create a prtrait layout set and then create a land scape layout set with defferent name. Open the print program and call strat_form for potrait and call other start_form for land scape. Now if u execute the script then both forms will be printed at a time. Repeat this upto many levels how many you want.

Hope this helps you, reply for queries, Shall post you the updates.

Regards.

Kumar. .

Former Member
0 Kudos

Hi Lakshman,

can you explain the portrait layout set and landscape layout set.

Regards,

Mani

Former Member
0 Kudos

We get that option in 'Header' button of se71 for a given form. In that go to basic settings, you have an option of 'Potrait format' and 'Landscape format'. select anyone as per your requirement.

Potrait is one which is lenght(vertical) wise more and breadth(horizontal) wise less. its just like normal A4 paper format setting.

Landscape is one which is breadth(horizontal) wise more and breadth(vertictal) wise less. its just like normal A4 paper format setting turned once to left/right side.

hope it clears your doubt. can try it out in se71 as said.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Navin,

Try implementing follownig logic.

After collecting all details in the internal table.

loop at itab.

at new customer.

open_form.

endat.

start_form. 1

write_form. 1

end_form. 1

start_form. 2

write_form. 2

end_form. 2

at end of customer.

close_Form.

endat.

endloop.

And it should work in the scenario mentioned. I believe this will create individual spool request for each customer.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***

Message was edited by:

Mr Kapadia

Former Member
0 Kudos

Hi,

First off, I would be having only one entry (unique) for each customer, so we can do away with 'at new' and 'at end'. I am not able to understand why have you mentioned - start_form. write_form. end_form. twice, what exactly will it do?

can you clear on this point pls.

we can simple open, write & close on each run of loop isn' it ??? and I to agree that this should probably create diff spool for each customer.

Thanks for your input dear.

Former Member
0 Kudos

Hi Navin,

In case you have different layout lets say one for customer outstanding, one for customer acknowledgement , one for customer invoices .

In that case start_form will call a particular form which may have diff. layout and print , once one part ( e.g. customer outstanding) is over you can call end_form this will end customer outstanding form and then you can goforward to customer ack form by start_form .and finally close_Form.

Thus within one spool request you will have all 3 letters together. I hope i am making a point clear.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***