Skip to Content
0
Former Member
Nov 22, 2012 at 10:55 AM

custom tab at header level for PO

595 Views

Hi experts

I trying to add a new custom tab at header level for t code me21n/me22n.me23n. but the tab is displaying only for me23n. not for me21n and me22n.

I used badi me_gui_po_cust

Method i used in badi me_gui_po_cust

1. Subscribe menthod

METHOD IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
DATA: LS_SUBSCRIBER LIKE LINE OF RE_SUBSCRIBERS.
CHECK IM_APPLICATION = 'PO'.
CHECK IM_ELEMENT = 'HEADER'.
CLEAR RE_SUBSCRIBERS[].
LS_SUBSCRIBER-NAME = 'SCREEN'.
LS_SUBSCRIBER-DYNPRO = '0001'.
LS_SUBSCRIBER-PROGRAM = 'ZME_GUI_PO_CUST_SCREEN'.
LS_SUBSCRIBER-STRUCT_NAME = 'ZEKPO'.
LS_SUBSCRIBER-LABEL = 'OTHER DATA'.
LS_SUBSCRIBER-POSITION = 11.
LS_SUBSCRIBER-HEIGHT = 7.
APPEND LS_SUBSCRIBER TO RE_SUBSCRIBERS.
ENDMETHOD.

2.MAP_DYNPRO_FIELDS method
METHOD IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS.
FIELD-SYMBOLS: <MAPPING> LIKE LINE OF CH_MAPPING.
LOOP AT CH_MAPPING ASSIGNING <MAPPING>.
CASE <MAPPING>-FIELDNAME.
WHEN 'EBELN'. <MAPPING>-METAFIELD = MMMFD_CUST_03.
WHEN 'MWSKZ'. <MAPPING>-METAFIELD = MMMFD_CUST_04.
ENDCASE.
ENDLOOP.
ENDMETHOD.

3.Program used with PBO of the screen


*&---------------------------------------------------------------------*
*& Report ZME_GUI_PO_CUST_SCREEN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZME_GUI_PO_CUST_SCREEN.
TABLES: ZEKPO.

DATA: CALL_SUBSCREEN TYPE SY-DYNNR,
CALL_PROG TYPE SY-REPID,
CALL_VIEW TYPE REF TO CL_SCREEN_VIEW_MM,
ebeln TYPE ekpo-ebeln,
CALL_VIEW_STACK TYPE REF TO CL_SCREEN_VIEW_MM OCCURS 0.

*&---------------------------------------------------------------------*
*& Form set_subscreen_and_prog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->DYNNR text
* -->PROG text
* -->VIEW text
*----------------------------------------------------------------------*
FORM SET_SUBSCREEN_AND_PROG USING DYNNR TYPE SY-DYNNR
PROG TYPE SY-REPID
VIEW TYPE REF TO CL_SCREEN_VIEW_MM.
CALL_SUBSCREEN = DYNNR.
CALL_PROG = PROG.
CALL_VIEW = VIEW.
ENDFORM. "SET_SUBSCREEN_AND_PROG
*----------------------------------------------------------------------*
* MODULE STATUS_0001 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
TYPES : BEGIN OF TY_EKPO, "CHANGES
EBELN TYPE EBELN,
MWSKZ TYPE MWSKZ,
END OF TY_EKPO.

DATA : IT_HEADER TYPE TABLE OF ZEKPO,
WA_HEADER TYPE ZEKPO,
IT_EKPO TYPE TABLE OF TY_EKPO,
WA_EKPO TYPE TY_EKPO.


MODULE STATUS_0001 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

*BREAK-POINT.
*SELECT EBELN MWSKZ INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO
* WHERE EBELN = '3000000007'.
* BREAK-POINT.
SELECT SINGLE * FROM EKPO
INTO CORRESPONDING FIELDS OF WA_HEADER
WHERE EBELN = '3000000006'.

ZEKPO-MWSKZ = WA_HEADER-MWSKZ.

* SELECT EBELN MWSKZ INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO
* WHERE EBELN = WA_HEADER-EBELN.

* READ TABLE IT_EKPO INTO WA_EKPO " CHANGES
*WITH KEY EBELN = WA_HEADER-EBELN.
* IF SY-SUBRC IS INITIAL. "CHANGES
* WA_HEADER-MWSKZ = WA_EKPO-MWSKZ."CHANGES
* ENDIF."CHANGES
ENDMODULE. "STATUS_0001 OUTPUT

badi 2nd

when i m trying to use badi ME_PROCESS_PO_CUST

but 1 implementation is already in the system. when i m trying to change this its is asking for access kye.

Please help me to display the tab in me21n and me22n

thanks and regard

bpn