SAP Function Modules

CUSTOMER_SELECT_NEXT_DATA SAP Function module







CUSTOMER_SELECT_NEXT_DATA 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_SELECT_NEXT_DATA 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_SELECT_NEXT_DATA - CUSTOMER SELECT NEXT DATA





CALL FUNCTION 'CUSTOMER_SELECT_NEXT_DATA' "
  IMPORTING
    lastblock =                 " sel_fields-read_flag
    complete_record_number =    " sel_fields-max_kunnr
    complete_block_number =     " sel_fields-max_kunnr
* TABLES
*   out_kna1_tab =              " kna1
*   out_knb1_tab =              " knb1
*   out_knvv_tab =              " knvv
*   out_knvp_tab =              " knvp
*   out_knbk_tab =              " knbk
*   out_knb5_tab =              " knb5
*   out_knvi_tab =              " knvi
*   out_knvk_tab =              " knvk
*   out_knas_tab =              " knas
*   out_knva_tab =              " knva
*   out_vckuns_tab =            " vckuns
*   out_knat_tab =              " knat
*   out_knbw_tab =              " knbw
*   out_knex_tab =              " knex
  EXCEPTIONS
    FUNCTION_MISSING = 1        "
    FUNCTION_CALL_FAILED = 2    "               Function module call error
    .  "  CUSTOMER_SELECT_NEXT_DATA

ABAP code example for Function Module CUSTOMER_SELECT_NEXT_DATA





The ABAP code below is a full code listing to execute function module CUSTOMER_SELECT_NEXT_DATA 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_lastblock  TYPE SEL_FIELDS-READ_FLAG ,
ld_complete_record_number  TYPE SEL_FIELDS-MAX_KUNNR ,
ld_complete_block_number  TYPE SEL_FIELDS-MAX_KUNNR ,
it_out_kna1_tab  TYPE STANDARD TABLE OF KNA1,"TABLES PARAM
wa_out_kna1_tab  LIKE LINE OF it_out_kna1_tab ,
it_out_knb1_tab  TYPE STANDARD TABLE OF KNB1,"TABLES PARAM
wa_out_knb1_tab  LIKE LINE OF it_out_knb1_tab ,
it_out_knvv_tab  TYPE STANDARD TABLE OF KNVV,"TABLES PARAM
wa_out_knvv_tab  LIKE LINE OF it_out_knvv_tab ,
it_out_knvp_tab  TYPE STANDARD TABLE OF KNVP,"TABLES PARAM
wa_out_knvp_tab  LIKE LINE OF it_out_knvp_tab ,
it_out_knbk_tab  TYPE STANDARD TABLE OF KNBK,"TABLES PARAM
wa_out_knbk_tab  LIKE LINE OF it_out_knbk_tab ,
it_out_knb5_tab  TYPE STANDARD TABLE OF KNB5,"TABLES PARAM
wa_out_knb5_tab  LIKE LINE OF it_out_knb5_tab ,
it_out_knvi_tab  TYPE STANDARD TABLE OF KNVI,"TABLES PARAM
wa_out_knvi_tab  LIKE LINE OF it_out_knvi_tab ,
it_out_knvk_tab  TYPE STANDARD TABLE OF KNVK,"TABLES PARAM
wa_out_knvk_tab  LIKE LINE OF it_out_knvk_tab ,
it_out_knas_tab  TYPE STANDARD TABLE OF KNAS,"TABLES PARAM
wa_out_knas_tab  LIKE LINE OF it_out_knas_tab ,
it_out_knva_tab  TYPE STANDARD TABLE OF KNVA,"TABLES PARAM
wa_out_knva_tab  LIKE LINE OF it_out_knva_tab ,
it_out_vckuns_tab  TYPE STANDARD TABLE OF VCKUNS,"TABLES PARAM
wa_out_vckuns_tab  LIKE LINE OF it_out_vckuns_tab ,
it_out_knat_tab  TYPE STANDARD TABLE OF KNAT,"TABLES PARAM
wa_out_knat_tab  LIKE LINE OF it_out_knat_tab ,
it_out_knbw_tab  TYPE STANDARD TABLE OF KNBW,"TABLES PARAM
wa_out_knbw_tab  LIKE LINE OF it_out_knbw_tab ,
it_out_knex_tab  TYPE STANDARD TABLE OF KNEX,"TABLES PARAM
wa_out_knex_tab  LIKE LINE OF it_out_knex_tab .


"populate fields of struture and append to itab
append wa_out_kna1_tab to it_out_kna1_tab.

"populate fields of struture and append to itab
append wa_out_knb1_tab to it_out_knb1_tab.

"populate fields of struture and append to itab
append wa_out_knvv_tab to it_out_knvv_tab.

"populate fields of struture and append to itab
append wa_out_knvp_tab to it_out_knvp_tab.

"populate fields of struture and append to itab
append wa_out_knbk_tab to it_out_knbk_tab.

"populate fields of struture and append to itab
append wa_out_knb5_tab to it_out_knb5_tab.

"populate fields of struture and append to itab
append wa_out_knvi_tab to it_out_knvi_tab.

"populate fields of struture and append to itab
append wa_out_knvk_tab to it_out_knvk_tab.

"populate fields of struture and append to itab
append wa_out_knas_tab to it_out_knas_tab.

"populate fields of struture and append to itab
append wa_out_knva_tab to it_out_knva_tab.

