cancel
Showing results for 
Search instead for 
Did you mean: 

/SCWM/EX_ERP_STOCK_MAPPING BADI TUTORIAL

Former Member
0 Kudos
3,011

Hi to everyone,

i need to understand how to implement BADI

/SCWM/EX_ERP_STOCK_MAPPING in EWM.

Calling method b.z.w. CV_MAPPER->ERP_TO_WME

in /SCWM/IF_EX_ERP_STOCK_MAPPING~GET_MAPPER_INSTANCE require to fill structure

is_erp_stock and is_erp_location.

But how to fill that data ??

Have you found documentation on that BADI ? Have you experience to share ?

thks in advance

Andrea

Accepted Solutions (0)

Answers (2)

Answers (2)

Ajit_Routray
Active Contributor
0 Kudos

Hi Andrea,

I guess you need to do below steps

-> Copy the class /SCWM/CL_ERP_STOCK_MAPPER or /SCWM/CL_ERP_STOCK_MAPPER_S4 as per your system, make Z class, then modify the method as per your requirement.

-> Replace your Z class: Create instance of your z class in BADI Method , then pass to CV_MAPPER

Please check FM :/SCWM/GET_STOCKID_MAP_INSTANCE for more details and let us know if you have further queries.

Kind Regards,

Ajit

Ajit_Routray
Active Contributor
0 Kudos

Hi Andrea,

Please find the below SAP documentation with example and let us know if you have further queries.

BAdI: Enhancement of the ERP Stock ID Mapping

Use

This Business Add-In (BAdI) is used in the Extended Warehouse Management (SCM-EWM) component.

You can use this BAdI to create a separate implementation of the stock key mapping. The stock key mapping is used in the communication between the EWM and ERP system, among others in the delivery interface and the goods movement interface.

  • Stock key on the ERP side: plant, storage location, material, ERP stock type, ERP special stock key
  • Stock key on the EWM side: entitled, owner, product, EWM stock type, EWM special stock key

Typically, it is possible to use this BAdI to change the relationship between the entitled on the EWM side and the plant/storage location on the ERP side. In the standard system, the EWM entitled is mapped to an ERP plant. This BAdI allows you to map the EWM entitled to a storage location group. One storage location group consists for example of two storage locations, one storage location for the stock in putaway, and one storage location for the stock in the warehouse.

Note that the implementation of a separate stock mapping is very critical. Any error can lead to stock inconsistencies between the ERP and EWM system. SAP is not responsible for stock inconsistencies due to an erroneous implementation of the stock mapping.

The implementation of a separate stock mapping does not affect the value help for the Entitled field. The search can be changed using BAdI /SCWM/EX_BASIS_SH_ENTITLED.

The definition of an entitled at storage-location-group level instead of plant level has other consequences, which must be considered in a customer project:

  • All items of a delivery must contain the same entitled.
  • Business partner master data: A business partner has to be created manually in EWM for each entitled, as the CIF interface is only able to create a business partner for a plant. The external identification CRM011 of the manually created business partners can represent a storage location group but not a plant.
  • Entitled-specific product master data: The maintenance effort of warehouse-/entitled-specific product master data will grow due to the fact that more entitled-related storage location groups are used.
  • Entitled-specific accounting data: The accounting data used for goods issues based on deliveries for cost elements is stored at entitled level. If multiple entitled parties are used within one plant, a higher maintenance effort is required to store the accounting data for each entitled even though it has to be the same accounting data for each storage location group.

Standard settings

No BAdI implementation is available in the standard system. The standard coding is automatically executed.

The BAdI is not filter-dependent.

The BAdI is not designed for multiple use.

Activities

For information about implementing BAdIs as part of the Enhancement Concept, see SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.

Example

Example 1:

The warehouse number 0001 is linked to ERP plant 0001 with four storage locations:

  • ROD1 (stock in putaway) and AFS1 (stock in the warehouse)
  • ROD2 (stock in putaway) and AFS2 (stock in the warehouse)

With the standard mapping, it is only possible to define plant 0001 as entitled.

With an implementation of this BAdI, you define the following entitled parties:

  • One entitled for storage locations ROD1 and AFS1
  • One entitled for storage locations ROD2 and AFS2

Example 2:

The warehouse number 0002 is linked to ERP plant 0002 with two storage locations:

  • STL1: Storage location 1
  • STL2: Storage location 2

With the standard mapping, it is only possible to define plant 0002 as entitled.

With an implementation of this BAdI, you define the following entitled parties:

  • One entitled for storage location STL1
  • One entitled for storage location STL2

Kind Regards,

Ajit