A highly flexible, modern ABAP framework designed to dynamically map, route, and execute standard Smart Forms and Adobe Forms for Repair Orders, Service Notifications, and Sales Contracts in SAP under the /CTDI/ namespace.
By decoupling form execution logic from hardcoded standard print programs, this repository enables SAP developers and consultants to configure customized printing routines, spool bundling, and local PDF output control entirely via customizing tables keyed by specific Contract / Repair Numbers (VBELN), SKZ, and AKZ selectors.
- Dynamic Execution Engine: Decoupled, highly testable runtime printer orchestrator that dynamically resolves and executes custom print classes inheriting from the base print driver via the Template Method pattern.
- Separated Customizing Engine: Extraction of SM30 table maintenance validations, in-memory RTTI inheritance verification, system modifiability checks, and dynamic class skeleton generation into a dedicated static helper class (
/CTDI/CL_PRINT_CUST_ENGINE). - Centralized Selection Screen Lifecycle: Single-method toolbar setup (
init_toolbar( )) and FCODE dispatching (handle_selection_screen_fcode( )) for quick SM30 Customizing navigation across all print programs. - GOS Image Attachment & PDF Merging: Automated retrieval of image attachments (GOS
/ SOFFICEand Content Server / ArchiveLinkZRS_JPG) from orders and linked notifications via/CTDI/CL_PRINT_GOS_IMAGES, scaling images to A4 with aspect ratio preservation and merging directly into the PDF output stream. - Mass Printing & Spool Bundling: High-performance ALV processing (
/CTDI/PRINT_REPAIR_MASS) with flexible spool modes (individual spool per order, bundled multi-order spool job, or client-side merged PDF). - Parallel RFC Mass Execution: High-throughput distributed printing (
/CTDI/PRINT_REPAIR_MASS_PRLL) running across multiple dialog work processes. - Standard SLG1 Message Logging: Integrated application logging class (
/CTDI/CL_PRINT_DRIVER_LOG) with object-oriented exception logging and runtime log level filtering (I,W,E). - Full Translation Friendliness (L10N): Multilingual support across English and German text pools, data elements, table definitions, and message classes.
- abapGit Standard Compliance: Cleaned XML serializers and standard 7-bit ASCII encoding, fully validated with
abaplint(0 errors / 0 warnings). - Automated Form Type Detection: Dynamically detects the form technology (Smart Forms vs. Adobe PDF-based Forms) at runtime by querying SAP metadata (
STXFADM), eliminating manually-configured technology flags. - Dynamic Repair Result Access Sequence: Implements a configurable 11-step fallback access sequence reading from
/CTDI/REP_RESULTusing combinations of Contract, SKZ, AKZ, and Swap Flags.
All ABAP objects are structured in an abapGit compatible format under the src/ directory:
- Forms Customizing Table: src/#ctdi#rep_forms.tabl.xml
- Project Customizing Table: src/#ctdi#rep_projec.tabl.xml
- Repair Result Table: src/#ctdi#rep_result.tabl.xml
- Repair Structure: src/#ctdi#repair.tabl.xml
- Repair Error Table Type: src/#ctdi#repair_error_tt.ttyp.xml
- Base Print Driver Class: src/#ctdi#cl_print_driver_base.clas.abap
- CTDI Print Driver Class: src/#ctdi#cl_print_driver_ctdi.clas.abap
- Legacy Print Driver Class: src/#ctdi#cl_print_driver_legacy.clas.abap
- Template/Demo Driver Class: src/#ctdi#cl_print_driver_template.clas.abap
- Customizing Engine Class: src/#ctdi#cl_print_cust_engine.clas.abap
- GOS Image Attachment & Merger: src/#ctdi#cl_print_gos_images.clas.abap
- Unified Logger Class: src/#ctdi#cl_print_driver_log.clas.abap
- CTDI Print Data Provider Class: src/#ctdi#cl_print_data_ctdi.clas.abap
- Legacy Print Data Provider Class: src/#ctdi#cl_print_data_legacy.clas.abap
- Single Interactive Print Program: src/#ctdi#print_repair.prog.abap
- Mass ALV Processing Program: src/#ctdi#print_repair_mass.prog.abap
- Parallel RFC Mass Print Program: src/#ctdi#print_repair_mass_prll.prog.abap
- Customizing Validation Exception: src/#ctdi#cx_cust_error.clas.abap
- Driver Execution Exception: src/#ctdi#cx_print_driver_error.clas.abap
- Configuration Not Found Exception: src/#ctdi#cx_no_config_found.clas.abap
- Message Class: src/#ctdi#print_repair.msag.xml
When a new business project category is introduced requiring a new Adobe Form or Smart Form layout, follow these 4 operational steps:
Create the form layout in SAP:
- For Adobe PDF-Based Forms: Use Transaction
SFPto design the Interface and Form. - For Smart Forms: Use Transaction
SMARTFORMSto build the layout.
Link the specific Contract/Repair ID to your form and print class using Transaction SM30 (table /CTDI/REP_FORMS):
- Contract/Repair Number: The contract
VBELNassociated with the repair project. - Form Name: The name of the SFP Form or Smart Form created in Step 1.
- Class Name: Leave blank. The SM30 validation event will automatically offer to generate a new SE24 class inheriting from base class
/CTDI/CL_PRINT_DRIVER_BASE(named/CTDI/CL_PRINT_DRIVER_{vbeln}).
In transaction SE24, locate your newly generated class /CTDI/CL_PRINT_DRIVER_{vbeln}:
- Redefine the action hook methods:
unpack_io_data: Extract parameters.fetch_data_from_db: Select data.map_and_register_data: Map fields and register parameters viaregister_custom_parameter.
Go to Transaction NACE and map the print output routine for your Output Type to the print program /CTDI/PRINT_REPAIR. Once tested, release and transport the configuration and generated classes to QA/PRD.
- Import the package into your SAP system using abapGit.
- Activate all imported objects.
- Configure your contract mapping via Transaction
SM30for table/CTDI/REP_FORMSand project defaults in/CTDI/REP_PROJEC. - Attach the event template sm30_event_class_generator.abap to table maintenance events:
- Event 05 (Creating a new entry): Attach
on_new_entry. - Event 01 (Before saving): Attach
validate_entry.
- Event 05 (Creating a new entry): Attach
- Wire the program /CTDI/PRINT_REPAIR into Transaction
NACEunder your specific Contract/Order Output Type.