Event is passing incorrect object key

Question: Dear Workflow guru's,
I have created a new event for object type LIKP (using subtype ZLIKP and delegation). The event should be raised when a field VBUK_WBSTK_NEW is changed in the outbound delivery. I am then using the event in a "wait for event" step in my workflow.
Upon testing, the workflow reached the wait for event step, but when field VBUK-WBSTK was changed the workflow does not move on. I checked the event instance linkage table and event linkage and the object instance is in the table. I then ran an event trace to see if the event was being raised when field VBUK-WBSTK was being changed in the application. When doing my event trace, I found that the envet was being raised, but the event was passing the incorrect object key. The key for LIKP is delivery number and in this instance my delivery number is 0080001242. However, when I change field VBUK_WBSTK_NEW for delivery 0080001242, the event trace shows the object key as 0001242.

I believe this is why my wait for event step never terminates. Does anyone no why the event is returning the incorrect object instatnce key? Any ideas how to fix this?


sandmann

Answer:
How are you raising the event? maybe the mistake is there if you are not biulding the object key properly.
_________________
------------------------------------
Two wrongs can't make a right,
it usually takes three or more.
------------------------------------
Hasta la victoria, Siempre.

Answer:
I am raising the event using change documents. When a change is made to VBUK-WBSTK and the new value = 'C', the event is raised. In the case of a wait event, there is no binding per se. An entry is made in the event instance linkage table (Transaction code SWEINST) when there is a step that requires it (a wait for event step or a step with a terminating event). The entry into the table is made with buisness object type, event, receiver type, object key, and receiver ID. My understanding of event instance linkages is that when an event is raised that has the same object key as an entry in the event instance linkage table, something is done to the reciever type/ID. In this case the reciever type id is EVENTITEM, because the the table entry was made for a wait event step, and the reciever ID is the workitem ID of the wait event step. As far as I know, there is no binding.

My problem is that when the event is raised, the event contaner element _EVT_OBJKEY is being populated incorrectly. Therefore, it never matches the objectkey in the event instance linkage table which means nothing happens to the reciever ID (in this case the workitem for the wait for event step never terminates).

The strange thing is that this event is for business object LIKP (outbound delivery). The key for business object LIKP is LIKP-VBELN (delivery number). VBELN is 10 characters in length, but my event is popualting the _EVT_OBJKEY with a value that is only 7 characters in length. Instead of being populated with a value like '0080001234' it is being populated with a value of '0001234'. It's like the ABAP code (I believe it is a function module) is truncating the first 3 characters of the delivery number.

sandmann

Answer:
Hi,

This sounds like an incompatibility issue with the object keys.

As a matter of interest, what entry have you got in SWEC to raise the event for your change document?

Regards,

Tim

Answer:
Just an FYI for future reference.

I created an OSS message for this issue with SAP. I made the change in SWED as per thier solution and it corrected my problem. Here is SAP's response:

Please understand that this is more consulting in the
no-where-land between workflow and application, especially
because the corresponding SWEC and SWED entries do not exist in
SAP standard.

Nevertheless here are some tips&tricks.

I believe that the behaviour can be controlled by the flag
"client dependent" in transaction SWED for the entry
LIEFRUNG LIKP. This flag musn't be set.


Another approach would be implementing a function module

FUNCTION Z_SWE_TEMPLATE_OBJECT_KEY_ADOPT.
*"
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(CHANGEDOCUMENT_HEADER) LIKE CDHDR
*" STRUCTURE CDHDR
*" VALUE(OBJECTTYPE) LIKE SWOTOBJID-OBJTYPE
*" VALUE(OBJECTKEY) LIKE SWOTOBJID-OBJKEY
*" EXPORTING
*" VALUE(OBJECTKEY) LIKE SWOTOBJID-OBJKEY
*" TABLES
*" CHANGEDOCUMENT_POSITION STRUCTURE CDPOS
*"

CONCATENATE '008' OBJECTKEY INTO OBJECTKEY.

ENDFUNCTION.

and enter it in the most right column of SWED for the entry
LIEFRUNG LIKP. But this only works if you know that the
key always starts with '008'.

Kind regards
Peter
(Workflow Development Support)

Regards
Peter Amrhein
(Workflow Development Support)

Answer:
HI

I am face similar problem. I want to trigger event for BUS2101 when change doc created with QINF change object.

I found similar fm QLWF_BUS2101_OBJECT_KEY and update this into SWED trans.

Event is created when change using QI02. but Event trace show receiver not found.

why it so any help!!!
Copyright ?2007 - 2008 www.jt77.com