Skip to Content

SAP Workflow Event Parameter Mapping Instance

Aug 07, 2017 at 08:25 AM


avatar image

Hi Experts, I have created a workflow(Class Based). Below are details of the workflow

Class -

- Interface IF_WORKFLOW added and implemented LOPR and FIND_BY_LOPR

- One Event created with a parameter EQUNR

Workflow -

- New Event is mapped with Workflow

When i trigger this event from SWUE workflow starts however Event parameter is not passed to the workflow and Event Object is always initial. I debugged this workflow putting infinite loop in the constructor and can see that the EQUNR value is always initial.

Can you help here?

Thanks, Pritam

  METHOD constructor.
    m_equipment = im_equipment.
    m_lpor-instid = m_equipment.
    m_lpor-typeid = '/XXXXX/CL_WF_EQUIPMENT'.
    m_lpor-catid  = 'CL'.
    MOVE lpor-instid TO lv_equnr.
    READ TABLE mt_instance WITH KEY equnr = lv_equnr INTO ls_instance.
    IF sy-subrc IS NOT INITIAL.
      ls_instance-equnr = lv_equnr.
          CREATE OBJECT ls_instance-object
              im_equipment = lv_equnr.
        CATCH cx_bo_error.
      result ?= ls_instance-object.
      APPEND ls_instance TO mt_instance.
  METHOD bi_persistent~lpor.
    result = m_lpor.
wf1.jpg (27.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Pavan Bhamidipati Aug 07, 2017 at 12:31 PM

Hi Pritam,

I am talking about the object key but not about the event parameters. As the event parameters can be optional as well as mandatory. LPOR basically is a structure which is a combination of the Instance ID, Class name and BOR Type. LPOR will be filled by the instance or event when the event is created. So the main point over here is about the object key which helps to instantiate the workflow by the system. Make sure you pass the object key. The EQUNR or the equipment number must be the part of object key . Not as a part of event parameters. The instance of the business class must be the unique and this is identified by the system by passing the object key.

Thanks, Pavan

Show 2 Share
10 |10000 characters needed characters left characters exceeded

My event parameter is optional. Object Key is EQUNR. When i trigger event, i don't get option to put key attribute. I think there is something wrong here. Please see the screen attached.


wf2.jpg (65.8 kB)


I think you might have forgot to enable the key for the business class you created for the euqipment.Please find below



11.png (22.0 kB)
Mike Pokraka Aug 07, 2017 at 01:19 PM

Your binding looks a little weird. You are binding equipment twice and it looks like you are using the id as an event parameter. If equipment is the object, you don't need the equipment number as a parameter too.

You must also define the key attribute(s) of a business class in SE24 on the attributes tab - in your case equipment number. WF will then know to use it as your instance ID (LPOR-INSTID).

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Mike,

Issue was solved yesterday. You are rite, Key was not defined correctly that is why i was facing issue.

Thanks a lot.


Pavan Bhamidipati Aug 07, 2017 at 09:50 AM

Hi Pritam,

I hope when you are trying to create the event from SWUE I assume that you are forwarding the Object Key. Because the object key will be the INSTID of the business class. However, I would also recommend to create a test program and try to start workflow by creating an event by using the SAP_WAPI_CREATE_EVENT. For example, have a look at the below screen shot.


12.png (21.4 kB)
10 |10000 characters needed characters left characters exceeded
Pritam Kunal Aug 07, 2017 at 10:34 AM

Dear Pavan,

I forgot to mention that Event parament is passed correctly and i tried executing report program to trigger workflow as well.

One thing to remrmber here - Event parament is available in workflow however it doesn't create instance object. therefore any other task that is dependent on the instance of the class object fails.



10 |10000 characters needed characters left characters exceeded