SAP Function Modules

WB2_ADD_ON_SELECT SAP Function module







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

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


Pattern for FM WB2_ADD_ON_SELECT - WB2 ADD ON SELECT





CALL FUNCTION 'WB2_ADD_ON_SELECT' "
  EXPORTING
*   i_doc_type =                " wb2_doc_type
    i_tew_type =                " wb2_tew_type
*   i_scenario =                " wb2_business_scenario
*   i_error_tew =               " wb2b_error_tew
*   i_max_lines = 500           " rwlf2-max_lines
*   i_items = 'X'               " c
* TABLES
*   t_vbeln_range =             " wbeln_ran
*   t_posnr_range =             " tposn_ran
*   t_posnr_sub_range =         " tposn_ran
*   t_tkonn_range =             " wbeln_ran
*   t_tposn_range =             " tposn_ran
*   t_tposn_sub_range =         " tposn_ran
*   t_tkonn_ex_range =          " tkonn_ex_ran
*   t_komwbgt =                 " komwbgt
*   t_erdat_range =             " erdat_ran
*   t_ernam_range =             " ernam_ran
*   t_master_step_range =       " wb2_step_ran
*   t_business_step_range =     " wb2_step_ran
*   t_complete_range =          " wb2_complete_ran
*   t_pre_step_range =          " wb2_step_ran
*   t_error_tew_range =         " wb2_error_tew_ran
  EXCEPTIONS
    NO_RECORDS_FOUND = 1        "
    .  "  WB2_ADD_ON_SELECT

ABAP code example for Function Module WB2_ADD_ON_SELECT





The ABAP code below is a full code listing to execute function module WB2_ADD_ON_SELECT 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_t_vbeln_range  TYPE STANDARD TABLE OF WBELN_RAN,"TABLES PARAM
wa_t_vbeln_range  LIKE LINE OF it_t_vbeln_range ,
it_t_posnr_range  TYPE STANDARD TABLE OF TPOSN_RAN,"TABLES PARAM
wa_t_posnr_range  LIKE LINE OF it_t_posnr_range ,
it_t_posnr_sub_range  TYPE STANDARD TABLE OF TPOSN_RAN,"TABLES PARAM
wa_t_posnr_sub_range  LIKE LINE OF it_t_posnr_sub_range ,
it_t_tkonn_range  TYPE STANDARD TABLE OF WBELN_RAN,"TABLES PARAM
wa_t_tkonn_range  LIKE LINE OF it_t_tkonn_range ,
it_t_tposn_range  TYPE STANDARD TABLE OF TPOSN_RAN,"TABLES PARAM
wa_t_tposn_range  LIKE LINE OF it_t_tposn_range ,
it_t_tposn_sub_range  TYPE STANDARD TABLE OF TPOSN_RAN,"TABLES PARAM
wa_t_tposn_sub_range  LIKE LINE OF it_t_tposn_sub_range ,
it_t_tkonn_ex_range  TYPE STANDARD TABLE OF TKONN_EX_RAN,"TABLES PARAM
wa_t_tkonn_ex_range  LIKE LINE OF it_t_tkonn_ex_range ,
it_t_komwbgt  TYPE STANDARD TABLE OF KOMWBGT,"TABLES PARAM
wa_t_komwbgt  LIKE LINE OF it_t_komwbgt ,
it_t_erdat_range  TYPE STANDARD TABLE OF ERDAT_RAN,"TABLES PARAM
wa_t_erdat_range  LIKE LINE OF it_t_erdat_range ,
it_t_ernam_range  TYPE STANDARD TABLE OF ERNAM_RAN,"TABLES PARAM
wa_t_ernam_range  LIKE LINE OF it_t_ernam_range ,
it_t_master_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN,"TABLES PARAM
wa_t_master_step_range  LIKE LINE OF it_t_master_step_range ,
it_t_business_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN,"TABLES PARAM
wa_t_business_step_range  LIKE LINE OF it_t_business_step_range ,
it_t_complete_range  TYPE STANDARD TABLE OF WB2_COMPLETE_RAN,"TABLES PARAM
wa_t_complete_range  LIKE LINE OF it_t_complete_range ,
it_t_pre_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN,"TABLES PARAM
wa_t_pre_step_range  LIKE LINE OF it_t_pre_step_range ,
it_t_error_tew_range  TYPE STANDARD TABLE OF WB2_ERROR_TEW_RAN,"TABLES PARAM
wa_t_error_tew_range  LIKE LINE OF it_t_error_tew_range .

