Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need BADI or Exit in MIGO transaction

Former Member
0 Kudos

Hi All,

While creating GOODS RECEIPT in MIGO, I need to update the Equipment master.

In MIGO transaction, go to DETAIL DATA Click on the IMPORT tab and press theDETAIL button. It will take you to IMPORT DATA . Click on the ORIGIN/DESTINATION/BUSINESS tab , there you will find the CITY OF ORIGIN (EIPO-HERKL). Here user will enter the value for city of origin.

Requirement is to capture this entered CITY OF ORIGIN and update in the COMPANY OF MANUFACTURE field (HERLD) in equipment master using BAPI, BAPI_EQUI_CHANGE.

Could anyone please suggest me how to capture the City of Origin value and which BADI/Exit will be suitable to write above mentioned BAPI.

I need these field values in BADI/Exit : MATNR and SERNR

Thanks in advance.

Regards,

Harsha

2 REPLIES 2

s_nnoorie
Active Participant
0 Kudos

Hi,

you can use BAPI_GOODSMVT_CREATE for goods receipt.

i had a similer requirement of passing equipment serial numbers.

in Tables of BAPI u can pass ur equipment numbers (GOODSMVT_SERIALNUMBER STRUCTURE BAPI2017_GM_SERIALNUMBER).

GMCODE Table T158G

01 - MB01 - Goods Receipts for Purchase Order

02 - MB31 - Goods Receipts for Prod Order

03 - MB1A - Goods Issue

04 - MB1B - Transfer Posting

05 - MB1C - Enter Other Goods Receipt

06 - MB11

Domain: KZBEW - Movement Indicator, Goods movement w/o reference

B - Goods movement for purchase order

F - Goods movement for production order

L - Goods movement for delivery note

K - Goods movement for kanban requirement (WM - internal only)

O - Subsequent adjustment of "material-provided" consumption

W - Subsequent adjustment of proportion/product unit material

Sample code:

*----


Header

wa_header-pstng_date = sy-datum.

wa_header-doc_date = sy-datum.

*----


Code

wa_code-gm_code = '04'.

loop at it_da INTO wa_da.

SELECT SINGLE matnr

FROM equi

INTO v_matnr

WHERE equnr = wa_da-equnr

AND sernr = wa_da-sernr.

SET LOCALE LANGUAGE sy-langu.

TRANSLATE wa_da-batch TO UPPER CASE.

TRANSLATE wa_da-shift TO UPPER CASE.

*----


Item

wa_item-material = v_matnr. "wa_da-matnr.

wa_item-plant = wa_da-werks.

wa_item-stge_loc = 'CE00'.

wa_item-batch = wa_da-batch.

IF wa_da-remrk_qc = 'R'.

wa_item-move_type = '344'.

CLEAR wa_item-MOVE_STLOC.

ELSE.

wa_item-move_type = '311'.

wa_item-MOVE_STLOC = 'CF00'.

ENDIF.

wa_item-entry_qnt = '1'.

wa_item-MVT_IND = ' '.

APPEND wa_item to it_item.

*----


Serial number

cnt = cnt + 1.

wa_serial_no-matdoc_itm = cnt.

wa_serial_no-serialno = wa_da-sernr.

APPEND wa_serial_no to it_serial_no.

CLEAR wa_da.

ENDLOOP.

*--


BAPI--


CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = wa_header

goodsmvt_code = wa_code

IMPORTING

MATERIALDOCUMENT = doc_no

tables

goodsmvt_item = it_item

GOODSMVT_SERIALNUMBER = it_serial_no

return = it_return1

.

endif.

Former Member
0 Kudos

Hi harsha

Please put a break point in the class CL_EXITHANDELER------->>and CALL METHOD cl_exithandler=>get_class_name_by_interface

exit name will provide u the BADI name .

And execute the MIGO transaction in other window ..

As i am not able to view the DETAILS tab as u said .

Once u find the BADI name::

Check the details in se18 -


>> give BADI name -


>> u can check its PARAMETERS in the SIGNATURE section .

that are being used by that BADI .

Regards

Swapnil