2013 Nov 15 4:41 PM
Hi Experts,
I collected the spool of existing invoices - for few invoices output type is mail and so sending mail to the respective recipient.
Few invoices have the output type as printer, now for these invoices need program to print the spool when selected.
Please share me ideas if any.
Regards,
Rafi
2013 Nov 15 5:07 PM
Hi Rafi,
There is a field called nast-nacha. depending on the value we could distinguish whether we can send it as mail or print directly.(case nast-nacha)
Create a debugger short cut and drag it onto the print popup.just before the execution of pint from a standard tcode(. va03 for example). we can find the perform from the standard code which will be responsible for print. We could use it in our code.
Thanks,
Anil
2013 Nov 15 5:11 PM
Hi,
If you have spool numbers ready in you hand, then go to transaction SP01 and put the spool numbers in the selection screen and from there you can print the invoices.
2013 Nov 15 5:17 PM
2013 Nov 15 5:21 PM
Hi Experts,
I solved it myself.
We just need to call a FM to which need to specify the Device/Printer Name and the Spool ID.
That's it - printing job is done.
I have tested it on my local printer with a spool for Invoice.
Regards,
Rafi
2013 Nov 15 5:23 PM
2013 Nov 19 12:55 PM
2013 Nov 19 1:12 PM
Hi Rafi,
Please find the below steps to print spool from ABAP program.
1) Fetch the jobname, job count from TBTCO database table.
2) Fetch the spool request number based on above information from TBTCP database table.
3) Use function module RSPO_GET_TYPE_SPOOLJOB to get the type of spool job
Now use submit report For example”
* Submit the Spool list to memory and return
SUBMIT rspolist EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = gv_rqident.
4) Where gv_rqident is the spool number.
5) Now get the ABAP list from “LIST_FROM_MEMORY” function module.
6) Compress the spool table by calling below function module.
* Compress the spool table
CALL FUNCTION 'TABLE_COMPRESS' "Schneller Tabellencopy
TABLES
in = gt_listobject
out = gt_soali.
Where gt_listobject is the internal table used to compress data in step 5.
And gt_soali is the internal table in which compressed data is stored.
7) Now pass this internal table to function module “SO_DOCUMENT_INSERT_API1”.
2013 Nov 21 3:13 PM
Hi Komal,
I guess SO_DOCUMENT_INSERT_API1 is used for attaching the documents as PDF/.HTML etc type of file formats to the business documents like invoices or purchase orders or sales orders.
It's like document services.
Regards,
Rafi