SAP Function Modules

WARRANTY_TABLES_READ SAP Function module







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

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


Pattern for FM WARRANTY_TABLES_READ - WARRANTY TABLES READ





CALL FUNCTION 'WARRANTY_TABLES_READ' "
* EXPORTING
*   dialog = 0                  " sy-index
  IMPORTING
    result_total =              " sy-subrc
    e_bgmk_k =                  " rbgm00-selek
    e_bgmp_k =                  " rbgm00-selek
    e_bgmz_k =                  " rbgm00-selek
    e_gaart_in =                " txt80
    e_gaart_out =               " txt80
* TABLES
*   t_bgmkobj =                 " bgmkobj
*   t_bgmk =                    " bgmk
*   t_bgmp =                    " bgmp
*   t_bgmz =                    " bgmz
*   t_790g =                    " t790g
*   t_ivbgmk =                  " gbgmk
*   t_ivbgmp =                  " gbgmp
*   t_ivbgmz =                  " gbgmz
*   t_790g_t =                  " t790g_t       Warranty Type Text
  EXCEPTIONS
    INVALID_WARRANTY_POS = 1    "
    INVALID_MASTERWARRANTY = 2  "
    INVALID_WARRANTY_COUNTER = 3  "
    INVALID_WARRANTY_TYPE = 4   "
    BGMK_LVORM = 5              "
    .  "  WARRANTY_TABLES_READ

ABAP code example for Function Module WARRANTY_TABLES_READ





The ABAP code below is a full code listing to execute function module WARRANTY_TABLES_READ 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_result_total  TYPE SY-SUBRC ,
ld_e_bgmk_k  TYPE RBGM00-SELEK ,
ld_e_bgmp_k  TYPE RBGM00-SELEK ,
ld_e_bgmz_k  TYPE RBGM00-SELEK ,
ld_e_gaart_in  TYPE TXT80 ,
ld_e_gaart_out  TYPE TXT80 ,
it_t_bgmkobj  TYPE STANDARD TABLE OF BGMKOBJ,"TABLES PARAM
wa_t_bgmkobj  LIKE LINE OF it_t_bgmkobj ,
it_t_bgmk  TYPE STANDARD TABLE OF BGMK,"TABLES PARAM
wa_t_bgmk  LIKE LINE OF it_t_bgmk ,
it_t_bgmp  TYPE STANDARD TABLE OF BGMP,"TABLES PARAM
wa_t_bgmp  LIKE LINE OF it_t_bgmp ,
it_t_bgmz  TYPE STANDARD TABLE OF BGMZ,"TABLES PARAM
wa_t_bgmz  LIKE LINE OF it_t_bgmz ,
it_t_790g  TYPE STANDARD TABLE OF T790G,"TABLES PARAM
wa_t_790g  LIKE LINE OF it_t_790g ,
it_t_ivbgmk  TYPE STANDARD TABLE OF GBGMK,"TABLES PARAM
wa_t_ivbgmk  LIKE LINE OF it_t_ivbgmk ,
it_t_ivbgmp  TYPE STANDARD TABLE OF GBGMP,"TABLES PARAM
wa_t_ivbgmp  LIKE LINE OF it_t_ivbgmp ,
it_t_ivbgmz  TYPE STANDARD TABLE OF GBGMZ,"TABLES PARAM
wa_t_ivbgmz  LIKE LINE OF it_t_ivbgmz ,
it_t_790g_t  TYPE STANDARD TABLE OF T790G_T,"TABLES PARAM
wa_t_790g_t  LIKE LINE OF it_t_790g_t .

DATA(ld_dialog) = '123 '.

"populate fields of struture and append to itab
append wa_t_bgmkobj to it_t_bgmkobj.

"populate fields of struture and append to itab
append wa_t_bgmk to it_t_bgmk.

"populate fields of struture and append to itab
append wa_t_bgmp to it_t_bgmp.

"populate fields of struture and append to itab
append wa_t_bgmz to it_t_bgmz.

"populate fields of struture and append to itab
append wa_t_790g to it_t_790g.

"populate fields of struture and append to itab
append wa_t_ivbgmk to it_t_ivbgmk.

