cancel
Showing results for 
Search instead for 
Did you mean: 

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

akshay_rp
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

akshay_rp
Explorer
0 Kudos

Solved my self , This was due binding was not done on Task level (each task where WF log entry required ) WF to local task binding.

former_member763681
Discoverer
0 Kudos

Hi Akshay

I am also facing the same issue , when my workflow is triggering from class , then data in SWW_WI2OBJ - instance id is storing in guid , how to change this value to object key ?

please help.

petrsourek
Explorer
0 Kudos

Hello,

Any update to this problem? I have the same issue, but only sometimes. I had managed to ask customer for making OSS message, but I think that OSS will respond something like SAP_WAPI has not been released for customer coding, I guess I will have to find another solution to it (not first case).

The problem is, that in some cases, SAP doesn’t insert record into table SWW_WI2OBJ, and then SAP_WAPI... FM doesn’t see the object.

I was thinking of simple report searching and regenerating the missing records, e.g. from table SWWWIHEAD, but I dont know if I can just generate GUID by myself or if the table GUID has links to other parts of system...

Thanks,
Regards,

Petr Šourek

anjan_paul
Active Contributor
0 Kudos

Hi,

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

Thanks

akshay_rp
Explorer
0 Kudos

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 ?


StephaneBailleu
Active Contributor
0 Kudos

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

akshay_rp
Explorer
0 Kudos

Hi ,

eid is already defined as key attribute for class .

Thanks

Akshay