SAP Function Modules

ASSORTMENT_GET_ASORT_OF_USER SAP Function module







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

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


Pattern for FM ASSORTMENT_GET_ASORT_OF_USER - ASSORTMENT GET ASORT OF USER





CALL FUNCTION 'ASSORTMENT_GET_ASORT_OF_USER' "
  EXPORTING
*   valid_per_date = SY-DATUM   " sy-datum
*   select_invalid_asort = SPACE  " wtdy-typ01
    user =                      " wrf1-locnr    Assortment User
    user_type =                 " wrf1-vlfkz
*   vkorg = SPACE               " wrsz-vkorg
*   vtweg = SPACE               " wrsz-vtweg
*   no_buffer = SPACE           " wtdy-typ01
*   date_to =                   " sy-datum      Valid-to date
  IMPORTING
    asort_default =             " wrs1
* TABLES
*   assortment_data =           " wrs1
*   assortment_connects =       " wrsz
  EXCEPTIONS
    NO_ASORT_FOUND = 1          "
    .  "  ASSORTMENT_GET_ASORT_OF_USER

ABAP code example for Function Module ASSORTMENT_GET_ASORT_OF_USER





The ABAP code below is a full code listing to execute function module ASSORTMENT_GET_ASORT_OF_USER 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_asort_default  TYPE WRS1 ,
it_assortment_data  TYPE STANDARD TABLE OF WRS1,"TABLES PARAM
wa_assortment_data  LIKE LINE OF it_assortment_data ,
it_assortment_connects  TYPE STANDARD TABLE OF WRSZ,"TABLES PARAM
wa_assortment_connects  LIKE LINE OF it_assortment_connects .

DATA(ld_valid_per_date) = '20210129'.

DATA(ld_select_invalid_asort) = some text here

SELECT single LOCNR
FROM WRF1
INTO @DATA(ld_user).


SELECT single VLFKZ
FROM WRF1
INTO @DATA(ld_user_type).


SELECT single VKORG
FROM WRSZ
INTO @DATA(ld_vkorg).


SELECT single VTWEG
FROM WRSZ
INTO @DATA(ld_vtweg).


DATA(ld_no_buffer) = some text here
DATA(ld_date_to) = '20210129'.

"populate fields of struture and append to itab
append wa_assortment_data to it_assortment_data.

"populate fields of struture and append to itab
append wa_assortment_connects to it_assortment_connects. . CALL FUNCTION 'ASSORTMENT_GET_ASORT_OF_USER' EXPORTING * valid_per_date = ld_valid_per_date * select_invalid_asort = ld_select_invalid_asort user = ld_user user_type = ld_user_type * vkorg = ld_vkorg * vtweg = ld_vtweg * no_buffer = ld_no_buffer * date_to = ld_date_to IMPORTING asort_default = ld_asort_default * TABLES * assortment_data = it_assortment_data * assortment_connects = it_assortment_connects EXCEPTIONS NO_ASORT_FOUND = 1 . " ASSORTMENT_GET_ASORT_OF_USER
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_asort_default  TYPE WRS1 ,
ld_valid_per_date  TYPE SY-DATUM ,
it_assortment_data  TYPE STANDARD TABLE OF WRS1 ,
wa_assortment_data  LIKE LINE OF it_assortment_data,
ld_select_invalid_asort  TYPE WTDY-TYP01 ,
it_assortment_connects  TYPE STANDARD TABLE OF WRSZ ,
wa_assortment_connects  LIKE LINE OF it_assortment_connects,
ld_user  TYPE WRF1-LOCNR ,
ld_user_type  TYPE WRF1-VLFKZ ,
ld_vkorg  TYPE WRSZ-VKORG ,
ld_vtweg  TYPE WRSZ-VTWEG ,
ld_no_buffer  TYPE WTDY-TYP01 ,
ld_date_to  TYPE SY-DATUM .

ld_valid_per_date = '20210129'.

"populate fields of struture and append to itab
append wa_assortment_data to it_assortment_data.

ld_select_invalid_asort = some text here

"populate fields of struture and append to itab
append wa_assortment_connects to it_assortment_connects.

SELECT single LOCNR
FROM WRF1
INTO ld_user.


SELECT single VLFKZ
FROM WRF1
INTO ld_user_type.


SELECT single VKORG
FROM WRSZ
INTO ld_vkorg.


SELECT single VTWEG
FROM WRSZ
INTO ld_vtweg.


ld_no_buffer = some text here
ld_date_to = '20210129'.

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