md04 add new columns
Post on 29-Dec-2015
Embed Size (px)
MD04 Add ColumnMD04 transaction gives a live information about current material stock in plant and how various MRP element will affect the stock in future. It will show outbound deliveries, sales orders, inbound deliveries, purchase orders, purchase requisitions and forecasts with there respective quantity and date and how much stock will remain in plant after that transaction.
User exit availableEXIT_SAPLM61R_001EXIT_SAPMM61R_001
FM to get the data displayed in MD04MD_STOCK_REQUIREMENTS_LIST_API
Add column to MD04 transaction
User exit available allows to add up to three columns in transaction MD04. To add column to MD04 screen you need to put code in both EXIT_SAPLM61R_001 and EXIT_SAPMM61R_001 exits. Code in exit EXIT_SAPLM61R_001 determines the column header text of new column(s) and exit EXIT_SAPMM61R_001 contains code to derive value which will be displayed in column.
You can find the sample code for each user exit in include LXM61F04 and LXM61F03. For more information on this see documentation of Enhancement M61X0002 in transaction SMOD.
These two user exits are now replaced by BADI MD_ADD_COL_EZPS. For backward compatibility, SAP still allows users to use exits to add column in MD04. However if you implement BADI BADI MD_ADD_COL_EZPS then call to user exits will be skipped. See the code below from program SAPLM61R.* Call the user-exit if the BADI (that replaces the exit) is not active PERFORM badi_get_business_add_in USING 'MD_ADD_COL_EZPS' CHANGING lo_badi. IF lo_badi IS INITIAL. CALL CUSTOMER-FUNCTION '001' EXPORTING imdkp = mdkp imt61d = mt61d IMPORTING button1_ez = usex1-text "text Button1 Einzelzeil. button2_ez = usex2-text "text Button2 Einzelzeil. button3_ez = usex3-text "text Button3 Einzelzeil. button1_ps = usex1_ps"text Button1 Periodensum button2_ps = usex2_ps"text Button2 Periodensum. button3_ps = usex3_ps. "text Button3 Periodensum. ENDIF.
BADI MD_ADD_COL_EZPS has methods ACTIVATE_ADD_COLUMNS and FILL_ADD_COLUMNS and like exists you use one method to activate and put column heading to columns and other to fill the value in columns. Again, you can find the sample code for these methods in class CL_EXM_IM_MD_ADD_COL_EZPS in SE24, just double click on the method and you will see the code. BADI MD_ADD_COL_EZPS is not multi use BADI, which means you can only have one implementation of BADI, which make sense. You can get additional information about BADI MD_ADD_COL_EZPS from transaction SE18.