Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

MM06E005 - BUS2012 changed event not triggered on custom fields changed

rudi_aubermann2
Explorer
0 Kudos
452

Hi folks,

I have implemented MM06E005 enhancement and added some custom fields to Purchase Order item tab. Everything works fine so far, but now I have the requirement to run some ABAP-code after the PO is manually changed (e.g. in Transaction ME22n). Problem: This code must run after the changes are written to the database, so I cant call it within the exits provided in the enhancement MM06E005! My approach ist to use the CHANGED-event of BUS2012, which is triggered at any changes made on a PO.

On first sight, this works fine, but I have noticed that if I call TX ME22N and change only values of my custom fileds, the CHANGED-event is not triggered. If I make changes on SAP-standard fields, everything works fine.

I just wonder if there is a way within the Enhancement ME06E005 to indicate that the PO has been changed, even if only Z-FIelds (in my case in Include CI_EKPODB) have been modified and therefore ensure that Change-event of BUS2012 is triggered?

Thank you.

Edited by: Rudi Aubermann on Sep 5, 2009 3:54 PM

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
174

Did you use function module EXIT_SAPMM06E_018, and made it return E_CI_UPDATE = 'X' when a custom field is changed ? This is to inform SAP that an item custom field was changed.

Edited by: Sandra Rossi on Sep 5, 2009 7:15 PM (added : "when a custom field is changed")

10 REPLIES 10

Sandra_Rossi
Active Contributor
0 Kudos
175

Did you use function module EXIT_SAPMM06E_018, and made it return E_CI_UPDATE = 'X' when a custom field is changed ? This is to inform SAP that an item custom field was changed.

Edited by: Sandra Rossi on Sep 5, 2009 7:15 PM (added : "when a custom field is changed")

0 Kudos
174

Yes, E_CI_UPDATE is populated in EXIT_SAPMM06E_018, but no effect.

0 Kudos
174

So... You may trigger it by yourself : in EXIT_SAPMM06E_013, call SWE_EVENT_CREATE, but make sure to call it only when SAP does not do it (I don't know how )

0 Kudos
174

Thanks for your replies. Yes, EXIT_SAPMM06E_013 might be a possibility, but it would need a lot of coding to trigger the event only in case that the Z-fields (_and no others_) have been modified.

0 Kudos
174

Hi Rudi,

The data elements that you have used for teh fields are standard ones or custom data elements, if they are custom data elements try and check the change documsnt check box and try.

Regards,

Himanshu

0 Kudos
174

Hi Himanshu,

this one took the cookie!!!

Your were right, my Z-fields are all custom data types, and checking the "Change document" box in the datatype definitions was the solution. Now BUS2012-Changed event is triggered as expected - and I am happy

Thank you very much for your time, also thanks to Sandra and Shailaja!

Rudi

0 Kudos
174

Bravo Himanshu : I could never imagine there could be a relationship between change document and workflow event technologies!

0 Kudos
174

Well Sandra,

Perhaps there is because event linkage is also done for change documents basically change document is one way to trigger a event for a business object (see transaction SWEC) . So when a change document is registered for a field that triggers an event where the linkege is there. I suppose that was what was happening and good that finally we were able to help in our small ways to get it going

Regards,

Himanshu

0 Kudos
174

Nice, I didn't know that. Thx for sharing! (if I could give you points, I would do it )

former_member262988
Active Contributor
0 Kudos
174

Hi,

Do one thing.....under function group .....XM06 create a z include under pai of the screen .....and declare a flag and update the flag checking for the tocde whether its 'ME22N' or 'ME23N' and use this flag value.....by abap memory concept ...import export....

Thanks,

Shailaja Ainala.