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: 

Sales order simulation bapi and material price group???

Former Member

Hello every one...

I am calling BAPI_SALESORDER_SIMULATE to get the pricing simulation of a sales order, My requirement is that I want to enter Material Pricing group (KONDM) so that pricing be simulated according to the material pricing group I enter..... but the simulation bapi does not provide this field,,, I cannot use sales order create from data2 bapi,, as it does not provide condition table as output, which is also my core requirement,,, my question is that is there some bapi/fm where I can provide material pricing group along with other info and retrieve complete simulation of sales order pricing with condition details aswell....

thanks

2 REPLIES 2

Former Member
0 Kudos

Managed it using abap memory and prepare hearder info user exit routine

svenja_unger
Explorer
0 Kudos

Hi!

I'm having the same use-case right now. I know it's a long time ago - but do you still have the code of how you ended up implementing it? Would be a huge help!

KR Svenja

Update: Since the post is so old there will probably be no reply. I want to share my solution for the future.

Instead of ABAP-Memory I used a Singleton-Class to store the data I needed. I've created the instance and setted the data before the BAPI_SALESORDER_SIMULATE-call.

Then I've enhanced Include MV45AFZZ, form userexit_move_field_to_vbkd.

This form gets called one for the head and for every position.

DATA: ls_transaction_header TYPE /snap/ps_tr_hdr,
lt_transaction_pos TYPE /snap/ps_t_trans_item.

"here get_instance()->get_data()

"when position - not head
IF vbap-posnr IS NOT INITIAL.

"set fields in VBKD
vbkd-posnr = vbap-posnr.
vbkd-konda = <ls_transaction_pos>-discount_type.

ENDIF.