Introduction: This Document is a continuation of my document SAP Workflows in ALE/EDI – part 1 where I covered the methods to utilize SAP Workflows in ALE/EDI technologies. This document will cover remaining topics like Rule based Inbound flow and Active monitoring.
Rule based Inbound Flow:
This inbound idoc technique is used when a manual intervention is required before idoc is posted. Some customers want this functionality especially in case of some change idocs so that before changing data in an application document they can cross check if the changes are ok to be done. In this technique,
I am using the sales order change as an example and the standard message type is ORDCHG. The requirement is such that whenever sales order change idoc is triggered to be posted, an agent has to cross check if the change is feasible. For this a work item should appear in the inbox of assigned user so that by executing it the user can see the idoc and delete it if further processing is not required.
Settings done for this scenario:
Sales orders are often changed by users and the changes are to be validated by managers before changes are effective. In such scenario we need to create a custom process code which gets initiated by standard workflow task TS30200088 when ever sales order change happens. This task is used to display the idoc as a work item in sap inbox. Method DOCUMENTPROCESS is used for this purpose. This method contains functionality to end the process and make the idoc status as 53 in case changes in business document are valid and to set the deletion indicator in case there are some discrepancies in the change idoc and set the idoc status as 68.
Note: Whenever the inbound messages are passed to SAP system, process code is determined through configuration which in turn executes this task. Also the process code point to the task below:
- Process code creation : I created a custom process code named ZOCH as below. Task TS30200088 is assigned to custom process code created for this process. This process code executes this task when inbound messages pass as explained above.
- Maintaining Partner Profiles Maintain partner profile:
The standard task TS30200088 is a general task so the agent is taken from the general view of partner profile. Now the interface can be tested using standard transaction WE19: Posting sales order for the same customer 100000001(TEST CUSTOMER 1 test) for which we have maintained the partner profile as shown above.
Testing the inbound scenario:
Now click on OK: You’ll get a pop as below:
The work item analysis with SWIA:
When pressed Enter, idoc is created:
Work item in inbox using SBWP:
Executing Work items
Idoc status is 62 which implies that it’s a success. Now the agent can verify the changes in the sales order. If there is any discrepancy and the idoc has to be stopped from processing then agent can stop the further idoc processing as mentioned and if changes are fine then it can be further processed to status 53(successful posting)
Processing for correct changes
Click on the E1EDK01 segment and look at the PO number in the BELNR field. Use this PO number to locate the sales order in the system. For each sales order item, compare the quantity field in the sales order to the value in MENGE field in E1EDP09 segment. If values are acceptable then go to the sales order and make those changes manually. Also we can have another ORDCHG idoc in the system with posting FM attached and post the idoc in order to make those changes in the system.
If values are not acceptable then we can purge the idoc as shown in the screen shot below.
If values are correct then we can complete the idoc processing by Edit –>Process –> End process. This way the status of idoc will be set to 53 and then we can make the changes in the sales order manually.
The standard report RSEIDOCA available in SAP, which is used for sending work items to a recipient given on the selection screen of this standard report. This report gives all the idocs created in the predefined time period, whose current status corresponds to the selected status and that satisfy the additional selection criteria, are evaluated. This evaluation is usually scheduled as a batch job, but can also be started interactively. The time limits are determined at run time on the basis of the time parameters entered. If the number of idocs exceeds the ‘critical idoc number’, an alarm message is sent to the recipients entered. The alarm message in this case is a work item of the TS74508518 standard task.
Following fields are input in order to notify a user about idocs of status 51 which got posted let’s say 5 days back.
With above values, the information of all the idocs which were in status 51 in last 5 days are sent to recipient specified in the selection screen above(recipient has been masked) as shown in screen shot below. If number of idocs which are posted in last 5 days with failed status 51 exceeds Critical idoc number then an alarm mail is sent to the recipient as below:
When I double click on the mail, following screen appears, which shows all the idocs with status 51, which got posted in last 5 days.
When we double click on the error message shown above, it navigates to Idoc list as shown below.
References: ALE, EDI AND IDOC by Aravind Nagpal and www.help.sap.com