<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Function module for assortment change WSOA2 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569066#M4712909</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Issue solved, finally.&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 13:17:26 GMT</pubDate>
    <dc:creator>former_member797394</dc:creator>
    <dc:date>2022-06-07T13:17:26Z</dc:date>
    <item>
      <title>Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaq-p/12569053</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
  &lt;P&gt;My requirement in function module is to call transaction code WSOA2 in order to add stores(WRSZ-LOCNR) to existing assortments(WRS1-ASORT).&lt;/P&gt;
  &lt;P&gt;This is my first time I am asking for FM, that is why a more clear answer would be appreciated. However, it is not neccessary. &lt;/P&gt;
  &lt;P&gt;I hope my question is clear. &lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 10:16:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaq-p/12569053</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-05-26T10:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569054#M4712897</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You may try with the BAPI - &lt;STRONG&gt;BAPI_ASSORTMENT_MAINTAINDATA .  Open the bapi SE37 - the FM documentation may help you further&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;STRONG&gt;CALL FUNCTION 'BAPI_ASSORTMENT_MAINTAINDATA' "Maintenance of Assortments
  EXPORTING
    assortment =                " bapie1wrs1
    assortmentx =               " bapie1wrs1x
  IMPORTING
    return =                    " bapiret2
* TABLES
*   materialgroup =             " bapie1wrs6
*   materialgroupx =            " bapie1wrs6x
*   description =               " bapie1wrst
*   descriptionx =              " bapie1wrstx
*   assortmentusers =           " bapie1wrsz
*   assortmentusersx =          " bapie1wrszx&lt;/STRONG&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2022 11:35:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569054#M4712897</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-05-26T11:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569055#M4712898</link>
      <description>&lt;P&gt;Thank you vey much. I have a question. What is the difference between &lt;STRONG&gt;assortment &lt;/STRONG&gt;and&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;assortmentx. &lt;/STRONG&gt;What should I write here? &lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 12:52:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569055#M4712898</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-05-26T12:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569056#M4712899</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Sorry for delay,&lt;/P&gt;&lt;P&gt;In X table - you have to mark the items you mentioned in &lt;STRONG&gt;assortment table, - &lt;/STRONG&gt;mark them with X in &lt;STRONG&gt;assortmentX &lt;/STRONG&gt;table&lt;STRONG&gt;.  If you do not mention then that item will mot be updated&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 05:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569056#M4712899</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-05-31T05:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569057#M4712900</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Am I doing everything correctly? If yes, then program does not write my entries and not even giving any errors.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:&lt;BR /&gt;  ld_return            TYPE bapiret2,&lt;BR /&gt;  it_assortmentusers  TYPE STANDARD TABLE OF bapie1wrsz, "TABLES PARAM&lt;BR /&gt;  wa_assortmentusers  LIKE LINE OF it_assortmentusers,&lt;BR /&gt;  it_assortmentusersx  TYPE STANDARD TABLE OF bapie1wrszx, "TABLES PARAM&lt;BR /&gt;  wa_assortmentusersx  LIKE LINE OF it_assortmentusersx,&lt;BR /&gt;  ld_assortment       TYPE bapie1wrs1,&lt;BR /&gt;  wa_assortment       LIKE ld_assortment,&lt;BR /&gt;  ld_assortmentx      TYPE bapie1wrs1x,&lt;BR /&gt;  wa_assortmentx      LIKE ld_assortmentx.&lt;BR /&gt;LOOP AT mt_info INTO ls_info.&lt;BR /&gt;      wa_assortment-assortment          = ls_info-asort.&lt;BR /&gt;      wa_assortmentx-assortment         = 'X'.&lt;BR /&gt;      wa_assortmentusers-seqnumber      = '5'.&lt;BR /&gt;      wa_assortmentusers-customer_site  = ls_info-locnr.&lt;BR /&gt;      wa_assortmentusers-salesorg       = ls_info-vkorg.&lt;BR /&gt;      wa_assortmentusers-distr_chan     = ls_info-vtweg.&lt;BR /&gt;      wa_assortmentusersx-seqnumber     = 'X'.&lt;BR /&gt;      wa_assortmentusersx-customer_site = 'X'.&lt;BR /&gt;      wa_assortmentusersx-salesorg      = 'X'.&lt;BR /&gt;      wa_assortmentusersx-distr_chan    = 'X'.&lt;BR /&gt;      APPEND wa_assortmentusers  TO it_assortmentusers.&lt;BR /&gt;      APPEND wa_assortmentusersx TO it_assortmentusersx.&lt;BR /&gt;    ENDLOOP.&lt;BR /&gt;    CALL FUNCTION 'BAPI_ASSORTMENT_MAINTAINDATA'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        assortment       = wa_assortment&lt;BR /&gt;        assortmentx      = wa_assortmentx&lt;BR /&gt;      IMPORTING&lt;BR /&gt;        return           = ld_return&lt;BR /&gt;      TABLES&lt;BR /&gt;*       MATERIALGROUP    =&lt;BR /&gt;*       MATERIALGROUPX   =&lt;BR /&gt;*       DESCRIPTION      =&lt;BR /&gt;*       DESCRIPTIONX     =&lt;BR /&gt;        assortmentusers  = it_assortmentusers&lt;BR /&gt;        assortmentusersx = it_assortmentusersx.&lt;BR /&gt;    WRITE: ld_return-message.&lt;BR /&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        wait = 'X'&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jun 2022 06:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569057#M4712900</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T06:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569058#M4712901</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Did you debug and check the table - ld_return&lt;/P&gt;&lt;P&gt;What is expected and what it is nod updated.  Can you please share.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 08:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569058#M4712901</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-06-07T08:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569059#M4712902</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Yes, I have debuged. In ld-return, there is nothing written. My programm should append new markets to an assortment. So, I am passing assortment(ASORT), market(LOCNR) and two more fields. Everything seems to be written to internal tables,but nothing is written to the tables. What may be the reason for this? And what should I share, for better understanding?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 08:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569059#M4712902</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T08:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569060#M4712903</link>
      <description>&lt;P&gt;I am not fully aware of the functionality.  However, can you please pass the values for  ( for both asoortment and assortment uers)&lt;/P&gt;&lt;P&gt;VALID_FROM&lt;/P&gt;&lt;P&gt;VALID_TO&lt;/P&gt;&lt;P&gt;ASTMT_CAT&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569060#M4712903</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-06-07T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569061#M4712904</link>
      <description>&lt;P&gt;I tried this, but unfortunately this didnt work&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 10:00:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569061#M4712904</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T10:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569062#M4712905</link>
      <description>&lt;P&gt;Here is the full code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zmm_kub_upl.&lt;BR /&gt;INCLUDE zbc_bal_log.&lt;BR /&gt;DATA:&lt;BR /&gt;  ld_return            TYPE bapiret2,&lt;BR /&gt;  it_assortmentusers  TYPE STANDARD TABLE OF bapie1wrsz, "TABLES PARAM&lt;BR /&gt;  wa_assortmentusers  LIKE LINE OF it_assortmentusers,&lt;BR /&gt;  it_assortmentusersx  TYPE STANDARD TABLE OF bapie1wrszx, "TABLES PARAM&lt;BR /&gt;  wa_assortmentusersx  LIKE LINE OF it_assortmentusersx,&lt;BR /&gt;  ld_assortment       TYPE bapie1wrs1,&lt;BR /&gt;  wa_assortment       LIKE ld_assortment,&lt;BR /&gt;  ld_assortmentx      TYPE bapie1wrs1x,&lt;BR /&gt;  wa_assortmentx      LIKE ld_assortmentx.&lt;BR /&gt;PARAMETERS:&lt;BR /&gt;p_file  TYPE  localfile OBLIGATORY.&lt;BR /&gt;CLASS lcl_report DEFINITION DEFERRED.&lt;BR /&gt;TYPES: BEGIN OF gts_struct,&lt;BR /&gt;         sheet TYPE i,&lt;BR /&gt;         name  TYPE tabname,&lt;BR /&gt;       END OF gts_struct.&lt;BR /&gt;DATA: go_report TYPE REF TO lcl_report.&lt;BR /&gt;DATA: bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE.&lt;BR /&gt;CLASS lcl_excel_uploader DEFINITION.&lt;BR /&gt;  PUBLIC SECTION.&lt;BR /&gt;    DATA: header_rows_count TYPE i.&lt;BR /&gt;    DATA: max_rows          TYPE i.&lt;BR /&gt;    DATA: filename          TYPE localfile.&lt;BR /&gt;    DATA: mt_struct TYPE TABLE OF gts_struct.&lt;BR /&gt;    METHODS:&lt;BR /&gt;      constructor.&lt;BR /&gt;    METHODS:&lt;BR /&gt;      upload  IMPORTING iv_sheet TYPE i&lt;BR /&gt;              CHANGING  ct_data  TYPE ANY TABLE.&lt;BR /&gt;  PRIVATE SECTION.&lt;BR /&gt;    DATA: lv_tot_components TYPE i.&lt;BR /&gt;    METHODS:&lt;BR /&gt;      do_upload&lt;BR /&gt;        IMPORTING&lt;BR /&gt;          iv_begin TYPE i&lt;BR /&gt;          iv_end   TYPE i&lt;BR /&gt;          iv_sheet TYPE i&lt;BR /&gt;        EXPORTING&lt;BR /&gt;          rv_empty TYPE flag&lt;BR /&gt;        CHANGING&lt;BR /&gt;          ct_data  TYPE STANDARD TABLE.&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;CLASS lcl_excel_uploader IMPLEMENTATION.&lt;BR /&gt;  METHOD constructor.&lt;BR /&gt;    max_rows = 9999.&lt;BR /&gt;    DATA: ls_struct TYPE gts_struct.&lt;BR /&gt;    ls_struct-sheet = 1.&lt;BR /&gt;    ls_struct-name = 'ZMM_KUB'.&lt;BR /&gt;    APPEND ls_struct TO mt_struct.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;  METHOD upload.&lt;BR /&gt;    DATA: lo_struct TYPE REF TO cl_abap_structdescr,&lt;BR /&gt;          lo_table  TYPE REF TO cl_abap_tabledescr,&lt;BR /&gt;          lt_comp   TYPE cl_abap_structdescr=&amp;gt;component_table.&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;    lo_table ?= cl_abap_structdescr=&amp;gt;describe_by_data( ct_data ).&lt;BR /&gt;    lo_struct ?= lo_table-&amp;gt;get_table_line_type( ).&lt;BR /&gt;    lt_comp    = lo_struct-&amp;gt;get_components( ).&lt;BR /&gt;    lv_tot_components = lines( lt_comp ).&lt;BR /&gt;    DATA: lv_empty TYPE flag,&lt;BR /&gt;          lv_begin TYPE i,&lt;BR /&gt;          lv_end   TYPE i.&lt;BR /&gt;    lv_begin = header_rows_count + 1.&lt;BR /&gt;    lv_end   = max_rows.&lt;BR /&gt;    WHILE lv_empty IS INITIAL.&lt;BR /&gt;      do_upload(&lt;BR /&gt;        EXPORTING&lt;BR /&gt;            iv_begin = lv_begin&lt;BR /&gt;            iv_end   = lv_end&lt;BR /&gt;            iv_sheet = iv_sheet&lt;BR /&gt;        IMPORTING&lt;BR /&gt;            rv_empty = lv_empty&lt;BR /&gt;        CHANGING&lt;BR /&gt;            ct_data  = ct_data&lt;BR /&gt;      ).&lt;BR /&gt;      lv_begin = lv_end + 1.&lt;BR /&gt;      lv_end   = lv_begin + max_rows.&lt;BR /&gt;    ENDWHILE.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;  METHOD do_upload.&lt;BR /&gt;    DATA: li_exceldata  TYPE STANDARD TABLE OF zalsmex_tabline.&lt;BR /&gt;    DATA: ls_exceldata  LIKE LINE OF li_exceldata.&lt;BR /&gt;    DATA: lv_tot_rows   TYPE i.&lt;BR /&gt;    DATA: lv_packet     TYPE i.&lt;BR /&gt;    DATA: lt_dfies TYPE TABLE OF dfies.&lt;BR /&gt;    DATA: ls_struct TYPE gts_struct.&lt;BR /&gt;    FIELD-SYMBOLS: &amp;lt;struc&amp;gt; TYPE any,&lt;BR /&gt;                   &amp;lt;field&amp;gt; TYPE any.&lt;BR /&gt;*   Upload this packet&lt;BR /&gt;    CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE1'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        filename                = filename&lt;BR /&gt;        i_begin_col             = 1&lt;BR /&gt;        i_begin_row             = iv_begin&lt;BR /&gt;        i_end_col               = lv_tot_components&lt;BR /&gt;        i_end_row               = iv_end&lt;BR /&gt;        i_sheet                 = iv_sheet&lt;BR /&gt;      TABLES&lt;BR /&gt;        intern                  = li_exceldata&lt;BR /&gt;      EXCEPTIONS&lt;BR /&gt;        inconsistent_parameters = 1&lt;BR /&gt;        upload_ole              = 2&lt;BR /&gt;        OTHERS                  = 3.&lt;BR /&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;BR /&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;BR /&gt;      rv_empty = 'X'.&lt;BR /&gt;      EXIT.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;*   No rows uploaded, exit&lt;BR /&gt;    IF li_exceldata IS INITIAL.&lt;BR /&gt;      rv_empty = 'X'.&lt;BR /&gt;      EXIT.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;*     Проверка запятых&lt;BR /&gt;    DATA lr_structdescr TYPE REF TO cl_abap_structdescr.&lt;BR /&gt;    DATA l_component TYPE abap_compdescr .&lt;BR /&gt;    READ TABLE mt_struct INTO ls_struct WITH KEY sheet = iv_sheet.&lt;BR /&gt;    IF sy-subrc EQ 0.&lt;BR /&gt;      lr_structdescr ?= cl_abap_typedescr=&amp;gt;describe_by_name( ls_struct-name ).&lt;BR /&gt;    ENDIF.&lt;BR /&gt;*   Move from Row, Col to Flat Structure&lt;BR /&gt;    LOOP AT li_exceldata INTO ls_exceldata.&lt;BR /&gt;*       Append new row&lt;BR /&gt;      AT NEW row.&lt;BR /&gt;        APPEND INITIAL LINE TO ct_data ASSIGNING &amp;lt;struc&amp;gt;.&lt;BR /&gt;      ENDAT.&lt;BR /&gt;      READ TABLE lr_structdescr-&amp;gt;components INTO l_component INDEX ls_exceldata-col.&lt;BR /&gt;      IF l_component-type_kind = 'P'.&lt;BR /&gt;        REPLACE ALL OCCURRENCES OF ',' IN ls_exceldata-value WITH '.'.&lt;BR /&gt;      ENDIF.&lt;BR /&gt;*       component and its value&lt;BR /&gt;      ASSIGN COMPONENT ls_exceldata-col OF STRUCTURE &amp;lt;struc&amp;gt; TO &amp;lt;field&amp;gt;.&lt;BR /&gt;      IF sy-subrc EQ 0.&lt;BR /&gt;        &amp;lt;field&amp;gt; = ls_exceldata-value.&lt;BR /&gt;      ENDIF.&lt;BR /&gt;*       add the row count&lt;BR /&gt;      AT END OF row.&lt;BR /&gt;        IF &amp;lt;struc&amp;gt; IS NOT INITIAL.&lt;BR /&gt;          lv_tot_rows = lv_tot_rows + 1.&lt;BR /&gt;        ENDIF.&lt;BR /&gt;      ENDAT.&lt;BR /&gt;    ENDLOOP.&lt;BR /&gt;*   packet has more rows than uploaded rows,&lt;BR /&gt;*   no more packet left. Thus exit&lt;BR /&gt;    lv_packet = iv_end - iv_begin.&lt;BR /&gt;    IF lv_tot_rows LT lv_packet.&lt;BR /&gt;      rv_empty = 'X'.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;  ENDMETHOD.                    "do_upload&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;CLASS lcl_report DEFINITION.&lt;BR /&gt;  PUBLIC SECTION.&lt;BR /&gt;    CONSTANTS: mc_object    TYPE bal_s_log-object      VALUE 'ZMM',&lt;BR /&gt;               mc_subobject TYPE bal_s_log-subobject   VALUE 'ZMM_INFO_UPL'.&lt;BR /&gt;    DATA: mt_info TYPE TABLE OF zmm_kub,&lt;BR /&gt;          mo_log  TYPE REF TO lcl_bal_log.&lt;BR /&gt;    METHODS:&lt;BR /&gt;      constructor,&lt;BR /&gt;      file_f4,&lt;BR /&gt;      load_file,&lt;BR /&gt;      post_data,&lt;BR /&gt;*      create_condition IMPORTING is_info TYPE zmm_inforec,&lt;BR /&gt;*      check,&lt;BR /&gt;      add_sy_message&lt;BR /&gt;      .&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;CLASS lcl_report IMPLEMENTATION.&lt;BR /&gt;  METHOD file_f4.&lt;BR /&gt;    DATA: lv_directory TYPE string,&lt;BR /&gt;          lt_filetable TYPE filetable,&lt;BR /&gt;          ls_filetable TYPE LINE OF filetable,&lt;BR /&gt;          lv_rc        TYPE i.&lt;BR /&gt;    CALL METHOD cl_gui_frontend_services=&amp;gt;file_open_dialog&lt;BR /&gt;      EXPORTING&lt;BR /&gt;*       window_title            =&lt;BR /&gt;*       default_extension       =&lt;BR /&gt;*       default_filename        =&lt;BR /&gt;        file_filter             = 'Excel files (*.xls, *.xlsx)|*.xls; *.xlsx'&lt;BR /&gt;*       with_encoding           =&lt;BR /&gt;*       initial_directory       = 'C:\'&lt;BR /&gt;*       multiselection          =&lt;BR /&gt;      CHANGING&lt;BR /&gt;        file_table              = lt_filetable&lt;BR /&gt;        rc                      = lv_rc&lt;BR /&gt;*       user_action             =&lt;BR /&gt;*       file_encoding           =&lt;BR /&gt;      EXCEPTIONS&lt;BR /&gt;        file_open_dialog_failed = 1&lt;BR /&gt;        cntl_error              = 2&lt;BR /&gt;        error_no_gui            = 3&lt;BR /&gt;        not_supported_by_gui    = 4&lt;BR /&gt;        OTHERS                  = 5.&lt;BR /&gt;    IF sy-subrc EQ 0.&lt;BR /&gt;      READ TABLE lt_filetable INTO ls_filetable INDEX 1.&lt;BR /&gt;      p_file = ls_filetable-filename.&lt;BR /&gt;    ELSE.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;  METHOD load_file.&lt;BR /&gt;    DATA: lo_uploader TYPE REF TO lcl_excel_uploader.&lt;BR /&gt;    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        text = 'Загрузка файла...'.&lt;BR /&gt;    CREATE OBJECT mo_log&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        extnumber = ''&lt;BR /&gt;        object    = mc_object&lt;BR /&gt;        subobject = mc_subobject.&lt;BR /&gt;    CREATE OBJECT lo_uploader.&lt;BR /&gt;    lo_uploader-&amp;gt;max_rows = 65000.&lt;BR /&gt;    lo_uploader-&amp;gt;filename = p_file.&lt;BR /&gt;*    lo_uploader-&amp;gt;filename = 'C:\Users\kh.yusupkhujayev\Desktop\kip.xlsx'.&lt;BR /&gt;    lo_uploader-&amp;gt;header_rows_count = 2.&lt;BR /&gt;    lo_uploader-&amp;gt;upload( EXPORTING iv_sheet = 1 CHANGING ct_data = mt_info ).&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;  METHOD post_data.&lt;BR /&gt;    DATA: lt_msg   TYPE TABLE OF bdcmsgcoll,&lt;BR /&gt;          ls_msg   LIKE LINE OF lt_msg,&lt;BR /&gt;          ls_info  LIKE LINE OF mt_info,&lt;BR /&gt;          lv_dummy,&lt;BR /&gt;          la_new   TYPE abap_bool,&lt;BR /&gt;          lv_new   TYPE abap_bool,&lt;BR /&gt;          lv_chn   TYPE abap_bool.&lt;BR /&gt;    DATA run_mode   TYPE c.&lt;BR /&gt;    LOOP AT mt_info INTO ls_info.&lt;BR /&gt;      wa_assortment-assortment          = ls_info-asort.&lt;BR /&gt;      wa_assortment-astmt_cat           = 'C'.&lt;BR /&gt;      wa_assortmentx-assortment         = 'X'.&lt;BR /&gt;      wa_assortmentx-astmt_cat          = 'X'.&lt;BR /&gt;      wa_assortmentusers-seqnumber      = '5'.&lt;BR /&gt;      wa_assortmentusers-customer_site  = ls_info-locnr.&lt;BR /&gt;      wa_assortmentusers-salesorg       = ls_info-vkorg.&lt;BR /&gt;      wa_assortmentusers-distr_chan     = ls_info-vtweg.&lt;BR /&gt;      wa_assortmentusers-valid_from     = ls_info-datab.&lt;BR /&gt;      wa_assortmentusers-valid_from     = ls_info-datbi.&lt;BR /&gt;*      wa_assortmentusers-astmtuserc     = 'C'.&lt;BR /&gt;      wa_assortmentusersx-seqnumber     = 'X'.&lt;BR /&gt;      wa_assortmentusersx-customer_site = 'X'.&lt;BR /&gt;      wa_assortmentusersx-salesorg      = 'X'.&lt;BR /&gt;      wa_assortmentusersx-distr_chan    = 'X'.&lt;BR /&gt;      wa_assortmentusersx-valid_from    = 'X'.&lt;BR /&gt;      wa_assortmentusersx-valid_from    = 'X'.&lt;BR /&gt;*      wa_assortmentusersx-astmtuserc    = 'X'.&lt;BR /&gt;      APPEND wa_assortmentusers  TO it_assortmentusers.&lt;BR /&gt;      APPEND wa_assortmentusersx TO it_assortmentusersx.&lt;BR /&gt;    ENDLOOP.&lt;BR /&gt;    CALL FUNCTION 'BAPI_ASSORTMENT_MAINTAINDATA'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        assortment       = wa_assortment&lt;BR /&gt;        assortmentx      = wa_assortmentx&lt;BR /&gt;      IMPORTING&lt;BR /&gt;        return           = ld_return&lt;BR /&gt;      TABLES&lt;BR /&gt;*       MATERIALGROUP    =&lt;BR /&gt;*       MATERIALGROUPX   =&lt;BR /&gt;*       DESCRIPTION      =&lt;BR /&gt;*       DESCRIPTIONX     =&lt;BR /&gt;        assortmentusers  = it_assortmentusers&lt;BR /&gt;        assortmentusersx = it_assortmentusersx.&lt;BR /&gt;    WRITE:/&lt;BR /&gt;             ld_return-type,&lt;BR /&gt;             ld_return-id,&lt;BR /&gt;             ld_return-number,&lt;BR /&gt;             ld_return-message.&lt;BR /&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        wait = 'X'.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;  METHOD constructor.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;INITIALIZATION.&lt;BR /&gt;  CREATE OBJECT go_report.&lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;BR /&gt;  go_report-&amp;gt;file_f4( ).&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;  go_report-&amp;gt;load_file( ).&lt;BR /&gt;  go_report-&amp;gt;post_data( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jun 2022 10:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569062#M4712905</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T10:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569063#M4712906</link>
      <description>&lt;P&gt;Yes, Just a random try..  &lt;/P&gt;&lt;P&gt;Put the Commit statement just immidiate after the BAPI.&lt;/P&gt;&lt;P&gt;Write statement after the commit.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 10:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569063#M4712906</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-06-07T10:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569064#M4712907</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; CALL FUNCTION 'BAPI_ASSORTMENT_MAINTAINDATA'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        assortment       = wa_assortment&lt;BR /&gt;        assortmentx      = wa_assortmentx&lt;BR /&gt;      IMPORTING&lt;BR /&gt;        return           = ld_return&lt;BR /&gt;      TABLES&lt;BR /&gt;*       MATERIALGROUP    =&lt;BR /&gt;*       MATERIALGROUPX   =&lt;BR /&gt;*       DESCRIPTION      =&lt;BR /&gt;*       DESCRIPTIONX     =&lt;BR /&gt;        assortmentusers  = it_assortmentusers&lt;BR /&gt;        assortmentusersx = it_assortmentusersx.&lt;BR /&gt;    IF sy-subrc EQ 0.&lt;BR /&gt;      COMMIT WORK AND WAIT.&lt;BR /&gt;    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you mean like this, than, it still does not work. Is there any option I can know what is going wrong with ld_return. There should be something wrong, so my program does not work.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 10:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569064#M4712907</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T10:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569065#M4712908</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I found out that in WRSZ table, data is inserting, but because it is not writing assortment, my program does not work correctly. &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2056576-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 11:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569065#M4712908</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T11:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569066#M4712909</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Issue solved, finally.&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569066#M4712909</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-07T13:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569067#M4712910</link>
      <description>&lt;P&gt;Curious to know - what was the issue that was hidden for long time&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569067#M4712910</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-06-07T13:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569068#M4712911</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;the mistake was that I needed assortment both for assortment and assortment user, it should look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wa_assortment-assortment          = ls_info-asort.&lt;BR /&gt;wa_assortmentx-assortment         = 'X'.&lt;BR /&gt;wa_assortmentusers-assortment     = ls_info-asort.&lt;BR /&gt;wa_assortmentusersx-assortment    = 'X'.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jun 2022 04:02:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569068#M4712911</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-08T04:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569069#M4712912</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;venkateswaran.k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However, another issue seems to pop up. Can I also change the value of data with the help of this BAPI? Now I need to change the DATBI (Valid To) of an existing assortment in order to delete it. So, first task is done, which was to enter data. Now, I need to delete data. Can I do this with the help of this BAPI?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 05:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569069#M4712912</guid>
      <dc:creator>former_member797394</dc:creator>
      <dc:date>2022-06-08T05:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for assortment change WSOA2</title>
      <link>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569070#M4712913</link>
      <description>&lt;P&gt;hmm. I need to research on that. &lt;/P&gt;&lt;P&gt;You may close this thread and open a new thread - so that It will be useful for those who are searching for solution on same issue&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 05:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-module-for-assortment-change-wsoa2/qaa-p/12569070#M4712913</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-06-08T05:22:59Z</dc:date>
    </item>
  </channel>
</rss>

