DebugProgramIt takes nearly three minutes to find the cause. The problem lies in the SAP standard function shp_delivery_create_from_sto.
Use simple data to test the function separately.
| Purchase order |
Line item |
Quantity |
Unit |
| 4600021861 |
360 |
900 |
M |
| 4600021861 |
370 |
900 |
M |
| 4600021861 |
380 |
600 |
M |
Now, we need to create a dump delivery order (the delivery order for inter-company transactions) for the above data. The test data is as follows:
1. When I create a full number of rows, there is no problem and I can create them.
Input
Output (normal, number of rows, number of correct delivery order 41037971)
2. When there are only a part of the Creation quantity, it's strange...
Input (the number of items in the first row is not all, only 360 is returned. Normally, the result is the same as the preceding one, but the number of items in the second row is 899)
Output (the number of rows is gone, and the number of rows is changed to two)
Let's see more.
Input
Output (two 380 rows, the other two rows are gone)
Input
Output
Input (this is normal when only the last one is an incomplete number)
Output
This is really a problem (debugging this ghost thing, I sat down for more than seven hours), there is no way to change this function, you can only start from the called place.
Before calling the API, I proposed all the incomplete quantities separately as a single item to create a delivery order. This problem is bypassed.
It was already early in the morning, and the angry old lady did not dare to wake him up. She hid herself in a small room and sat down for a sleep.