Skip to Content
0

My custom tab coding affecting previously developed custom tab in me21n.

Dec 02, 2016 at 11:44 AM

97

avatar image

Hi Abapers,

I have developed a custom tab with 6 fields and added in me21n as 'Security Details'. Its working fine in me21n, ,me22n, me23n & me29n. Data is getting updated from me21n to table EKKO as well as if changed from me22n, me23n or me29n then also its getting updated perfectly. My tab is going to work for certain document types that too is working fine. Now my problem is that one custom tab which was developed earlier in me21n by someone else which has document types display same as mine and some more is also getting affected in other document types but working fine with my document types only. This should not happen. Its all happening for me in ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER where we both have added codes for based on document types. I am sharing my and his code for reference. Please someone help me to figure out where its going wrong.

This is previous persons'code.

DATA: L_PERSISTENT TYPE MMPUR_BOOL,
WA_HEAD TYPE MEPOHEADER.

FIELD-SYMBOLS: <FS> LIKE LINE OF CH_FIELDSELECTION.

CALL METHOD IM_HEADER->GET_DATA
RECEIVING
RE_DATA = WA_HEAD.

IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME23N' OR SY-TCODE EQ 'ME29N'.

IF WA_HEAD-BSART = 'NB' OR
WA_HEAD-BSART = 'ZIMP' OR
WA_HEAD-BSART = 'ZSER' OR
WA_HEAD-BSART = 'ZIMS' OR
WA_HEAD-BSART = 'ZCPM' OR
WA_HEAD-BSART = 'ZCIM' OR
WA_HEAD-BSART = 'ZHSS' OR
WA_HEAD-BSART = 'ZCPS' OR
WA_HEAD-BSART = 'ZCIS' OR
WA_HEAD-BSART = 'ZCHS'.

EXPORT ZTRTYP = ME->Z_TRTYP TO MEMORY ID 'ZTRTYP'.

IF ( ME->Z_TRTYP = 'V' AND SY-UCOMM NE 'MESAVE' ).
IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME29N' .

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ELSE.
IF SY-UCOMM = 'METOGG'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ENDIF.
ENDIF.
ELSEIF ME->Z_TRTYP = 'H' .

IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N'
OR SY-TCODE EQ 'ME23N'
OR SY-TCODE EQ 'ME29N'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ELSE.
IF SY-UCOMM = 'METOGG'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ENDIF.
ENDIF.

ELSEIF ME->Z_TRTYP = 'A'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

ENDIF.
ELSE.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_01.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.
READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_09.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_10.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.


ENDIF.
ENDIF.

IF SY-TCODE = 'ME22N' AND SY-UNAME = 'DEV1'.
DATA: GS_FS TYPE LINE OF TTYP_FIELDSELECTION_MM.

L_PERSISTENT = IM_HEADER->IS_PERSISTENT( ).

MOVE '501' TO GS_FS-METAFIELD.
MOVE '-' TO GS_FS-FIELDSTATUS.
INSERT GS_FS INTO CH_FIELDSELECTION INDEX 1.

ENDIF.

In ME_GUI_PO_CUST~SUBSCRIBE he declared as

DATA: LS_SUBSCRIBER LIKE LINE OF RE_SUBSCRIBERS.

CHECK IM_APPLICATION = 'PO'.

CHECK IM_ELEMENT = 'HEADER'.

CLEAR RE_SUBSCRIBERS[].

LS_SUBSCRIBER-NAME = SUBSCREEN1.
LS_SUBSCRIBER-DYNPRO = '0100'.
LS_SUBSCRIBER-PROGRAM = 'SAPLZPOCUST'.
LS_SUBSCRIBER-STRUCT_NAME = 'CI_EKKODB'.
LS_SUBSCRIBER-LABEL = 'PO Additional'.
LS_SUBSCRIBER-POSITION = 15.
LS_SUBSCRIBER-HEIGHT = 7.
APPEND LS_SUBSCRIBER TO RE_SUBSCRIBERS.

This is my code.

DATA: LS_PERSISTENT TYPE MMPUR_BOOL,
LS_HEAD TYPE MEPOHEADER,
FLAG TYPE CHAR1.

DATA: LS_ITEM TYPE MEPOITEM,
LT_ITEM TYPE STANDARD TABLE OF MEPOITEM,
LT_PO_ITEMS TYPE PURCHASE_ORDER_ITEMS.
DATA: LV_PLANT TYPE EWERK.

FIELD-SYMBOLS: <FS_PO_ITEM> TYPE PURCHASE_ORDER_ITEM.
FIELD-SYMBOLS: <FS1> LIKE LINE OF CH_FIELDSELECTION.

