SAP Function Modules

C2_DB_PLFT_READ SAP Function module - Read PLFT from database







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

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


Pattern for FM C2_DB_PLFT_READ - C2 DB PLFT READ





CALL FUNCTION 'C2_DB_PLFT_READ' "Read PLFT from database
  EXPORTING
*   datub = 0                   " plft-datuv
*   datub = 0                   " plft-datuv    Date upper limit for DB selection
*   datuv = 0                   " plft-datuv
*   datuv = 0                   " plft-datuv    Date lower limit for DB selection
    plnnr =                     " plft-plnnr
    plnnr =                     " plft-plnnr    selected task list number
    plnty =                     " plft-plnty
    plnty =                     " plft-plnty    selected task list type
  IMPORTING
    plnft_max =                 " rc2bt-plnft_max  max. process instruction counter
    zaehl_max =                 " rc2bt-zaehl_ft  Max. change counter
  TABLES
    planft =                    " plftb
  EXCEPTIONS
    NO_RECORDS = 1              "               No records exist for selected task list no.
    .  "  C2_DB_PLFT_READ

ABAP code example for Function Module C2_DB_PLFT_READ





The ABAP code below is a full code listing to execute function module C2_DB_PLFT_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_plnft_max  TYPE RC2BT-PLNFT_MAX ,
ld_zaehl_max  TYPE RC2BT-ZAEHL_FT ,
it_planft  TYPE STANDARD TABLE OF PLFTB,"TABLES PARAM
wa_planft  LIKE LINE OF it_planft .


SELECT single DATUV
FROM PLFT
INTO @DATA(ld_datub).


SELECT single DATUV
FROM PLFT
INTO @DATA(ld_datub).


SELECT single DATUV
FROM PLFT
INTO @DATA(ld_datuv).


SELECT single DATUV
FROM PLFT
INTO @DATA(ld_datuv).


SELECT single PLNNR
FROM PLFT
INTO @DATA(ld_plnnr).


SELECT single PLNNR
FROM PLFT
INTO @DATA(ld_plnnr).


SELECT single PLNTY
FROM PLFT
INTO @DATA(ld_plnty).


SELECT single PLNTY
FROM PLFT
INTO @DATA(ld_plnty).


"populate fields of struture and append to itab
append wa_planft to it_planft. . CALL FUNCTION 'C2_DB_PLFT_READ' EXPORTING * datub = ld_datub * datub = ld_datub * datuv = ld_datuv * datuv = ld_datuv plnnr = ld_plnnr plnnr = ld_plnnr plnty = ld_plnty plnty = ld_plnty IMPORTING plnft_max = ld_plnft_max zaehl_max = ld_zaehl_max TABLES planft = it_planft EXCEPTIONS NO_RECORDS = 1 . " C2_DB_PLFT_READ
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_plnft_max  TYPE RC2BT-PLNFT_MAX ,
ld_datub  TYPE PLFT-DATUV ,
ld_datub  TYPE PLFT-DATUV ,
it_planft  TYPE STANDARD TABLE OF PLFTB ,
wa_planft  LIKE LINE OF it_planft,
ld_zaehl_max  TYPE RC2BT-ZAEHL_FT ,
ld_datuv  TYPE PLFT-DATUV ,
ld_datuv  TYPE PLFT-DATUV ,
ld_plnnr  TYPE PLFT-PLNNR ,
ld_plnnr  TYPE PLFT-PLNNR ,
ld_plnty  TYPE PLFT-PLNTY ,
ld_plnty  TYPE PLFT-PLNTY .


SELECT single DATUV
FROM PLFT
INTO ld_datub.


SELECT single DATUV
FROM PLFT
INTO ld_datub.


"populate fields of struture and append to itab
append wa_planft to it_planft.

SELECT single DATUV
FROM PLFT
INTO ld_datuv.


SELECT single DATUV
FROM PLFT
INTO ld_datuv.


SELECT single PLNNR
FROM PLFT
INTO ld_plnnr.


SELECT single PLNNR
FROM PLFT
INTO ld_plnnr.


SELECT single PLNTY
FROM PLFT
INTO ld_plnty.


SELECT single PLNTY
FROM PLFT
INTO ld_plnty.

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