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

Duplicate condition records with BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
1,817

Hi All,

I'm creating a sales order with function module BAPI_SALESORDER_CREATEFROMDAT2.

The problem I'm having is that I want to change one of the rates on a percentage based condition type when I create the sales order.

I pass the data in the parameter ORDER_CONDITIONS_IN and set the COND_UPDAT field to 'X'. When the sales order gets created though, two condition records are created for this condition type. One is created with the determined rate (from pricing) and another one with the rate that I passed to the BAPI.

Iam populating UPDATEFLAG to 'U' in ORDER_CONDITIONS_INX parameter still duplicate recod is coming.

Please see the below coding.

wa_bapicond-itm_number = '10'.

*...Dealer Commision

wa_bapicond-cond_type = 'ZCOA'.

wa_bapicond-cond_value = '1000.00'.

wa_bapicond-currency = 'INR'.

wa_bapicond-cond_updat = gc_x.

APPEND wa_bapicond TO gt_bapicond.

wa_bapicondx-itm_number = '10'.

wa_bapicondx-cond_type = 'ZCOA'.

wa_bapicondx-cond_value = gc_x.

wa_bapicondx-updateflag = 'U'.

wa_bapicondx-currency = gc_x.

APPEND wa_bapicondx TO gt_bapicondx.

I have used Logic_switch-pricing to 'G'. Still it is not working.

Please let me know how i should omit duplicate record.

Regards

Rajesh

4 REPLIES 4
Read only

Former Member
0 Likes
1,005

Hi Rajesh

Depending on the Condition type characteristics you might find two. Only one line of both records will be in blue colour which shows the active record for the order.

Only record with the active state will be considered for operations.

Kind Regards

Eswar

Note: Reward for helpful answers.

Read only

Former Member
0 Likes
1,005

Hi Eswar,

I know it. what ever i pass though BAPI is the active one. But i do not want the duplicate one. Please help me how to acieve that.

Regards,

Rajesh

Read only

0 Likes
1,005

Hi all,

I think you have to check customizing. If a condition type is defined as automatic in customizing for certain access sequence so a more item is added.

Create an order without conditions (in the BAPI) and the check if the duplicate one is still there. If so, the solution is to change the customizing.

Read only

former_member96
Explorer
0 Likes
1,005

Dear All,

Condition record which mentioned comes into the sales order twice through BAPI because automatic pricing customization. It can be changed from automatic to manual pricing to fix the error but ıt also need to be added to sales order manually. While keeping the automatic pricing save_document_prepare_exit can be taken into consideration to modify the condition record while comes from Bapi as twice.