SAP Function Modules

BAPI_ASSORTMENT_MAINTAINDATA SAP Function module - Maintenance of Assortments







BAPI_ASSORTMENT_MAINTAINDATA 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 BAPI_ASSORTMENT_MAINTAINDATA into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 1070
Released Date: 16.06.1998
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_ASSORTMENT_MAINTAINDATA - BAPI ASSORTMENT MAINTAINDATA





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
    .  "  BAPI_ASSORTMENT_MAINTAINDATA

ABAP code example for Function Module BAPI_ASSORTMENT_MAINTAINDATA





The ABAP code below is a full code listing to execute function module BAPI_ASSORTMENT_MAINTAINDATA 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_return  TYPE BAPIRET2 ,
it_materialgroup  TYPE STANDARD TABLE OF BAPIE1WRS6,"TABLES PARAM
wa_materialgroup  LIKE LINE OF it_materialgroup ,
it_materialgroupx  TYPE STANDARD TABLE OF BAPIE1WRS6X,"TABLES PARAM
wa_materialgroupx  LIKE LINE OF it_materialgroupx ,
it_description  TYPE STANDARD TABLE OF BAPIE1WRST,"TABLES PARAM
wa_description  LIKE LINE OF it_description ,
it_descriptionx  TYPE STANDARD TABLE OF BAPIE1WRSTX,"TABLES PARAM
wa_descriptionx  LIKE LINE OF it_descriptionx ,
it_assortmentusers  TYPE STANDARD TABLE OF BAPIE1WRSZ,"TABLES PARAM
wa_assortmentusers  LIKE LINE OF it_assortmentusers ,
it_assortmentusersx  TYPE STANDARD TABLE OF BAPIE1WRSZX,"TABLES PARAM
wa_assortmentusersx  LIKE LINE OF it_assortmentusersx .

DATA(ld_assortment) = 'Check type of data required'.
DATA(ld_assortmentx) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_materialgroup to it_materialgroup.

"populate fields of struture and append to itab
append wa_materialgroupx to it_materialgroupx.

"populate fields of struture and append to itab
append wa_description to it_description.

"populate fields of struture and append to itab
append wa_descriptionx to it_descriptionx.

"populate fields of struture and append to itab
append wa_assortmentusers to it_assortmentusers.

"populate fields of struture and append to itab
append wa_assortmentusersx to it_assortmentusersx. . CALL FUNCTION 'BAPI_ASSORTMENT_MAINTAINDATA' EXPORTING assortment = ld_assortment assortmentx = ld_assortmentx IMPORTING return = ld_return * TABLES * materialgroup = it_materialgroup * materialgroupx = it_materialgroupx * description = it_description * descriptionx = it_descriptionx * assortmentusers = it_assortmentusers * assortmentusersx = it_assortmentusersx . " BAPI_ASSORTMENT_MAINTAINDATA
IF SY-SUBRC EQ 0. "All OK 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_return  TYPE BAPIRET2 ,
ld_assortment  TYPE BAPIE1WRS1 ,
it_materialgroup  TYPE STANDARD TABLE OF BAPIE1WRS6 ,
wa_materialgroup  LIKE LINE OF it_materialgroup,
ld_assortmentx  TYPE BAPIE1WRS1X ,
it_materialgroupx  TYPE STANDARD TABLE OF BAPIE1WRS6X ,
wa_materialgroupx  LIKE LINE OF it_materialgroupx,
it_description  TYPE STANDARD TABLE OF BAPIE1WRST ,
wa_description  LIKE LINE OF it_description,
it_descriptionx  TYPE STANDARD TABLE OF BAPIE1WRSTX ,
wa_descriptionx  LIKE LINE OF it_descriptionx,
it_assortmentusers  TYPE STANDARD TABLE OF BAPIE1WRSZ ,
wa_assortmentusers  LIKE LINE OF it_assortmentusers,
it_assortmentusersx  TYPE STANDARD TABLE OF BAPIE1WRSZX ,
wa_assortmentusersx  LIKE LINE OF it_assortmentusersx.

ld_assortment = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_materialgroup to it_materialgroup.
ld_assortmentx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_materialgroupx to it_materialgroupx.

"populate fields of struture and append to itab
append wa_description to it_description.

"populate fields of struture and append to itab
append wa_descriptionx to it_descriptionx.

"populate fields of struture and append to itab
append wa_assortmentusers to it_assortmentusers.

"populate fields of struture and append to itab
append wa_assortmentusersx to it_assortmentusersx.

SAP Documentation for FM BAPI_ASSORTMENT_MAINTAINDATA


This method can be used to create new assortment and change or delete existing material master data. ...See here for full SAP fm documentation

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 BAPI_ASSORTMENT_MAINTAINDATA or its description.