Sunteți pe pagina 1din 12

Topic: ALE error handling through workflow

Prepared By: Abhijit Daptary


Siddharth Samal

Pre-requisites.

It is assumed that the reader of this article has some knowledge in SAP workflow BOR objects
and ALE Idoc process like process code, Partner Profile etc.

Description

Here, we will be discussing in details the Error handling of an Inbound Idoc through triggering an
event which in turn will be triggering a workflow attached to the workflow.

Steps:-
1. Create custom BOR object with the events, Start and Stop event
2. Create a workflow for the error handling, like generating a notification whenever an error
occurred in the Inbound Idoc.
3. Creation of Function Module and attachment with the Process Code
4. Create the settings for the Inbound Process of the Idoc through the Process Code.

Creation of BOR objects. Go to the transaction SWO1.

Enter a name for the Object type and click ‘CREATE’ button for creating the custom BOR object.

Enter the details required for creating the BOR objects...


For more Tips, Tutorials, Certification Questions and Interview Questions, visit 1
SAPTechnical.com
Create the Key fields and events of the BOR object.
For creating the Key fields place the cursor on the Key fields and Click on the Create Button

Create events for triggering the workflow and stopping the workflow.
For creating the event place the cursor on the EVENTS and Click the create button like Key
fields.
Create two events.
Enter the event name description etc and proceed further to create it.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 2
SAPTechnical.com
Similarly create another event for ending the Workflow in the similar manner like that created
earlier.

Now, Generate the BOR object through the generate button

Release the EVENTS and subsequently release the BOR object.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 3
SAPTechnical.com
After the creation of BOR object
Create a workflow for the generation of notification whenever an error is reached in the Inbound
Idoc.
Execute the transaction SWDD.

Click on the CREATE button for creating the workflow for error handling.

Choose
the Step type to be inserted for the notification like here we are using Send Mail option for
sending a mail to the user whenever any error occurred.

Activate the Workflow and test it whether it is working as per the requirement.
After the successful completion it is required to attach the workflow with the event.
Go to the Header section (Denoted by CAP).

Go to the Start Events TAB.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 4
SAPTechnical.com
Enter the details of the event with which the workflow should be linked like the category, BOR
object type and the event with which that should be linked.
Enter here the BOR object that has been created and give the name of event created for starting
the workflow.
Click on the Binding Button for generating the binding between the event and the workflow.

Generate the binding and click OK button to save the binding.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 5
SAPTechnical.com
Click on Activate / deactivate button for activating the linkage.

After the successful linkage the following sign will appear on the workflow.....

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 6
SAPTechnical.com
This shows that the workflow has been linked to the event and it will be triggered whenever that
particular event will be triggered.

After the creation and successful linkage of workflow with the event it is required it is required to
generate a function module and attached it to the process code.

Go to SE37 transaction and copy a standard process code function module to a custom one. Do
no delete any parameters from the function module as the SAP standard program itself is calling
this.

In that function module do the required validation and whenever the validation fails set a standard
parameter ‘WORKFLOW_RESULT’ to 9999 from within the function module, otherwise normally
proceed to set the status to 53.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 7
SAPTechnical.com
Af
ter the creation of function module it is required to attach it to the process code and
corresponding attached to the message type at the Partner Profile stage.

The process code is being created through the transaction WE42


Go to the change mode and click the New Entries button for creating new process code.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 8
SAPTechnical.com
Enter the Process Code Name, description and choose the processing type as Processing by
function module. Click on the extension button of Identification.

The details for the of the Process Code after clicking the identification button will be

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 9
SAPTechnical.com
Whenever idoc arrives into the Destination system then the standard SAP triggers the Process
code attached to the Message type in the partner profile. The partner profile is being maintained
in the transaction WE20.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 10
SAPTechnical.com
Since, it is and inbound scenario so the message type and the corresponding process code will
be maintained for the Inbound Parameters.

Click on Create Inbound Parameters button for creating new Inbound Message type and the
corresponding message type.

Enter the process code for the corresponding message type.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 11
SAPTechnical.com
Click SAVE button for saving the changes.

Whenever the Idoc arrives into the target system, it checks the partner profile and finds the
corresponding process code. The process code is being linked with the function module through
which the idoc is required to be processed.

For more Tips, Tutorials, Certification Questions and Interview Questions, visit 12
SAPTechnical.com

S-ar putea să vă placă și