Forms: Smart Forms & Adobe Forms
Design graphically: form interface (import parameters, tables), global definitions, pages and windows (main window flows across pages), nodes (text, table, loop, alternative, program lines, graphics).
30.1 Form technologies
Legacy (still in older standard outputs) Mature, widely used on ECC
Adobe Forms (SAP Interactive Forms by Adobe) Strategic for on-premise; requires ADS (Adobe Document Services) SAP Forms Service by Adobe (BTP)
Cloud rendering; used with S/4HANA output management S/4HANA Output Management BRF+ / Fiori apps
Determines which form and channel (print, e-mail)
30.2 Smart Forms
Design graphically: form interface (import parameters, tables), global definitions, pages and windows (main window flows across pages), nodes (text, table, loop, alternative, program lines, graphics). Activation generates a function module with an unpredictable name — always resolve it at runtime:
For PDF: set getotf = abap_true, get the OTF data from job_output_info, and convert with CONVERT_OTF.
DATA lv_fm TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = 'ZSF_INVOICE'
IMPORTING fm_name = lv_fm
EXCEPTIONS OTHERS = 1.
DATA(ls_ctrl) = VALUE ssfctrlop( no_dialog = abap_true preview = abap_true ).
DATA(ls_out) = VALUE ssfcompop( tddest = 'LP01' ).
CALL FUNCTION lv_fm
EXPORTING
control_parameters = ls_ctrl
output_options = ls_out
is_header = ls_invoice_header
TABLES
it_items = lt_invoice_items
EXCEPTIONS
OTHERS = 1.30.3 Adobe Forms
Interface (SFP: ABAP dictionary-based or XML schema; CDS-based for gateway forms) + Form (context mapping + layout designed in Adobe LiveCycle Designer).
Interactive (fillable) forms are also possible. In the cloud, forms are rendered by SAP Forms Service by Adobe with templates managed in Fiori apps (*Maintain Form Templates*).
DATA lv_fm TYPE funcname.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING i_name = 'ZAF_INVOICE' IMPORTING e_funcname = lv_fm.
DATA(ls_outparams) = VALUE sfpoutputparams( getpdf = abap_true nodialog = abap_true ).
CALL FUNCTION 'FP_JOB_OPEN' CHANGING ie_outputparams = ls_outparams EXCEPTIONS OTHERS = 1.
DATA ls_formout TYPE fpformoutput.
CALL FUNCTION lv_fm
EXPORTING
/1bcdwb/docparams = VALUE sfpdocparams( langu = sy-langu )
is_header = ls_invoice_header
it_items = lt_invoice_items
IMPORTING
/1bcdwb/formoutput = ls_formout
EXCEPTIONS OTHERS = 1.
CALL FUNCTION 'FP_JOB_CLOSE' EXCEPTIONS OTHERS = 1.
" ls_formout-pdf now holds the PDF as xstring (attach to mail, download, archive)