Introduction: In this blog, we’ll look at how to change the printer in the SAP CRM system dynamically rather than keeping it configured under the PPF action profile.

In configurations (T-code SPRO), we have Actions available which needs to be configured with all the required business functionality. I’m using Actions in Billing as an example for the sake of this discussion.

Follow the SPRO path mentioned below, to achieve printer determination logic.

Customer Relationship Management –> Basic Functions –> Actions –>Actions in Billing –> Change Actions and Conditions  –>Define Conditions

 

 

Choose Specific conditions and don’t maintain any Output Device and Number of Copies as per following image. Notice : Prntr Dtrmntn says BADI implementation for Printer Determine PPF.

Note : Other print parameters can also be dynamically controlled rather than being kept in configuration.

Next implement the BADI PRINTER_DETERM_PPF with Filter Values as a (specific/pattern) action.

Put the business logic in method GET_PRINTER_DATA to modify exporting parameter CP_PRINTER_DATA.

Below are the print parameter which can be modify in BADI implementation.

If the method fails to provide a printer name and no printer is preserved in the configuration, don’t forget to add the line of code below to prevent any configuration errors.

      IF cp_printer_data-device IS INITIAL.
        cp_printer_data-device = 'LP01'.
      ENDIF.
      IF cp_printer_data-copies IS INITIAL.
        cp_printer_data-copies = '001'.
      ENDIF.

The feature is now complete, giving you the freedom to send print jobs to several printers using a single action profile, if required.  (For example, based on specific condition(s), various printers can be kept in a z-table or something similar.)

I hope you enjoyed reading this post. Please continue reading. I appreciate your thoughts and suggestions at any time. And once more, thank you very much for your valuable time.

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