How To Call Workflow From Abap Program Sap

ABAP Classes in Workflow

  1. How To Call Workflow From Abap Program Sap Tutorial
  2. Abap Submit Job
  3. How To Call Workflow From Abap Program Sap Modules

15.Why IF_WORKFLOW Interface?

Hi there - actually this is really easy. In your ABAP create the event with FM SAPWAPICREATEEVENT. Use transaction SWE2 to define the workflow / task to start when the event is created. Ensure in the definition of your BOR (or CLASS if using OO workflow) you've defined an EVENT. How to CALL TRANSACTION in ABAP. The goal is to call Transaction with parameters and skip first screen. Example to call the Prod Order display transaction: SET PARAMETER ID 'ANR' FIELD wofnumber. CALL TRANSACTION 'CO03' AND SKIP FIRST SCREEN. The example below show how to call a transaction and skip first screen. Find out how to configure clients so that the same version of an SAP workflow item is used when the workflow is triggered in separate clients. Continue Reading. How to send attachments in an SAP workflow item. An SAP user has created a user decision step in an SAP workflow item and wants to know how an end user can send an attachment to other. Aug 29, 2017 This example shows a simple way to call a workflow process from Event-Class into a Class Method or SAP ABAP Program. Create a reference to SAP Business Interface in our class (trx SE24). With this way we are able to use our SAP ABAP Class into SAP Business Workflow Event Containers.

The IF_WORKFLOW interface is necessary when using an ABAP class within the SAP WebFlow Engine. The interface contains methods that allow the object to be used within the SAP WebFlow Engine.

The SAP WebFlow Engine handles all objects generically. Objects have to be saved in the event of a context change. Therefore, it is necessary to convert object references in such a way that they can be saved persistently. Conversely, we have to be able to generate the corresponding instance of an ABAP class from the persistently saved key.

There are also a number of SAP WebFlow Engine components, for example, the Workflow Log that can display objects. In this case the object has to provide corresponding functions.

The IF_WORKFLOW interface puts a logical parenthesis round the BI_PERSISTENT(instance management) and BI_OBJECT (object behavior) interfaces. The IF_WORKFLOWinterface contains the following methods:

ØBI_PERSISTENT~FIND_BY_LPOR

ØBI_PERSISTENT~LPOR

ØBI_PERSISTENT~REFRESH

ØBI_OBJECT~DEFAULT_ATTRIBUTE_VALUE

ØBI_OBJECT~EXECUTE_DEFAULT_METHOD

ØBI_OBJECT~RELEASE

A class that implements the IF_WORKFLOW interface can be used in any workflow. The class is automatically released for use in workflows when the interface is implemented. Therefore, we can only make compatible changes to a class after implementation (we cannot delete attributes, change types or delete methods). There is no where-used list to show which workflows the class is used in.

Internal classes of an application should not implement the IF_WORKFLOW interface, since this could mean that each method of the class is used in the workflow. Therefore, we should encapsulate the workflow functions in another class that calls the selected methods of the internal class.

Each method of the IF_WORKFLOW Interface as mentioned earlier has its distinct functionality, which is discussed below.

16.BI_PERSISTENT~FIND_BY_LPOR Method:

If we want to convert a persistent saved display of an object into an instance of the corresponding ABAP class, SAP Webflow Engine calls the BI_PERSISTENT~FIND_BY_LPOR method.

Features:

The method parameter LPOR is the persistent object reference and is of SIBFLPOR structure type. A reference of BI_PERSISTENT type is returned.

Call

The following table shows the components of the SIBFLPOR structure:

Field

Description

CATID

Describes the object type ( CL for ABAP classes)

TYPEID

ABAP class name

INSTID

Object key. The key is limited to 32 characters.

We can implement this method in several ways. In the case of persistent classes we can create the ABAP object instance using the generated classes. In the case of individual persistence management we have to implement the individual actions (such as creating an instance, performing an existence check, entering public attributes, and so on) manually within the class.

Sap

Instance management takes place automatically in the case of persistent classes. In the case of individual persistence management we also have to carry out instance management by class. The SAP WebFlow Engine does not provide any instance management. We must therefore implement our own instance management in the case of individual persistence management.

The FIND_BY_LPOR method should always return the same instance if the following problems are to be avoided:

How To Call Workflow From Abap Program Sap Tutorial

  • Inconsistency in the data display

  • Instance data being overwritten by another instance

  • Locking conflicts

There is an implementation example in the CL_SWF_FORMABSENC demo class.

17.BI_PERSISTENT~LPOR Method:

The BI_PERSISTENT~LPOR method is the counterpart to the BI_PERSISTENT~FIND_BY_LPOR method. It provides the persistent display for an existing instance of an ABAP object.

Features:

The method returns the persistent display of an object reference as a SIBFLPOR type structure as described earlier.

Abap Submit Job

There is a close relationship between the BI_PERSISTENT~FIND_BY_LPOR method and the BI_PERSISTENT~LPOR method. If we call the BI_PERSISTENT~FIND_BY_LPOR method first and then the BI_PERSISTENT~LPOR method, the BI_PERSISTENT~LPOR method must return the same value as was previously used to call the BI_PERSISTENT~FIND_BY_LPOR method.

There are also several ways of implementing this method in this case. There is an implementation example in the CL_SWF_FORMABSENC demo class.

18.BI_PERSISTENT~REFRESH Method:

SAP WebFlow Engine calls the BI_PERSISTENT~REFRESH method when the system has to ensure that all values of an object are valid or that they agree exactly with the persistent display of the object.

Features:

The method implementation depends on the internal organization of the class. We can check the object instance data in the database, if necessary.

If we do not need the method in our class, then we need only to carry out a “dummy” implementation (without further coding) to avoid program errors when the system calls the method.

How To Call Workflow From Abap Program Sap Modules

There is an implementation example in the CL_SWF_FORMABSENC demo class.

Comments are closed.