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: 

Standard Table Update --> Trigger Event

Former Member
0 Kudos

Hi all,

I need to catch records being added/changed/deleted from a database table (a standard one).

The table is updated through a standard BAPI and no change document flag is set for any of the fields I'd like to monitor.

My original idea was to try to trigger an event on table changes and then catch it with a custom developed program, but with no change documents it seems it's not possible to proceed that way.

Is there any other way to do it?

Am I missing something?

Thanks a lot for any help.

Fra

8 REPLIES 8

ssimsekler
Active Contributor
0 Kudos

Hi Franco

Did you look for a user-exit or a BAdI? If one exists, you can implement it to track changes.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

manuel_bassani
Contributor
0 Kudos

Ciao Franco,

you could try to see if a business object exists (transaction SWO1) for your table (which table ?).

If the business object contains the events you require, you can use business workflow to catch them.

I hope that helps.

Cheers, Manuel Bassani

Former Member
0 Kudos

Hi Franco,

please check , it may help you.

Best regards,

Alvaro

Former Member
0 Kudos

Hi Franco,

Which table? Or is it a secret?

Which BAPI also? That may help provide an answer.

Brad

0 Kudos

Hi all,

Here are some more infos:

-- We are in APO 4.0.

-- table is /SAPAPO/MATMAP (product code mapping table).

-- BAPI I'm referring to is the "...SAVEMULTIPLE2" for Product Master Data (Business Object: BUS10001) - do not remember the exact name (anyway it's the savemultiple method for BUS10001).

-- No event available for BUS10001.

Serdar,

I'd like to try to avoid working on an user-exit/BAdI within the savemultiple BAPI, I didn't check them yet, I'll eventually try this way if anything else fails.

Manuel,

As stated above the "closest" object is BUS10001, anyway it contains no event for me to catch.

This'd have been my favourite way but it seems it cannot work. Any trick would be appreciated...

Alvaro,

checked the thread, lots of useful info especially on change documents but, unless I'm missing something, it seems I cannot have CDs created upon MATMAP table changes. Isn't it?

Brad,

no secrets, I didn't report table and BAPI names because I was trying to find a solution to the general problem.

"Is it possible to somehow have an event triggered on updates/changes to a standard table when no ChangeDocuments, or BusinessObjects' events are avilable?"

thank you all for the answers and support.

ciao

Fra

0 Kudos

<<

"Is it possible to somehow have an event triggered on updates/changes to a standard table when no ChangeDocuments, or BusinessObjects' events are available?"

>>

you can create a Z Subtype for the original business object type and delegate the original object to this new subtype. Add a new event say ChangeProduct to your new Business Object.

Further, you will have to find a user-exit or BADI in the application program ( Xn for changing product data ) to raise this event ChangeProduct( using macro swc_create_event / FM SWE_EVENT_CREATE ) on business object.

I don't see any benefit however, because you'll have to use the user-exit / BADI anyway.

Thanks,

Ram

0 Kudos

Ram,

I understand the solution you propose, but as you pointed out, this'd require the implementation of an user-exit/BAdI within the standard BAPI to raise the event anyway.

I'd try to avoid this approach if it's possible.

Thanks

Fra

0 Kudos

In any case , even if you want to generate change documents and it is not given by SAP then you will have to implement a user-exit/BADI for this.

There is no other option because you can't do anything at the database level, in case you are thinking about some kind of trigger at Database table level. That's not possible with SAP. You have to use your logic within the Application program. And that means the logic should be embedded in all the application programs which are updating data in the related db table.

Now, since the application program , in this case, belong to SAP standard , you have to use Uer-Exits / BADIs. Or else

you can copy all these transaction BAPIs into Z program / BAPI and implement your logic for change document creation / event trigger . Further, ask your SAP users to use these Xns, Block original SAP standard transactions.

But why do you hate User-exits/BADIs so much?

Believe me; once you've found it, it's probably the easiest thing to do in SAP after SAP Business Objects

Cheers,

Ram