Introduction:

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.

Option%20to%20add%20printer%20name%20directly%20in%20output%20management%20tab%20for%20output%20actions

Option to add printer name directly in output management tab for output actions

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.

Option%20to%20maintain%20printer%20name%20in%20Condition%20Configuration

Option to maintain printer name in Condition Configuration

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.

 

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.

BADI%20Implementation

BADI Implementation

Next we need to write the printer determination logic(as per business requirement) in the BADI implementation class method GET_PRINETR_DATA.

BADI%20implementation%20class%20method

BADI implementation class method

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.

Testing:

  1. Open a Freight Order and Generate the Print action
  2. Check the printer name in generated action. The printer which we have determined using custom logic got populated as printer name.

Conclusion:

This can be a very common requirement for output management of SAP TM. I hope this blog helps.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x