When working with supplier scheduling agreements in SAP, one may sometimes encounter the error message ME161 – “The notified quantity exceeds the ordered quantity“. This happens if one adds a new scheduled quantity and a scheduled date to the scheduling agreement in transaction ME38. But what does that mean exactly and how can we solve this problem?
In the following blog post we will give a step by step walkthrough on how to debug this issue in SAP.
For the impatient, here is the quick solution to resolving ME161. The reason for this error is that there are inbound deliveries which have not been put away yet, but whose overall quantity exceeds the target quantity in the scheduling agreement in ME32L.
Say the target quantity of a given scheduling agreement 5500000147 in ME32L is for instance 40.000, like in the following example:
In this case there shouldn’t be any inbound deliveries exceeding 40.000. One can easily check the inbound deliveries with transaction VL06I and open a specific inbound delivery with transaction VL33N. In the following example, relating to the scheduling agreement above, there is an erroneous inbound delivery with 4,000,000 parts, which is the root cause of the issue.
There are two ways to solve this…
- Remove the inbound delivery (if it is in fact an erroneous one)
- Increase the number of items in the scheduling agreement in transaction ME32L
The ME161 issue – a step-by-step debugging
For the less impatient, here is a more in-depth explanation. If you had encountered the given problem without having this blog post to hand – what would be the steps to get to this issue?
First of all, let’s check the message in detail. As soon as you try to add a new scheduling amount and a new scheduling date and you save the scheduling agreement, you will see the following warning in transaction ME38:
Click on View details and the following details will appear.
If one looks a bit closer to the diagnosis part (and knowing the problem already, since we have disclosed the solution above), the issue is clear: the notified quantity is greater than the ordered quantity. But since you are working in the scheduling agreement and you just wanted to add a new line, you probably did not think about the notified quantity at all. Or you might not even know, what the system now means with notified quantity. At least I did not at at this point, that’s why a debugged it and wrote this post you are new reading.
So let’s dig deeper. Click on “Technical Information” to see, what kind of message has been raised there.
Then click on navigate to reach the actual message. What we know so far already: it is the message number 161 (ME161) we need to chase.
Click on the “Messages” tab and then select ME161. Then hit the “Where used list” button.
In the dialog select the first three boxes and then execute the transaction. The following list is shown.
Now the question is: which program is it? Well, here you either need some experience (so you know, which one to choose), or we need to check back with the transaction, where the problem initially occurred and the message was raised. In that case it was ME38. Go back to ME38, navigate to the scheduling items and enter /h in the transaction field and press Enter and then Enter again. That switches on the debugging mode.
The second Enter opens the ABAP debugger, which discloses the program used behind the transaction.
It is SAPMM06E. Thus, we know that MM06EF0P_PRUEFEN is presumably the right place to look further. Thus, in the previous where used list, double click on it, and the lines where the message is raised in ABAP will be displayed.
Double click on the first line (618) and in the opening selection choose the program SAPMM06E. Set a breakpoint in line 618 and 620 and then execute transaction ME38 in debug mode again. The system will stop the execution at the given point.
If you now go backwards in the ABAP code, you can see that a return code 6 triggered the message. The return code 6 in turn was set in the loop above (line 567 onwards). The system checks all inbound deliveries related to the given scheduling agreement. If the confirmed quantity of all inbound deliveries is larger than the scheduled quantity, then the error message is raised.
That’s exactly what has been shown in the original error message (except that the term “notified quantity” is used there, instead of confirmed quantity).
To summarize: either you get the root cause of an error or a warning message straight away and know what to do, or you start looking under the bonnet by debugging the ABAP code. With some know how the latter is easier than it sounds!
Want more information?
If you still have questions about ME161 or how best to handle EDI in your SAP system feel free to contact us; we are more than happy to help!
Alternatively, you can find lots of relevant SAP content in our resource centre.