Sunday 14 April 2019

Trigger workflow by OData service

This blog is define to trigger the workflow by custom application through Odata services it is a simple workflow with user decision, when a user approve the workflow the record will be created in database table.

To Create an Odata services check my first blog

http://www.sapspot.com/building-your-first-fiori-app-with-backend-connection-and-odata-service/

1. Goto Tcode SWO1 to create a custom business object

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Create two events SAVE and EDIT

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Add the key fields of the object

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Generate the business object

Goto Tcode SWDD and create a workflow.

Define its starting events

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Create a container element

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Assign the agent

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Assign General Task to agent (The one who is triggering will get notification in its own inbox)

Create a user decision

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Now Goto Create_entity method and add this FM

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Also write this FM in update_entity

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Now Create a Method and Add in the Activity

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

Activate the workflow

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Certification

No comments:

Post a Comment