SAP Function Modules

LAGP_READ SAP Function module - Select from table LAGP - 2nd layer







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

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


Pattern for FM LAGP_READ - LAGP READ





CALL FUNCTION 'LAGP_READ' "Select from table LAGP - 2nd layer
  EXPORTING
    i_lgnum =                   " lagp-lgnum    Warehouse number / warehouse complex
    i_lgtyp =                   " lagp-lgtyp    Storage type
*   i_lgpla =                   " lagp-lgpla    Storage bin
*   i_verif =                   " lagp-verif    Verification field for mobile data entry
*   line_exist = ' '            " c             if 'x' check only if line exsists
  IMPORTING
    o_answr =                   " c             send out 'x' for line exsists in table
  TABLES
    e_lagp =                    " lagp          Storage bins
  EXCEPTIONS
    NO_ENTRY_FOUND = 1          "
    NO_PARAMETERS_FOUND = 2     "
    FUNCTION_NOT_EXIST = 3      "
    .  "  LAGP_READ

ABAP code example for Function Module LAGP_READ





The ABAP code below is a full code listing to execute function module LAGP_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_o_answr  TYPE C ,
it_e_lagp  TYPE STANDARD TABLE OF LAGP,"TABLES PARAM
wa_e_lagp  LIKE LINE OF it_e_lagp .


SELECT single LGNUM
FROM LAGP
INTO @DATA(ld_i_lgnum).


SELECT single LGTYP
FROM LAGP
INTO @DATA(ld_i_lgtyp).


SELECT single LGPLA
FROM LAGP
INTO @DATA(ld_i_lgpla).


SELECT single VERIF
FROM LAGP
INTO @DATA(ld_i_verif).

DATA(ld_line_exist) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_e_lagp to it_e_lagp. . CALL FUNCTION 'LAGP_READ' EXPORTING i_lgnum = ld_i_lgnum i_lgtyp = ld_i_lgtyp * i_lgpla = ld_i_lgpla * i_verif = ld_i_verif * line_exist = ld_line_exist IMPORTING o_answr = ld_o_answr TABLES e_lagp = it_e_lagp EXCEPTIONS NO_ENTRY_FOUND = 1 NO_PARAMETERS_FOUND = 2 FUNCTION_NOT_EXIST = 3 . " LAGP_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 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_o_answr  TYPE C ,
ld_i_lgnum  TYPE LAGP-LGNUM ,
it_e_lagp  TYPE STANDARD TABLE OF LAGP ,
wa_e_lagp  LIKE LINE OF it_e_lagp,
ld_i_lgtyp  TYPE LAGP-LGTYP ,
ld_i_lgpla  TYPE LAGP-LGPLA ,
ld_i_verif  TYPE LAGP-VERIF ,
ld_line_exist  TYPE C .


SELECT single LGNUM
FROM LAGP
INTO ld_i_lgnum.


"populate fields of struture and append to itab
append wa_e_lagp to it_e_lagp.

SELECT single LGTYP
FROM LAGP
INTO ld_i_lgtyp.


SELECT single LGPLA
FROM LAGP
INTO ld_i_lgpla.


SELECT single VERIF
FROM LAGP
INTO ld_i_verif.

ld_line_exist = 'Check type of data required'.

SAP Documentation for FM LAGP_READ


This function retrieves transfer order information from the table LAGP (Storage bins). ...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 LAGP_READ or its description.