In the previous blog I explained the conceptual differences between NAST based output management and in this blog I will explain step by step instructions on how to create a custom output type. The object of this blog is not just to explain how it works, but to make new output management work in practical scenarios.
Where do we start?
A great place to start would be a very informative blog by Anirudh Jain Output Management via BRF+
Also please check out these notes
Most of the delivered outputs work when the initial setup is completed as per the notes above. However, many a times we need to go beyond the delivered content and this is what I would like to share in this blog series.
How to configure a custom output
Step 1 – Activate new output management by application. You can notice that the configuration to S4HANA output management is now moved to Cross-Application components area where it rightfully belongs. Follow the path below in SPRO to start the creation of new output.
Cross-Application Components-> Output Control -> Manage Application Object Type Activation
As explained by OSS note – 2298826 you can turn on S4HANA output management by application from S4HANA 1610 onwards. For earlier versions refer to OSS note – 23340682334068. You will notice that only SD related applications appear in this area. Application type activation steps are embedded in SPRO nodes for different functional areas as below.
Materials Management -> Inventory Management and Physical Inventory -> Print Control -> Activation of new Output Management
Once you switch on the application, you will notice that the output screen changes in the application transaction. Output type field is not a 4 character field anymore.
Step 2 – Create a new output type. Follow the menu path as below. You should already see some outputs delivered in this section.
Cross- Applications -> Output control -> Define Output Types
There is not a whole lot of setup in this area. All you need to provide is a name for the output type, description and a call back class. Please bear in mind that S4HANA output management can trigger multiple outputs for the same output type. You do not need to configure multiple output types to trigger multiple outputs (for ex: Print, Email and Idoc channels can all be configured with the same output types to trigger based on different conditions).
Callback class – Let us understand the call back class in detail. There are several methods available and I will focus on important methods that can help you further enhance the functionality
IF_APOC_AUTHORITY~CHECK – Introduce custom authorization checks. Setting the field rv_authorized = ‘X’. Will allow the output to be processed. If rv_authorized is not set to X, the output will stay in “To be output” status.
IF_APOC_OR_ITEM_VALIDATION~CHECK_ITEM – I did not see this method until 1709. In one of my earlier posts I mentioned that the classic output requirements are not supported in S4HANA output management. This method fills for that gap. This method is generally not available in the delivered call back class. However you can enhance the method and add interface IF_APOC_OR_ITEM_VALIDATION to the class. You can add a number of validations and add to the message log.
IF_APOC_OR_ITEM_VALIDATION~VALIDATE_CREATED_ITEM – I did not see this method until 1709. In one of my earlier posts I mentioned that the classic output requirements are not supported in S4HANA output management. This method fills for that gap. This method is generally not available in the delivered call back class. However you can enhance the method and add interface IF_APOC_OR_ITEM_VALIDATION to the class. You can then implement all the custom validation rules (legacy output requirements) here by setting IS_VALID = SPACE you can fail the output.
IF_SOMU_BADI_FORM_MASTER~GET_FORM_MASTER_DATA – Enables modification of data on the master form template. Did not get to use the master form functionality much. Will add details when I have come firsthand experience
IF_APOC_COMMON_API~GET_FDP_PARAMETER – This method is already implemented, did not need to manipulate anything in this method.
IF_APOC_COMMON_API~GET_DATA_FOR_ROLE – The standard class comes with this method implemented to read the email addresses from the address tables and populate the email ID for email outputs. As you are aware, SAP has stopped supporting FAX functionality. We were able to successfully make the Fax output work by modifying the code to read the fax number instead of the email address and convert it into an email address by concatenating the default domain settings for Fax from transaction SCOT.
IF_APOC_COMMON_API~GET_DATA_FOR_SENDER – The standard class comes with this method implemented to read the email addresses from the configuration for sales org, company code etc. This method can be leveraged to modify the email address to base it on some other logic.
IF_APOC_COMMON_API~GET_LEGACY_DATA – This is good method to link the new output management with classic output management. This method can be leveraged to generate Idocs, or use legacy output technologies. This is the approach used to integrate idoc technology with S4HANA output management. SAP has not implemented this method for the callback class for Sales order output. By implementing this method, you can enable the idocs for sales orders.
IF_APOC_COMMON_API~RENDER_DOCUMENT_LEGACY – This method can be leveraged to directly call legacy output programs.
IF_APOC_COMMON_API~CHECK_AUTHORITY – This is a deprecated method, use IF_APOC_AUTHORITY~CHECK instead.
Step 3 – Configure output conditions. Key concept that needs to be understood here is the concept of the CDS view tied to the output. Each application is linked to one and only one CDS view. Picture combining all the condition tables you had in the old output determination procedure, if you are conversant with NAST based output management. Here is how you can find out the name of the CDS view linked to the application. It is very important to know this to help you extend the delivered functionality and also for troubleshooting.
Go to transaction OPD or Cross-Application Components -> Output Control -> Define Business Rules for Output Determination from SPRO. Select application area, Select output type, click on the button “Context overview”. Click on condition parameters of the application. This should give you the name of the CDS view. The fields in this CDS view are available in all of the steps below to build your conditions.
If the delivered fields are not sufficient for the conditions you desire to build, you can extend the CDS views. Please see an informative blog by Tushar Sharma.
In the next blog post I will explain the rest of the configration needed to complete the setup of outputs.
Hope you find this information useful.