Converting sap script output into pdf format?
I have modified the standard purchase order script form MEDRUCK . Now i need to generate the output into pdf format.
This is not only limited to spool requests , But also when the user creates the purchase order and clicks on print or print preview the output should be in pdf format.
Please help on where and what code has to be written for this requirement?
max bianchi replied
If you're using a release greater or equal to 4.6C, the std drive program is SAPFM06P, and here the std fm ME_READ_PO_FOR_PRINTING and ME_PRINT_PO are called in routine ENTRY_NEU.
Those std fm are real print program, so u need to change them, so u should:
- Create the program ZAPFM06P as copy of SAPFM06P (copy the main program only, not its includes;
- Replace the std include FM06PE02 (where the routine ENTRY_NEU is defined) with ZFM06PE02;
- Copy the function group MEDRUCK and all its function modules;
- Modify the routine ENTRY_NEU (defined in the new include ZFM06PE02) in order to call the new fms:
data: l_druvo like t166k-druvo, l_nast like nast, l_from_memory, l_doc type meein_purchase_doc_print. clear ent_retco. if nast-aende eq space. l_druvo = '1'. else. l_druvo = '2'. endif. call function 'ZME_READ_PO_FOR_PRINTING' exporting ix_nast = nast ix_screen = ent_screen importing ex_retco = ent_retco ex_nast = l_nast doc = l_doc changing cx_druvo = l_druvo cx_from_memory = l_from_memory. check ent_retco eq 0. call function 'ZME_PRINT_PO' exporting ix_nast = l_nast ix_druvo = l_druvo doc = l_doc ix_screen = ent_screen ix_from_memory = l_from_memory ix_toa_dara = toa_dara ix_arc_params = arc_params ix_fonam = tnapr-fonam "HW 214570 importing ex_retco = ent_retco.
- Change the fm ZME_PRINT_PO in order to manage the pdf format
- U should create a new message (ZPDF) in order to create the pdf file instead of spool;