SAP Function Modules

ASSORTMENT_VERSION_ALL SAP Function module







ASSORTMENT_VERSION_ALL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ASSORTMENT_VERSION_ALL into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: WSO1
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ASSORTMENT_VERSION_ALL - ASSORTMENT VERSION ALL





CALL FUNCTION 'ASSORTMENT_VERSION_ALL' "
  EXPORTING
*   activity_code = SPACE       " wtdy-typ01    Activation code (' '-simulation/'X'-incl. data maintenance)
    function =                  " wtdy-typ01    See Long Text
*   item_intern = SPACE         " wtdy-typ01    If material not yet in database (-> long text)
    item_data =                 " wint_wam1     Data in stages for the MARA/MAW1 segment
    transaction_code =          " wtdy-typ01    Material maintenance transaction (1-create,2-change,3-delete)
    first =                     " wtdy-typ01    First program run (per material environment) -> long text
*   all_variants_of_item_group = SPACE  " wtdy-typ01  All variants of a generic material --> long text
*   change_plant_list = SPACE   " wtdy-typ01    See Long Text
*   error_info = SPACE          " wtdy-typ01    Error list is displayed online
*   item_intern_variants = SPACE  " wtdy-typ01  If component (generic material, set, etc), do not read from database (long txt)
*   all_mbew_items = ' '        " wtdy-typ01    Transfer of all (required) MBEW-BWTAR's
*   all_mvke_items = ' '        " wtdy-typ01    Transfer of all (required) MVKE-VKORG/VTWEG's
*   last_listing = ' '          " wtdy-typ01    End date cuts off all subsequent listings
*   check_all_assortments = ' '  " wtdy-typ01
*   maximum_dc_time = SPACE     " wtdy-typ01
*   reduce_sales_line = ' '     " wtdy-typ01
*   list_local_assortments = SPACE  " wtdy-typ01
*   list_delivering_plant = SPACE  " wtdy-typ01
*   assortyp = ' '              " rmmwz-assortyp  Assortment Type
  IMPORTING
    wscor =                     " wscor         Message code for errors (-> long text)
  TABLES
*   default_plant_list =        " wint_fdef     Default for maximum period/area of validity for listing
    plant_list =                " wint_loc      Possibly listed stores --> see long text
*   unit_exclusion_list =       " wint_me       List of units of measure to be excluded
*   variant_list =              " wint_wam1     See Long Text
    sales_line_data =           " wint_sl       All data from screen GD2 (see long text)
*   layout_groups =             " malg          Layout modules for the material (see long text)
*   item_numbers =              " wint_intnr    See Long Text
*   t_marc =                    " marc          Pass MARC data (MRP) to special maintenance function
*   all_mbew_bwtar =            " wint_bwtar    List of all required MBEW-BWTAR's
*   all_mvke_sdlines =          " wint_mvke2    List of all required MVKE-VKORG/VTWEG's
*   deleted_plants_by_changes =   " wint_loc    List of the plants that are excluded after changes
*   layout_groups_old =         " malg
  EXCEPTIONS
    ARTNR_NOT_FOUND = 1         "               Material number not found
    NO_LOCATION_FOUND = 2       "               No plant found for listing
    NO_SALES_LINE_FOUND = 3     "               Distribution chain not valid
    UNALLOWED_ASSORTMENT_LEVEL = 4  "           Range grade not valid
    UNALLOWED_ASSORTMENT_PRIORITY = 5  "        Range priority not valid
    UNALLOWED_DATE = 6          "               Date specifications not valid
    UNALLOWED_FUNCTION = 7      "               Impermissible function code
    UNALLOWED_LISTING_METHOD_DC = 8  "          Listing procedure for DC not valid
    UNALLOWED_LISTING_METHOD_SHOP = 9  "        Listing procedure not valid
    UNALLOWED_TRANSACTION_CODE = 10  "          Transaction code not valid
    COMPRIMATION_NOT_ALLOWED = 11  "            Compression per generic material only allowed with TRANS._CODE 1
    NO_CHANGE_OF_LSTMETHOD = 12  "              Currently: no change allowed to listing procedure
    MANUEL_METHOD_AND_NOT_NEW = 13  "           Currently: manual procedures only for initial creation
    NO_MANUEL_LISTING = 14      "               Manual procedure and termination - no listing
    .  "  ASSORTMENT_VERSION_ALL