DATA(ld_i_doc_type) = 'Check type of data required'.
DATA(ld_i_tew_type) = 'Check type of data required'.
DATA(ld_i_scenario) = 'Check type of data required'.
DATA(ld_i_error_tew) = 'Check type of data required'.

DATA(ld_i_max_lines) = Check type of data required
DATA(ld_i_items) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_vbeln_range to it_t_vbeln_range.

"populate fields of struture and append to itab
append wa_t_posnr_range to it_t_posnr_range.

"populate fields of struture and append to itab
append wa_t_posnr_sub_range to it_t_posnr_sub_range.

"populate fields of struture and append to itab
append wa_t_tkonn_range to it_t_tkonn_range.

"populate fields of struture and append to itab
append wa_t_tposn_range to it_t_tposn_range.

"populate fields of struture and append to itab
append wa_t_tposn_sub_range to it_t_tposn_sub_range.

"populate fields of struture and append to itab
append wa_t_tkonn_ex_range to it_t_tkonn_ex_range.

"populate fields of struture and append to itab
append wa_t_komwbgt to it_t_komwbgt.

"populate fields of struture and append to itab
append wa_t_erdat_range to it_t_erdat_range.

"populate fields of struture and append to itab
append wa_t_ernam_range to it_t_ernam_range.

"populate fields of struture and append to itab
append wa_t_master_step_range to it_t_master_step_range.

"populate fields of struture and append to itab
append wa_t_business_step_range to it_t_business_step_range.

"populate fields of struture and append to itab
append wa_t_complete_range to it_t_complete_range.

"populate fields of struture and append to itab
append wa_t_pre_step_range to it_t_pre_step_range.

