Supply Chain Management Blog Posts by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
cancel
Showing results for 
Search instead for 
Did you mean: 
640

Dear colleagues
This article describes the extensibility potential of the central EWM application - EWM Monitor, available from SAP S/4HANA 2023 FPS2 and brings some more technical details in addition to the blog post link EWM Warehouse Management Monitor – Enhancements with SAP S/4HANA 2023 FPS2. The target audience is EWM consultants, developers and solution architects.

 

Overview:

Let's imagine, we have a request to extend the inbound node with custom selection fields e.g planned unloading date, currently the Warehouse Management monitor provides selection screen extensibility only for a few standard nodes (via Dynamic Selection), but most standard nodes can only be extended by copying them to custom nodes. From SAP S/4HANA 2023 FPS2 there is a possibility to extended standard nodes with custom fields using BADI: /SCWM/EX_MON_CUSTOM_SELECT, enhancement spot /SCWM/ES_MONITOR_FRAMEWORK.

DzmitryCharniakevich_0-1739447908738.png

Figure 1 - Standard Inbound Delivery selection screen with customer specific Screen Enhancement

Using this BADI you can easily add custom fields Supported nodes (as of OP2023 FPS2): 

Node/FMDescription in Monitor
Inbound Delivery 
/SCWM/WHRHEAD_MONInbound Delivery
/SCWM/WHRITEM_MONInbound delivery Item
/SCWM/WHRHDR_INB_WO_MONWarehouse Order
/SCWM/WHRHDR_INB_TO_MONWarehouse Task
/SCWM/WHRHEAD_INB_HU_MONHandling Unit
Outbound Delivery Order 
/SCWM/WHRHEAD_MON_OUTOutbound Delivery
/SCWM/WHRITEM_MON_OUTOutbound delivery Item
/SCWM/WHRHDR_OUT_WO_MONWarehouse Order
/SCWM/WHRHDR_OUT_TO_MONWarehouse Task
/SCWM/WHRHEAD_OUT_HU_MONHandling Unit
/SCWM/WHRHDR_OUT_WAVE_MONWave (no EEW support, only ODO Header fields possible)
Production Material Request 
/SCWM/HEAD_PCRPMR Header
/SCWM/ITEM_PCRPMR Items
/SCWM/PCRHDR_WO_MONWarehouse Order
/SCWM/PCRHDR_TO_MONWarehouse Task
Documents 
/SCWM/HUMO_HEADERHandling Unit (no BAdI support for deleted/dispatched HU selection)
/SCWM/HEAD_PCPosting Change Header
/SCWM/ITEM_PCPosting Change Items
/SCWM/HEAD_STStock Transfer Header
/SCWM/ITEM_STStock Transfer Items
Stock and Bin 
/SCWM/HU_OVERVIEW_MONHandling Unit
/SCWM/HU_PER_BIN_MONHandling Unit

BADI overview:

BADI name:  /SCWM/EX_MON_CUSTOM_SELECT.

Enhancement spot: /SCWM/ES_MONITOR_FRAMEWORK.

Filters:

  • LGNUM - Warehouse number
  • FM_NAME - function module name

Screen enhancements contain information about the supported nodes, FM's names etc.

DzmitryCharniakevich_0-1739448841230.png

Figure 2 -Screen enhancements information

There is a BADI example implementation available for each monitor node and its sub-nodes. These examples provide all the necessary details to help you implement the BADI correctly.

How to implement the BADI:

It is highly recommended to separate the BADI implementations for different Monitor nodes, for example: Inbound delivery node and its sub nodes would have BADI implementation 1 and Outbound delivery node and its sub nodes would have BADI implementation 2. The Implementation logic would be separated by filters. 

Inbound delivery and its sub node example:

Firstly, EEW structures should be extended with your custom field names, for delivery you have to defined logical field names in customising.

Filters combinations should be created:

DzmitryCharniakevich_0-1739449277940.png

Figure 3 - Filters combinations for Inbound Node.

The next step would be custom selection screen creation using custom report. Code sample could be found in /SCWM/CL_EI_MON_CUST_SEL_INB example implementation class, method SCREEN_ENHANCEMENT_EXAMPLE.

Small remark: All selection screens must be defined as sub screen, as only sub screen areas could be replaced.For standard execution without BADI, sub screen area 8999 (representing the dummy sub screen area without any fields) would be called, when the BADI is implemented, 8999 sub screen area would be replaced with custom sub screen area that was defined in Screen Enhancements tab of BADI implementation.

