In this blog, I will be describing about how to trigger the GP Process from an ABAP system. Here is the scenario. You need to start the GP Process after the ABAP background (batch) program is over.
SAP has provided the GP Process Discovery service (WSIL), which will give you the list of process available in Guided Procedure design time with their generated version and WSDL location.
Step 1: Identify the GP Process in the WSIL
You can use
to find out the WSDL location of the GP Process. After identifying the GP process from the WSIL, select the WSDL location, which will be used for creating the web service client. The GP execute process WSDL will consists of all mandatory built-in roles (Administrator, Owner and Overseer) and user-defined roles available for the process and it also has the following operations:
GetProcessResult – gives information about the process status & finish time
StartProcess – Starts the GP process instance template
Step 2: Creating a consumer proxy in the ABAP System
Next step will be creating the consumer proxy for the web service client in ABAP. Login to your ABAP system and launch transaction SE80. From the repository browser select the ‘Proxy Object’ under Enterprise Service option. Now create the ‘Service Consumer’ proxy for the GP WSDL. As an end result, now the ABAP proxy class and the relevant proxy structures are created in the system.
Step 3: Creating a ABAP Web Service Client Program* *
Now create the ABAP web service client program using the generated the proxy class as shown below:
DATA: CO_OBJ1 TYPE REF TO ZV1CO_GPPROCESS_PROCESS1_0_2 .
CREATE OBJECT CO_OBJ1.
LOGICAL_PORT_NAME = ‘ZV1CO_GPPROCESS_PROCESS1_0_2’.
CATCH CX_AI_SYSTEM_FAULT .
data: OUTPUT type ZV1START_PROCESS_OUT_DOC,
INPUT type ZV1START_PROCESS_IN_DOC,
StartRoles type ZVPSTART_PROCESS_IN_DOC_ROLES,
Action10Role type ZV1START_PROCESS_IN_DOC_ACTION,
userList type ZVPUSER_LIST,
userInRole type ZVPSTRING_TAB,
userstring like line of userInRole,
go_sys_exception type ref to CX_AI_SYSTEM_FAULT,
exception_msg type string.
INPUT-UDName = ‘ABAPInvoked’.
INPUT-UDDescription = ‘This GP was invoked by ABAP’.
INPUT-CallBack_URL = ‘http://callback.local‘.
userstring = ‘Administrator’.
Append userstring to userInRole.
userList-USER = userInRole.
Action10Role-USERS = userList.
StartRoles-Action_10 = Action10Role.
INPUT-Roles = StartRoles.
CALL METHOD co_obj1->Start_Process
INPUT = INPUT
OUTPUT = OUTPUT.
CATCH CX_AI_SYSTEM_FAULT INTO go_sys_exception.
exception_msg = go_sys_exception->get_text( ).
CATCH CX_AI_APPLICATION_FAULT .
Note: The above source code is sample for my GP process. Change the source code based on your GP Process WSDL.
Step 4: Create the logical port using either SOAMANGER or LPCONFIG transaction</p><p>Since my ABAP backend is AS 7.0 SP14, I have used SOAMANAGER to create the logical port. Launch SOAMANGER and specify the generated consumer proxy as shown below:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251700216/image1_9350.jpg|height=233|alt=|width=576|src=https://weblogs.sdn.sap.com/weblogs/images/251700216/image1_9350.jpg|border=0!</p><p>Click on ‘Apply Selection’ to create the logical port by specifying the name and WSDL location. System will create the logical port with the default information from the WSDL. Click on the transport bindings</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251700216/image2_9350.gif|height=264|alt=|width=552|src=https://weblogs.sdn.sap.com/weblogs/images/251700216/image2_9350.gif|border=0!</p><p>Add the process instance id & process information query strings (? style=document& pid=<gp_process_id_value>&pver=<gp_process_version) as part of the default transport binding path prefix. By saving the entries in SOAMANAGER will automatically create a RFC destination of type G in SM59 with GUID like below:</p><p>!https://weblogs.sdn.sap.com/weblogs/images/251700216/image3_9350.jpg|height=130|alt=|width=559|src=https://weblogs.sdn.sap.com/weblogs/images/251700216/image3_9350.jpg|border=0!</p><p>Step 5: Execute the Client Program
As a last step, now we can execute the web service client program and verify the GP process triggered in the CE 7.1 portal (GP Runtime Work Center) as shown below:
ABAP report output with the response process instance GUID for the started GP process
Triggered GP process in CE 7.1 portal