Adobe Forms
ABAP Developmentintermediate

Adobe Forms Part 8: Output Parameters, PDF Return and Spool Handling

Key takeaway

Control what happens with Adobe output: SFPOUTPUTPARAMS for print, preview, PDF return and archiving, reading FPFORMOUTPUT-PDF, emailing PDFs with CL BCS, downloading for tests, spool handling and FP JOB CLOSE results.

Explanation

📌 KEY POINTS
✅ SFPOUTPUTPARAMS controls the job: DEST (printer), NODIALOG, PREVIEW, REQIMM (print immediately), REQNEW (new spool), GETPDF (return PDF), COPIES, ARCMODE (archiving).

✅ With GETPDF = 'X' the generated FM returns FPFORMOUTPUT-PDF as XSTRING — ready for email, archive or download.

✅ Email with CL_BCS: create document, attach the PDF (converted to SOLIX with CL_BCS_CONVERT), add recipient, send, COMMIT WORK.

⚠️ Emails from CL_BCS are only sent after COMMIT WORK (and SOST/SCOT settings) — test in a system where mail sending is configured.

━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE

Part 5 printed to spool. Many processes need PDFs instead: email to customers, archive, portal download.

━━━━━━━━━━━━━━━━━━━━
▶ 1. KEY PARAMETERS

  • Print: DEST, NODIALOG, REQIMM, REQNEW, COPIES.
  • Preview: PREVIEW = 'X' (dialog only).
  • PDF return: GETPDF = 'X' (optionally also print via other settings, depending on release).
  • Archiving: ARCMODE (1 print only, 2 archive only, 3 print and archive) with archive parameters in output control.

━━━━━━━━━━━━━━━━━━━━
▶ 2. PDF RETURN

  • Call the FM with IMPORTING /1BCDWB/FORMOUTPUT = ls_result; ls_result-PDF contains the PDF.
  • One PDF per call; for a combined PDF of several documents use job-level options (release-dependent) or merge afterwards.\n\n━━━━━━━━━━━━━━━━━━━━\n▶ 3. EMAIL WITH CL_BCS\n• cl_bcs=>create_persistent( ), cl_document_bcs=>create_document( ), add_attachment with SOLIX table (cl_bcs_convert=>xstring_to_solix), set sender/recipient (cl_cam_address_bcs=>create_internet_address), send( ), COMMIT WORK.
  • Monitor in SOST.

━━━━━━━━━━━━━━━━━━━━
▶ 4. TESTING

Download the PDF to the PC (GUI_DOWNLOAD / cl_gui_frontend_services=>gui_download) to compare versions.

━━━━━━━━━━━━━━━━━━━━
▶ 5. SPOOL AND JOB RESULT

  • FP_JOB_CLOSE can return job results (e.g. pages, spool IDs) via E_RESULT (SFPJOBOUTPUT).
  • SP01 shows spool requests; SPAD device types define the printer language used by ADS.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

  1. Change your driver to GETPDF = 'X' and download the PDF.
  2. Email the PDF to yourself with the code example (test system with SCOT configured).
  3. Check SOST for the sent message.

✅ CHECKPOINT: you can produce PDFs from Adobe Forms and deliver them by email or file.

Code example

ABAP Code
* ===== Get PDF and email it =====FORM send_invoice_pdf USING iv_pdf    TYPE xstring                            iv_vbeln  TYPE vbeln_vf                            iv_email  TYPE ad_smtpadr.  DATA: lo_send   TYPE REF TO cl_bcs,        lo_doc    TYPE REF TO cl_document_bcs,        lo_rcpt   TYPE REF TO if_recipient_bcs,        lt_body   TYPE bcsy_text,        ls_body   TYPE soli,        lt_solix  TYPE solix_tab,        lv_subj   TYPE so_obj_des,        lv_size   TYPE so_obj_len,        lx_bcs    TYPE REF TO cx_bcs.   TRY.      lo_send = cl_bcs=>create_persistent( ).       CONCATENATE 'Invoice' iv_vbeln INTO lv_subj SEPARATED BY space.      ls_body-line = 'Please find your invoice attached.'.      APPEND ls_body TO lt_body.      lo_doc = cl_document_bcs=>create_document( i_type    = 'RAW'                                                  i_text    = lt_body                                                  i_subject = lv_subj ). *     PDF xstring -> SOLIX table for the attachment      lt_solix = cl_bcs_convert=>xstring_to_solix( iv_xstring = iv_pdf ).      lv_size  = xstrlen( iv_pdf ).      lo_doc->add_attachment( i_attachment_type    = 'PDF'                              i_attachment_subject = lv_subj                              i_attachment_size    = lv_size                              i_att_content_hex    = lt_solix ).      lo_send->set_document( lo_doc ).       lo_rcpt = cl_cam_address_bcs=>create_internet_address( iv_email ).      lo_send->add_recipient( lo_rcpt ).      lo_send->send( ).      COMMIT WORK.                            " mail is sent only after commit    CATCH cx_bcs INTO lx_bcs.      MESSAGE lx_bcs TYPE 'S' DISPLAY LIKE 'E'.  ENDTRY.ENDFORM. * ===== In the driver: request the PDF =====* ls_outpar-getpdf   = 'X'.* ls_outpar-nodialog = 'X'.* CALL FUNCTION lv_fm ... IMPORTING /1bcdwb/formoutput = ls_result.* PERFORM send_invoice_pdf USING ls_result-pdf ls_header-vbeln lv_email.

Real project scenario

A company wanted invoices emailed to customers instead of printed. The first version generated PDFs correctly, but no emails arrived: the program never called COMMIT WORK after CL_BCS send, and SCOT had no SMTP node in QA.
After adding the commit, configuring SCOT and monitoring SOST, emails were delivered. The team also stored each PDF in the archive (ArchiveLink) for audit.

Common mistakes

  • Missing COMMIT WORK after CL_BCS send.
  • GETPDF without NODIALOG in background.
  • Passing XSTRING directly as text attachment.
  • No SCOT/SOST configuration in test systems.
  • One job per document when only PDFs are needed.

Best practices

  • Use GETPDF for email/archive scenarios.
  • Convert PDF with CL_BCS_CONVERT.
  • Commit after send; monitor SOST.
  • Download PDFs for regression comparison.
  • Configure archiving mode deliberately.

Interview angle

Questions: "How do you get a PDF from an Adobe Form?", "How do you email it?", "Which output parameters matter?"
Strong answer: SFPOUTPUTPARAMS (DEST, NODIALOG, PREVIEW, REQIMM, GETPDF, ARCMODE); GETPDF returns FPFORMOUTPUT-PDF xstring; email with CL_BCS: create document, attachment via XSTRING_TO_SOLIX, recipient, send, COMMIT WORK, monitor SOST; FP_JOB_CLOSE result for spool info.

Practice this lesson

Quick check

1. PDFs are generated and sent with CL_BCS, but no email arrives and SOST shows nothing. Likely cause?

2. Which pair is commonly used to open and close Adobe Form processing?

3. Which output parameter is commonly used when PDF binary output is required?

Interview questions

1. A billing job generated PDFs successfully, but customers never received the emails. What do you check?

Answer it in your own words first, then compare.

2. How do you call an Adobe Form from an ABAP driver program?

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics