cancel
Showing results for 
Search instead for 
Did you mean: 

How to find ObjectKey for the workflow, or Task for a ObjectKey

Former Member
0 Kudos

Hi,

I am developing a custom workflow for a customer request,

I need to apply a condition like, If there is a open workflow request for this customer, then it should not start another workflow.

how do I do that ?

I tried to look into SWi6, it gives results till I keep the Object key Blank, if I use this with the object key then it gives no result.

I have also tried function module SAP_WAPI_WORKITEMS_TO_OBJECT, but still no success.

I have developed my own Business object for this with key fields.

thanks

Siddharth

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Try with this FM --> SWN_UWL_GET_WORKLIST

Here, you can get your workitems with status READY, SELECTED or STARTED and also validate which tasks.

Regards,

Former Member
0 Kudos

it seems the Business object is not getting instantiated in your workflow design. Please create a Task that executes GENERICINSTANTIATE Method of Business Object SYSTEM and instanciate your Business object in the workflow design. Once this task is executed you will get an entry in the respective table.

Thanks

Arghadip

former_member190818
Active Contributor
0 Kudos

Hi,

You can check in the table SWW_WI2OBJ, whether for the key and business object, there is workflow exist or not.

Get the last workitem based on the timestamp and pass that work item in SWWWIHEAD and get the top work item.

Now check whether the status is COMPLETED or INPROCESS or READY, based on which you can trigger or not.

Regards,

JMB

Former Member
0 Kudos

HI JMB,

thanks for the reply,

i have checked table SWW_WI2OBJ, i can see only one entry, which is nowhere related to my object key for which i have started around 4 workflows.

thanks

siddharth

former_member190818
Active Contributor
0 Kudos

Hi,

I hope you should be having details of object key and business object in that table. Pass BO to TYPEID field and check pls.

I've used this table for many scenarios like this.

Regards,

JMB

Former Member
0 Kudos

Hi JMB,

This table contains no entry for my BO :(.

also this contans only one entry, although I have around 8-9 active workflow at this time.

thanks

siddharth

Former Member
0 Kudos

Hi,

What was the result when you executed the function module SAP_WAPI_WORKITEMS_TO_OBJECT ?

Check if you have specified the correct length while giving the object key value.

Kind Regards,

Swarna.

Former Member
0 Kudos

Hi,

create a attribute in that BO and that attribute will chk if there is any active workflow instance running for that BO key.

set up a start condition for that attribute.Use Tcode SWB_COND to set start condition for your WF.

Former Member
0 Kudos

Hi Naresh,

what should be the type of this attribute, is there any function module i can use to check the existing workflow.

thanks

siddharth