cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Workflow Event Parameter Mapping Instance

Former Member
0 Kudos

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'.
  ENDMETHOD.
    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.
      TRY.
          CREATE OBJECT ls_instance-object
            EXPORTING
              im_equipment = lv_equnr.
        CATCH cx_bo_error.
          EXIT.
      ENDTRY.
      result ?= ls_instance-object.
      APPEND ls_instance TO mt_instance.
    ENDIF.
  METHOD bi_persistent~lpor.
    result = m_lpor.
  ENDMETHOD.
View Entire Topic
bpawanchand
Active Contributor

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

Former Member
0 Kudos

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

bpawanchand
Active Contributor
0 Kudos

Hi

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

Thanks,

Pavan