cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_CONTRACT_CREATE - Net price for item taken from conditions is not done

gilberto_parga
Participant
0 Kudos

Hi again guys!

I am facing the problem about the net price (and other values like tax code, target quantity, order unit, material group...) being changed (updated) automatically when you execute ME31K transaction to create a contract and then put certain materials in the line items (that's great), but the fields are not changed from BAPI.


For those certain materials, a warning appears in ME31K when you assign values in the item overview and then try to go to details or press enter, with message "Material 999999 mainly procured internally (please check your input)", then I pressed Enter and a popup message appeared: "Order Unit KG --the unit I put in order unit and order price unit fields-- cannot be used" and after accepting that popup a new popup arrived with message "Net price for item 000010 taken from conditions". Then I could see that the fields short text, target quantity, order unit, net price, order price unit and even the tax code were changed accordingly (tax code was set even before I put some value in the item details window). All those changes are wanted by my functional consultant to be detected and replicated using BAPI_CONTRACT_CREATE, but actually it does not happen. BAPI takes the values I put in the item data table (BAPIMEOUTITEM, BAPIMEOUTITEMX) as they are. Using manually the same data with ME31K leads to completely different values due the aforementioned messages and automatic changes. Do you know how to have BAPI_CONTRACT_CREATE to do the same automatic changes?


Thank you!

Accepted Solutions (0)

Answers (2)

Answers (2)

gilberto_parga
Participant
0 Kudos

Thanks for the answer Jürgen. Actually I had to use an implicit enhancement implementation on a specific part of logic flow inside BAPI_CONTRACT_CREATE, procuring using it only when ABAP stack has my custom report, for some cases. For other cases I had to use BDC recordings.

JL23
Active Contributor
0 Kudos

see, ME31K is a online transaction, SAP can communicate with the user, can send warning messages to make the user think, can send pop-ups with yes/no decisions, the user is able to see what SAP did and can directly take corrective actions.

All this is not possible in a BAPI, hence you have to prepare your BAPI call with the wanted values. The determination of those values is made by the programmer in the calling program before the BAPI  is called.  And even the functionality of the BAPI may be limited compared to the online transaction, e.g. scales and volume rebates are not supported among many other restrictions as you can read in the docu to this BAPI.