cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Container element not been populated

03-14-2008 8:49 PM
former_member852447 Active Participant
1624 views 9 comments
0 Likes
SAP Managed Tags
Subscribe

Hello Workflow colleagues,

I am starting a workflow from an event CREATED using business object BUS2096. I need to do agent assignment to a group so I have created a role with customized code which will find the agents assigned. The issue is that to work my function module requires an IDOC number. The event CREATED is triggered by an incoming IDOC. When I debug the customized function module the IDOC number is not being passed so I cannot find the agents to which the workflow must be sent.

I set up the element IDOC in the workflow container but in the triggering event bindings I do not have an option to bind it as I require my sales document to be &_EVT_OBJECT&.

I recently solved another triggering issue by binding PRIORITY to ‘1’ which solved the express message failure so I was wondering if I could bind the IDOC in a similar way but it has to be dynamic so it cannot be hardcoded.

I hope I have described the issue clearly but if not please not ask for more details

David.S.Dittmer

0 Likes

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member852447
Active Participant
0 Likes

Hello,

In the check FM I will try and get the IDOC # from table EDIDC. Hopefully the IDOC will already have posted into the table at this point in the workflow. The IDOC # I will populate into the container of the Fm SWE_EVENT_CREATE and hopefully this will flow through to the rule container where another FM can search the IDOC for the organizational unit. The aim of this exercise is to get the IDOC # into the rule container as it is not been passed by the event.

former_member852447
Active Participant
0 Likes

hello jai,

I am now coding in this change but have a question. You mention that I have to get the IDOC No from a table before I can enter the parameters for FM SWE_EVENT_CREATE. This raises 2 question

1. Will the iDOC be populated in a table at this stage.

2 What table since I do not have an IDOC # most of these tables requie an IDOC # as a select.

Sure if I can get past this point the rest will flow

Thanks

Former Member
0 Likes

1. Will the iDOC be populated in a table at this stage.

I guess so like you said earlier that you are able to IDoc when event got created and you know when we are in check fm of standard event then event has been created.

2 What table since I do not have an IDOC # most of these tables requie an IDOC # as a select.

For that you may want to see the area menu WEDI, I dont remember the table for Idoc right now, try to find out by running SQL trace using ST05 for that.

Cheers

Jai

Former Member
0 Likes

Hi David,

Well the Idocs basic types are stored in table EDBAS .

Moreover have you tried the event triggering by FM 'SAP_WAPI_CREATE_EVENT - to trigger the z or Sap events in business objects?

Regards,

Ribhu

Former Member
0 Likes

Ribhu/David,

If you are using SAP_WAPI_CREATE_EVENT make sure about COMMIT_WORK in import parameter of this FM.

You dont want to do commit_work in Check FM. pass space in stead of X then.

Cheers

Jai

former_member852447
Active Participant
0 Likes

Hello Jai,

This sounds like a great solution. Let me code it and I will give you 100% points once I get it to work but even if there are issues I will give you points in any case.

Thanks

former_member852447
Active Participant
0 Likes

Hello Jai,

This sounds like a way to go. However just a few questions:

1. New created event ZCREATE would need to be linked to a business object, right so would I need to create a new business object as a sub-type of BUS2096.

2.At the moment I am using FM SWW_WI_CREATE_VIA_EVENT in SWE2....would I stop using this and create a check FM and in the check FM add FM SWE_EVENT_CREATE

Thanks

Former Member
0 Likes

1. New created event ZCREATE would need to be linked to a business object, right so would I need to create a new business object as a sub-type of BUS2096.

Yes you have to create one custom subtype start with Z and delegate your BUS2096 to your z one.

2.At the moment I am using FM SWW_WI_CREATE_VIA_EVENT in SWE2....would I stop using this and create a check FM and in the check FM add FM SWE_EVENT_CREATE

well I think that FM SWW_WI_CREATE_VIA_EVENT is receiver FM not check FM. so you gotta create check FM starting with Z then get the IDocNo from tables and then populate SWE_EVENT_CREATE FM's event_container table with IdocNo. you can see sample coding for check fm in this forum (write down check fm and search forum).

Check FM is lies between your event and receiver type (your workflow template in this case) , this function if raises an exception workflow wont trigger (so you can raise your own exception too)

I think that you are familiar with workflow settings and all.

Hope that it will solve your issue 100%, If yes then I deserves points.

Let me know for additional info.

Cheers

Jai

Former Member
0 Likes

David,

If I understood your problem correctly then I think that you wants to provide IDOC No. to workflow in triggering event.

I think that this solution would work for you.

Create one more custom event say zcreated and also create one parameter in that event say IdocNo.

Now do one thing dont link directly workflow with created event but link with zcreated. Now created is standard event and will automatically trigger by sap, then you gotta create one check FM (go to SWETYPV or SWE2 for check FM) then inside this check fm use FM SWE_EVENT_CREATE to create your zcreated event, you have to find out the specific IdocNo in populate the event parameter IdocNo with that Idoc.

I think it will solve your problem.

Reward points if you think that solution is working.

If we are not on same page then provide some more info.

Cheers

Jai