Restrict GR before Delivery Date

I want to restrict that vendor supplies goods before the delivery date written on PO .i.e. system should give some error if goods are supplied before the scheduled delivery date mentioned in PO.

One way is to check data at your MIGO entry, is through SAP enhancments (Tcode : cmod).
I have implemented numerous checks for my end users (posting dates, movement types vs material types, mandatory fields under specific conditions, posting date deviation from today, total consumption per order etc).

Try enhancment MBCF0002 and component EXIT_SAPMM07M_001.
 

Through tcode SMOD you can find the available enhancments and function modules, go through the documentation and choose one. For MM inventory management the package is MB.

My system (4.7) returns the following list:

Exit name Short text
MB_CF001  Customer Function Exit in the Case of Updating a Mat. D
MBCF0002  Customer function exit: Segment text in material doc. i
MBCF0005  Material document item for goods receipt/issue slip
MBCF0006  Customer function for WBS element
MBCF0007  Customer function exit: Updating a reservation
MBCF0009  Filling the storage location field
MBCF0010  Customer exit: Create reservation BAPI_RESERVATION_CREA
MBCF0011  Read from RESB and RKPF for print list in  MB26

With tcode CMOD create a project "Zxxx" and insert the choosen enhancement. Automatically its components will be added to your project.

Press the "Compoents" button and double click the function exit that you will change.

Now you should be looking at the source code of the function (abap editor). Take a look of the available internal tables that are imported.

Double click on the include ZX.......  which does not exist and it will be created by you.

Add the source code needed to cover your validations.

Save and activate your project

Execute MIGO and check your enhancement.

Note: one problem I still haven't solved. I can use only ERROR messages not WARNINGS.

SAP MM Tips by : Elly

Fast links:
IM And Control Review Questions And Answers

Get help for your SAP MM problems
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 Discussion Forum

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.