"populate fields of struture and append to itab
append wa_t_ivbgmp to it_t_ivbgmp.

"populate fields of struture and append to itab
append wa_t_ivbgmz to it_t_ivbgmz.

"populate fields of struture and append to itab
append wa_t_790g_t to it_t_790g_t. . CALL FUNCTION 'WARRANTY_TABLES_READ' * EXPORTING * dialog = ld_dialog IMPORTING result_total = ld_result_total e_bgmk_k = ld_e_bgmk_k e_bgmp_k = ld_e_bgmp_k e_bgmz_k = ld_e_bgmz_k e_gaart_in = ld_e_gaart_in e_gaart_out = ld_e_gaart_out * TABLES * t_bgmkobj = it_t_bgmkobj * t_bgmk = it_t_bgmk * t_bgmp = it_t_bgmp * t_bgmz = it_t_bgmz * t_790g = it_t_790g * t_ivbgmk = it_t_ivbgmk * t_ivbgmp = it_t_ivbgmp * t_ivbgmz = it_t_ivbgmz * t_790g_t = it_t_790g_t EXCEPTIONS INVALID_WARRANTY_POS = 1 INVALID_MASTERWARRANTY = 2 INVALID_WARRANTY_COUNTER = 3 INVALID_WARRANTY_TYPE = 4 BGMK_LVORM = 5 . " WARRANTY_TABLES_READ
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "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_result_total  TYPE SY-SUBRC ,
ld_dialog  TYPE SY-INDEX ,
it_t_bgmkobj  TYPE STANDARD TABLE OF BGMKOBJ ,
wa_t_bgmkobj  LIKE LINE OF it_t_bgmkobj,
ld_e_bgmk_k  TYPE RBGM00-SELEK ,
it_t_bgmk  TYPE STANDARD TABLE OF BGMK ,
wa_t_bgmk  LIKE LINE OF it_t_bgmk,
ld_e_bgmp_k  TYPE RBGM00-SELEK ,
it_t_bgmp  TYPE STANDARD TABLE OF BGMP ,
wa_t_bgmp  LIKE LINE OF it_t_bgmp,
ld_e_bgmz_k  TYPE RBGM00-SELEK ,
it_t_bgmz  TYPE STANDARD TABLE OF BGMZ ,
wa_t_bgmz  LIKE LINE OF it_t_bgmz,
ld_e_gaart_in  TYPE TXT80 ,
it_t_790g  TYPE STANDARD TABLE OF T790G ,
wa_t_790g  LIKE LINE OF it_t_790g,
ld_e_gaart_out  TYPE TXT80 ,
it_t_ivbgmk  TYPE STANDARD TABLE OF GBGMK ,
wa_t_ivbgmk  LIKE LINE OF it_t_ivbgmk,
it_t_ivbgmp  TYPE STANDARD TABLE OF GBGMP ,
wa_t_ivbgmp  LIKE LINE OF it_t_ivbgmp,
it_t_ivbgmz  TYPE STANDARD TABLE OF GBGMZ ,
wa_t_ivbgmz  LIKE LINE OF it_t_ivbgmz,
it_t_790g_t  TYPE STANDARD TABLE OF T790G_T ,
wa_t_790g_t  LIKE LINE OF it_t_790g_t.

ld_dialog = '123 '.

"populate fields of struture and append to itab
append wa_t_bgmkobj to it_t_bgmkobj.

"populate fields of struture and append to itab
append wa_t_bgmk to it_t_bgmk.

"populate fields of struture and append to itab
append wa_t_bgmp to it_t_bgmp.

"populate fields of struture and append to itab
append wa_t_bgmz to it_t_bgmz.

"populate fields of struture and append to itab
append wa_t_790g to it_t_790g.

"populate fields of struture and append to itab
append wa_t_ivbgmk to it_t_ivbgmk.

"populate fields of struture and append to itab
append wa_t_ivbgmp to it_t_ivbgmp.

"populate fields of struture and append to itab
append wa_t_ivbgmz to it_t_ivbgmz.

"populate fields of struture and append to itab
append wa_t_790g_t to it_t_790g_t.

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