ABAP development for MRP

New columns in MD04

MD_ADD_COL_OVERVIEW Additional Fields in MD04

method IF_EX_MD_ADD_COL_EZPS~ACTIVATE_ADD_COLUMNS.
CLEAR: button1_ez, button2_ez, button3_ez,
ez1_mode, ez2_mode, ez3_mode.

button1_ez = text-ez1.

* Define an icon for button 2, but text only as quickinfo
button2_ez-icon_id = '@3O@'. " ICON_FINAL_DATE
button2_ez-icon_text = space.
button2_ez-quickinfo = text-ez2.

* The column with the batch number should always be visible
ez1_mode = '1'.
endmethod.



METHOD if_ex_md_add_col_ezps~fill_add_columns.
DATA : lv_vtweg TYPE vtweg,
lv_vtext TYPE vtxtk.

CLEAR : lv_vtweg, lv_vtext.
SELECT SINGLE vtweg INTO lv_vtweg FROM vbak WHERE vbeln = ie3mdpslx-delnr.
IF sy-subrc EQ 0.
SELECT SINGLE vtext INTO lv_vtext FROM tvtwt WHERE spras = 'E'
AND vtweg = lv_vtweg.
emdezx_usex1 = lv_vtext.
ENDIF.
ENDMETHOD.

MRP on HANA

Existing BAdI implementations that influence the data reading process of the classic MRP (e.g. BAdI MD_CHANGE_MRP_DATA) will or won't be supported in S4HANA depending on the used planning transactions:
  • If the planning transactions are not optimized for HANA (like MD50, MD51 or all LTP planning transactions), then the classic BAdIs/extension with their implementations will still be supported.
  • If the planning transactions are optimized for HANA (like MD01, MD02, MD03, materials forced to classic MRP by MRP Live), then it is required to use an alternative ABAP BAdI. In this case BAdI MD_ADD_ELEMENTS has to be used to adjust the data determined by the HANA optimized reading processes.

Application components:  PP-MRP-PR, PP-MRP-PE, PP-REM-PLN

Function group: M61X

Using the Business Add-In (BAdI) MD_ADD_ELEMENTS, you can change the MRP data that was imported during the following processes:

Once the requirements and receipts have been completely imported in the standard system, you can completely revise the data. You can also add user-defined requirements and receipts to the table of MRP elements.

Note the far-reaching effects, which may result, for example in the subsequent net requirements calculation in planning and during the interpretation of the planning result. There is no consistency check after the method has run. SAP does not accept responsibility for any data inconsistency, which may occur, nor for errors in subsequent processes.

Due to the complexity of this BAdI and the high risk, which can arise as a result of changes, this BAdI is only designed for SAP internal Industry Business Solutions. Customers or partners should only use this BAdI in exceptional cases and in consultation with the development department.



2268085 - S4TWL - MRP Live on SAP HANA - MD01N

Below you will find a list of the most important and useful BAdIs on MRP:

  • MD_CHANGE_MRP_DATA: In my opinion, it is the most important BAdI on MRP. It allows you to change any MRP element during the MRP or on MD04 transaction. The most common use is to make an MRP element not relevant for MRP but it can be also used for another changes, such as changes in quantities, for example. You can find an example of implmenentation on the document Making an element not relevant to MRP using BAdI MD_CHANGE_MRP_DATA.
  • MD_SUBCONT_LOGIC: This BAdI is used to activate the old subcontracting logic which was used until release release 3.1I. All subcontracting stocks and requirements are managed in the net segment, which means that there are no separate subcontracting segments. See also note 1927160.
  • MD_ADD_ELEMENTS: With this BAdI is possible to include a new user-defined MRP element.
  • MD_DISPLAY_ELEMENT: Allows you to change the display of an MRP element.
  • MD_MRP_PARAMETERS: With this BAdI is possible to change the settings from material master, customizing or even quota arrangement for an specific material, before the MRP run or in MD04, for example.
  • MD_ADD_COL_EZPS: With this BAdI it’s possible to include additional columns on the MRP evaluation transactions (MD04, for example).
  • MD_PURREQ_CHANGE and MD_PLDORD_CHANGE: Can be used for fill and change fields of purchase requisitions and planned orders created, changed or deleted during the MRP run.
  • MD_PURREQ_POST and MD_PLDORD_POST: Can be used for additional actions after the purchase requisition and planned order changes, such as saving information on a custom table, a workflow or implementing a change log. It should not be used for changing the order itself.
  • MD_MODIFY_SOURCE: This BAdi allows you to define your own logic for the source determination during the MRP run.
  • MD_MODIFY_PRODVERS: This BAdi allows you to define your own logic for the production version selection.
  • MD_PLDORD_SCHEDULING: With this BAdI you can change the scheduling parameters for planned orders before scheduling is called.
  • MD_STOCK_TRANSFER: This BAdI allows you to change the requirement dates of the requirements of stock transfer procurement proposal in the issuing plant.
  • MD_EXT_SUP: On the standard system, there is no determination of the issuing storage location for stock transfers, however, it is possible to create your own logic to select the issuing storage location for stock transfers using this BAdI. You can find more information about MD_EXT_SUP on note 1783556 and on wiki http://wiki.scn.sap.com/wiki/x/qgQbF
  • MD_CHANGE_CALENDAR: This BAdI can be used to use a different calendar for the safety time and the evaluations of the range of coverage data, instead of the factory calendar.
  • MD_EXCLUDE_MATERIAL: Can be used to show a tab with “Additional Selections” on the initial screen of transactions MD06 and MD07 where you can add your own fields to restrict the selection.
  • MD_LAST_LOT_EXACT: Allows you to use your own logic to calculat the last lot on a sales or project individual stocks.
  • MD_MRP_LIST: With this BAdI you can process data from the MRP list of a material during posting in the planning run. It allows you to evaluate the MRP data immediately after the planning run and trigger follow-up actions, however, you cannot change the MRP data.
  • MD_INTERACT_PLANNING: With this BAdI it’s possible to control is users are allowed to change MRP elements in the results display of the planning transactions for a material (such as MD02).
  • MD_SET_TRAFFIC_LIGHTS_DS: With this BAdI you can define your own limit values for the range-of-coverage evaluation for certain materials. See note 1587375 for more details.
  • MD_PURREQ_REL_STRAT: This BAdI can be used to deactivate the release strategy for purchase requisitions generated by MRP.
  • MD_CREATE_GROUPING: You can use this BAdI to define a customer-specific grouping of materials for the current stock/requirements list.
  • MD_MRP_RUN_PARALLEL: Can be used to adjust the number of materials which are assigned to a process for each planning package when running parallel MRP. That way, it is possible to achieve a more uniform utilization of the tasks when there are extremely different runtime of the individual application servers or of the tasks.
  • MD_ADAPT_DISTRIBUTION: This BAdI was delivered to influence the start/end date and the factory calendar used for the distribution of quantities on the MRP transactions, when using a distribution key.



You must be very careful when implementing any of these BAdIs, since generally there is not check after the BAdI execution and it is possible to make deep changes on the MRP standard logic.

In order to find a complete list of the BAdIs available for MRP, just look for BAdIs starting with MD on transaction SE18.

It is possible to know if a BAdI is active by the indicator “BAdI Active” on transactions MD04 and MD05.

BADI ACTIVE.png

You can also find the complete list of available MRP BAdIs and more information about each BAdI on SPRO, on the following path:

– Production – Material Requirements Planning – Business Add-Ins for Requirements Planning

BAdI.png


Comments