Skip to Content

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:

 

REPORT  ZTEST_GP_PROCESS.

DATA: CO_OBJ1 TYPE REF TO ZV1CO_GPPROCESS_PROCESS1_0_2 .

TRY.

    CREATE OBJECT CO_OBJ1.

  •     EXPORTING

  •        LOGICAL_PORT_NAME = ‘ZV1CO_GPPROCESS_PROCESS1_0_2’.

  CATCH CX_AI_SYSTEM_FAULT .

ENDTRY.

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.

TRY.

    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

      EXPORTING

        INPUT  = INPUT

      IMPORTING

        OUTPUT = OUTPUT.

    WRITE OUTPUT-Response.

  CATCH CX_AI_SYSTEM_FAULT INTO go_sys_exception.

    exception_msg = go_sys_exception->get_text( ).

    write exception_msg.

  CATCH CX_AI_APPLICATION_FAULT .

ENDTRY.

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

!https://weblogs.sdn.sap.com/weblogs/images/251700216/image5_9350.gif|height=270|alt=|width=574|src=https://weblogs.sdn.sap.com/weblogs/images/251700216/image5_9350.gif|border=0!</body>

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

  1. Ginger Gatling
    Hello Velu,
    This is great – I had no idea how to do this – I will give it a try – thanks for pointing me in the right way!
    Best regards
    Ginger
    (0) 
  2. suresh A
    Hi Velu,

    We have a requirement where we need to trigger a process from WebDynpro ABAP application. I have two things to mention here.

    1.We are on C.E 7.0 SP14. You have mentioned this for C.E 7.1. Can I still use this to trigger process?

    2.I need to pass some values from my ABAP application also to the process. Is that possible?

    Thank You,
    Suresh.

    (0) 
    1. Bv Pillai Post author
      Hi Suresh,

      There is no CE7.0 SP14.  CE 7.0 with SP06 is latest. You have mistakenly mentioned. It should be NW7.0 SP14. You can still trigger the process from NW7.0 SP14 system also pass the values to your GP parameters from ABAP WD.

      Regards,
      Velu

      (0) 
      1. suresh A
        Velu,

        Sorry about that. Its NW7.0 SP14.

        Could you please let me know how the parameters can be passed. I have around 15 parameters to be passed from ABAP application to the first CO in my Process. Some of the parameters are Texts, with more than 255 characters.

        Thank You,
        Suresh.

        (0) 
        1. Bv Pillai Post author
          Suresh,

          You have ‘INPUT_PARAMETERS’ deep structure for the proxy generated class(from GP Process WSDL). You can fill in all your input parameters value thru this deep structure and then start the GP process from ABAP.

          Regards,
          Velu

          (0) 
  3. suresh A
    Hi Velu,

    Is there any way where we can send some attachments, to the attachemnts tab available on Actions, using this technique?

    I couldn’t find any option but Iam just wondering if there is any way.

    Thank You,
    Suresh.

    (0) 
  4. Tejaswini Chafekar
    Hi Velu,

    I have created one test process and followed the steps that you have mentioned to instantiate the process from ABAP system. I was able to instantiate a process.

    Now I have created an actual process with aorund 15 input parameters and generated a proxy. But, when I try to instantiate the process, Iam geting the following error.
    SOAP:1.026 SRT: HTTP-Code 500: (“Internal Server Error”).

    Any idea why is this happening?

    Please suggest!!

    Thanks,
    Runal

    (0) 
    1. Bv Pillai Post author
      Hi Runal,

      Please check your logical port/GP WSDL. Test the generated RFC destination in SM59. Check the trace in SOAMANAGER.

      Regards,
      Velu

      (0) 
  5. Tejaswini Chafekar
    Hi Velu,

    I created one proxy class for my test process version 10.
    But now when i have to make some changes, it again saves the process with version 11.

    Now the class existing for version 10, doesnt get updated with the latest changes.

    Do we need to delete and create one new proxy class, everytime when we make any changes in the process?
    Also do we need to change the code everytime for instantiating the process?

    Thanks,
    Runal

    (0) 
  6. Tejaswini Chafekar
    Hi Velu,

    Your blog helped us a lot, to understand GP. Thanks!

    I have one question,
    Can we have Lotus Notes instead of Portal’s UWL to show up actions on instantiation?
    Is this integration possible?

    Thanks,
    Runal

    (0) 
  7. Gabriel Alberto Pérez García
    Hi Velu,

    I created the class, port and program followed the steps that you mentioned. But when you run this program ends with the following error.

    SOAP:1,007 SRT: Unsupported xstream found: (“HTTP Code 200  : OK”).

    Any idea why this happens?

    Please suggest!

    Thank you.

    Will have a document for possible errors of this kind?

    (0) 
  8. Mikulas Kankula
    Hi Velu,

    I have problem get the return parameters and state of GP process to ABAP. The StartProcess method working fine, process is started. After I finish the GP process, I would like to determine the return parameters and state of this finished process. I try call methods GetProcessInfo to receive process state, and GetProcessResult to receive process return parameters, but return structures is empty (Guid is used as input paramaters). Can you help me , pls ?

    Thanks,

    Nicholas

    (0) 
  9. Devisha Bhavik
    Hi Velu,

    This is really a nice weblog to start with.

    We have developed proxy classses for our GP processes and those are being used as well.

    But now, we have a change in the GP porcess and becuase of that some of the input parameters and roles are also got changed.

    At this time, process version got changed from 0.20 to 0.22.

    IN this case, how can we regenarate the proxy?

    It gives error to me whenever i try to regenarate.

    I have tried altering the WSDL file and it worked fine to atleast update the proxy classes.

    But now, it is not allowing to make changes in the Logical port in the SOAMANAGER.

    I have to update the process version in SOAMANAGER under transport settings.

    I am getting error saying:      SRT Framework exception: Preconfiguration is invalid

    can you please let me know how I can solve this issue.

    (0) 

Leave a Reply