cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can I execute a CAP function on a HANA database trigger?

shinjan
Explorer
0 Likes
1,677

Hi,

I have a scenario where some table data is getting replicated into HANA from an ECC system with the help of SLT.

The requirement is to send these records over to an external system as soon as they reach HANA using an HTTP POST. The table has timestamps allowing me to identify the latest records.

My question is:

  1. Is there a way to hookup some XSODATA or CAP odata to perform a post call on database triggers?
  2. Is there a way for CAP Events to respond to table record changes in a schema as soon as this happens?
  3. Do I have to create a job that will periodically read this table and compile it for post calls from a CAP project?

Thank you for your help.

View Entire Topic
martinstenzig
Contributor

I don't think there is anything 'standard' that you can do to get an event in CAP when you enter a record in an underlying DB table through 'non CAP' means.

Thinking out of the box, what you could try are a few things:

Approach A:

1. setup a HANA remote source/virtual table to a HTTP BTP service (CAP or event mesh and then CAP).

2. Use the trigger to call the virtual table which in turn/ultimately 'triggers' a CAP service request.

3. Once you captured the event in CAP, you can process it as if the event came in through a standard OData request.

Approach B:

1. Redirect the call through a CAP OData service which gives you all the options

Approach C

1. Setup business event enablement and connect it to event mesh. So rather than using SLT, you would just trigger an event and push it into the event mesh

2. Build a CAP application that can control and supplement what goes into the target application.

shinjan
Explorer
0 Likes

Thank you for your reply. Since BTP is not an option for this, I am curious about Approach B. Can you give an example? Thanks!

martinstenzig
Contributor

The idea would be that rather than SLT writing to HANA directly, you would do a post to the CAP service to store the information. CAP then would store the information but in the 'after' entity handler you could add any logic you want/need.