6 minute read

How to Debug SAP Message ME161 - "The Notified Quantity Exceeds the Ordered Quantity"

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.

Quick solution

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:

Scheduling agreement target quantity
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

Resolving ME161 - Inbound delivery
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Solution:

There are two ways to solve thisā€¦

  1. Remove the inbound delivery (if it is in fact an erroneous one)
  2. Increase the number of items in the scheduling agreement in transaction ME32L

White Paper - EDI Integration in SAP

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:

Resolving ME161 - Warning message
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Click on View details and the following details will appear.

ME161 error message
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

Resolving ME161 - Navigating to ME161
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

Select where used
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Click on the ā€œMessagesā€ tab and then select ME161. Then hit the ā€œWhere used listā€ button.

Execute where used
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

In the dialog select the first three boxes and then execute the transaction. The following list is shown.

Resolving ME161 - Used Programs
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

Resolving ME161 - Start in debug mode
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

The second Enter opens the ABAP debugger, which discloses the program used behind the transaction.

Resolving ME161 - ABAP debugger
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

Resolving ME161 - Lines displayed
Ā© 2021. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

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.

SAP ERP and SAP S/4HANA are the trademarks or registered trademarks of SAP SE or its affiliates in Germany and in several other countries.

most read

Keep on reading

2 minute read

How to End Another User's SAP Session

Unable to edit a crucial document in SAPĀ® because you're locked out? Learning how to end another user's SAP session will solve this issue.

3 minute read

Ɯbersetzungen fĆ¼r SAPĀ®-Terminologie und SAPĀ®-Begriffe finden

Using the correct translations for SAPĀ® terminology is important in international projects. Discover how to find these quickly.

2 minute read

How to Save an IDoc Parser Report to a Local File

In this short and simple guide we show you how to save an IDoc parser report to a local file in just a couple of easy steps.

6 minute read

SAPĀ® EDI Project Roles - A Breakdown

Learn the various EDI project roles involved in achieving successful EDI integration in SAP systems and how the different roles interact.

5 minute read

Alternatives to the Seeburger PI Adapter

The end of maintenance for the Seeburger PI Adapter is imminent. What alternatives are there and which is the best suited for your business?

3 minute read

How to create an SAP transaction code

Want to know how to create an SAP transaction code for an existing ABAP program so that you can easily call the program?

9 minute read

Alternative Solutions for EDI Data Exchange with SAP PI and SAP PO

Discover the three possibilities when it comes to implementation of electronic data interchange (EDI) in SAP Process Integration or SAP Process Orchestration (SAP PI/PO).

6 minute read

How to Set Up and Manage Automatic SAP Jobs

SAP jobs can be used to automate processes in SAP ERP so they can be carried out without user intervention. We explore the key features.

4 minute read

IDoc Status Change in SAP ERP

IDoc statuses are not always the clearest - particularly when errors occur. In this article we explain how to change IDoc status as required.

6 minute read

How Can I Add an Entry to an SAP Table?

In this article we show how to add entries to an existing SAP table - even if it does not have its own maintenance dialog.

4 minute read

IDocs in SAP S/4HANA: The Differences to SAP ECC 6.0

The change to S/4HANA also impacts the format of IDocs. In this article we explore IDocs in S/4HANA and the new and changed elements.

11 minute read

Migration to SAP S/4HANA - 5 Key Considerations

Are you prepared for migration to SAP S/4HANA? Discover the 5 key questions all businesses looking to upgrade to SAP's new ERP system should consider.

Subscribe to the e-Invoicing newsletters