Skip to Content
Technical Articles
Author's profile photo Orhan Akman

S/4HANA Commodity Code

What is the commodity code and how is it defined in the material master data?

 

One of the innovations that comes with S/4HANA is the change in commodity codes.

Sap Note:

 

Thread : https://answers.sap.com/questions/651551/where-is-the-configuration-of-commodity-codes-to-s.html?childToView=664237#answer-664237

What is Commodity Code?

If you import or export goods from within the European Union (EU) or outside it, you should understand the importance of commodity codes.

When trading internationally, you will need to find the correct commodity code for your goods so you can fill out customs paperwork accurately. The code is an eight-digit number for exports outside the EU or goods moving within the EU, but is a ten-digit number for imports from outside the EU. Once you know the commodity code, you can look up other important information such as duty rates and any import or export restrictions.

Classifying goods and how to do it

When trading internationally, you need to choose the right commodity code for your goods. The following describes how to define the classification codes.

Classifying your goods correctly will help ensure that you:

  • Pay the right duty and VAT
  • Know whether an import or export licence is needed

You are legally responsible for the correct classification of your goods, even if you use an agent. Incorrect classification can lead to your goods being delayed or seized and you will have to pay any duty and tax owed, plus possible financial penalties.

 

Identification of commodity codes to the system

The SAP GUI has an operation code / SAPSLL / CLSNR_01 where you can define commodity codes.

When you continue by entering the Number Scheme which you defined in the SAP GUI System, a screen appears as follows

You can define or delete the Commodity Codes on this screen.

A new commodity code is defined as follows.

The defined Commodity Codes be seen in the following tables as stated in SAP Note.

”Even though this information is not saved in the obsolete tables (MARC, T604, T604T) anymore, it still visible there anyway”

These datas are stored in  /SAPSLL/CLSNR (Trade Classification Number) tables. You can find the description of commodity codes in  /SAPSLL/CLSNRT (description of commodity codes) tables.

There are 2 methods to use the Commodity Code generated at the SAP GUI. The first one is the Migration Cockpit and the second one is / SAPSLL / CL_PRCLS_API. We will examine these two methods

  1. The first one is the transaction code of LTMC (Migration Cockpit).

In the Name field, enter the corresponding description and press the Create button.

There are commodity codes from the Migration Objects field. To start the process, the document is selected and opened.

The corresponding template is downloaded from the next screen.

Before making changes, I want to show where the change is made from the Material main data screen. The commodity code in the material master data is not open for data entry.

Relevant fields are entered in the Downloaded Material Commodity Code template.

On the Migration Cockpit screen, You can save the template with the “Upload” button.

After loading, we activate the process by “Activate” button and start the transfer.

4 Steps process. After uploading the information as in the screenshot below, the next step is called “Close”

When the data in Excell is loaded on the system, information is given about whether there is a missing, incorrect data entry in the description field. If there isnt any the incorrect data entry, the process is going on.

After you select all to match the values, the Confirm Mapping Values button is pressed. Or it can be done in manuel matching by entering the values from the name field.

On the last step, you can finish the process by “Finish” button.

We’ll see that the Commodity Code field is full when we go to check the material change to the main data screen

We entered the commodity code with the migration cockpit in this field which is closed to the data entry on the SAP GUI screen.

  1. The other method is that using /SAPSLL/CL_PRCLS_API. The related fields are entered by running Create_Classification

A constant value can be entered in the IV_STCTS, IV_DATAB, IV_DATBI fields.

The commodity code can be entered in the IV_CCNGN fields.  The material number can be entered in the IT_PRODUCTS fields.

Before the testing, The Commodity Code field in the material main data  screen as follows.

Enter the necessary parameters for changing and run the program.



The Commodity Code field in the material main data screen, as in the following screenshot, has changed.

As a result, it is seen that data can be entered into the commodity code field on the material main data screen using API and Migration Cockpit.

 

Hopefully, this blog will be helpful for everyone

Orhan Akman

