Skip to Content
avatar image
Former Member

Duplicate condition records with BAPI_SALESORDER_CREATEFROMDAT2

Hi guys,

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.

I am aware that there is a ORDER_CONDITIONS_INX parameter in 4.7 (and an UPDATEFLAG field) however we are on version 4.6c here and that parameter is not available.

Has anybody managed to do something similar in version 4.6C?

Many thanks

Fuad

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 15, 2006 at 01:47 PM

    <i>you don't have to pass the bapisdls at all. Just don't pass the bapisdls. make sure that you're passing kschl, kbetr kmein kwert in the conditions_in parameter to the bapi. That should do it.</i>

    Hi Vijay,

    I copied your answer here that you posted in a new thread so that others can have a background to the problem.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vijay,

      Apologies for only replying now, but just to let you and others know, I managed to fix my problem by using pricing type "G" with parameter LOGIC_SWITCH.

      Thank you

      Regards

      Fuad

  • avatar image
    Former Member
    Jun 15, 2006 at 11:06 AM

    Hi Fuad,

    I think there can be two ways.

    1. Create SAles order as you are creating without pasing any value for this condition type. and then change this condition value ( which is being determined automatically) by using BAPI_SALESORDER_CHANGE wher you can use Update flag as 'X' In parameter CONDITIONS_INX of this BAPI.

    <b>OR</b>

    2. If you want to happen this chage at the time of sales order creation, then I think , this particual condition type should be "manual" and not "Automatic" One.

    Hope this helps.

    Regds,

    Akshay Bhagwat

    Note: Pls mark helpful answers.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      The LOGIC_SWITCH doesn't seem to work, the only ones it allows me to use are "B" and "C" and neither of these have fixed the problem.

      Akshay, I'm hoping I can avoid having to call the change BAPI again to update the rate on the condition type. I will have a look at the possibility of changing the condition type to manual first.

      Thanks to all for your input so far.

      Regards

      Fuad

  • avatar image
    Former Member
    Jun 15, 2006 at 10:30 AM

    I believe you follow this pattern for condions in your FM. If so it should work properly. It's not need for COND_UPDAT,I believe.

    * header condition
    
    bapicond-itm_number = '000000'.
    bapicond-cond_type = 'CON1'.
    bapicond-cond_value = zval1.
    
    APPEND bapicond.
    
    *condition is for any position 
    
    bapicond-itm_number = cont_pos_item.
    bapicond-cond_type = 'CON2'.
    bapicond-cond_value = zval1.
    bapicond-currency = curr.
    
    APPEND bapicond.

    I believe this is helpful for you.

    rgds,

    Thomas.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Thomas,

      This is the pattern that I am following and it creates manually entered conditions okay.

      However when I pass a condition record with a rate to the BAPI, and if this condition type (and rate) is automatically determined from pricing, then it creates two condition records when the sales order gets created

  • avatar image
    Former Member
    Jun 15, 2006 at 10:48 AM

    Hi,

    Try this....

    update the BAPISDLS structure(Logical Switch) with the following and pass to BAPI.

    BAPISDLS-PRICING = 'C'.

    if 'C' doesnt work, try all the options, to know all the options go to the value range of domain KNPRS.

    Sreedhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 05, 2008 at 01:01 PM

    I still having the duplicate problem, Allready tried with the Logic Switch (All pricing values 'A' to'K').

    If I set a 'G' in Logic_Switch-pricing, some conditions still duplicating with amount 0(Zero).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 22, 2011 at 12:32 PM

    Hello,

    I am not sure if the problem is still alive.

    I faced the same problem and found some useful information in oss notes, by which I found the solution.

    Please check notes 574088, 593246 + related notes

    Rgds,

    Viktor Bojtos

    Hungary

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 08, 2015 at 03:03 PM

    I have faced this Same issue lately ..

    and the Solution was:

    the SD Consultant Changed the Type of the Condition type to Manual Pricing instead of Automatic Pricing 😊

    Add comment
    10|10000 characters needed characters exceeded