SAP Function Modules

WB2_EXP_SELECT_FOR_RECOVERY SAP Function module - Global Trade: Read Add-On Data for Reporting







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

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


Pattern for FM WB2_EXP_SELECT_FOR_RECOVERY - WB2 EXP SELECT FOR RECOVERY





CALL FUNCTION 'WB2_EXP_SELECT_FOR_RECOVERY' "Global Trade: Read Add-On Data for Reporting
  EXPORTING
*   i_doc_type = 'F '           " wb2_doc_type  Document Category
    i_tew_type =                " wb2_tew_type  Trading Execution Workbench Type
*   i_scenario =                " wb2_business_scenario  Business Scenario
*   i_error_tew =               " wb2b_error_tew  Global Trade: Fehler bei der Nachfolgedokumenterzeugung
*   i_max_lines = 500           " rwlf2-max_lines  SYST-TABIX as structure
*   i_items = 'X'               " c
  IMPORTING
    exp_doc_type =              " wb2_expense_doc_type  Expense Document Type
* TABLES
*   t_vbeln_range =             " wbeln_ran     Range structure for vendor billing documents
*   t_posnr_range =             " tposn_ran     Trading-Kontrakt: Range Struktur Trading-Kontrakt Position
*   t_posnr_sub_range =         " tposn_ran     Trading-Kontrakt: Range Struktur Trading-Kontrakt Position
*   t_tkonn_range =             " wbeln_ran     Range structure for vendor billing documents
*   t_tposn_range =             " tposn_ran     Trading-Kontrakt: Range Struktur Trading-Kontrakt Position
*   t_tposn_sub_range =         " tposn_ran     Trading-Kontrakt: Range Struktur Trading-Kontrakt Position
*   t_tkonn_ex_range =          " tkonn_ex_ran  Trading Contract: Range Structure for Contract Number
*   t_komwbgt =                 " komwbgt       Communication Structure
*   t_erdat_range =             " erdat_ran     Range structure for Created on
*   t_ernam_range =             " ernam_ran     Range structure Document entered by
*   t_master_step_range =       " wb2_step_ran  Range Structure for Business Process Steps
*   t_business_step_range =     " wb2_step_ran  Range Structure for Business Process Steps
*   t_complete_range =          " wb2_complete_ran  Range Structure for Completion Indicator
*   t_pre_step_range =          " wb2_step_ran  Range Structure for Business Process Steps
*   t_error_tew_range =         " wb2_error_tew_ran  Range Structure for Error in Follow-On Document Generation
  EXCEPTIONS
    NO_RECORDS_FOUND = 1        "
    .  "  WB2_EXP_SELECT_FOR_RECOVERY

ABAP code example for Function Module WB2_EXP_SELECT_FOR_RECOVERY





The ABAP code below is a full code listing to execute function module WB2_EXP_SELECT_FOR_RECOVERY 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_exp_doc_type  TYPE WB2_EXPENSE_DOC_TYPE ,
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_EXP_SELECT_FOR_RECOVERY' 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 IMPORTING exp_doc_type = ld_exp_doc_type * 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_EXP_SELECT_FOR_RECOVERY
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_exp_doc_type  TYPE WB2_EXPENSE_DOC_TYPE ,
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_EXP_SELECT_FOR_RECOVERY or its description.