ME5xN(x:1-2): custom column is editable in Subscreen Item but not in ALV grid
FM
MEMFS_BUILD_MAPPING_PO_VIEWS
->LMEMFSF0Z
enhancement 14 zenhance_alvg_rid_editable. "active version
map 'ZZ_NOT_INPUT' mmmfd_cust_01.
endenhancement.
BADI
IF_EX_ME_PROCESS_REQ_CUST
~FIELDSELECTION_ITEM
method IF_EX_ME_PROCESS_REQ_CUST~FIELDSELECTION_ITEM.
* To control 'ZZ_NOT-INPUT' field editable in ALV grid of ME5xN x=1.2
CHECK sy-tcode eq 'ME51N' or sy-tcode eq 'ME52N'.
TYPE-POOLS:mmmfd.
data: f_document type mepo_document.
FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
* In ME52N change mode,it's editable,but in view mode,it's not.
CALL METHOD im_header->GET_TRANSACTION_STATE( IMPORTING EX_DOCUMENT = f_document ).
IF f_document-TRTYP eq 'V'.
READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_01.
IF sy-subrc IS INITIAL.
<fs>-fieldstatus = '.'.
ENDIF.
ENDIF.
endmethod.