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: 

Event creation in SAP

Former Member
0 Kudos

Dear Experts,

Hope you had a great weekend.

I have a small requirement, where in I have to change the sales document immediately after it being saved.

Can some one please give me a step by step procedure on, how to create an event, such that the event calls the BAPI to change the sales document, once the document is saved onto database.

My requirement is unique because of preexisting huge customization. Please advice.

I'm relatively new to workflow and events, any detail explanation would be highly appreciated, also if there are any std SAP programs for reference please advice.

Thanks

-Amit

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

A simple, non-workflow based solution is to create an output of the sales order and run it asynchronously with RSNAST00. Use the output program to change the order. It's very similar to what SAP does with auto-picking non-warehouse managed deliveries. The EK00 output generates the pick list and then updates the picking information on the delivery during delivery save (or later if using RSNAST00). Schedule RSNAST00 at intervals that make sense for you. You certainly can use workflow but it's not really necessary here and neither are custom events and background jobs. I certainly would not use USEREXIT_SAVE_DOCUMENT, as that is only intended for subsequent Z-table updates once the order has been processed.

4 REPLIES 4

former_member156446
Active Contributor
0 Kudos

In SAP you create events using SM62 Tr. and in some "at save" enhancement point or in a BADI you can call this event.

[Starting and Event to kick off a job |http://www.erpgenie.com/abaptips/content/view/477/1/]

uygur_burak
Active Contributor
0 Kudos

Hello Amit,

Do you look for an function module or another things for changing sales document after posting operation completed or look for an user-exit after database commit and VBAK & VBAP tables filled by system?

If you want to change sales order with Z-program after posting operation completed, you can use BAPI_SALESORDER_CHANGE FM. Otherwise, you want to change sales document after database commit, as far as I know, there is no user-exit for this request.

But you can use MV45AFZZ user-exit (Form USEREXIT_SAVE_DOCUMENT) for 1 step before saving data.

Regards,

Burak

0 Kudos

Thanks Burak,

I'm familiar with the fn modules and BAPI's to change the sales document, but my concern is I couldn't find a user exit or BADI, after the data base commit, also since the sales document update is done as a V1 update I do not want the systme to go out of the program and come in changing the LUW.

So thought if there is a way that I can call an event or trigger a workflow once the sales document is created and there by chnaging the same.

Please advice.

-Amit

brad_bohn
Active Contributor
0 Kudos

A simple, non-workflow based solution is to create an output of the sales order and run it asynchronously with RSNAST00. Use the output program to change the order. It's very similar to what SAP does with auto-picking non-warehouse managed deliveries. The EK00 output generates the pick list and then updates the picking information on the delivery during delivery save (or later if using RSNAST00). Schedule RSNAST00 at intervals that make sense for you. You certainly can use workflow but it's not really necessary here and neither are custom events and background jobs. I certainly would not use USEREXIT_SAVE_DOCUMENT, as that is only intended for subsequent Z-table updates once the order has been processed.