SFP Interface and Context Design
Learn how interface and context control what data reaches the Adobe Form layout.
Explanation
The SFP interface defines import parameters, global definitions, initialization logic and form routines. The context decides which fields, structures and tables are available to the layout. A common issue in Adobe Forms is that the driver passes correct data, but the field is blank in PDF because it is not correctly mapped in the context. Good interface design means passing only the required header, item, text, address and condition data. Complex calculations should usually happen in the driver or service class, not inside the form.
Code example
* Purpose:* Recommended data preparation before Adobe Form call.* Keep the form interface simple and business-ready. TYPES: BEGIN OF ty_invoice_header, vbeln TYPE vbeln_vf, kunnr TYPE kunnr, name1 TYPE name1, gstin TYPE char20, total TYPE netwr, END OF ty_invoice_header. TYPES: BEGIN OF ty_invoice_item, posnr TYPE posnr_vf, matnr TYPE matnr, arktx TYPE arktx, fkimg TYPE fkimg, netwr TYPE netwr, END OF ty_invoice_item. DATA ls_header TYPE ty_invoice_header.DATA lt_items TYPE TABLE OF ty_invoice_item. * Driver program should fill final printable fields before form call.* This avoids too much logic inside form layout.PERFORM prepare_invoice_data USING p_vbeln CHANGING ls_header lt_items. * Pass clean header and item data to Adobe Form interface.Real project scenario
A billing form showed blank GST number although the driver populated it. The issue was that the GST field was added to the interface but not dragged into the context node used by the layout.
Common mistakes
- Adding field to interface but not context. - Passing database tables directly without output structure. - Doing business calculations in layout scripts. - Overloading interface with unused parameters.
Best practices
- Pass print-ready structures. - Keep context hierarchy clear. - Avoid unused interface parameters. - Check context binding when fields are blank.
Interview angle
Interviewers may ask why a field is blank in Adobe Form. Context binding is one of the first checks.