SAP Function Modules

MY_RECEIPT_DATA_ARRAY_FETCH SAP Function module







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

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


Pattern for FM MY_RECEIPT_DATA_ARRAY_FETCH - MY RECEIPT DATA ARRAY FETCH





CALL FUNCTION 'MY_RECEIPT_DATA_ARRAY_FETCH' "
* EXPORTING
*   i_mypar =                   " mypar
*   i_mympy = X                 " mympy
  TABLES
    r_mymp =                    " range_c4
    r_matnr =                   " matnr_rang
*   r_gjahr =                   " range_n4
*   r_period =                  " range_n6
*   r_budat =                   " range_date
*   t_mymp =                    " mymp
*   t_mymp1 =                   " mymp1
  EXCEPTIONS
    NO_DATA = 1                 "
    .  "  MY_RECEIPT_DATA_ARRAY_FETCH

ABAP code example for Function Module MY_RECEIPT_DATA_ARRAY_FETCH





The ABAP code below is a full code listing to execute function module MY_RECEIPT_DATA_ARRAY_FETCH 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_r_mymp  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_r_mymp  LIKE LINE OF it_r_mymp ,
it_r_matnr  TYPE STANDARD TABLE OF MATNR_RANG,"TABLES PARAM
wa_r_matnr  LIKE LINE OF it_r_matnr ,
it_r_gjahr  TYPE STANDARD TABLE OF RANGE_N4,"TABLES PARAM
wa_r_gjahr  LIKE LINE OF it_r_gjahr ,
it_r_period  TYPE STANDARD TABLE OF RANGE_N6,"TABLES PARAM
wa_r_period  LIKE LINE OF it_r_period ,
it_r_budat  TYPE STANDARD TABLE OF RANGE_DATE,"TABLES PARAM
wa_r_budat  LIKE LINE OF it_r_budat ,
it_t_mymp  TYPE STANDARD TABLE OF MYMP,"TABLES PARAM
wa_t_mymp  LIKE LINE OF it_t_mymp ,
it_t_mymp1  TYPE STANDARD TABLE OF MYMP1,"TABLES PARAM
wa_t_mymp1  LIKE LINE OF it_t_mymp1 .

DATA(ld_i_mypar) = 'Check type of data required'.
DATA(ld_i_mympy) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_r_mymp to it_r_mymp.

"populate fields of struture and append to itab
append wa_r_matnr to it_r_matnr.

"populate fields of struture and append to itab
append wa_r_gjahr to it_r_gjahr.

"populate fields of struture and append to itab
append wa_r_period to it_r_period.

"populate fields of struture and append to itab
append wa_r_budat to it_r_budat.

"populate fields of struture and append to itab
append wa_t_mymp to it_t_mymp.

"populate fields of struture and append to itab
append wa_t_mymp1 to it_t_mymp1. . CALL FUNCTION 'MY_RECEIPT_DATA_ARRAY_FETCH' * EXPORTING * i_mypar = ld_i_mypar * i_mympy = ld_i_mympy TABLES r_mymp = it_r_mymp r_matnr = it_r_matnr * r_gjahr = it_r_gjahr * r_period = it_r_period * r_budat = it_r_budat * t_mymp = it_t_mymp * t_mymp1 = it_t_mymp1 EXCEPTIONS NO_DATA = 1 . " MY_RECEIPT_DATA_ARRAY_FETCH
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_mypar  TYPE MYPAR ,
it_r_mymp  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_r_mymp  LIKE LINE OF it_r_mymp,
ld_i_mympy  TYPE MYMPY ,
it_r_matnr  TYPE STANDARD TABLE OF MATNR_RANG ,
wa_r_matnr  LIKE LINE OF it_r_matnr,
it_r_gjahr  TYPE STANDARD TABLE OF RANGE_N4 ,
wa_r_gjahr  LIKE LINE OF it_r_gjahr,
it_r_period  TYPE STANDARD TABLE OF RANGE_N6 ,
wa_r_period  LIKE LINE OF it_r_period,
it_r_budat  TYPE STANDARD TABLE OF RANGE_DATE ,
wa_r_budat  LIKE LINE OF it_r_budat,
it_t_mymp  TYPE STANDARD TABLE OF MYMP ,
wa_t_mymp  LIKE LINE OF it_t_mymp,
it_t_mymp1  TYPE STANDARD TABLE OF MYMP1 ,
wa_t_mymp1  LIKE LINE OF it_t_mymp1.

ld_i_mypar = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_r_mymp to it_r_mymp.
ld_i_mympy = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_r_matnr to it_r_matnr.

"populate fields of struture and append to itab
append wa_r_gjahr to it_r_gjahr.

"populate fields of struture and append to itab
append wa_r_period to it_r_period.

"populate fields of struture and append to itab
append wa_r_budat to it_r_budat.

"populate fields of struture and append to itab
append wa_t_mymp to it_t_mymp.

"populate fields of struture and append to itab
append wa_t_mymp1 to it_t_mymp1.

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