You can disable or grey out standard field in ME51N on certain condition. the solution you need to create Enhancement Implementation in function module MEREQBADI_FS_ITEM and create enhancement on last line and put this ABAP Code into this enhancement.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
DATA: WA_ITEM TYPE MEREQ_ITEM, WA_header TYPE MEREQ_header. FIELD-SYMBOLS: <fs_sakto> like line of CH_FIELDSELECTION. CLEAR: WA_ITEM. CALL METHOD IM_ITEM->GET_DATA " Get PR items RECEIVING RE_DATA = WA_ITEM. CALL METHOD IM_header->GET_DATA " Get PR items RECEIVING RE_DATA = WA_header. IF wa_item-idnlf ne ''. READ TABLE CH_FIELDSELECTION ASSIGNING <fs_sakto> WITH TABLE KEY METAFIELD = 73. IF SY-SUBRC eq 0. <fs_sakto>-fieldstatus = '*'. "Displayed Only ENDIF. ELSE. READ TABLE CH_FIELDSELECTION ASSIGNING <fs_sakto> WITH TABLE KEY METAFIELD = 73. IF SY-SUBRC eq 0. <fs_sakto>-fieldstatus = '+'. "Displayed Only ENDIF. ENDIF. IF wa_item-afnam ne ''. READ TABLE CH_FIELDSELECTION ASSIGNING <fs_sakto> WITH TABLE KEY METAFIELD = 17. IF SY-SUBRC eq 0. <fs_sakto>-fieldstatus = '*'. "Displayed Only ENDIF. ELSE. READ TABLE CH_FIELDSELECTION ASSIGNING <fs_sakto> WITH TABLE KEY METAFIELD = 17. IF SY-SUBRC eq 0. <fs_sakto>-fieldstatus = '+'. "Displayed Only ENDIF. ENDIF. |
Note : That’s code will grey out automatically after user input data into field AFNAM ( Requisitioner […]