Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Converting sap script output into pdf format?

Hi all,

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?



Former Member
Former Member 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_doc   type meein_purchase_doc_print.

  clear ent_retco.
  if nast-aende eq space.
    l_druvo = '1'.
    l_druvo = '2'.

  call function 'ZME_READ_PO_FOR_PRINTING'
            ix_nast        = nast
            ix_screen      = ent_screen
            ex_retco       = ent_retco
            ex_nast        = l_nast
            doc            = l_doc
            cx_druvo       = l_druvo
            cx_from_memory = l_from_memory.
  check ent_retco eq 0.
  call function 'ZME_PRINT_PO'
            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
            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;


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question