cancel
Showing results for 
Search instead for 
Did you mean: 

Check if work item already exists(SAP-Inbox).

Former Member
0 Kudos

i have a report which is scheduled in batch-hourly basis may be.

Let's say it is executed 1st time.

BO-Event is triggered from report which in turn triggers workflow and subsequently Work item is sent to the user.

User need to execute the work item.

now when the job is executed again-another hour may be. I want to check if work item is still pending(READY STATE) in his inbox.

If yes then i don't want to trigger work item again and sent to his inbox.

I am thinking to use CHECK FUNCTION MODULE (Event type linkage) to validate this check.

Issue i am facing:

I can see there is a table SWWWIHEAD - which contains work items and their status.

But i  want to check (if work item with same container data is already present in his inbox) or work item with diff data is present in his inbox.

In short, i want to read READY-work item container data.

I can't find work item container data in tables:SWW_CONT,SWW_CONTOB.

Accepted Solutions (0)

Answers (4)

Answers (4)

egor_malov
Contributor
0 Kudos

Hi,

As I get it, you are trying to avoid creating duplicate workflow instances for some BOR instance. There is a great blog post about it:

"A grown-up Singleton concept for Workflow instances (3 step approach)"

by Florin Wach 

http://scn.sap.com/community/bpm/business-workflow/blog/2013/05/05/the-super-singleton-concept-for-w...

Former Member
0 Kudos

I have used check function module.Based on certain conditons, i am triggering exception in check function module.-I don't want to trigger workflow.

But the issue is when raising exception in check FM . Program is getting timeout.

what could be the reason. Please advice.

Do i need to pass some value in export parameter of FM-RESULT- so that workflow do not trigger.

former_member185167
Active Contributor
0 Kudos

Hello,

"BO-Event is triggered from report which in turn triggers workflow"

A better approach would be to have the event created whenever the necessary condition (e.g. creation of a PO) occurs. Then you wouldn't have to do what you're trying to do now.

regards

Rick

Former Member
0 Kudos

Hi,

Use function module SAP_WAPI_READ_CONTAINER to read the container values for the user decison work item.

Regards

Ibraihm

Former Member
0 Kudos

Use function module SAP_WAPI_READ_CONTAINER to read the container values for the user decison work item.

It is not a user decision work item- it is 'ACTIVITY' Work item.

Former Member
0 Kudos

I meant the step which sends a workitem to the user inbox. you can use SAP_WAPI_READ_CONTAINER for activity work item too.

Regards

Ibrahim

Former Member
0 Kudos

Ibrahim,

thanks for the information.

I will be using this logic to check whether work item already exist in user's inbox or not.

One thing, please shed some light.

When i am using event to trigger workflow and passing event container elements to workflow container( Binding).

Variables values when passed in element container are different and when seen in Check Function module are little different.

For example:

when passed in event container while triggering event.

And when in debugging mode checkFM , event container is seen:

The same variable is concatenated with some numeric string.

What could be the reason. Due to this values of variables are truncated.

former_member185167
Active Contributor
0 Kudos

Hello,

"What could be the reason. Due to this values of variables are truncated."

What values are showing in the actual workflow container?

"20" could indicate a space, is that a possibility?

regards

Rick Bakker