"populate fields of struture and append to itab
append wa_t_error_tew_range to it_t_error_tew_range. . CALL FUNCTION 'WB2_ADD_ON_SELECT' EXPORTING * i_doc_type = ld_i_doc_type i_tew_type = ld_i_tew_type * i_scenario = ld_i_scenario * i_error_tew = ld_i_error_tew * i_max_lines = ld_i_max_lines * i_items = ld_i_items * TABLES * t_vbeln_range = it_t_vbeln_range * t_posnr_range = it_t_posnr_range * t_posnr_sub_range = it_t_posnr_sub_range * t_tkonn_range = it_t_tkonn_range * t_tposn_range = it_t_tposn_range * t_tposn_sub_range = it_t_tposn_sub_range * t_tkonn_ex_range = it_t_tkonn_ex_range * t_komwbgt = it_t_komwbgt * t_erdat_range = it_t_erdat_range * t_ernam_range = it_t_ernam_range * t_master_step_range = it_t_master_step_range * t_business_step_range = it_t_business_step_range * t_complete_range = it_t_complete_range * t_pre_step_range = it_t_pre_step_range * t_error_tew_range = it_t_error_tew_range EXCEPTIONS NO_RECORDS_FOUND = 1 . " WB2_ADD_ON_SELECT
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_i_doc_type  TYPE WB2_DOC_TYPE ,
it_t_vbeln_range  TYPE STANDARD TABLE OF WBELN_RAN ,
wa_t_vbeln_range  LIKE LINE OF it_t_vbeln_range,
ld_i_tew_type  TYPE WB2_TEW_TYPE ,
it_t_posnr_range  TYPE STANDARD TABLE OF TPOSN_RAN ,
wa_t_posnr_range  LIKE LINE OF it_t_posnr_range,
ld_i_scenario  TYPE WB2_BUSINESS_SCENARIO ,
it_t_posnr_sub_range  TYPE STANDARD TABLE OF TPOSN_RAN ,
wa_t_posnr_sub_range  LIKE LINE OF it_t_posnr_sub_range,
ld_i_error_tew  TYPE WB2B_ERROR_TEW ,
it_t_tkonn_range  TYPE STANDARD TABLE OF WBELN_RAN ,
wa_t_tkonn_range  LIKE LINE OF it_t_tkonn_range,
it_t_tposn_range  TYPE STANDARD TABLE OF TPOSN_RAN ,
wa_t_tposn_range  LIKE LINE OF it_t_tposn_range,
ld_i_max_lines  TYPE RWLF2-MAX_LINES ,
ld_i_items  TYPE C ,
it_t_tposn_sub_range  TYPE STANDARD TABLE OF TPOSN_RAN ,
wa_t_tposn_sub_range  LIKE LINE OF it_t_tposn_sub_range,
it_t_tkonn_ex_range  TYPE STANDARD TABLE OF TKONN_EX_RAN ,
wa_t_tkonn_ex_range  LIKE LINE OF it_t_tkonn_ex_range,
it_t_komwbgt  TYPE STANDARD TABLE OF KOMWBGT ,
wa_t_komwbgt  LIKE LINE OF it_t_komwbgt,
it_t_erdat_range  TYPE STANDARD TABLE OF ERDAT_RAN ,
wa_t_erdat_range  LIKE LINE OF it_t_erdat_range,
it_t_ernam_range  TYPE STANDARD TABLE OF ERNAM_RAN ,
wa_t_ernam_range  LIKE LINE OF it_t_ernam_range,
it_t_master_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN ,
wa_t_master_step_range  LIKE LINE OF it_t_master_step_range,
it_t_business_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN ,
wa_t_business_step_range  LIKE LINE OF it_t_business_step_range,
it_t_complete_range  TYPE STANDARD TABLE OF WB2_COMPLETE_RAN ,
wa_t_complete_range  LIKE LINE OF it_t_complete_range,
it_t_pre_step_range  TYPE STANDARD TABLE OF WB2_STEP_RAN ,
wa_t_pre_step_range  LIKE LINE OF it_t_pre_step_range,
it_t_error_tew_range  TYPE STANDARD TABLE OF WB2_ERROR_TEW_RAN ,
wa_t_error_tew_range  LIKE LINE OF it_t_error_tew_range.

ld_i_doc_type = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_vbeln_range to it_t_vbeln_range.
ld_i_tew_type = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_posnr_range to it_t_posnr_range.
ld_i_scenario = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_posnr_sub_range to it_t_posnr_sub_range.
ld_i_error_tew = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_tkonn_range to it_t_tkonn_range.

"populate fields of struture and append to itab
append wa_t_tposn_range to it_t_tposn_range.

ld_i_max_lines = Check type of data required
ld_i_items = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_tposn_sub_range to it_t_tposn_sub_range.

"populate fields of struture and append to itab
append wa_t_tkonn_ex_range to it_t_tkonn_ex_range.

"populate fields of struture and append to itab
append wa_t_komwbgt to it_t_komwbgt.

"populate fields of struture and append to itab
append wa_t_erdat_range to it_t_erdat_range.

"populate fields of struture and append to itab
append wa_t_ernam_range to it_t_ernam_range.

"populate fields of struture and append to itab
append wa_t_master_step_range to it_t_master_step_range.

"populate fields of struture and append to itab
append wa_t_business_step_range to it_t_business_step_range.

"populate fields of struture and append to itab
append wa_t_complete_range to it_t_complete_range.

"populate fields of struture and append to itab
append wa_t_pre_step_range to it_t_pre_step_range.

"populate fields of struture and append to itab
append wa_t_error_tew_range to it_t_error_tew_range.

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