How to Restrict Goods Receipt Before Delivery Date in SAP Using Enhancements

Introduction

In many SAP MM (Materials Management) implementations, one critical control requirement is to prevent the posting of a Goods Receipt (GR) before the Purchase Order (PO) delivery date. This is essential for ensuring procurement compliance, inventory accuracy, and vendor performance tracking. SAP does not provide standard error handling for this by default, but you can implement a custom solution using SAP Enhancements and user exits. 

Why Restrict Goods Receipt Before the PO Delivery Date?

Allowing goods to be received before the scheduled delivery date can cause: - Inaccurate inventory valuation - Misleading supplier performance metrics - Process compliance issues - Early financial postings affecting period close Hence, enforcing a control at the MIGO (Goods Movement) transaction level is crucial for robust procurement governance.

Recommended SAP Enhancement: MBCF0002

To create a restriction mechanism, we use Enhancement MBCF0002 with the component EXIT_SAPMM07M_001. This enhancement allows you to implement custom ABAP logic to validate delivery dates during the MIGO transaction.

Step-by-Step Guide: How to Implement the Restriction

1. Identify the Right Enhancement

Use Tcode SMOD to find enhancements related to Inventory Management. Focus on package MB which is used for MM Inventory Management functionalities. 

Common Enhancements:
 
Exit Name Short Description
MB_CF001 Customer Exit for Material Document Updates
MBCF0002 Segment Text in Material Document (Recommended)
MBCF0005 Material Document Item for GR/Issue Slip
MBCF0006 WBS Element Custom Function
MBCF0007 Reservation Updates
MBCF0009 Storage Location Field Control
MBCF0010 BAPI Reservation Creation Exit
MBCF0011 Print List Enhancements for MB26

2. Create a Custom Project in CMOD

  • Go to Tcode CMOD
  • Create a new project, for example ZGR_RESTRICTION
  • Click Enhancements, add MBCF0002
  • Click Components, double-click EXIT_SAPMM07M_001

3. Add Custom ABAP Code

Within the ABAP Editor: - Double-click the include starting with ZX..., which will prompt you to create the include.
- In the include, insert logic to check if the GR Posting Date < PO Delivery Date
- Trigger an error message if this condition is violated.

IF sy-datum < eket-eindt.  " Compare system date with delivery date
  MESSAGE e001(zgr_check) WITH 'GR date cannot be earlier than delivery date on PO'.
ENDIF.

Note: Replace eket-eindt and other fields with the correct structure as available in your internal tables (e.g., xekpo, xeket, mkpf, etc.).

4. Activate and Test

  • Save and activate your code and project.
  • Test your logic in MIGO by attempting a GR before the PO delivery date.
  • You should see an error message preventing the posting.

Known Limitation

Currently, only error messages are supported via this enhancement. Warning messages (that allow continuation) are not functional in this exit.

Fast links:
IM And Control Review Questions And Answers

Get help for your SAP MM problems
SAP MM Forums - Do you have a SAP MM Question?

SAP MM Books
SAP Materials Management Reference Books

SAP MM Tips
SAP MM Configuration Tips and Materials Management

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.