ABAP code example for Function Module ASSORTMENT_VERSION_ALL





The ABAP code below is a full code listing to execute function module ASSORTMENT_VERSION_ALL including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_wscor  TYPE WSCOR ,
it_default_plant_list  TYPE STANDARD TABLE OF WINT_FDEF,"TABLES PARAM
wa_default_plant_list  LIKE LINE OF it_default_plant_list ,
it_plant_list  TYPE STANDARD TABLE OF WINT_LOC,"TABLES PARAM
wa_plant_list  LIKE LINE OF it_plant_list ,
it_unit_exclusion_list  TYPE STANDARD TABLE OF WINT_ME,"TABLES PARAM
wa_unit_exclusion_list  LIKE LINE OF it_unit_exclusion_list ,
it_variant_list  TYPE STANDARD TABLE OF WINT_WAM1,"TABLES PARAM
wa_variant_list  LIKE LINE OF it_variant_list ,
it_sales_line_data  TYPE STANDARD TABLE OF WINT_SL,"TABLES PARAM
wa_sales_line_data  LIKE LINE OF it_sales_line_data ,
it_layout_groups  TYPE STANDARD TABLE OF MALG,"TABLES PARAM
wa_layout_groups  LIKE LINE OF it_layout_groups ,
it_item_numbers  TYPE STANDARD TABLE OF WINT_INTNR,"TABLES PARAM
wa_item_numbers  LIKE LINE OF it_item_numbers ,
it_t_marc  TYPE STANDARD TABLE OF MARC,"TABLES PARAM
wa_t_marc  LIKE LINE OF it_t_marc ,
it_all_mbew_bwtar  TYPE STANDARD TABLE OF WINT_BWTAR,"TABLES PARAM
wa_all_mbew_bwtar  LIKE LINE OF it_all_mbew_bwtar ,
it_all_mvke_sdlines  TYPE STANDARD TABLE OF WINT_MVKE2,"TABLES PARAM
wa_all_mvke_sdlines  LIKE LINE OF it_all_mvke_sdlines ,
it_deleted_plants_by_changes  TYPE STANDARD TABLE OF WINT_LOC,"TABLES PARAM
wa_deleted_plants_by_changes  LIKE LINE OF it_deleted_plants_by_changes ,
it_layout_groups_old  TYPE STANDARD TABLE OF MALG,"TABLES PARAM
wa_layout_groups_old  LIKE LINE OF it_layout_groups_old .


DATA(ld_activity_code) = some text here

DATA(ld_function) = some text here

DATA(ld_item_intern) = some text here
DATA(ld_item_data) = 'Check type of data required'.

DATA(ld_transaction_code) = some text here

DATA(ld_first) = some text here

DATA(ld_all_variants_of_item_group) = some text here

DATA(ld_change_plant_list) = some text here

DATA(ld_error_info) = some text here

DATA(ld_item_intern_variants) = some text here

DATA(ld_all_mbew_items) = some text here

DATA(ld_all_mvke_items) = some text here

DATA(ld_last_listing) = some text here

DATA(ld_check_all_assortments) = some text here

DATA(ld_maximum_dc_time) = some text here

DATA(ld_reduce_sales_line) = some text here

DATA(ld_list_local_assortments) = some text here

DATA(ld_list_delivering_plant) = some text here

DATA(ld_assortyp) = some text here

"populate fields of struture and append to itab
append wa_default_plant_list to it_default_plant_list.

"populate fields of struture and append to itab
append wa_plant_list to it_plant_list.

"populate fields of struture and append to itab
append wa_unit_exclusion_list to it_unit_exclusion_list.

"populate fields of struture and append to itab
append wa_variant_list to it_variant_list.

