SAP Commodity Code – Comparison ECC vs S/4HANA

Having recently worked on quite a few customers and dealing with developments around commodity code I have compiled some notes comparing commodity code handling in ECC vs S/4HANA.

Commodity Code Master Table

ECCS/4HANA
T604/SAPSLL/CLSNR

Maintenance

ECC

Customising Activity – SPRO at path Materials Management->Purchasing->Foriegn Trade/Customs->Basic Data for Foreign Trade->Define Commodity Codes / Import Code Numbers By Country

SM30 View – V_T604

S/4HANA

No Longer Customising data, maintained in the system using App Manage Commodity Codes. Commodity codes are defined under Scheme.

Material Assignment Table

ECCS/4HANA
Commodity code is assigned to Material at Plant level and stored in table MARC field STAWN.Commodity code is assigned to Material with start and end date, stored in table /SAPSLL/MARITC. Note assignment is not at the Plant level.

For compatibility reason, in S/4HANA system MARC still has field STAWN but in replacement CDS object NSDM_E_MARC value is derived from the table /SAPSLL/MARITC. Same value will appear for materials in different plant, also you will see Commodity code value valid on system date via MARC object.

Application used for Assignment

ECCS/4HANA
Transaction MM01 and MM02 App – Classify Products and Reclassify Products
Classify Products shows a list of material
which does not have commodity code assigned to them.
Once you have assigned commodity
code to the material using
Classify Production app use app Reclassify Products
to change code assignment.

Update Commodity Code of a Material

ECCS/4HANA
Using BAPI_MATERIAL_SAVEDATAClass /SAPSLL/CL_PRCLS_API

ECC Code

parameters : p_matnr type mara-matnr obligatory,
             p_werks type marc-werks obligatory,
             p_comm  type marc-stawn obligatory.

start-of-selection .

  data : ls_headdata   type bapimathead,
         ls_plantdata  type bapi_marc,
         ls_plantdatax type bapi_marcx,
         ls_return     type bapiret2.

  ls_headdata-material     = p_matnr .
  ls_plantdata-plant       = p_werks .
  ls_plantdatax-plant = p_werks .

  ls_plantdata-comm_code   = p_comm .
  ls_plantdatax-comm_code  = abap_true.

  call function 'BAPI_MATERIAL_SAVEDATA'
    exporting
      headdata   = ls_headdata
      plantdata  = ls_plantdata
      plantdatax = ls_plantdatax
    importing
      return     = ls_return.

  write ls_return-message .

S/4 HANA Code

parameters : p_matnr type mara-matnr obligatory,
             p_stcts type /sapsll/clsnr-nosct obligatory,
             p_ccngn type /sapsll/clsnr-ccngn
                 matchcode object /sapsll/shlp_commodity_code obligatory,
             p_datab type /sapsll/clsnr-datab default sy-datum,
             p_datbi type /sapsll/clsnr-datbi default '99991231'.

start-of-selection .

  data(lo_product_api) = new /sapsll/cl_prcls_api( ) .

  lo_product_api->create_classification(
    exporting
      iv_stcts    = p_stcts
      iv_ccngn    = p_ccngn
      iv_datab    = p_datab
      iv_datbi    = p_datbi
      it_products = value /sapsll/matnr_t( ( p_matnr ) )
      iv_no_commit = abap_false
  importing
    et_messages = data(lt_message) ).

  loop at lt_message assigning field-symbol(<lfs_message>) .
    write : <lfs_message>-message .
  endloop .

3 Replies to “SAP Commodity Code – Comparison ECC vs S/4HANA

  1. Does it need a seperate license of GRC? (as the international trade solution, while embedded in S/4, is under GRC)..

  2. IT’s PERFECT !!!! thanx a lot!!!
    I’m developing a WF to copy the Comm. Code when I create a material with MM01 in reference to another…
    this example of using the API is very useful for me.

Leave a Reply