Spend Management Blogs by Members
Check out community member blog posts about spend management and SAP Ariba, SAP Fieldglass, and SAP Concur solutions. Post or comment about your experiences.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
2,253

Summary

In ECC during purchase order creation, it is possible to have different order unit and price unit with conversions maintained (directly while PO creation or in material master). For ex: PO with quantity 5 EA and net price of 10 EUR/1 KG.

The standard SRM SUS (Supplier Self Service) can handle only two cases below:

  • Order unit same as price unit
  • Order unit and price unit are of the same dimension (for ex: order unit = CM and price unit = M and where the conversions are available in transaction CUNI)

The above example of a PO where order unit and price unit belong to different dimensions are not handled in standard SUS solution. The enhancement described in this document enables this functionality in SUS. The enhancement basically converts all the quantity into one unit before sending it to SUS and when the order response/ASN is being created, it will be converted back to order unit.

Applies to:

SAP SRM 7.0 and above

Overview of the enhancement:

1.Customer fields for SUS Purchase order in SRM
2.Proxy enhancements in PI for both ECC and SRM proxies
3.Implementation of BADI PUR_SE_POERPREQOUT_ASYN (enhancement spot PUR_SPOT_SE_PURCHASE_ORDER) in ECC
4.Implementation of BADI /SAPSRM/BD_SOA_MAPPING (enhancement spot /SAPSRM/ES_SOA_MAPPING ) in SRM
5.Implementation of BADI BBP_SAPXML1_OUT_BADI in SRM

Customer fields at SUS PO

Three new customer fields are added to SUS PO – the following three fields are added into the include structures INCL_EEW_PD_ITEM_CSF_SUSPO and INCL_EEW_PD_ITEM_CSF. This is same as mentioned in the SAP Note 672960.

The following values are transferred from ECC to SRM/SUS for these 3 CUF fields:

  • ZZCON_BASE  will hold EKPO-BPUMN (Denominator for Conv. of Order Price Unit into Order Unit)
  • ZZCON_PRICE  will hold EKPO-BPUMZ (Numerator for Conversion of Order Price Unit into Order Unit)
  • ZZBASEUOM  will hold EKPO-MEINS which is the order unit of PO item

Proxy Enhancements in PI

The following proxies are used for PO transmission from ECC to SRM/SUS:

The proxy enhancement is carried out like the normal PI data type enhancements and the steps are as mentioned below:

  • Create a customer SWCV and a customer namespace
  • Add standard SWCV SAP APPL 6.06 and SRM SERVER 7.01 as underlying SWCV for the customer SWCV
  • Create a data type enhancement for ECC:

                        

  • Create data type enhancement for SRM:

                          

  • Generate the data type enhancement in ECC and SRM in transaction SPROXY
  • Check the standard proxy structure and verify that the proxy enhancement fields are available ECC proxy enhancement:

                          

  • Check the standard proxy structure and verify that the proxy enhancement fields are available SRM proxy enhancement:

                        

Implementation of BADI PUR_SE_POERPREQOUT_ASYN in ECC

The above BADI method IF_PUR_SE_POERPREQOUT_ASYN~OUTBOUND_PROCESSING is implemented in ECC where the values for these 3 CUF fields are filled when the order unit and price units differ. And the quantities are modified based on the conversion factors maintained from order unit to price unit.

For ex: consider a PO item with quantity = 10 EA, net price = 100 EUR/2 KG, 2 EA = 3 KG. The values sent to SUS are as below:

PO FieldECC POSUS
Quantity10 EA15 KG
Order UnitEAKG
Net Price100 EUR100 EUR
Per22
Order Price UnitKGKG
Conversion2 EA = 3 KG

The values for the CUF fields will be:

ZZCON_BASE2
ZZCON_PRICE3
ZZBASEUOM EA

Implementation of BADI /SAPSRM/BD_SOA_MAPPING in SRM

This BADI is implemented in SRM and the method that needs to be implemented is /SAPSRM/IF_BADI_SOA_MAPPING~MAP_XI_TO_BACKEND. In this BADI which is the mapping from the incoming XML to PD structures, the customer field values will be mapped:

Implementation of BADI BBP_SAPXML1_OUT_BADI in SRM

In this BADI implementation, the values are converted back to order unit based on the values specified by vendor while creating order response and ASN creation.

Method PURCHASEORDER_SUS:

The schedule lines and confirmed schedule lines in the PO response sent from SUS to ECC is modified to convert values back to order unit:

LOOP AT cs_purchase_order_message-purchase_order-item INTO cs_xml_item.
LOOP AT it_item INTO cs_item.
*       Only proceed if PO contained different UoMs
CHECK NOT cs_item-zzbaseuom IS INITIAL.

IF cs_item-number_ext EQ cs_xml_item-id-value.
*         Convert Schedule Line (original PO values)
ct_sched
= cs_xml_item-schedule_line.

LOOP AT ct_sched INTO cs_xml_schedule.
CALL FUNCTION 'UNIT_OF_MEASURE_SAP_TO_ISO'
EXPORTING
sap_code   
= cs_item-zzbaseuom
IMPORTING
iso_code   
= cs_xml_schedule-quantity-unit_code
EXCEPTIONS
not_found  
= 1
no_iso_code
= 2
OTHERS      = 3.
IF cs_item-zzcon_price IS NOT INITIAL.
cs_xml_schedule
-quantity-value = cs_xml_schedule-quantity-value * cs_item-zzcon_base / cs_item-zzcon_price.
ELSE.
cs_xml_schedule
-quantity-value = cs_xml_schedule-quantity-value * cs_item-zzcon_base.
ENDIF.

MODIFY ct_sched FROM cs_xml_schedule.
ENDLOOP.

cs_xml_item
-schedule_line = ct_sched.

*         Convert Confirmed Schedule line (confirmed values)
ct_sched_conf
= cs_xml_item-confirmed_schedule_line.

LOOP AT ct_sched_conf INTO cs_sched_conf.
CALL FUNCTION 'UNIT_OF_MEASURE_SAP_TO_ISO'
EXPORTING
sap_code   
= cs_item-zzbaseuom
IMPORTING
iso_code   
= cs_sched_conf-quantity-unit_code
EXCEPTIONS
not_found  
= 1
no_iso_code
= 2
OTHERS      = 3.

IF cs_item-zzcon_price IS NOT INITIAL.
cs_sched_conf
-quantity-value = cs_sched_conf-quantity-value * cs_item-zzcon_base / cs_item-zzcon_price.
ELSE.
cs_sched_conf
-quantity-value = cs_sched_conf-quantity-value * cs_item-zzcon_base.
ENDIF.
MODIFY ct_sched_conf FROM cs_sched_conf.
ENDLOOP.

cs_xml_item
-confirmed_schedule_line = ct_sched_conf.
ENDIF.
MODIFY cs_purchase_order_message-purchase_order-item FROM cs_xml_item.
ENDLOOP.

Method ASN_SUS:

4 Comments