Skip to Content
avatar image
Former Member

Problem with condition record during sales order creation program

Dear Experts,

Here we are developing a program which create condition record through FM RV_CONDITION_COPY and RV_CONDITION_SAVE and RV_CONDITION_RESET

which creates pricing condition records successfully then in the same program just after creating condition record we are calling BAPI_SALESORDER_CREATEFROMDAT2 to create sales order which creates sales orders successfully.

But issue is that this sales order created with Old Condition record (if already exists). we used syntax commit and wait after conditions FM but still not able to find the solution.Please help.

Thanks in advance.

Regards

Ravi K

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Feb 23, 2017 at 11:41 AM

    Hello,

    After Condition record use BAPI_TRANSACTION_COMMIT and wait = ' ''and check the entry in database table whether your condition records are updating before you are calling BAPI_SALESORDER_CREATEFROMDAT2.

    thank you!!

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 23, 2017 at 09:27 PM

    It's hard to find a black cat in a dark room... Have you checked pricing analysis in the order? Maybe the condition record very much exists in DB but is not pulled because of the data in the order (e.g. pricing date). Otherwise updates not committed yet or some data issue would be the only possible reason.

    You could run SQL trace as well to see exactly what happens.

    P.S. If I may say - creating a condition record for the order right before placing the order seems rather odd. Why not just have a manual price instead? Something to think about it.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 24, 2017 at 06:36 AM

    Hi,

    Thanks for your suggestions here one more thing i would like to share that if i am trying execute the program for three cases means first condition record creation and then first sales order creation same loop i am executing for more then three different values i.e. second condition record creation and second sales order creation and so on.here it is executing for some times for any of one or two correctly but not for all the three (suppose i am executing three records) i think there is some data base updation issue means it should have to create condition record first and update that price then only it will go for sales order creation with that new price.(but it is picking old price if it is exist already for some cases).

    Also i have tried above two options but still not got the solution.

    Thanks in advance.

    Regards,

    Ravi k

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 24, 2017 at 10:12 AM

    Hi,

    We have solved the above issue through putting check in our program if condition record is updated then only create sales order thank you all for your valuable inputs.

    One more issue we are facing while creation sales order through BAPI_SALESORDER_CREATEFROMDAT1 we have a requirement to put delivery block on schedule line level.We have passed the below parameters in ORDER_SCHEDULE_EX along with header & item parametrs

    ORDER_SCHEDULE_EX-OPERATION "009"

    ORDER_SCHEDULE_EX-ITM_Number "000010"

    ORDER_SCHEDULE_EX-SCHED_LINE "0001"

    ORDER_SCHEDULE_EX-REQ_DLV_BL "10" (as per our system config)

    Here the sales order is created but schedule line delivery block is not updated.

    Please help.

    Thanks in advance.

    Regards,

    Ravi K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 27, 2017 at 09:00 AM

    Hi Experts,

    Above problem got resolved through BAPI_SALESORDER_CREATEFROMDAT2 instead of BAPI_SALESORDER_CREATEFROMDAT1.

    Thanks for your inputs & suggestions.

    Regards,

    Ravi K

    Add comment
    10|10000 characters needed characters exceeded