Skip to Content
avatar image
-1
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.

PERFORM XVBEP_AENDERN.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 21 at 07:25 PM

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

    https://archive.sap.com/discussions/thread/1680647

    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 comment
    10|10000 characters needed characters exceeded

  • Feb 15 at 05:48 AM

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

    Add 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.

  • Feb 15 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 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.