cancel
Showing results for 
Search instead for 
Did you mean: 

how to bind an event to a function?

Former Member
0 Kudos

Hello,

I'm try to create a function when the production order released event trigged save the order number to a Z table automaticaly.

I create an event in tcode SWO1,the event can be trig when I release the production order

is there any funciton that I can bind a event to a Z FUNCTION that I can process the Function to save the order number to a Z table

when this Event trigged ?

thanks very much

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

I'm not sure I understand but you can create a workflow that is started by your event.

In that workflow you then put a step that executes a task that calls a method (which you create in SWO1) to write the order number to a Z table. It doesn'thave to be a function.

regards

Rick

Former Member
0 Kudos

Dear Rick
,
I will try that  thanks !!

SandySingh
Active Contributor
0 Kudos

Hello

When a production order is saved, you can update the Z table from the userexit/BADI/ enhancement spot based on some condition. Refer to link below.

It makes sense to trigger workflow if you need an approval before update.

Regards

Sandy

Answers (2)

Answers (2)

Former Member
0 Kudos

I use Tcode SWETYPV link the event to an receive function and this works well

thanks!

Former Member
0 Kudos

You could create event receiver function and define that in transaction SWETYPV for your event.

How do you trigger the event? Did you do some coding somewhere? My first option would not be to put some Z-table insertion logic into event receiver (unless there is a specific reason (what is it?) and/or you need to use workflow for something). I would put the Z-table logic directly into some user-exit / BADI / enhancement (for the production order release). From my point of view using the event is just putting an extra layer in your solution - unless there really is some specific reason for this.

Regards,

Karri

Former Member
0 Kudos

thanks karri,

actually this is an example,

I‘m designing a program,this program need capture different status and do different things,such as when the SalesOrder create or change when Purchase Requistion create or change etc.

First I think to find userexits or enhancement in the PR save and change or SO save and change,

but this will need two many userexit in system

so I try to find if there are some technical can get all the event and now I find this