Smart Forms Part 3: Output Determination and the Print Program Entry
Preview · a free account unlocks the full lesson
Connect a Smart Form to SD/MM output control: output types in NACE, processing routines (program, FORM ENTRY, form name in TNAPR), condition records, NAST fields in the driver, return codes, reprocessing with VF31/RSNAST00, and debugging output issues.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 2 of this series printed a form directly from a report; in SD and MM, printing instead gets triggered through output control, which calls your driver program.
In output control (configured in NACE), an application — V3 for billing, V1 for sales, V2 for shipping, EF for purchasing — is linked to an output type such as RD00, BA00, LD00, or NEU.
That output type carries processing routines: a medium (1 for print), a program such as ZSD_INVOICE_PRINT, a FORM routine named ENTRY, and a Smart Form name such as ZSF_INVOICE.
Condition records — maintained in VV31 for billing — decide when the output is proposed in the first place, and a dispatch time (for example, 4 for immediately, or 1 to go through the RSNAST00 job) decides when it actually runs.
All of this processing-routine information, including the output type's assigned program, FORM, and Smart Form, is stored in table TNAPR.
The driver interface that output control calls looks like FORM entry USING return_code us_screen. It receives the output record through the global NAST structure (declared with TABLES nast), which carries OBJKY (the document number), SPRAS (language), LDEST (printer), ANZAL (copies), TDIMMED, and more. TNAPR is a global structure that output control fills for you, and its SFORM field holds the Smart Form name. The us_screen parameter is set to 'X' when the driver is called for a print preview.
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.