Skip to Content
author's profile photo Former Member
Former Member

Confirmed quantity is becoming zero in case of SO Split for batch stock related to Rush orders

While creating Sales Order from VA01/Web Services if order quantity is 100 then

[mchb1-clabs] 75 will go for ZTAN- 1st line item and [mkol1-slabs] 25 will for ZVN second line item created with userexit_move_field_to_vbak. In case of Web services we are updating confirmed quantity using BAP_MATERIAL_AVAILABILITY.This works fine when there is not batch entered and we will be referring mard-labst & mard-klabs. When we pass batch number we will be using same batch for both line items,everything works fine as expected only thing is the confirmed quantity for second line item becomes zero even though we pass correct available quantity.It becomes zero at some point and schedule is created with zero confirmed quantity.

Are we missing anything.Batch stock is checked in material and configuration we have cross verified and wont see we are missing anything.
Want to know if same batch will be allowed for 2 line items in same sales order,If so then why confirmed quantity is becoming zero.
We tried passing confirmed quantity in userexit_move_field_to_vbep however it gets changed at later point.

Deep down through debugger : Confirmed quantity becomes 0 in below call
* Liefergruppen korrelieren
perform liefergruppendatum_setzen(sapfv45v) using verarb_immer.


Any hint,trick suggestions are welcomed to achieve the requirement.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2018 at 07:25 PM

    SCN has been of great help and we were able to resolve the our issue from the below post.

    Here goes the solution mentioned in the above thread in case it wont open:

    And solution is as below if in case thread is not opening.
    In order to give the solution to all reader in the future. I finally find a solution.

    I wrote an OSS message to SAP and they answer me in this way:

    "Dear Customer,

    In a BAPI, the ATP check is performed in the background.

    Since the system is performing the availability check

    in background, the availability screen cannot be performed.

    So it is not able to make decisions regarding full

    delivery, delivery proposal...In this case,the system uses

    the configuration found in OVZJ. If your availability checking

    rule in OVZJ is blank, the system will choose full delivery.

    Sorry, but I can not give you a better solution to customizing in

    OVZJ, if you wish a partial delivery."

    In that transaction in customizing we inserted the value "E" and the partial delivery is created from VA01 and from BAPI too.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 15, 2018 at 05:48 AM

    Try to create manually from VA01 with the same input parameter and see how system is working.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      When we create manually a screen appears for ATP check and there whatever confirmed quantity we select that appears,issue will be when we run through webservices/BAPI we get zero confirmed quantity.We dont want to run simulate and check since this service is for 5 devices and we want to handle it in backend.

  • Posted on Feb 15, 2018 at 09:58 PM

    There are some holes in the story but this is the way I understand the situation. You're using some kind of web service to create a sales order (I'm guessing an FM and BAPI_SALESORDER... is involved here?). As an input to FM/BAPI, you provide 100 EA and a user exit is somehow expected to split this into 75 and 25. And you're saying this does not work as expected and does not work the same way as when you enter 100 EA in VA01?

    In this case, debugging the user exit using just FM (or whatever web service calls in SAP) and comparing it to VA01 seems like the only option. Also make sure to check that availability data provided by BAPI is as expected.

    This kind of design of splitting quantity into two line items based on availability doesn't seem like a good idea in general though. Why not just have one line and let ATP do its job and create multiple schedule lines? What if availability changes?

    Edit: there is an SAP note that describes when SD BAPIs do not work the same way as transaction. I'm not sure this is the case here but wouldn't hurt to find and read it.

    Add a comment
    10|10000 characters needed characters exceeded

    • Sorry, it's still not clear if your test in VA01 is exactly the same as when the order is placed by FM.

      In VA01 do you also enter 100 EA and it is somehow split into 2 lines? What exactly splits it? At what point do you get ATP screen? What do you see in it and for what items?

      I'm guessing in VA01 ATP check runs for 2 separate items, not for 100 EA. What parameters do you give to BAPI_MATERIAL_AVAILABILITY then? Naturally, you won't get any screens in BAPI. Scheduling will be made based on whatever values are passed to BAPI, that's all. If you've just checked availability and then immediately post an order but it says stock is not available then either you're not giving the same data to BAPIs or some other data in the order influences ATP check or there is a bug. Logically, there are really no other options.

      Again, make sure to search for SAP Notes because such inconsistencies between BAPI and transaction are a known issue. If this is not mentioned in the notes then run two exactly same scenarios, get the results, document this and open an incident with SAP. If you're giving the same exact values to VA01 and to BAPI normally you should expect the same result (again, unless it's already covered in a note).

      This is all custom ABAP development and even custom item categories, so I'm not sure how much assistance you could get on SCN. These things need a system access to troubleshoot.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.