DzmitryCharniakevich_1-1739450363984.png

Figure 4 - Screen Enhancements tab example for warehouse Inbound node implementation

Once this part would be done, you can start with class implementation. 

Before methods implementation, class range types for your custom fields should be defined for correct variant execution.

DzmitryCharniakevich_0-1739450965120.png

Figure 5 - example of range types for custom fields.

Based on these types instance attributes should be created.

DzmitryCharniakevich_1-1739451054475.png

Figure 6 - example of instance attributes for custom fields.

After this part, methods GET_INSTANCE and CONSTRUCTOR must be created and implemented, as our BADI implementation class would be called in report with custom sub screen areas.

SET_SELECTION_PARAMETERS and GET_SELECTION_PARAMETERS must be created and implemented for correct variant execution and they would be called in report with custom sub screen areas.

DzmitryCharniakevich_2-1739451299023.png

Figure 7 - example of parameters for SET_SELECTION_PARAMETERS method.

DzmitryCharniakevich_3-1739451315591.png

Figure 8 - example of parameters for GET_SELECTION_PARAMETERS method.

BADI implementation class methods:

ENHANCE_FIELD_MAPPING - Method is used to provide correct mapping between custom fields and standard fields. 

Parameters information: 

  • ct_mapping_parent - Table that would contain information about parent node mapping information. The parent mapping information is always relevant for parent node in warehouse monitor, for example Outbound delivery node or Inbound delivery node.
  • ct_mapping_sub  - Table that would contain information about sub node mapping information. The sub mapping information is always relevant for sub node in warehouse monitor, for example Outbound delivery item node or Inbound delivery warehouse node.
  • ct_mapping_batch - Table that would contain information about mapping for batch execution.

GET_SCREEN_PROGRAM - Method is used to get custom program name to connect standard selection screen and custom selection screen.

Parameters information: 

  • iv_monitor - Current monitor
  • iv_fm_name - Current FM
  • ev_repid - Report name
  • ev_screen_num - sub screen number ( only relevant, if you want to provide possibility for BADI execution in custom nodes, the information would be available in Part 2 ).

GET_VARIANT_DATA - Method is used to get variant data information, as there is no possibility to dynamically extend standard variant behavior.

Parameters information: 

  • rv_variant_data - contain variant information.

SET_VARIANT_DATA - Method is used to set variant data information, as there is no possibility to dynamically extend standard variant behavior.

Parameters information: 

  • iv_variant_data - contain variant information.

PRE_SELECTION - Method is used for only HU(currently) preselection. As there is no possibility to get information using EEW fields during standard HU selection, this method could be used to preselect values based on dynamic where clause or importing range tab. This method MUST be implemented for correct HU node execution.

Parameters information: 

  • iv_monitor - Current monitor.
  • it_where - Where tab that contain where clause for HU selection( highly recommended to use this.
  • it_mapping - Mapping table that contain all necessary mapping information.
  • it_tab_range - Range table that contain all select options for current execution.It might be relevant to check this table for additional selection values stored in parameters e.g. for Plan HU selection.
  • iv_table_alias - Table alias that should be used during preselection.
  • iv_lgnum - Warehouse number.
  • ct_presel - Table, that would contain preselected values.
  • cv_key_sel_opt_is_used - Key select option is HUIDENT for the HU selection. If you use this field for the preselected values, than the flag can be set to true. It is highly recommended to use HUIDENT as preselected value for better performance and stability. By setting this flag to true, you also confirm that you have considered all standard selection criteria from it_where in your preselection. They will not be considered in the subsequent standard selection for performance improvements, only HUIDENT from ct_presel will be considered.

POST_FILTERING - Method is used for filtering after standard selection is done.

Parameters information: 

  • iv_monitor - Current monitor.
  • it_tab_range - Range table that contain all select options for current execution.
  • iv_lgnum - Warehouse number.
  • ct_data - Monitor node selection result.

GET_VARIANT_DATA_BATCH - Method is used to get variant data during batch execution.

Parameters:

  • ct_batch_variant_data - Table contain variant data for batch execution.

Methods implementations could be found in the BADI example implementation class.

In part 2, I will describe in details with code sample, how to implement the BADI.

Thank you for your time!