SAP Function Modules

J_7L_READ_PACK SAP Function module







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

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


Pattern for FM J_7L_READ_PACK - J 7L READ PACK





CALL FUNCTION 'J_7L_READ_PACK' "
  EXPORTING
    i_vrpnr =                   " j_7lv01-vrpnr  Packaging Number
*   i_variante =                " j_7lvariante
*   i_datab =                   " sy-datum      Date from or Date within Interval
*   i_datbi =                   " sy-datum      Date To
*   i_flg_buffer_on = SPACE     " c             Use of Internal Data Buffer
*   i_flg_enque_pack = SPACE    " c             Lock Read Packing for Change
  TABLES
*   o_v01 =                     " j_7lv01
*   o_v01t =                    " j_7lv01t
*   o_v02 =                     " j_7lv02       Packaging Master: Fraction Assignment
*   o_v03 =                     " j_7lv03       Packaging Master: Recycling Partner Assignment
*   o_v08 =                     " j_7lv08       Packaging Master: Fraction - Recycling Partner Assignment
*   o_m11 =                     " j_7lm11
*   o_mm_client_data =          " bapi_mara_ga  Material Data at Client Level
*   o_mm_unitsofmeasure =       " bapi_marm_ga  Units of Measure
    return =                    " bapiret2      Return Code
  EXCEPTIONS
    READ_ERROR = 1              "               Read Error
    .  "  J_7L_READ_PACK

ABAP code example for Function Module J_7L_READ_PACK





The ABAP code below is a full code listing to execute function module J_7L_READ_PACK 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_o_v01  TYPE STANDARD TABLE OF J_7LV01,"TABLES PARAM
wa_o_v01  LIKE LINE OF it_o_v01 ,
it_o_v01t  TYPE STANDARD TABLE OF J_7LV01T,"TABLES PARAM
wa_o_v01t  LIKE LINE OF it_o_v01t ,
it_o_v02  TYPE STANDARD TABLE OF J_7LV02,"TABLES PARAM
wa_o_v02  LIKE LINE OF it_o_v02 ,
it_o_v03  TYPE STANDARD TABLE OF J_7LV03,"TABLES PARAM
wa_o_v03  LIKE LINE OF it_o_v03 ,
it_o_v08  TYPE STANDARD TABLE OF J_7LV08,"TABLES PARAM
wa_o_v08  LIKE LINE OF it_o_v08 ,
it_o_m11  TYPE STANDARD TABLE OF J_7LM11,"TABLES PARAM
wa_o_m11  LIKE LINE OF it_o_m11 ,
it_o_mm_client_data  TYPE STANDARD TABLE OF BAPI_MARA_GA,"TABLES PARAM
wa_o_mm_client_data  LIKE LINE OF it_o_mm_client_data ,
it_o_mm_unitsofmeasure  TYPE STANDARD TABLE OF BAPI_MARM_GA,"TABLES PARAM
wa_o_mm_unitsofmeasure  LIKE LINE OF it_o_mm_unitsofmeasure ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


SELECT single VRPNR
FROM J_7LV01
INTO @DATA(ld_i_vrpnr).

DATA(ld_i_variante) = 'Check type of data required'.
DATA(ld_i_datab) = '20210129'.
DATA(ld_i_datbi) = '20210129'.
DATA(ld_i_flg_buffer_on) = '20210129'.
DATA(ld_i_flg_enque_pack) = '20210129'.

"populate fields of struture and append to itab
append wa_o_v01 to it_o_v01.

"populate fields of struture and append to itab
append wa_o_v01t to it_o_v01t.

"populate fields of struture and append to itab
append wa_o_v02 to it_o_v02.

"populate fields of struture and append to itab
append wa_o_v03 to it_o_v03.

"populate fields of struture and append to itab
append wa_o_v08 to it_o_v08.

"populate fields of struture and append to itab
append wa_o_m11 to it_o_m11.