CALL METHOD IM_HEADER->GET_DATA
RECEIVING
RE_DATA = LS_HEAD.

LT_PO_ITEMS = IM_HEADER->GET_ITEMS( ). " Get PO items object

LOOP AT LT_PO_ITEMS ASSIGNING <FS_PO_ITEM>. " Get Purchasing Document Item
LS_ITEM = <FS_PO_ITEM>-ITEM->GET_DATA( ).
APPEND LS_ITEM TO LT_ITEM.
CLEAR LS_ITEM.
ENDLOOP.

READ TABLE LT_ITEM INTO LS_ITEM WITH KEY EBELN = LS_HEAD-EBELN.
IF SY-SUBRC = 0.
LV_PLANT = LS_ITEM-WERKS.
ENDIF.

IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME23N' OR SY-TCODE EQ 'ME29N'.

IF ( LS_HEAD-BSART = 'ZSER' OR
LS_HEAD-BSART = 'ZIMS' OR
LS_HEAD-BSART = 'ZCPS' OR
LS_HEAD-BSART = 'ZCIS' ) AND
LV_PLANT = '1100'.

EXPORT ZTRTYP = ME->Z_TRTYP TO MEMORY ID 'ZTRTYP'.

IF ( ME->Z_TRTYP = 'V' AND SY-UCOMM NE 'MESAVE' ).
IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME29N' .

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ELSE.
IF SY-UCOMM = 'METOGG'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ENDIF.
ENDIF.
ELSEIF ME->Z_TRTYP = 'H' .

IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME23N' OR SY-TCODE EQ 'ME29N'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ELSE.
IF SY-UCOMM = 'METOGG'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '+'.
ENDIF.

ENDIF.
ENDIF.

ELSEIF ME->Z_TRTYP = 'A'.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '*'.
ENDIF.

ENDIF.

ELSE.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_03.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.
READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_04.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_05.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_06.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_07.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

READ TABLE CH_FIELDSELECTION ASSIGNING <FS> WITH TABLE KEY METAFIELD = MMMFD_CUST_08.
IF SY-SUBRC IS INITIAL.
<FS>-FIELDSTATUS = '-'.
ENDIF.

ENDIF.
ENDIF.

In ME_GUI_PO_CUST~SUBSCRIBE I declared as

CHECK IM_APPLICATION = 'PO'.

CHECK IM_ELEMENT = 'HEADER'.

CLEAR LS_SUBSCRIBER.

LS_SUBSCRIBER-NAME = 'SDTCHECK'.
LS_SUBSCRIBER-DYNPRO = '0101'.
LS_SUBSCRIBER-PROGRAM = 'SAPLZMM_ME21N'.
LS_SUBSCRIBER-STRUCT_NAME = 'CI_EKKODB'.
LS_SUBSCRIBER-LABEL = 'Security Deposit'.
LS_SUBSCRIBER-POSITION = 19.
LS_SUBSCRIBER-HEIGHT = 7.
APPEND LS_SUBSCRIBER TO RE_SUBSCRIBERS.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Roland Jungnickel Dec 02, 2016 at 02:22 PM
0

both code is manipulating the same fields, make sure your fieldnames (numbers) get unique.

Share
10 |10000 characters needed characters left characters exceeded
surajit sharma Dec 03, 2016 at 10:08 AM
0

hi roland, yes u r right. i too think the same bcoz 6 fields are getting affected in the previous tab out of of nine as i have 6 fields in mine. Type pools MMFD has 10 fields for custom tab usage hence i used 6 from them but unfortunately previous developer also used 9 from them. This is the reason for things getting messed up. Do you have any idea to make them unique. I think this will solve the issue.

Share
10 |10000 characters needed characters left characters exceeded
surajit sharma Dec 05, 2016 at 06:56 AM
0

Hi Solved the issue.

Declared as below in ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS & ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.

TYPE-POOLS: MMMFD.
TYPE-POOLS: MMPUR.
CONSTANTS: MMMFD_CUST_11 TYPE MMPUR_METAFIELD VALUE 90000010.
CONSTANTS: MMMFD_CUST_12 TYPE MMPUR_METAFIELD VALUE 90000011.
CONSTANTS: MMMFD_CUST_13 TYPE MMPUR_METAFIELD VALUE 90000012.
CONSTANTS: MMMFD_CUST_14 TYPE MMPUR_METAFIELD VALUE 90000013.
CONSTANTS: MMMFD_CUST_15 TYPE MMPUR_METAFIELD VALUE 90000014.

Then changed code accordingly in ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.

Thank you Roland for showing the path.

Regards,

Arijit

Share
10 |10000 characters needed characters left characters exceeded