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

running BAPI_SALESORDER_CREATEFROMDAT2 in background

Former Member
0 Likes
928

Hi;

We are running in background the bapi "BAPI_SALESORDER_CREATEFROMDAT2" and is working ok, it creates the delivery. In tcode VL02N i've added a BADI implementation for SAVE BUTTON to save the items in a Z Table and it does ok.

My question is about the bapi, the bapi is running ok and the delivery is created but the badi for save button is not running, it seems not to be called, but if i run VL02N the badi works ok.

Any help.

Thanks on advance

David Fúnez

Tegucigalpa, Honduras

4 REPLIES 4
Read only

TuncayKaraca
Active Contributor
0 Likes
782

Does BAPI_SALESORDER_CREATEFROMDAT2 create Delivery or Sales Order?

Read only

0 Likes
782

yes it creates the delivery, but not trigger the badi for SAVE BUTTON

Read only

0 Likes
782

It's not triggering SAVE BUTTON, because probably Delivery is created via a Function Module inside BAPI. I don't think BAPI calls VL01N / VL02N transactions.

So I think you need to find a spot (enhancement, user-exit, etc) in BAPI to do same thing whatever you did for SAVE BUTTON.

Read only

0 Likes
782

I can also recommend you to create a reusable object (either function module or class-method) for "save the items in a Z Table", then you can call it from both SAVE BUTTON and BAPI.