Whenever i create Purchase Order, spool is generated. But when i create one more purcahse Order new spool is not getting generated.
It is goind inside the same pool.
I want the spool number, so i can generate the pdf for the PO form and send it through mail through workflow.
Kindly adivce me how to generate new spool evertime when new PO is created.
In the print program you can force a new spool by setting itcpo-tdnewid = 'X'. However, most standard print programs do not use this option. Then a new spool can be forced by using different spool header settings for each print like the spool title. When you set the spool title in the configuration of your output to hold the document number that is printed, then each print is forced to a new spool.
Generated Spool request number is in table TSP01.
Retrieve that number and pass to function module CONVERT_ABAPSPOOLJOB_2_PDF to generate PDF.
This function module enables you send a new document including any existing attachments. The document and the attachments are transferred in the same table. They are created when sent and can also be placed in the sender's outbox.