"populate fields of struture and append to itab
append wa_sales_line_data to it_sales_line_data.

"populate fields of struture and append to itab
append wa_layout_groups to it_layout_groups.

"populate fields of struture and append to itab
append wa_item_numbers to it_item_numbers.

"populate fields of struture and append to itab
append wa_t_marc to it_t_marc.

"populate fields of struture and append to itab
append wa_all_mbew_bwtar to it_all_mbew_bwtar.

"populate fields of struture and append to itab
append wa_all_mvke_sdlines to it_all_mvke_sdlines.

"populate fields of struture and append to itab
append wa_deleted_plants_by_changes to it_deleted_plants_by_changes.

"populate fields of struture and append to itab
append wa_layout_groups_old to it_layout_groups_old. . CALL FUNCTION 'ASSORTMENT_VERSION_ALL' EXPORTING * activity_code = ld_activity_code function = ld_function * item_intern = ld_item_intern item_data = ld_item_data transaction_code = ld_transaction_code first = ld_first * all_variants_of_item_group = ld_all_variants_of_item_group * change_plant_list = ld_change_plant_list * error_info = ld_error_info * item_intern_variants = ld_item_intern_variants * all_mbew_items = ld_all_mbew_items * all_mvke_items = ld_all_mvke_items * last_listing = ld_last_listing * check_all_assortments = ld_check_all_assortments * maximum_dc_time = ld_maximum_dc_time * reduce_sales_line = ld_reduce_sales_line * list_local_assortments = ld_list_local_assortments * list_delivering_plant = ld_list_delivering_plant * assortyp = ld_assortyp IMPORTING wscor = ld_wscor TABLES * default_plant_list = it_default_plant_list plant_list = it_plant_list * unit_exclusion_list = it_unit_exclusion_list * variant_list = it_variant_list sales_line_data = it_sales_line_data * layout_groups = it_layout_groups * item_numbers = it_item_numbers * t_marc = it_t_marc * all_mbew_bwtar = it_all_mbew_bwtar * all_mvke_sdlines = it_all_mvke_sdlines * deleted_plants_by_changes = it_deleted_plants_by_changes * layout_groups_old = it_layout_groups_old EXCEPTIONS ARTNR_NOT_FOUND = 1 NO_LOCATION_FOUND = 2 NO_SALES_LINE_FOUND = 3 UNALLOWED_ASSORTMENT_LEVEL = 4 UNALLOWED_ASSORTMENT_PRIORITY = 5 UNALLOWED_DATE = 6 UNALLOWED_FUNCTION = 7 UNALLOWED_LISTING_METHOD_DC = 8 UNALLOWED_LISTING_METHOD_SHOP = 9 UNALLOWED_TRANSACTION_CODE = 10 COMPRIMATION_NOT_ALLOWED = 11 NO_CHANGE_OF_LSTMETHOD = 12 MANUEL_METHOD_AND_NOT_NEW = 13 NO_MANUEL_LISTING = 14 . " ASSORTMENT_VERSION_ALL
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 13. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 14. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_wscor  TYPE WSCOR ,
ld_activity_code  TYPE WTDY-TYP01 ,
it_default_plant_list  TYPE STANDARD TABLE OF WINT_FDEF ,
wa_default_plant_list  LIKE LINE OF it_default_plant_list,
ld_function  TYPE WTDY-TYP01 ,
it_plant_list  TYPE STANDARD TABLE OF WINT_LOC ,
wa_plant_list  LIKE LINE OF it_plant_list,
it_unit_exclusion_list  TYPE STANDARD TABLE OF WINT_ME ,
wa_unit_exclusion_list  LIKE LINE OF it_unit_exclusion_list,
ld_item_intern  TYPE WTDY-TYP01 ,
ld_item_data  TYPE WINT_WAM1 ,
it_variant_list  TYPE STANDARD TABLE OF WINT_WAM1 ,
wa_variant_list  LIKE LINE OF it_variant_list,
ld_transaction_code  TYPE WTDY-TYP01 ,
it_sales_line_data  TYPE STANDARD TABLE OF WINT_SL ,
wa_sales_line_data  LIKE LINE OF it_sales_line_data,
it_layout_groups  TYPE STANDARD TABLE OF MALG ,
wa_layout_groups  LIKE LINE OF it_layout_groups,
ld_first  TYPE WTDY-TYP01 ,
it_item_numbers  TYPE STANDARD TABLE OF WINT_INTNR ,
wa_item_numbers  LIKE LINE OF it_item_numbers,
ld_all_variants_of_item_group  TYPE WTDY-TYP01 ,
it_t_marc  TYPE STANDARD TABLE OF MARC ,
wa_t_marc  LIKE LINE OF it_t_marc,
ld_change_plant_list  TYPE WTDY-TYP01 ,
it_all_mbew_bwtar  TYPE STANDARD TABLE OF WINT_BWTAR ,
wa_all_mbew_bwtar  LIKE LINE OF it_all_mbew_bwtar,
ld_error_info  TYPE WTDY-TYP01 ,
it_all_mvke_sdlines  TYPE STANDARD TABLE OF WINT_MVKE2 ,
wa_all_mvke_sdlines  LIKE LINE OF it_all_mvke_sdlines,
ld_item_intern_variants  TYPE WTDY-TYP01 ,
it_deleted_plants_by_changes  TYPE STANDARD TABLE OF WINT_LOC ,
wa_deleted_plants_by_changes  LIKE LINE OF it_deleted_plants_by_changes,
ld_all_mbew_items  TYPE WTDY-TYP01 ,
it_layout_groups_old  TYPE STANDARD TABLE OF MALG ,
wa_layout_groups_old  LIKE LINE OF it_layout_groups_old,
ld_all_mvke_items  TYPE WTDY-TYP01 ,
ld_last_listing  TYPE WTDY-TYP01 ,
ld_check_all_assortments  TYPE WTDY-TYP01 ,
ld_maximum_dc_time  TYPE WTDY-TYP01 ,
ld_reduce_sales_line  TYPE WTDY-TYP01 ,
ld_list_local_assortments  TYPE WTDY-TYP01 ,
ld_list_delivering_plant  TYPE WTDY-TYP01 ,
ld_assortyp  TYPE RMMWZ-ASSORTYP .


