Beruflich Dokumente
Kultur Dokumente
Applies to:
SAP ABAP, SAP PP, SAP MM. For more information, visit the ABAP homepage.
Summary
This paper outlines the correct implementation approach for validating the external batch number while doing
goods receipt using MIGO transaction.
We have to check the business rules on which the batch number is created. If the batch number is correct
we shall allow the goods receipt otherwise we shall throw an error message pop up.
The challenge / problem faced was we tried many implementation but after getting the error message pop
up , the user was unable to change the batch number since the screen was getting locked .
Author Bio
Abhishek Gupta currently works at IBM India Pvt Ltd. His current role is of application package
consultant. He has total year of 5.5 years of experience . He has previous worked in organizations
viz, SAP Labs , Wipro Technologies. You can reach him on mail id : abhishek.princy@gmail.com
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 1
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
Table of Contents
Business Background ......................................................................................................................................... 3
Associated Screen .......................................................................................................................................... 3
The old approach and problem ....................................................................................................................... 3
The Problem .................................................................................................................................................... 4
The Correct Approach. ....................................................................................................................................... 5
Related Content .................................................................................................................................................. 6
Disclaimer and Liability Notice ............................................................................................................................ 7
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 2
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
Business Background
The Batch management is often used for traceability purposes and is active at the material level. The batch
number is based on the business rules which makes it unique and the material to which it is assigned.
We need to build up a logic which shall check the business rules on the batch number while doing a goods
receipt using MIGO transaction.
Associated Screen
Screen where we give the Batch number during goods receipt in MIGO transaction.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 3
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
The Problem
Every time a wrong batch was added while performing the goods receipt, the error message pop up was
thrown. When the end user checks the errors message and tries to enter the batch number again, the screen
gets locked .Hence the end user has to again start the goods receipt.
As we can see here an error message pop up has come due to wrong batch number. After checking this
error pop up, we get the screen locked and we cannot re-enter the batch number.
Hence we gave up this approach and tried a different approach.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 4
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
lv_ok_code = sy-ucomm.
ENDMETHOD.
2) LINE_MODIFY:
METHOD if_ex_mb_migo_badi~line_modify.
DATA lv_line_id TYPE mb_line_id.
DATA ls_item TYPE goitem.
DATA lv_ok_code TYPE syucomm.
DATA ty_input TYPE bncom.
DATA ty_batch_number TYPE sa_charg.
lv_line_id = i_line_id.
ls_item = cs_goitem.
lv_ok_code = sy-ucomm.
Using the above approach the end user is now able to re-enter the batch number if the previously enter
batch number was not as per the business rules. The screen does not get locked now.
Another benefit of this approach was that it does not allow you to post the material with a wrong batch .
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 5
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
Related Content
https://forums.sdn.sap.com/thread.jspa?messageID=5299616#5299616
http://forums.sdn.sap.com/thread.jspa?threadID=878139
http://forums.sdn.sap.com/thread.jspa?threadID=1836426
For more information, visit the ABAP homepage
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 6
Validation of External Batch Numbering during Goods Receipt using MIGO Transaction
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 7