making delivery note mandatory in migo when goods · pdf filemaking delivery note mandatory in...

13
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com © 2011 SAP AG 1 Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order Applies to: Business users in purchasing function who are responsible for carrying out goods receipt against purchasing documents. Summary This article provides a methodical approach to ensure that SAP system captures the delivery note number for the goods received against purchasing document only. Standard feature in SAP configuration can ensure that delivery note number is mandatory but it does not differentiate between goods receipts from purchase orders and production orders. Author: Rahul G Asai Company: IBM Created on: 25 April 2011 Author Bio The author works with IBM as a logistics consultant. He brings with him rich experience in logistics modules of SAP for close to 4 years and domain experience of 2 years. He is an engineer and later pursued his MBA in Information Technology from VGSOM, IIT Kharagpur. .

Upload: duonganh

Post on 06-Mar-2018

703 views

Category:

Documents


24 download

TRANSCRIPT

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 1

Making Delivery Note Mandatory in

MIGO when Goods Receipt is Done

Against Purchase Order

Applies to:

Business users in purchasing function who are responsible for carrying out goods receipt against purchasing documents.

Summary

This article provides a methodical approach to ensure that SAP system captures the delivery note number for the goods received against purchasing document only. Standard feature in SAP configuration can ensure that delivery note number is mandatory but it does not differentiate between goods receipts from purchase orders and production orders.

Author: Rahul G Asai

Company: IBM

Created on: 25 April 2011

Author Bio

The author works with IBM as a logistics consultant. He brings with him rich experience in logistics modules of SAP for close to 4 years and domain experience of 2 years. He is an engineer and later pursued his MBA in Information Technology from VGSOM, IIT Kharagpur.

.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 2

Table of Contents

Business Requirements Specifications .............................................................................................................. 3

Scope of Standard SAP Configuration ............................................................................................................... 3

Use of BADI to make Delivery Note mandatory ................................................................................................. 4

Logic to be provided to ABAP Team ............................................................................................................... 4

Steps & Screenshots to be followed ............................................................................................................... 5 ABAP Code to be used in Mode_Set .......................................................................................................................... 6

ABAP Code to be used in Status_And_Header .......................................................................................................... 8

Test Case.......................................................................................................................................................... 10

Disclaimer and Liability Notice .......................................................................................................................... 13

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 3

Business Requirements Specifications

Change in standard SAP is required when goods receipt against purchase order is done. It is required by business that Delivery Note should be entered when goods receipt is done against purchase order in MIGO transaction.

Scope of Standard SAP Configuration

It is possible in standard SAP configuration to make this delivery note field mandatory in MIGO using field selection as indicated below. This enables delivery note as a required field in MIGO, but this also enables this field mandatory in MB31 i.e. goods receipt for production orders. Objective is to make the delivery note mandatory only in MIGO when goods are received against purchasing document.

2 Standard SAP configurations to make delivery note mandatory is-

SAP Customizing Implementation Guide -> Materials Management -> Inventory Management and Physical Inventory -> Field Selection for Goods Movements Initial/Header Screens

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 4

SAP Customizing Implementation Guide -> Materials Management -> Inventory Management and Physical Inventory -> Settings for Enjoy Transactions -> Settings for Goods Movements (MIGO) -> Field Selection for MIGO

Use of BADI to make Delivery Note mandatory

To make "Delivery Note" field GOHEAD-LFSNR, mandatory when selection is "Goods Receipt" against "Purchase Order".

BADI to be used is MB_MIGO_BADI

Logic to be provided to ABAP Team

Select Method MODE_SET

IF I_ACTION = A01 &

I_REFDOC = "R01"

Make LFSNR mandatory

Where

LFSNR = GOHEAD-LFSNR &

GOHEAD = Method STATUS_AND_HEADER-GOHEAD

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 5

Steps & Screenshots to be followed

Transaction Code: SE18

BADI: MB_MIGO_BADI

Go to SE18 Transaction code, select the radio button BADI and put in the BADI “MB_MIGO_BADI” and execute. You will be directed to below screen.

Select interface tab as indicated below, you will see the Methods available in the BADI. Select method “Mode_Set”.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 6

Here, you can see that there are two parameters, namely Action and Reference Documents as indicated below. Corresponding indicators for them are-

Action: Goods Receipt selection in MIGO, if it is A01

Reference Document: Purchase Order in MIGO, if it is R01

Here, ABAP code will check if in MIGO transaction, if the user has made the selection of GR and PO.

These inputs of users will be stored in the Memory ID of the ABAP code and will be transferred to another method of the BADI which will make the Delivery Note mandatory.

ABAP Code to be used in Mode_Set

method IF_EX_MB_MIGO_BADI~MODE_SET.

CALL FUNCTION 'ZMM_MIGO'

EXPORTING

i_action = i_action

i_refdoc = i_refdoc.

endmethod.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 7

Come back the interface screen again. Select “Status_And_Header” method to land up at Delivery Note field.

Select GOHEAD below to arrive at Delivery Note.

ABAP programme will check if the selection in MIGO is GR against PO and this input will be transferred to the method “Status_And_Header” through a memory ID.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 8

In above case, delivery note filed LFSNR will be made mandatory as indicated below.

ABAP Code to be used in Status_And_Header

METHOD if_ex_mb_migo_badi~status_and_header.

FIELD-SYMBOLS: <fs> TYPE ANY,

<fs1> TYPE ANY,

<fs2> TYPE ANY.

DATA : v_ebeln TYPE ebeln.

IF is_gohead-lifnr IS NOT INITIAL.

ASSIGN ('(SAPLZMM_MIGO)V_ACTION') TO <fs>.

IF sy-subrc IS INITIAL.

ASSIGN ('(SAPLZMM_MIGO)V_REFDOC') TO <fs1>.

IF sy-subrc IS INITIAL.

IF <fs> EQ 'A01' AND <fs1> EQ 'R01'.

IF is_gohead-lfsnr IS INITIAL.

MESSAGE i178(zpall) DISPLAY LIKE 'E' .

CALL TRANSACTION 'MIGO' .

ENDIF.

ENDIF.

ENDIF.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 9

ENDIF.

ENDIF.

ENDMETHOD.

Note: An error message is set as per business requirement. This is indicated in the Test Case in subsequent section.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 10

Test Case

Goods receipt against purchase order is selected in MIGO transaction. PO number is entered in

the MIGO screen. Delivery Note is kept blank initially.

On pressing enter, this BADI gets called and as there is no data in the Delivery Note, it throws an error message-

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 11

Again on Enter strike, PO number needs to be input. This time, delivery note data is input and it is executed.

This will populate the data from PO. Now, normal processing of GR against PO starts.

All mandatory fields like storage location, batch etc. are entered. Item is checked as indicated below-

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 12

On successful check, GR is posted. Material document is posted.

Material document is displayed below with input delivery note.

Making Delivery Note Mandatory in MIGO when Goods Receipt is Done Against Purchase Order

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 13

Disclaimer and Liability Notice

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.