ale error handling through workflow

18
ALE - Error handling through workflow By Abhijit Daptary & Siddharth Samal, Capgemi ni India 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 objec t with the ev ents, St art and St op even t 2. Create a wor kflow for the error handling, like generating a notification whenever an error occurred in the Inbound Idoc. 3. Creation of Fun ction Module and attach ment wi th the Proc ess 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.

Upload: gkotecha

Post on 29-May-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 1/18

ALE - Error handling through workflow

By Abhijit Daptary & Siddharth Samal, Capgemini India

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 tothe workflow.

Steps:-

1. Create custom BOR object with the events, Start and Stop event2. 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.

Page 2: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 2/18

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

Create the Key fields and events of the BOR object.

Page 3: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 3/18

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.

Page 4: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 4/18

 

Similarly create another event for ending the Workflow in the similar manner like that created earlier.

Page 5: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 5/18

Now, Generate the BOR object through the generate button

Release the EVENTS and subsequently release the BOR object.

After the creation of BOR object

Create a workflow for the generation of notification whenever an error is reached in the Inbound Idoc.

Page 6: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 6/18

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).

Page 7: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 7/18

 

Go to the Start Events TAB.

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.

Page 8: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 8/18

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.

Page 9: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 9/18

Click on Activate / deactivate button for activating the linkage.

Page 10: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 10/18

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

Page 11: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 11/18

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 processcode.

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 theSAP 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 thefunction module, otherwise normally proceed to set the status to 53.

Page 12: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 12/18

After 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 Profilestage.

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.

Page 13: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 13/18

Enter the Process Code Name, description and choose the processing type as Processing by function module. Click on the extension button of Identification.

Page 14: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 14/18

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

Page 15: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 15/18

Whenever idoc arrives into the Destination system then the standard SAP triggers the Process code attached to the Message type in the partner profile. Thepartner profile is being maintained in the transaction WE20.

Page 16: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 16/18

 

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.

Page 17: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 17/18

Enter the process code for the corresponding message type.

Page 18: Ale Error Handling Through Workflow

8/8/2019 Ale Error Handling Through Workflow

http://slidepdf.com/reader/full/ale-error-handling-through-workflow 18/18

 

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 linkedwith the function module through which the IDOC is required to be processed.