ld_activity_code = some text here

"populate fields of struture and append to itab
append wa_default_plant_list to it_default_plant_list.

ld_function = some text here

"populate fields of struture and append to itab
append wa_plant_list to it_plant_list.

"populate fields of struture and append to itab
append wa_unit_exclusion_list to it_unit_exclusion_list.

ld_item_intern = some text here
ld_item_data = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_variant_list to it_variant_list.

ld_transaction_code = some text here

"populate fields of struture and append to itab
append wa_sales_line_data to it_sales_line_data.

"populate fields of struture and append to itab
append wa_layout_groups to it_layout_groups.

ld_first = some text here

"populate fields of struture and append to itab
append wa_item_numbers to it_item_numbers.

ld_all_variants_of_item_group = some text here

"populate fields of struture and append to itab
append wa_t_marc to it_t_marc.

ld_change_plant_list = some text here

"populate fields of struture and append to itab
append wa_all_mbew_bwtar to it_all_mbew_bwtar.

ld_error_info = some text here

"populate fields of struture and append to itab
append wa_all_mvke_sdlines to it_all_mvke_sdlines.

ld_item_intern_variants = some text here

"populate fields of struture and append to itab
append wa_deleted_plants_by_changes to it_deleted_plants_by_changes.

ld_all_mbew_items = some text here

"populate fields of struture and append to itab
append wa_layout_groups_old to it_layout_groups_old.

ld_all_mvke_items = some text here

ld_last_listing = some text here

ld_check_all_assortments = some text here

ld_maximum_dc_time = some text here

ld_reduce_sales_line = some text here

ld_list_local_assortments = some text here

ld_list_delivering_plant = some text here

ld_assortyp = some text here

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ASSORTMENT_VERSION_ALL or its description.