SAP TM – Printer determination based on custom business logic for PPF Action / PPF Output – PDF Forms
A common functionality in SAP TM is to print PDF form when an action is executed in Output Management. This can be achieved manually by adding the printer name in output management tab and executing the action by checking the print checkbox.
2nd option, we can configure the default printer name in Condition Configuration (Processing Details-> Printer tab) and it will be automatically picked up and will be populated as printer name in output management tab action.
Another option is to use printer maintained in the user profile.
But the requirement can be like, the printer should be determined based on custom business logic and add into the printer name field in the Output Management tab whenever the action is executed.
This blog will show the steps needed to achieve this functionality.
Assuming, the reader has an idea about the PPF output functionality and SAP TM, moving forward with the solution.
To achieve printer determination using custom logic we need to create an implementation of BADI PRINTER_DETERM_PPF . This BADI is a filter dependent BADI. The filter needed here is our Action Definition name that has been created for PDF printing.
Next we need to write the printer determination logic(as per business requirement) in the BADI implementation class method GET_PRINETR_DATA.
Next we will remove the previously configured printer name from Condition Configuration as we want to determine the printer name based on our logic.
Once we activate the BADI implementation which we have created then we can see the BADI implementation description in the Printer tab as below and we need to tick the Printer Determination checkbox.
Now we are done with the implementation. Its time to test it.
- Open a Freight Order and Generate the Print action
- Check the printer name in generated action. The printer which we have determined using custom logic got populated as printer name.
This can be a very common requirement for output management of SAP TM. I hope this blog helps.