cancel
Showing results for 
Search instead for 
Did you mean: 

Get the Workflow Item ID at PR Creation

sreenivas_pachva
Participant
0 Kudos

Hi Experts,

My Requirement is to get the Approvers list and their release codes when PR Creation.

Actually we are getting Workflow item ID from table: SWW_WI2OBJ

Or you can also get the workflow item ID by using function module: SAP_WAPI_WORKITEMS_TO_OBJECT by passing Object Key(PR number) and Object type ID (BUS2105).

In my  scenario i used updated function module in the implementation of PR badi : ME_REQ_POSTED get the Workflow Item ID and release code but I could not able to get the workflow item id.

My requirement is to get the approvers list and release codes in between pr creation..In my scenario the existing work flow is Custom one..

Please help me out from that issue.

Thanks

Sreenivas Pachva

Accepted Solutions (0)

Answers (2)

Answers (2)

sreenivas_pachva
Participant
0 Kudos

Thanks Edamana for your information,

I want to know at which level workflow item get generated while creating pr creation in MM, it means that is there any exits, badis or enhancement spots when WI ID get entry available in  table SWW_WI2OBJ ..

Thanks

Sreenivas

nabheetscn
Active Contributor
0 Kudos

Hi Srenivas

Can you please explain your requirement what are you trying to achieve..?

Nabheet

Former Member
0 Kudos

When the Event is raised and the event reciever captures the corresponding event,then the next step is executed--> the work item id is created.For example if we raise an event for which there is no reciever,then the workitem Id may not be genreated.

In the Header Tab of the Workflow / Version-Dependent(current Workflow Version) / Program exits..there are a couple of exits provided

IF_SWF_IFS_WF_CONSTRUCTOR Called When A Workflow Instance Is Created

IF_SWF_IFS_WORKITEM_EXIT Workflow Interfaces: Runtime Exit

IF_SWF_IFS_WF_DESTRUCTOR Called When a Workflow Instance Is Created

I believe the usage of the first one can provide you with the work item ID .

IF_SWF_IFS_WORKITEM_EXIT interface are executed when the corresponding event for the workflow work item occurs.--> also looks like a good candidate

Please try these options(I have not tried it yet).....

Also,In the forum,there is a related thread to finding the PR release stratergy.It suggests a function module ME_REL_GET_RESPONSIBLE and also a hint on whether approvers are available if the WF is not created : https://scn.sap.com/thread/2086801

Hope It Helps.....

Former Member
0 Kudos

I believe that when the event create for start of workflow is called,the return parameter does not return the workitem id because the actual wotkitem id number is created on the first step of the workflow.

If the BUS2105 is a custom workflow,We can write an update or modify statement using the parameter (_workitem -_workitemid) of the system container to update the respective table preferably in the first step of the workflow.

The net effect remains the same that when we are updating from th progam using the SWW_WI2OBJ Or SAP_WAPI_WORKITEMS_TO_OBJECT,we fetch the key fields of the table based on key of the workflow and in the other case we need to update the Z-table  from workflow using the table key.

You can try posting/moving the thread in the Workflow forum.Maybe they can provide a better solution.

Hope it helps.