Professional Documents
Culture Documents
Former Member
06-14-2013 9:18 AM
11 Kudos
Dear all, I have implemented a custom tab in MIGO, you can follow the steps.
The first four fields should be the key fields, and the rest fields are your required custom fields.
Step 2: create a structure with the custom field you require on the MIGO.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 1/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
Step 3: open structure GOITEM and append the same custom structure into it as shown below.
Step 4: Create another structure and append the table created in Step-1.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 2/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
Step 5: Create a Table type of the structure created in step-4 as shown below.
Step 6: go to SE80 and create a program as shown below. This screen must contain two screen.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 3/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
Press Create Impl. Button and create Implementation: ZMIGO_WARRENTY as shown below.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 4/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
Step 9: Maintain the following attributes in your Class Interface as shown below.
Step 10: Write the following codes for the methods shown below.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 5/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
METHOD if_ex_mb_migo_badi~init.
APPEND gf_class_id TO ct_init.ENDMETHOD.
METHOD if_ex_mb_migo_badi~pbo_detail.
DATA: wa_extdata TYPE zst_warrenty.
DATA :gf_class_id TYPE migo_class_id.
gf_class_id = 'ZCLASS_MIGO_WARRENTY'.
CHECK i_class_id = gf_class_id.
IF g_no_input IS INITIAL.
e_cprog = 'ZSAPMZMM_MIGO_WARENTY'.
e_dynnr = '9001'. "External fields: Input
e_heading = 'Warranty'(001).
ELSE.
e_cprog = 'ZSAPMZMM_MIGO_WARENTY'.
e_dynnr = '9002'. "External fields: Display
e_heading = 'Warranty'(001).
ENDIF.
g_line_id = i_line_id.
READ TABLE gt_extdata INTO wa_extdata WITH KEY line_id = g_line_id.
IF sy-subrc = 0 AND wa_extdata-mblnr IS NOT INITIAL AND wa_extdata-mjahr IS NOT INITIAL AND wa_extdata-
zeile IS NOT INITIAL.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 6/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
METHOD if_ex_mb_migo_badi~pai_detail.
e_force_change = 'X'.ENDMETHOD.
METHOD if_ex_mb_migo_badi~line_modify.
DATA: ls_extdata TYPE zst_warrenty.
IF cs_goitem-mblnr IS NOT INITIAL AND cs_goitem-mjahr IS NOT INITIAL AND cs_goitem-zeile IS NOT INITIAL.
ls_extdata-line_id = i_line_id.
ls_extdata-mblnr = cs_goitem-mblnr.
ls_extdata-mjahr = cs_goitem-mjahr.
ls_extdata-zeile = cs_goitem-zeile.
ls_extdata-zzwarnt = cs_goitem-zzwarnt.
ls_extdata-zzwbegd = cs_goitem-zzwbegd.
ls_extdata-zzwendd = cs_goitem-zzwendd.
DELETE gt_extdata WHERE line_id = ls_extdata-line_id.
INSERT ls_extdata INTO TABLE gt_extdata.
ELSE.
ls_extdata-line_id = i_line_id.
ls_extdata-zzwarnt = cs_goitem-zzwarnt.
ls_extdata-zzwbegd = cs_goitem-zzwbegd.
ls_extdata-zzwendd = cs_goitem-zzwendd.
DELETE gt_extdata WHERE line_id = ls_extdata-line_id.
INSERT ls_extdata INTO TABLE gt_extdata.
ENDIF.ENDMETHOD.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 7/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
METHOD if_ex_mb_migo_badi~reset.
CLEAR: gt_extdata,
g_no_input,
gs_exdata_header,
g_cancel,
g_line_id.ENDMETHOD.
METHOD if_ex_mb_migo_badi~post_document.
DATA: wa_warrenty TYPE ztb_warrenty,
it_warrenty TYPE TABLE OF ztb_warrenty,
wa_mseg TYPE mseg,
wa_extdata TYPE zst_warrenty.
METHOD if_ex_mb_migo_badi~check_item.
DATA: wa_extdata TYPE zst_warrenty,
ls_bapiret TYPE bapiret2.
READ TABLE gt_extdata INTO wa_extdata WITH TABLE KEY line_id = i_line_id.
IF wa_extdata-zzwarnt IS INITIAL.
ls_bapiret-type = 'E'.
ls_bapiret-id = 'M7'.
ls_bapiret-number = '895'.
ls_bapiret-message_v1 = 'Enter warranty condition'(002).
APPEND ls_bapiret TO et_bapiret2.
ENDIF.
IF wa_extdata-zzwarnt = 'YES' AND ( wa_extdata-zzwbegd IS INITIAL OR wa_extdata-zzwendd IS INITIAL
OR ( wa_extdata-zzwbegd GT wa_extdata-zzwendd ) ).
ls_bapiret-type = 'E'.
ls_bapiret-id = 'M7'.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 8/9
3/1/24, 9:44 PM How to create a custom TAB for MIGO Item Details - SAP Community
ls_bapiret-number = '895'.
ls_bapiret-message_v1 = 'Enter appropriate warranty Start and End date'(003).
APPEND ls_bapiret TO et_bapiret2.
ENDIF.
ENDMETHOD.
METHOD if_ex_mb_migo_badi~mode_set.
CLEAR : g_no_input.
IF i_action = 'A04' .
g_no_input = 'X'.
ENDIF.
IF i_action = 'A03'.
g_cancel = 'X'.
ENDIF.ENDMETHOD.
Note: Leave the other Methods blank. Do not write any thing in that.
Step 11: Open MIGO , you will be able to see the new tab “WARRANTY” as shown below.
The system will store the data of your custom screen into the table created in Step-1.
https://community.sap.com/t5/application-development-blog-posts/how-to-create-a-custom-tab-for-migo-item-details/ba-p/13260106 9/9