Application Development and Automation 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: 
Read only

Execute a z-program on insert event on a table

venkateswaran_k
Active Contributor
0 Likes
2,852

Dear All

Can someone  help me on  the following.

I want to execute a z program as and when a record is created in SAP table.

Regards,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,014

Please use event in TMG.

8 REPLIES 8
Read only

Former Member
0 Likes
2,015

Please use event in TMG.

Read only

pavanm592
Contributor
0 Likes
2,014

I don't think we can trigger table maintenance events on using the SQL statement insert .

if we want to trigger table maintenance generator events we need to use the TMG Function modules like VIEW_MAINTENANCE_SINGLE_ENTRY. and call the z program in the event code.

Regards,

Pavan

Read only

former_member756887
Participant
0 Likes
2,014

Hi,

Kindly Find the attached screen for Event use of Table..

Read only

venkateswaran_k
Active Contributor
0 Likes
2,014

Thank you Anurudh, Bagaban and Pavan

I want to have this event from PTREQ_HEADER - a sap Standard Table.

At this moment, it has no TMG.

Can I create a TMG on this standard table?

Will there be any impact?

Regards,

Venkat

Read only

0 Likes
2,014

Hi,

if it is standard table, so I don't recomand you to do this, just could you tell us what you want excelty,

When some has inserted or updated the table should be registerd the event what he has done, so the SAP provides this to protocol alle changes in tables, and save them in CDHDR and CDPOS, it is called change documnent.



Regards

Ebrahim


Read only

0 Likes
2,014

Dear Ebrahim

I want to change a value of one column in this table upon inserting a record,

I want to change the value of NEXT_PROCESSOR_I col based on our custom logic.

Regards,

Venkat

Read only

0 Likes
2,014

Hi Venkateswaran

I would like to help you but the problem is SAP table , so if we are tallking about Z-Table, then we can try with a dialog, or MT ( SE30 ) with some events.

Anyhow, this called Database Triggers, so it means any change  DML ( Update, Delete,Insert ) on a table,then an event will be triggered,

You can refer to this link for more informations, Database Triggers - Tutorials - SAP Library

Regards

Ebrahim 

Read only

0 Likes
2,014

Hi Venkateswaran,

It looks like this table is part of a standard workflow (WS12300111). The NEXT_PROCESSOR_I field sounds like it is part of the standard approval logic.  Rather than custom development you may want to work with the standard SAP customization, or a BAdI. Have you tried configuring in transaction PTARQ? (you can get to the BAdI from here also)  You may want to check the thread   or search more in the space for SAP Business Workflow.

I hope this is helpful to you!

Margaret