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: 

pricing details missing in BAPI

Former Member
0 Kudos

Hi Guys,

I am creating sales order with reference to Contract thru BAPI,while creating SO,pricing details are missing.even Header level & item level Pricing conditions.Pricing conditions are maintained manually in Contract.

in test data,i have given header details ,item details & partner details.but in item details,no data for pricing condition & rate fields.

Regards

Satya

4 REPLIES 4

Former Member
0 Kudos

You have a couple of options:

1. Retrieve the contract's pricing conditions via FM BAPISDORDER_GETDETAILEDLIST.

The good thing about using this function module is that the data returns correctly formatted for use in BAPIs. The bad thing is that, if your company has large contracts, the FM can be extremely slow. We had complaints from our users when they were copying contracts with over 300 items on them.

2. Retrieve the contract's pricing conditions directly from table KONV. You will probably also need to use tables TVAK, T683V, and VBAK to get your key for the KONV read.

The good thing is that this is very quick, but the bad news is that you have to reformat the condition data into the format used by BAPIs. Some values are divided by 10 or multiplied by 100 for use in BAPIs. This code might be helpful for some of that:

lt_conditions-calctypcon = lt_konv-krech.

CASE lt_conditions-calctypcon.

WHEN 'A'.

lt_conditions-conbaseval = lt_konv-kawrt.

lt_conditions-cond_value = lt_konv-kbetr / 10.

WHEN 'B'.

lt_conditions-conbaseval = lt_konv-kawrt * 100.

lt_conditions-cond_value = lt_konv-kbetr.

WHEN 'C'.

lt_conditions-conbaseval = lt_konv-kawrt / 10.

lt_conditions-cond_value = lt_konv-kbetr.

WHEN OTHERS.

lt_conditions-conbaseval = lt_konv-kawrt.

lt_conditions-cond_value = lt_konv-kbetr.

ENDCASE.

lt_conditions-scalebasin = lt_konv-kzbzg.

IF lt_conditions-scalebasin <> space.

CASE lt_conditions-scalebasin.

WHEN 'C' OR 'D'.

lt_conditions-scalbasval = lt_konv-kawrt / 10.

WHEN OTHERS.

lt_conditions-scalbasval = lt_konv-kawrt.

ENDCASE.

ENDIF.

After you do either of the above methods to retrieve the data, you will then need to find the manually maintained contract conditions and pass them into the order creation BAPI using the order_conditions_in parameter(for the BAPI BAPI_SALESORDER_CREATEFROMDAT2).

0 Kudos

Hi Dave,

My requirement is,

I want to create Sales Order with reference to Contract using BAPI.i m able to create thru BAPI but pricing Conditions are missing.

for the same ,if i go VA01 - create reference,it captures all the details of Contract & creates SAles Order.My issue same thing not happens while using BAPI.

Note: no pricing details as input in BAPI.

0 Kudos

I think you can try fm BAPI_PRICES_CONDITIONS .

check the this sample thread for example:

regards,

Padma

former_member221372
Participant
0 Kudos

Hello Satya,

Could you please let me know how did you solve this issue as I am facing now.

Cheers,

Bharat