Assigned Tags

      30 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sarhan Polatates
      Sarhan Polatates

      Good job Orhan and full pack service 🙂 I like including Migration Cockpit steps. Looking forward to read more from you.

      Cheers,

      Sarhan.

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hello Sarhan Polatates ,

      Really nice application. I will add more information to my blog as soon as possible. Thank you for following.

      Orhan Akman

      Author's profile photo Mehmet Ozgur Unal
      Mehmet Ozgur Unal

      Hello Orhan ,

      Good job, keep it up! Then, waiting news for LTMC and

      S/4 HANA Embedded EWM with Suatcan Pekak.

      Brgds

      M.Ozgur Unal

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hi  Mehmet Ozgur Unal ;

      Thank you for your support for my development. Working with you is a nice experience.

      Brds

      Orhan Akman

       

       

      Author's profile photo Swapnesh Shah
      Swapnesh Shah

      Hi ,

       

      This is just uploading the Commodity code in S/4 HANA. It didn't cover the working functionality of commodity code. But it will help us in implementation.

       

      Thanks,

      Sush K

      Author's profile photo venu gopal
      venu gopal

      Hello,

      It is very nice document ..good job.

       

      Venugopal

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hello venu gopal ,

      I’m glad you like it. I hope ıt wıll be benefit for you

      Orhan Akman

      Author's profile photo ADMINSAP ADMINSAP
      ADMINSAP ADMINSAP

      hello,

       

      Very nice explication with screen shot. I struggled to find info on this topic. Keep it up !! please do post topic like this.

       

      Thank you very much

      dhenesh

      Author's profile photo Norbert Bürger
      Norbert Bürger

      Hi all,

      that's the way to assign a commodity code to a material. But how can I create the commodity codes? Not 10, not 20, thousands. With BTCI on transaction /SAPSLL/CLSNR_01 I can not assign the description. Is there a method available?

       

      Kind Regards

      Norbert

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hi Norbert Bürger ,

      We have made a development as follows to be able to assign Commodity Codes to materials. We're downloading an Excel template.

       

      After entering the Material and Commodity codes, we are doing excel upload.

      The code is as follows.

      *&---------------------------------------------------------------------*
      *& Report ZMM_MALZEME_GTIP
      *&---------------------------------------------------------------------*
      *&
      *&---------------------------------------------------------------------*
      *   Report         :  ZMM_MALZEME_GTIP
      *   Author         :  EBRU ZORLU
      *   Date           :  25.10.2018
      *   Program Type   :  Report/Program
      *   Tcode          :  -
      *   TS Number      :
      *   Program Purpose:  GTIP ATAMA
      
      *----------------------------------------------------------------------*
      *  MODIFICATION LOG:
      *----------------------------------------------------------------------*
      * CORR NO    |  DATE    |   PROGRAMMER  |   CHANGES DESCRIPTION
      *----------------------------------------------------------------------*
      *               25.10.2018  EBRU ZORLU   Initial Version
      *----------------------------------------------------------------------*
      REPORT zmm_malzeme_gtip.
      
      TYPE-POOLS: slis, icon.
      
      TABLES rlgrap.
      
      TYPES : BEGIN OF gty_rprt,
        cell,
        matnr  TYPE matnr,
        gtip  TYPE /sapsll/ccngn,
              END OF gty_rprt.
      
      TYPES : BEGIN OF gty_exc,
        field01(50) TYPE c,
        field02(50) TYPE c,
              END OF gty_exc.
      
      DATA: gt_exc TYPE TABLE OF gty_exc,
            gs_exc TYPE gty_exc.
      
      DATA: gt_rprt TYPE TABLE OF gty_rprt,
            gs_rprt TYPE gty_rprt.
      
      DATA: gt_intern TYPE TABLE OF alsmex_tabline,
            gs_intern TYPE alsmex_tabline.
      
      DATA: gv_string TYPE string.
      
      DATA: gt_fcat TYPE lvc_t_fcat,
            gs_fcat TYPE lvc_s_fcat,
            gs_layo TYPE lvc_s_layo.
      
      DATA: me TYPE REF TO /sapsll/cl_prcls_api.
      DATA: gv_datab TYPE /sapsll/datab,
            gv_datbi TYPE /sapsll/datbi,
            gv_stcts TYPE /sapsll/stcts.
      
      DATA: gs_product TYPE LINE OF /sapsll/matnr_t. " ? excelden mi gelcek?
      DATA: gt_product TYPE /sapsll/matnr_t. " ? excelden mi gelcek?
      
      DATA: gt_bapiret2_t TYPE bapiret2_t.
      
      
      SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN SKIP 1.
      PARAMETERS:  p_file TYPE rlgrap-filename MODIF ID sc1.
      SELECTION-SCREEN END OF BLOCK b1.
      
      SKIP.
      
      SELECTION-SCREEN PUSHBUTTON 1(20) TEXT-002 USER-COMMAND btn.
      
      **********************************************************************
      
      START-OF-SELECTION.
      
      gv_stcts =  'EU01'.
      gv_datab = '20180101'.
      gv_datbi = '29990101'.
      
      INITIALIZATION.
        PERFORM get_path.
      
      AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
        PERFORM open_file.
      
      AT SELECTION-SCREEN.
        PERFORM download_template.
      
      END-OF-SELECTION.
        PERFORM get_data.
      
        IF gt_rprt[] IS NOT INITIAL.
        PERFORM set_data.
        ENDIF.
      
      **********************************************************************
      
      FORM get_path.
        CALL METHOD cl_gui_frontend_services=>get_desktop_directory
          CHANGING
            desktop_directory    = gv_string
          EXCEPTIONS
            cntl_error           = 1
            error_no_gui         = 2
            not_supported_by_gui = 3
            OTHERS               = 4.
      
        CALL METHOD cl_gui_cfw=>update_view.
      ENDFORM.                    "get_path
      
      "excel şablonu indirir
      FORM download_template.
      
        DATA: lv_pos    TYPE numc2,
              lv_field  TYPE lvc_fname,
              lv_string TYPE string.
      
        FIELD-SYMBOLS <flv_field>.
      
        CONCATENATE gv_string '\malzeme_gtip_sablonu.xls' INTO lv_string.
      
        IF sy-ucomm EQ 'BTN'.
          CLEAR gt_exc.
          PERFORM create_fcat.
      
          LOOP AT gt_fcat INTO gs_fcat.
            CLEAR lv_pos.
      
            lv_pos = gs_fcat-col_pos.
      
            CONCATENATE 'FIELD' lv_pos INTO lv_field.
      
            ASSIGN COMPONENT lv_field OF STRUCTURE gs_exc TO <flv_field>.
      
            <flv_field> = gs_fcat-scrtext_m.
          ENDLOOP.
      
          APPEND gs_exc TO gt_exc.
      
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename = lv_string
              filetype = 'DAT'
            TABLES
              data_tab = gt_exc.
        ENDIF.
      ENDFORM.                    "download_template
      ********************************************************************
      
      FORM open_file.
        DATA: rc      TYPE i,
              lt_file TYPE filetable WITH HEADER LINE.
      
        REFRESH lt_file.
        CLEAR lt_file.
      
        CALL METHOD cl_gui_frontend_services=>file_open_dialog
          EXPORTING
            window_title            = 'Dosya adi..'
            default_extension       = '*'
            initial_directory       = gv_string
          CHANGING
            file_table              = lt_file[]
            rc                      = rc
          EXCEPTIONS
            file_open_dialog_failed = 1
            cntl_error              = 2
            error_no_gui            = 3
            not_supported_by_gui    = 4
            OTHERS                  = 5.
      
        READ TABLE lt_file INDEX 1.
        rlgrap-filename = lt_file-filename.
        p_file = rlgrap-filename.
      ENDFORM.                    "open_file
      
      **********************************************************************
      
      "excel verisini itaba atar
      FORM get_data.
      
        DATA lv_matnr TYPE matnr.
      
        DATA: lv_start_col TYPE i VALUE '1',
              lv_start_row TYPE i VALUE '2',
              lv_end_col   TYPE i VALUE '2',
              lv_end_row   TYPE i VALUE '10000'.
      
        FIELD-SYMBOLS: <fs>.
      
        DATA: lv_count    TYPE i,
              lv_totcount TYPE i,
              lv_percent  TYPE i,
              lv_index    TYPE i.
      
        IF p_file IS NOT INITIAL.
          rlgrap-filename = p_file.
          CLEAR: gt_exc, gt_rprt.
      
          CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
            EXPORTING
              filename                = rlgrap-filename
              i_begin_col             = lv_start_col
              i_begin_row             = lv_start_row
              i_end_col               = lv_end_col
              i_end_row               = lv_end_row
            TABLES
              intern                  = gt_intern
            EXCEPTIONS
              inconsistent_parameters = 1
              upload_ole              = 2
              OTHERS                  = 3.
      
          IF sy-subrc > 0.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            WRITE : / 'DOSYA OKUMA HATASI!'.
            WRITE : / 'TEKRAR DENEYINIZ!'.
            EXIT.
          ENDIF.
      
          DESCRIBE TABLE gt_intern LINES lv_totcount.
          CLEAR lv_count.
      
          IF gt_intern IS NOT INITIAL.
            SORT gt_intern BY row col.
            LOOP AT gt_intern INTO gs_intern.
              MOVE gs_intern-col TO lv_index.
              ASSIGN COMPONENT lv_index OF STRUCTURE gs_exc TO <fs>.
              MOVE gs_intern-value TO <fs>.
              AT END OF row.
                APPEND gs_exc TO gt_exc.
                CLEAR gs_exc.
              ENDAT.
            ENDLOOP.
          ENDIF.
      
          LOOP AT gt_exc INTO gs_exc.
            CLEAR gs_rprt.
      
            gs_rprt-matnr  = gs_exc-field01.
            gs_rprt-gtip   = gs_exc-field02.
            APPEND gs_rprt TO gt_rprt.
      
      *      ls_product =  gs_rprt-matnr .
      *      APPEND ls_product TO lt_product.
      
          ENDLOOP.
        ENDIF.
      ENDFORM.                    "get_data
      
      **********************************************************************
      
      FORM set_data.
      
        PERFORM create_layout.
        PERFORM create_fcat.
        PERFORM gtip.
      ENDFORM.
      
      **********************************************************************
      
      FORM create_layout.
        gs_layo-sel_mode  = 'D'.
        gs_layo-zebra     = 'X'.
        gs_layo-col_opt   = 'X'.
        gs_layo-box_fname = 'CELL'.
      ENDFORM.                    "create_layout
      
      **********************************************************************
      
      FORM create_fcat.
        CLEAR gt_fcat.
        PERFORM set_fcat USING '01' 'MATNR'  'Malzeme'.
        PERFORM set_fcat USING '02' 'GTIP'  'GTIP'.
      ENDFORM.                    "create_fcat
      
      **********************************************************************
      
      FORM set_fcat USING pv_cpos pv_fname pv_text.
        CLEAR gs_fcat.
        gs_fcat-col_pos   = pv_cpos.
        gs_fcat-fieldname = pv_fname.
        gs_fcat-scrtext_s =
        gs_fcat-scrtext_l =
        gs_fcat-scrtext_m =
        gs_fcat-reptext   =
        gs_fcat-coltext   = pv_text.
      
      
        APPEND gs_fcat TO gt_fcat.
      ENDFORM.                    "set_fcat
      
      **********************************************************************
      
      FORM display_alv.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
          EXPORTING
            i_callback_program       = sy-repid
            i_save                   = 'A'
            is_layout_lvc            = gs_layo
            it_fieldcat_lvc          = gt_fcat
            i_callback_pf_status_set = 'GUI'
            i_callback_user_command  = 'COMM'
          TABLES
            t_outtab                 = gt_rprt
          EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.
      ENDFORM.                    "display_alv
      
      **********************************************************************
      
      FORM gui USING rt_extab TYPE slis_t_extab.
        SET PF-STATUS 'MENU'.
      ENDFORM.                    "gui
      
      **********************************************************************
      
      FORM comm USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
        rs_selfield-refresh = 'X'.
      
        CASE r_ucomm.
          WHEN '&F03' OR '&F04' OR '&F05'.
            LEAVE PROGRAM.
      *    WHEN '&SAVE'.
      *      PERFORM aktar.
        ENDCASE.
      ENDFORM.                    "comm
      
      **********************************************************************
      
      FORM aktar CHANGING p_matnr.
      
      DATA lv_matnr TYPE matnr.
      
      *CLEAR lt_product.
      *  LOOP AT gt_rprt INTO gs_rprt .
      *    CLEAR lv_matnr.
      
          CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
            EXPORTING
              input  = p_matnr
            IMPORTING
              output = lv_matnr.
      
          p_matnr = lv_matnr.
      
      *      gs_product = lv_matnr.
      *      APPEND gs_product TO gt_product.
      
      *  ENDLOOP.
      
      ENDFORM.                                                    "aktar
      
      *&---------------------------------------------------------------------*
      *& Form GTIP
      *&---------------------------------------------------------------------*
      *& text
      *&---------------------------------------------------------------------*
      *& -->  p1        text
      *& <--  p2        text
      *&---------------------------------------------------------------------*
      FORM gtip .
      DATA: lv_matnr TYPE matnr,
            lt_bapiret2_t TYPE bapiret2_t.
      IF me IS INITIAL.
      CREATE OBJECT me.
      ENDIF.
      
      LOOP AT gt_rprt INTO gs_rprt .
      
         CLEAR lv_matnr.
         lv_matnr = gs_rprt-matnr.
         PERFORM aktar CHANGING lv_matnr.
      
         CLEAR : gt_product,gs_product.
         gs_product = lv_matnr.
         APPEND gs_product TO gt_product.
         CLEAR lt_bapiret2_t.
      
          CALL METHOD me->create_classification
            EXPORTING
              iv_stcts    = gv_stcts  "sabit
              iv_ccngn    = gs_rprt-gtip    "excelden
              iv_datab    = gv_datab  "sabit
              iv_datbi    = gv_datbi  "sabit
              it_products = gt_product      "excelden
            IMPORTING
              et_messages = lt_bapiret2_t.
      
          APPEND LINES OF lt_bapiret2_t TO gt_bapiret2_t.
      
      ENDLOOP.
      
      
        CALL FUNCTION 'RSCRMBW_DISPLAY_BAPIRET2'
          TABLES
            it_return = gt_bapiret2_t.
      
      
      
      ENDFORM. 
      
      
      
      
      Author's profile photo Jose Morales
      Jose Morales

      To this  great program that Orkan created, we did a version for single material update.

      REPORT zmat_arancel.

      TYPE-POOLS: slis, icon.

      TABLES rlgrap.

      TYPES : BEGIN OF gty_rprt,
      cell,
      matnr TYPE matnr,
      gtip TYPE /sapsll/ccngn,
      END OF gty_rprt.

      TYPES : BEGIN OF gty_exc,
      field01(50) TYPE c,
      field02(50) TYPE c,
      END OF gty_exc.

      DATA: gt_exc TYPE TABLE OF gty_exc,
      gs_exc TYPE gty_exc.

      DATA: gt_rprt TYPE TABLE OF gty_rprt,
      gs_rprt TYPE gty_rprt.

      DATA: gt_intern TYPE TABLE OF alsmex_tabline,
      gs_intern TYPE alsmex_tabline.

      DATA: gv_string TYPE string.

      DATA: gt_fcat TYPE lvc_t_fcat,
      gs_fcat TYPE lvc_s_fcat,
      gs_layo TYPE lvc_s_layo.

      DATA: me TYPE REF TO /sapsll/cl_prcls_api.
      *DATA:
      * gv_datab TYPE /sapsll/datab,
      * gv_datbi TYPE /sapsll/datbi,
      * gv_stcts TYPE /sapsll/stcts.

      DATA: gs_product TYPE LINE OF /sapsll/matnr_t. " ? excelden mi gelcek?
      DATA: gt_product TYPE /sapsll/matnr_t. " ? excelden mi gelcek?

      DATA: gt_bapiret2_t TYPE bapiret2_t.

      SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN SKIP 1.
      PARAMETERS:
      *p_file TYPE rlgrap-filename MODIF ID sc1,
      gv_stcts type /sapsll/stcts,
      gv_datab TYPE /sapsll/datab,
      gv_datbi TYPE /sapsll/datbi,
      field01 TYPE matnr,
      field02(10) TYPE C.
      SELECTION-SCREEN END OF BLOCK b1.

      SKIP.

      *SELECTION-SCREEN PUSHBUTTON 1(20) TEXT-002 USER-COMMAND btn.

      **********************************************************************

      START-OF-SELECTION.

      *gv_stcts = 'ES01'.
      *gv_datab = '20180101'.
      *gv_datbi = '29990101'.

      INITIALIZATION.
      PERFORM get_path.

      *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      * PERFORM open_file.

      AT SELECTION-SCREEN.
      PERFORM download_template.

      END-OF-SELECTION.
      PERFORM get_data.

      IF gt_rprt[] IS NOT INITIAL.
      PERFORM set_data.
      ENDIF.

      **********************************************************************

      FORM get_path.
      CALL METHOD cl_gui_frontend_services=>get_desktop_directory
      CHANGING
      desktop_directory = gv_string
      EXCEPTIONS
      cntl_error = 1
      error_no_gui = 2
      not_supported_by_gui = 3
      OTHERS = 4.

      CALL METHOD cl_gui_cfw=>update_view.
      ENDFORM. "get_path

      "excel #ablonu indirir
      FORM download_template.

      DATA: lv_pos TYPE numc2,
      lv_field TYPE lvc_fname,
      lv_string TYPE string.

      FIELD-SYMBOLS <flv_field>.

      CONCATENATE gv_string '\malzeme_gtip_sablonu.xls' INTO lv_string.

      IF sy-ucomm EQ 'BTN'.
      CLEAR gt_exc.
      PERFORM create_fcat.

      LOOP AT gt_fcat INTO gs_fcat.
      CLEAR lv_pos.

      lv_pos = gs_fcat-col_pos.

      CONCATENATE 'FIELD' lv_pos INTO lv_field.

      ASSIGN COMPONENT lv_field OF STRUCTURE gs_exc TO <flv_field>.

      <flv_field> = gs_fcat-scrtext_m.
      ENDLOOP.

      APPEND gs_exc TO gt_exc.

      CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      filename = lv_string
      filetype = 'DAT'
      TABLES
      data_tab = gt_exc.
      ENDIF.
      ENDFORM. "download_template
      ********************************************************************

      FORM open_file.
      * DATA: rc TYPE i,
      * lt_file TYPE filetable WITH HEADER LINE.
      *
      * REFRESH lt_file.
      * CLEAR lt_file.
      *
      * CALL METHOD cl_gui_frontend_services=>file_open_dialog
      * EXPORTING
      * window_title = 'Dosya adi..'
      * default_extension = '*'
      * initial_directory = gv_string
      * CHANGING
      * file_table = lt_file[]
      * rc = rc
      * EXCEPTIONS
      * file_open_dialog_failed = 1
      * cntl_error = 2
      * error_no_gui = 3
      * not_supported_by_gui = 4
      * OTHERS = 5.
      *
      * READ TABLE lt_file INDEX 1.
      * rlgrap-filename = lt_file-filename.
      * p_file = rlgrap-filename.
      ENDFORM. "open_file

      **********************************************************************

      "excel verisini itaba atar
      FORM get_data.

      * DATA lv_matnr TYPE matnr.
      *
      * DATA: lv_start_col TYPE i VALUE '1',
      * lv_start_row TYPE i VALUE '2',
      * lv_end_col TYPE i VALUE '2',
      * lv_end_row TYPE i VALUE '10000'.
      *
      * FIELD-SYMBOLS: <fs>.
      *
      * DATA: lv_count TYPE i,
      * lv_totcount TYPE i,
      * lv_percent TYPE i,
      * lv_index TYPE i.
      *
      * IF p_file IS NOT INITIAL.
      * rlgrap-filename = p_file.
      * CLEAR: gt_exc, gt_rprt.
      *
      * CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      * EXPORTING
      * filename = rlgrap-filename
      * i_begin_col = lv_start_col
      * i_begin_row = lv_start_row
      * i_end_col = lv_end_col
      * i_end_row = lv_end_row
      * TABLES
      * intern = gt_intern
      * EXCEPTIONS
      * inconsistent_parameters = 1
      * upload_ole = 2
      * OTHERS = 3.
      *
      * IF sy-subrc > 0.
      * FORMAT COLOR COL_BACKGROUND INTENSIFIED.
      * WRITE : / 'DOSYA OKUMA HATASI!'.
      * WRITE : / 'TEKRAR DENEYINIZ!'.
      * EXIT.
      * ENDIF.
      *
      * DESCRIBE TABLE gt_intern LINES lv_totcount.
      * CLEAR lv_count.
      *
      * IF gt_intern IS NOT INITIAL.
      * SORT gt_intern BY row col.
      * LOOP AT gt_intern INTO gs_intern.
      * MOVE gs_intern-col TO lv_index.
      * ASSIGN COMPONENT lv_index OF STRUCTURE gs_exc TO <fs>.
      * MOVE gs_intern-value TO <fs>.
      * AT END OF row.
      * APPEND gs_exc TO gt_exc.
      * CLEAR gs_exc.
      * ENDAT.
      * ENDLOOP.
      * ENDIF.
      *
      * LOOP AT gt_exc INTO gs_exc.
      * CLEAR gs_rprt.

      gs_rprt-matnr = field01.
      gs_rprt-gtip = field02.
      APPEND gs_rprt TO gt_rprt.

      ** ls_product = gs_rprt-matnr .
      ** APPEND ls_product TO lt_product.
      *
      * ENDLOOP.
      * ENDIF.
      ENDFORM. "get_data

      **********************************************************************

      FORM set_data.

      PERFORM create_layout.
      PERFORM create_fcat.
      PERFORM gtip.
      ENDFORM.

      **********************************************************************

      FORM create_layout.
      gs_layo-sel_mode = 'D'.
      gs_layo-zebra = 'X'.
      gs_layo-col_opt = 'X'.
      gs_layo-box_fname = 'CELL'.
      ENDFORM. "create_layout

      **********************************************************************

      FORM create_fcat.
      CLEAR gt_fcat.
      PERFORM set_fcat USING '01' 'MATNR' 'Malzeme'.
      PERFORM set_fcat USING '02' 'GTIP' 'GTIP'.
      ENDFORM. "create_fcat

      **********************************************************************

      FORM set_fcat USING pv_cpos pv_fname pv_text.
      CLEAR gs_fcat.
      gs_fcat-col_pos = pv_cpos.
      gs_fcat-fieldname = pv_fname.
      gs_fcat-scrtext_s =
      gs_fcat-scrtext_l =
      gs_fcat-scrtext_m =
      gs_fcat-reptext =
      gs_fcat-coltext = pv_text.

      APPEND gs_fcat TO gt_fcat.
      ENDFORM. "set_fcat

      **********************************************************************

      FORM display_alv.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
      i_callback_program = sy-repid
      i_save = 'A'
      is_layout_lvc = gs_layo
      it_fieldcat_lvc = gt_fcat
      i_callback_pf_status_set = 'GUI'
      i_callback_user_command = 'COMM'
      TABLES
      t_outtab = gt_rprt
      EXCEPTIONS
      program_error = 1
      OTHERS = 2.
      ENDFORM. "display_alv

      **********************************************************************

      FORM gui USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'MENU'.
      ENDFORM. "gui

      **********************************************************************

      FORM comm USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
      rs_selfield-refresh = 'X'.

      CASE r_ucomm.
      WHEN '&F03' OR '&F04' OR '&F05'.
      LEAVE PROGRAM.
      * WHEN '&SAVE'.
      * PERFORM aktar.
      ENDCASE.
      ENDFORM. "comm

      **********************************************************************

      FORM aktar CHANGING p_matnr.

      DATA lv_matnr TYPE matnr.

      *CLEAR lt_product.
      * LOOP AT gt_rprt INTO gs_rprt .
      * CLEAR lv_matnr.

      CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
      EXPORTING
      input = p_matnr
      IMPORTING
      output = lv_matnr.

      p_matnr = lv_matnr.

      * gs_product = lv_matnr.
      * APPEND gs_product TO gt_product.

      * ENDLOOP.

      ENDFORM. "aktar

      *&---------------------------------------------------------------------*
      *& Form GTIP
      *&---------------------------------------------------------------------*
      *& text
      *&---------------------------------------------------------------------*
      *& --> p1 text
      *& <-- p2 text
      *&---------------------------------------------------------------------*
      FORM gtip .
      DATA: lv_matnr TYPE matnr,
      lt_bapiret2_t TYPE bapiret2_t.
      IF me IS INITIAL.
      CREATE OBJECT me.
      ENDIF.

      LOOP AT gt_rprt INTO gs_rprt .

      CLEAR lv_matnr.
      lv_matnr = gs_rprt-matnr.
      PERFORM aktar CHANGING lv_matnr.

      CLEAR : gt_product,gs_product.
      gs_product = lv_matnr.
      APPEND gs_product TO gt_product.
      CLEAR lt_bapiret2_t.

      CALL METHOD me->create_classification
      EXPORTING
      iv_stcts = gv_stcts "sabit
      iv_ccngn = gs_rprt-gtip "excelden
      iv_datab = gv_datab "sabit
      iv_datbi = gv_datbi "sabit
      it_products = gt_product "excelden
      IMPORTING
      et_messages = lt_bapiret2_t.

      APPEND LINES OF lt_bapiret2_t TO gt_bapiret2_t.

      ENDLOOP.

      CALL FUNCTION 'RSCRMBW_DISPLAY_BAPIRET2'
      TABLES
      it_return = gt_bapiret2_t.

       

      ENDFORM.

      Author's profile photo christian nesser
      christian nesser

      Hi Orhan, I think i have the same issue like Norbert Burger. You described the way to migrate the commodity code with the material numbers. Thanks for this, it works fine here.
      But i need way for creation the commodty codes .As far as i understood there is no custmoizing anymore and the user have the Transaction /SAPSLL/CLSNR_01 in the S/HANA System and also a fiori app to create the commodity codes by himself.

      But we have thousand of commodity codes and we need to take them over to the new system.
      I know table T604 are obsolete but how can I migrate the codes into table /SAPSLL/CLSNR?  

      Thanks for your help

      Best regards
      Christian

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hello christian nesser

      Actually, i don't know more details about how can you transfer all commodity code from T604 table to new /SAPSLL/CLSNR table.

      You can directly create commodity codes from T-Code SAPSLL/CLSNR_01 and i'm thinking that development can be done from this T-Code.

      Brds

      Orhan Akman

      Author's profile photo Mrityunjai Kumar
      Mrityunjai Kumar

      Hi Orhan,

      First off all thanks for this nice blog, this is really helpful and well documented.

      While try to maintain this commodity code, i get a message that-

      ‘Numbering Scheme EU01 has no active numbering scheme content’

      Not sure what is the reason behind this message and how I could resolve this?

      Any help here is highly appreciated.

      Thanks in advance.

       

      Kind Regards,

      Mrityunjai

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hi Mrityunjai Pandey ,

      SAP Customizing Implementation Guide -> Governance, Risk and Compliance -> International Trade -> Classification  -> Define Numbering Scheme

      Could you please follow above mentioned customizing steps. Then, please compare the details with my screenshot.

       

       

      If you have a missing customization you have to complete classification steps.

       

      Best Regards

       

      Author's profile photo Mrityunjai Kumar
      Mrityunjai Kumar

      Hi Orhan,

      Thanks for the detailed listing.

      I have one last question, so when I have created all the commodity codes,

      Can I transport them to any downstream systems following the normal TR movement mechanism?

       

      Kind Regards,

      Mrityunjai

      Author's profile photo Milind Pampattiwar
      Milind Pampattiwar

      Hi Orhan Akman ,

      I am not finding Material Commodity Code object in Migration object. i can see Material and material classification. Do we need to make any configurations to see this object?

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hi Milind Pampattiwar ,

      I think you are asking same question with Mrityunjai Pandey . Could you please check above customizing steps if yes.

      Best Regards.

       

      Author's profile photo Mehmet Ozgur Unal
      Mehmet Ozgur Unal

      Hello  Orhan Akman ,

       

      Could you add SAP Notes 2642388 , 2711719 to your blog ?

      I checked notes, SAP informs us MARC-STAWN will not be updated with S4/HANA 1809 .

       

      Brgds

      M.Ozgur Unal

      Author's profile photo Orhan Akman
      Orhan Akman
      Blog Post Author

      Hi Mehmet Ozgur Unal ,

      I have attached the Sap notes which has been shared by you. In addition, there is one more note (2432527). And this note mentioned that field on the MM screen was changed with SAP S4/Hana 1809 version.

      Best Regards.

      Author's profile photo Mrityunjai Kumar
      Mrityunjai Kumar

      Hi Orham,

      What is the Numbering Schema for US and Canada?

      Kind Regards,

      Mrityunjai

      Author's profile photo Miroslav Holcik
      Miroslav Holcik

      Hi Orhan Akman

      is it somehow possible to maintain 2 different Commodity codes for the same Material/Plant combination?

      The scenario is "Used vehicles"

      as per definition a new car should have 8703 2410 00 whereas a used car 8703 2490 00. We are using the same Material no. for both with the only difference being the Used vehicle flag in VMS.

      There is of course the possibility to overwrite whatever value from Material Master with custom development, however I am looking for a standard solution.

      Author's profile photo Wojciech Zamlewski
      Wojciech Zamlewski

      Hello Orhan,

      I am on S4/HANA 1809, therefore MARC-STAWN is no longer updated and it is hidden now.

      We have the commodity codes already in the new /SAPSLL/ tables but I got a request to display the commodity code in MM03 as before.

      Any suggestions on how to proceed?

      Unhide MARC-STAWN and fill it dynamically via custom development?

      Author's profile photo Jasper Buis
      Jasper Buis

      Hi Wojchiech,

      The solution for that issue you can find here:

      https://answers.sap.com/questions/12657375/commodity-code-field-is-not-appearing-in-material-.html?childToView=12688031#answer-12688031

       

      Author's profile photo Suraj 1212
      Suraj 1212

      Hi Orhan Akman

      How do we maintain different commodity codes for International Export and International Import views ?

       

      Thank you...

      Author's profile photo badreddine ben mohamed
      badreddine ben mohamed

      Hi Orhan Akhan

      Is there any possibility to mass upload commodity codes for a new project implementation?

      I was looking through SAP blogs and SAP notes but there is only a possibility to make the classification in mass.

      By the way, I used LSMW but I couldn't add the description for the code. I just uploaded them without description.

      Thank you in advance,

      Badr

       

      Author's profile photo Kaan Alperen Ozen
      Kaan Alperen Ozen

      Hi badreddine ben mohamed ,

      I am facing the same issue, have you found a way to mass upload new commodity codes?

      Thanks in advance

      Author's profile photo Kishan Sripathi
      Kishan Sripathi

      Hi

      where does import processing control code MARC- STEUC maintained in S/4 ? what is the new table name and where to maintain the same? IN ECC it used to be maintained in logistics general->Material master->Material ID's->Maintain PKWiUs

      thanks

      Author's profile photo JENNY GARZON
      JENNY GARZON

      Hello,

      It is very nice document ..good job. But, I want update Commodity Code of a Material,

      How can I do that?
      
      
      thanks
      
      Author's profile photo Sachin arora
      Sachin arora

      Hello Orhan,

      we are  converting ECC to S/4 HANA. Our customer uses commodity codes. My questions are

      1. Will all the existing commodity codes used in material master  in ECC be automatically transferred to S/4 HANA Material Master ?

       

      2)  Do we need to define new numbering scheme in S/4 HANA for commodity codes and once again assign commodity codes to all existing material master through LTMC as defined in this blog of yours ?

       

      regards

      Sonu