cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger a event when WBS gets changed in Cj02

Former Member
0 Kudos

Hello,

I have a requirement where I need to send create an idoc and send the idoc to external system when WBS is created or changed.  Currently, I have the following setup:

   - I have created a YBUS2054 as a subtype of BUS2054 using SWO1

   - YBUS2054 has been delegated to BUS2054

   - created an CHANGED event in the YBUS2054. This event is implemented and then released

   - created a type linkage (object type=YBUS2054, event=CHANGED, receiver type null, and receiver function module = zz_create_wbs_idoc) using SWETYPV. This function is supposed to create an idoc when CHANGED event occurs. I just don't know how to trigger the event to occur.

   - all the port, define idoc type, logical system, and etc are setup
   - when I try to create an entry in "Event for Chagne Document" using SWEC with change doc object=PROJ, business object type = YBUS2054, with on change, I get "Key for change doc object PROJ and business object type YBUS2054 are incompatible".

I tried various configurations, and I was not successfully in creating an event on CHANGED

can you please advise what I am missing in getting the changed event to trigger?

Thank you in advance,

Shawn

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186746
Active Contributor
0 Kudos

Hi,

If the change doc doesnt exist, check if you can create an event using BSVW.

Also use the event log to see if there are other sap standard events happening.

I checked the package belonging to CJ02 to see if there is something useable, but didn't find anything: CN_PSP_OPR

If there are no sap standard ways to get an event, you'll have to find a badi/enhancement spot and include some coding to start the event using fm SAP_WAPI_CREATE_EVENT.

Kind regards, Rob Dielemans

Former Member
0 Kudos

Hi,

I believe there is a change document becaus when I did CJ02 and changed wbs description, it created an entry in CDHDR and CDPOS with PROJ object class.  Consquently, I went BSVW and created the following:

StatusOT = PRN, BusinessOT=YBUS2054, Event=CHANGED, and nothing happens. I don't know what I am missing.

Your help is greatly appreciated.

Shawn

former_member186746
Active Contributor
0 Kudos

Hi, I don't know which tables are involved with WBS maintenance, but check transaction SWED to see wich change doc exists for this functionality, I can see that a PROJS also exists.

Kind regards, Rob Dielemans

Former Member
0 Kudos

WBS is in PRPS table, and yes, there is PROJ and PROJS in SWED. I believe WBS change in within PROJ change doc object, I say that because, WBS changes in CDHDR and CDPOS are in PROJ objectclass

Thanks,

Shawn

Former Member
0 Kudos

Are there any workflow (event) guru who can help on this?

Thanks,

Shawn

ronen_weisz
Active Contributor
0 Kudos

You need an object with the same key as the change document table in SWED, create one and if the key are the same you will be able to link it in SWEC.

Another option is to leave the object black an use a function module to process the change documents in SWEC - when you create a new line in SWEC you can see there is a place to enter a function module to process the change documents (in theory you can call the IDOC directly from there - you don't even need to process the event)

Former Member
0 Kudos

Hi Ronen,

I am not sure if I follow what you mean. Here is I found: When I change the WBS, the chagnes are captured in CDHDR with PROJ object class. In SWEC, I tried to create an entry with PROJ with YBUS2054 Business Obj.Type, and with CHANGED event. It gave me a warning about "...imcompatible...".

With reference to SWED, there is an entry  PROJ/PROJ/PROJ in Change doc.object/Leading table in change document/change document key with structure columns, respectively with create/change/delete all checked. Can you be kind enough to list what is needed for it to work please?

Thank you,

anjan_paul
Active Contributor
0 Kudos

Hi ,

  share your screenshot,  it is always better to use BUS2054 instaead of YBUS2054 if you already delegated

Former Member
0 Kudos

Hi Anjan,

YBUS2054 has been delegated to BUS2054. I tried BUS2054 within SWEC, and still get the
"Key for change doc.object PROJ and business object type BUS2054 are incompatible" message.

Thanks,

ronen_weisz
Active Contributor
0 Kudos

I have been thinking about creating a documents for this so:

Former Member
0 Kudos

Hi Ronen,

do I make copy of BUS2054 into YBUS2054 and create a PROJ-PSPNR as an additional key and not make YBUS2054 as subtype of BUS2054?  Because I can't create the additional key if I create YBUS2054 as sub-type.

Thanks,

ronen_weisz
Active Contributor
0 Kudos

This should not be a sub-type of BUS2054 since the key is not the same, the only use of this object is to give you a starting point and enable event creation. once you have an event use a function module as receiver and in the FM raise an event for the standard object.

Former Member
0 Kudos

Thanks, Ronen. Please allow me to experiement on this, and see what kind of barrier I get into. Thanks,