Skip to Content

My Workflow Instance ID not generating entry in table sww_wi2obj via Class method call.

Hello Workflow Experts ,

System: S4 HANA.

When i am triggering Workflow via class event call with object ID which is Key attribute for Class and Constructor , Workflow is triggering but one entry should generate with instance ID (Object ID ) in table sww_wi2ob , i can see workflow log and workitem entries in table sww_wi2obj but Instance ID is blank.

When Is Use FM SAP_WAPI_WORKITEMS_TO_OBJECT to search logs for this INSTID i am not getting relevant filter as FM using table sww_wi2ob workflow logs.

Please let me know Any changes required in below method find_by_lpor or lpor or constructor ?

Below is code part for Workflow enabled class method :

find_by_lpor

DATA: lv_lpor TYPE zid.

MOVE lpor-instid(4) TO lv_lpor.

CREATE OBJECT result TYPE zcl_wf_process

EXPORTING iv_ie_eid = lv_lpor.

************************************************

method BI_PERSISTENT~LPOR.

result = me->gs_obj.

**********************************************

METHOD constructor.

DATA: lv_typeid TYPE sibftypeid.

lv_typeid = 'ZCL_WF_PROCESS'.

me->ie_eid = iv_id. " Constructure Parameter

me->gs_obj-catid = 'CL'.

me->gs_obj-typeid = lv_typeid .

me->gs_obj-instid = iv_id. " Constructure Parameter

*****************************************************************

When i am passing lv_lpor values as hard coded value eg: 1111 it is visible in table sww_wi2obj-instid but not if I pass this as variable at run time.

Still awaiting reply from Workflow Experts .

Appreciate on Quick help,

Thanks in Advance.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Aug 13, 2018 at 09:33 AM

    Hi

    I think you need to have defined an attribute as key attribute which would be the instance of your class

    Have you done it ?

    I hope this helps, tell me if it does or does not

    Cheers

    Stephane

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 20, 2018 at 08:09 AM

    Hi,

    Please check and share the code of SAP_WAPI_WORKITEMS_TO_OBJECT. Also share the screenshots of workflow containser.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

    • Below is input for FM SAP_WAPI_WORKITEMS_TO_OBJECT ,

      This FM will fatch data from table sww_wi2obj only , issue is table is storing data with blank Instance Number,

      If we give input without instance ID FM will show all wf Logs as FM output for the Object class input.

      As i Explain in main post Instance ID will store only when i am passing it as Constance in find_by_por method but not when i am passing it at run time via veritable, it is also triggering WF properly in both the case.

      I want to read my WF log based on Instance Object ID by Given FM but table not storing Instance number.

      Any one If you can check your WF is storing Instance ID in table , for Class based WF ?


      2.png (16.4 kB)
      1.png (11.2 kB)