"populate fields of struture and append to itab
append wa_out_vckuns_tab to it_out_vckuns_tab.

"populate fields of struture and append to itab
append wa_out_knat_tab to it_out_knat_tab.

"populate fields of struture and append to itab
append wa_out_knbw_tab to it_out_knbw_tab.

"populate fields of struture and append to itab
append wa_out_knex_tab to it_out_knex_tab. . CALL FUNCTION 'CUSTOMER_SELECT_NEXT_DATA' IMPORTING lastblock = ld_lastblock complete_record_number = ld_complete_record_number complete_block_number = ld_complete_block_number * TABLES * out_kna1_tab = it_out_kna1_tab * out_knb1_tab = it_out_knb1_tab * out_knvv_tab = it_out_knvv_tab * out_knvp_tab = it_out_knvp_tab * out_knbk_tab = it_out_knbk_tab * out_knb5_tab = it_out_knb5_tab * out_knvi_tab = it_out_knvi_tab * out_knvk_tab = it_out_knvk_tab * out_knas_tab = it_out_knas_tab * out_knva_tab = it_out_knva_tab * out_vckuns_tab = it_out_vckuns_tab * out_knat_tab = it_out_knat_tab * out_knbw_tab = it_out_knbw_tab * out_knex_tab = it_out_knex_tab EXCEPTIONS FUNCTION_MISSING = 1 FUNCTION_CALL_FAILED = 2 . " CUSTOMER_SELECT_NEXT_DATA
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 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_lastblock  TYPE SEL_FIELDS-READ_FLAG ,
it_out_kna1_tab  TYPE STANDARD TABLE OF KNA1 ,
wa_out_kna1_tab  LIKE LINE OF it_out_kna1_tab,
ld_complete_record_number  TYPE SEL_FIELDS-MAX_KUNNR ,
it_out_knb1_tab  TYPE STANDARD TABLE OF KNB1 ,
wa_out_knb1_tab  LIKE LINE OF it_out_knb1_tab,
ld_complete_block_number  TYPE SEL_FIELDS-MAX_KUNNR ,
it_out_knvv_tab  TYPE STANDARD TABLE OF KNVV ,
wa_out_knvv_tab  LIKE LINE OF it_out_knvv_tab,
it_out_knvp_tab  TYPE STANDARD TABLE OF KNVP ,
wa_out_knvp_tab  LIKE LINE OF it_out_knvp_tab,
it_out_knbk_tab  TYPE STANDARD TABLE OF KNBK ,
wa_out_knbk_tab  LIKE LINE OF it_out_knbk_tab,
it_out_knb5_tab  TYPE STANDARD TABLE OF KNB5 ,
wa_out_knb5_tab  LIKE LINE OF it_out_knb5_tab,
it_out_knvi_tab  TYPE STANDARD TABLE OF KNVI ,
wa_out_knvi_tab  LIKE LINE OF it_out_knvi_tab,
it_out_knvk_tab  TYPE STANDARD TABLE OF KNVK ,
wa_out_knvk_tab  LIKE LINE OF it_out_knvk_tab,
it_out_knas_tab  TYPE STANDARD TABLE OF KNAS ,
wa_out_knas_tab  LIKE LINE OF it_out_knas_tab,
it_out_knva_tab  TYPE STANDARD TABLE OF KNVA ,
wa_out_knva_tab  LIKE LINE OF it_out_knva_tab,
it_out_vckuns_tab  TYPE STANDARD TABLE OF VCKUNS ,
wa_out_vckuns_tab  LIKE LINE OF it_out_vckuns_tab,
it_out_knat_tab  TYPE STANDARD TABLE OF KNAT ,
wa_out_knat_tab  LIKE LINE OF it_out_knat_tab,
it_out_knbw_tab  TYPE STANDARD TABLE OF KNBW ,
wa_out_knbw_tab  LIKE LINE OF it_out_knbw_tab,
it_out_knex_tab  TYPE STANDARD TABLE OF KNEX ,
wa_out_knex_tab  LIKE LINE OF it_out_knex_tab.


"populate fields of struture and append to itab
append wa_out_kna1_tab to it_out_kna1_tab.

"populate fields of struture and append to itab
append wa_out_knb1_tab to it_out_knb1_tab.

"populate fields of struture and append to itab
append wa_out_knvv_tab to it_out_knvv_tab.

"populate fields of struture and append to itab
append wa_out_knvp_tab to it_out_knvp_tab.

"populate fields of struture and append to itab
append wa_out_knbk_tab to it_out_knbk_tab.

"populate fields of struture and append to itab
append wa_out_knb5_tab to it_out_knb5_tab.

"populate fields of struture and append to itab
append wa_out_knvi_tab to it_out_knvi_tab.

"populate fields of struture and append to itab
append wa_out_knvk_tab to it_out_knvk_tab.

"populate fields of struture and append to itab
append wa_out_knas_tab to it_out_knas_tab.

"populate fields of struture and append to itab
append wa_out_knva_tab to it_out_knva_tab.

"populate fields of struture and append to itab
append wa_out_vckuns_tab to it_out_vckuns_tab.

"populate fields of struture and append to itab
append wa_out_knat_tab to it_out_knat_tab.

"populate fields of struture and append to itab
append wa_out_knbw_tab to it_out_knbw_tab.

"populate fields of struture and append to itab
append wa_out_knex_tab to it_out_knex_tab.

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