"populate fields of struture and append to itab
append wa_o_mm_client_data to it_o_mm_client_data.

"populate fields of struture and append to itab
append wa_o_mm_unitsofmeasure to it_o_mm_unitsofmeasure.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'J_7L_READ_PACK' EXPORTING i_vrpnr = ld_i_vrpnr * i_variante = ld_i_variante * i_datab = ld_i_datab * i_datbi = ld_i_datbi * i_flg_buffer_on = ld_i_flg_buffer_on * i_flg_enque_pack = ld_i_flg_enque_pack TABLES * o_v01 = it_o_v01 * o_v01t = it_o_v01t * o_v02 = it_o_v02 * o_v03 = it_o_v03 * o_v08 = it_o_v08 * o_m11 = it_o_m11 * o_mm_client_data = it_o_mm_client_data * o_mm_unitsofmeasure = it_o_mm_unitsofmeasure return = it_return EXCEPTIONS READ_ERROR = 1 . " J_7L_READ_PACK
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_vrpnr  TYPE J_7LV01-VRPNR ,
it_o_v01  TYPE STANDARD TABLE OF J_7LV01 ,
wa_o_v01  LIKE LINE OF it_o_v01,
ld_i_variante  TYPE J_7LVARIANTE ,
it_o_v01t  TYPE STANDARD TABLE OF J_7LV01T ,
wa_o_v01t  LIKE LINE OF it_o_v01t,
ld_i_datab  TYPE SY-DATUM ,
it_o_v02  TYPE STANDARD TABLE OF J_7LV02 ,
wa_o_v02  LIKE LINE OF it_o_v02,
ld_i_datbi  TYPE SY-DATUM ,
it_o_v03  TYPE STANDARD TABLE OF J_7LV03 ,
wa_o_v03  LIKE LINE OF it_o_v03,
ld_i_flg_buffer_on  TYPE C ,
it_o_v08  TYPE STANDARD TABLE OF J_7LV08 ,
wa_o_v08  LIKE LINE OF it_o_v08,
ld_i_flg_enque_pack  TYPE C ,
it_o_m11  TYPE STANDARD TABLE OF J_7LM11 ,
wa_o_m11  LIKE LINE OF it_o_m11,
it_o_mm_client_data  TYPE STANDARD TABLE OF BAPI_MARA_GA ,
wa_o_mm_client_data  LIKE LINE OF it_o_mm_client_data,
it_o_mm_unitsofmeasure  TYPE STANDARD TABLE OF BAPI_MARM_GA ,
wa_o_mm_unitsofmeasure  LIKE LINE OF it_o_mm_unitsofmeasure,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return.


SELECT single VRPNR
FROM J_7LV01
INTO ld_i_vrpnr.


"populate fields of struture and append to itab
append wa_o_v01 to it_o_v01.
ld_i_variante = '20210129'.

"populate fields of struture and append to itab
append wa_o_v01t to it_o_v01t.
ld_i_datab = '20210129'.

"populate fields of struture and append to itab
append wa_o_v02 to it_o_v02.
ld_i_datbi = '20210129'.

"populate fields of struture and append to itab
append wa_o_v03 to it_o_v03.
ld_i_flg_buffer_on = '20210129'.

"populate fields of struture and append to itab
append wa_o_v08 to it_o_v08.
ld_i_flg_enque_pack = '20210129'.

"populate fields of struture and append to itab
append wa_o_m11 to it_o_m11.

"populate fields of struture and append to itab
append wa_o_mm_client_data to it_o_mm_client_data.

"populate fields of struture and append to itab
append wa_o_mm_unitsofmeasure to it_o_mm_unitsofmeasure.

"populate fields of struture and append to itab
append wa_return to it_return.

SAP Documentation for FM J_7L_READ_PACK


Reads the data for a REA packaging from the database or an internal buffer. ...See here for full SAP fm documentation



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