SAP Function Modules

CUSTOMER_KEY_SELECTION SAP Function module







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

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


Pattern for FM CUSTOMER_KEY_SELECTION - CUSTOMER KEY SELECTION





CALL FUNCTION 'CUSTOMER_KEY_SELECTION' "
  TABLES
    in_kunnr_range =            " kun_range
*   in_ktokd_range =            " ktkd_range    Range for Account Group (KTOKD)
*   in_sortl_range =            " srtl_range    Range for Sort Field (SORTL)
*   in_kukla_range =            " kukl_range    Range for Customer Classification (KUKLA)
*   in_vkorg_range =            " vorg_range    Range for Sales Organization (VKORG)
*   in_bukrs_range =            " bukr_range    Range for Company Code (BUKRS)
*   in_parvw_range =            " prvw_range    Range for Partner Role (PARVW)
    out_kunnr_list =            " kund01
    .  "  CUSTOMER_KEY_SELECTION

ABAP code example for Function Module CUSTOMER_KEY_SELECTION





The ABAP code below is a full code listing to execute function module CUSTOMER_KEY_SELECTION 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:
it_in_kunnr_range  TYPE STANDARD TABLE OF KUN_RANGE,"TABLES PARAM
wa_in_kunnr_range  LIKE LINE OF it_in_kunnr_range ,
it_in_ktokd_range  TYPE STANDARD TABLE OF KTKD_RANGE,"TABLES PARAM
wa_in_ktokd_range  LIKE LINE OF it_in_ktokd_range ,
it_in_sortl_range  TYPE STANDARD TABLE OF SRTL_RANGE,"TABLES PARAM
wa_in_sortl_range  LIKE LINE OF it_in_sortl_range ,
it_in_kukla_range  TYPE STANDARD TABLE OF KUKL_RANGE,"TABLES PARAM
wa_in_kukla_range  LIKE LINE OF it_in_kukla_range ,
it_in_vkorg_range  TYPE STANDARD TABLE OF VORG_RANGE,"TABLES PARAM
wa_in_vkorg_range  LIKE LINE OF it_in_vkorg_range ,
it_in_bukrs_range  TYPE STANDARD TABLE OF BUKR_RANGE,"TABLES PARAM
wa_in_bukrs_range  LIKE LINE OF it_in_bukrs_range ,
it_in_parvw_range  TYPE STANDARD TABLE OF PRVW_RANGE,"TABLES PARAM
wa_in_parvw_range  LIKE LINE OF it_in_parvw_range ,
it_out_kunnr_list  TYPE STANDARD TABLE OF KUND01,"TABLES PARAM
wa_out_kunnr_list  LIKE LINE OF it_out_kunnr_list .


"populate fields of struture and append to itab
append wa_in_kunnr_range to it_in_kunnr_range.

"populate fields of struture and append to itab
append wa_in_ktokd_range to it_in_ktokd_range.

"populate fields of struture and append to itab
append wa_in_sortl_range to it_in_sortl_range.

"populate fields of struture and append to itab
append wa_in_kukla_range to it_in_kukla_range.

"populate fields of struture and append to itab
append wa_in_vkorg_range to it_in_vkorg_range.

"populate fields of struture and append to itab
append wa_in_bukrs_range to it_in_bukrs_range.

"populate fields of struture and append to itab
append wa_in_parvw_range to it_in_parvw_range.

"populate fields of struture and append to itab
append wa_out_kunnr_list to it_out_kunnr_list. . CALL FUNCTION 'CUSTOMER_KEY_SELECTION' TABLES in_kunnr_range = it_in_kunnr_range * in_ktokd_range = it_in_ktokd_range * in_sortl_range = it_in_sortl_range * in_kukla_range = it_in_kukla_range * in_vkorg_range = it_in_vkorg_range * in_bukrs_range = it_in_bukrs_range * in_parvw_range = it_in_parvw_range out_kunnr_list = it_out_kunnr_list . " CUSTOMER_KEY_SELECTION
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:
it_in_kunnr_range  TYPE STANDARD TABLE OF KUN_RANGE ,
wa_in_kunnr_range  LIKE LINE OF it_in_kunnr_range,
it_in_ktokd_range  TYPE STANDARD TABLE OF KTKD_RANGE ,
wa_in_ktokd_range  LIKE LINE OF it_in_ktokd_range,
it_in_sortl_range  TYPE STANDARD TABLE OF SRTL_RANGE ,
wa_in_sortl_range  LIKE LINE OF it_in_sortl_range,
it_in_kukla_range  TYPE STANDARD TABLE OF KUKL_RANGE ,
wa_in_kukla_range  LIKE LINE OF it_in_kukla_range,
it_in_vkorg_range  TYPE STANDARD TABLE OF VORG_RANGE ,
wa_in_vkorg_range  LIKE LINE OF it_in_vkorg_range,
it_in_bukrs_range  TYPE STANDARD TABLE OF BUKR_RANGE ,
wa_in_bukrs_range  LIKE LINE OF it_in_bukrs_range,
it_in_parvw_range  TYPE STANDARD TABLE OF PRVW_RANGE ,
wa_in_parvw_range  LIKE LINE OF it_in_parvw_range,
it_out_kunnr_list  TYPE STANDARD TABLE OF KUND01 ,
wa_out_kunnr_list  LIKE LINE OF it_out_kunnr_list.


"populate fields of struture and append to itab
append wa_in_kunnr_range to it_in_kunnr_range.

"populate fields of struture and append to itab
append wa_in_ktokd_range to it_in_ktokd_range.

"populate fields of struture and append to itab
append wa_in_sortl_range to it_in_sortl_range.

"populate fields of struture and append to itab
append wa_in_kukla_range to it_in_kukla_range.

"populate fields of struture and append to itab
append wa_in_vkorg_range to it_in_vkorg_range.

"populate fields of struture and append to itab
append wa_in_bukrs_range to it_in_bukrs_range.

"populate fields of struture and append to itab
append wa_in_parvw_range to it_in_parvw_range.

"populate fields of struture and append to itab
append wa_out_kunnr_list to it_out_kunnr_list.

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