Adobe Forms Part 5: The Driver Program Pattern
Preview · a free account unlocks the full lesson
Write a production-grade Adobe Form driver: selection, data preparation per document, FP JOB OPEN once, FP FUNCTION MODULE NAME, per-document calls with SFPDOCPARAMS (language, country), error handling with exceptions and messages, FP JOB CLOSE with result, and the output-control entry routine.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 4 designed the form's interface; now the driver program needs to fill that interface and actually run the print job.
The general pattern is one FP_JOB_OPEN call before the loop, one call to the generated function module per document inside the loop, and one FP_JOB_CLOSE call after the loop, so that all the documents end up in a single spool job together.
SFPDOCPARAMS sets the language (LANGU) and country (COUNTRY) per document, which controls translations and locale-specific formatting for that particular document. In output control, the driver's ENTRY routine reads NAST for the document, printer, and language, exactly the way it does with Smart Forms.
One thing to handle carefully: if FP_JOB_OPEN fails, or the job never gets properly closed, the entire run fails, so exceptions need to be handled and the job needs to always be closed.
The overall structure runs like this: first comes the selection step, picking the documents, printer, and whether you want a preview or a PDF; then FP_JOB_OPEN, passing SFPOUTPUTPARAMS with settings like dest, nodialog, preview, getpdf, and reqimm; then a call to FP_FUNCTION_MODULE_NAME to resolve the generated function module's name; then the main loop, which prepares the data for each document, sets SFPDOCPARAMS, calls the function module, and handles any errors; and finally FP_JOB_CLOSE, optionally returning results like the number of pages produced and the spool IDs generated.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.