SAP CP_B0_PLAN_READ_FROM_DB Function Module for Read data from database in document tables in C?BT groups









CP_B0_PLAN_READ_FROM_DB is a standard cp b0 plan read from db SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read data from database in document tables in C?BT groups processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for cp b0 plan read from db FM, simply by entering the name CP_B0_PLAN_READ_FROM_DB into the relevant SAP transaction such as SE37 or SE38.

Function Group: CPB0
Program Name: SAPLCPB0
Main Program:
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CP_B0_PLAN_READ_FROM_DB pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CP_B0_PLAN_READ_FROM_DB'"Read data from database in document tables in C?BT groups
EXPORTING
* FLG_ADM_IMP = 'X' "Determine administrative information
* FLG_CHK_LOEKZ = ' ' "
* FLG_REF_IMP = 'X' "Trigger references
PLNNR_IMP = "Task list number
PLNTY_IMP = "Task list type
* PLNAL_IMP = ' ' "
TCA11_IMP = "GI of the objects to be loaded
* STLTY_W = ' ' "
* STLNR_W = ' ' "
* STLAL_W = ' ' "

IMPORTING
FLG_NOT_FOUND_EXP = "No data found
.



IMPORTING Parameters details for CP_B0_PLAN_READ_FROM_DB

FLG_ADM_IMP - Determine administrative information

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

FLG_CHK_LOEKZ -

Data type: PLMZ-LOEKZ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

FLG_REF_IMP - Trigger references

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

PLNNR_IMP - Task list number

Data type: PLPO-PLNNR
Optional: No
Call by Reference: No ( called with pass by value option)

PLNTY_IMP - Task list type

Data type: PLPO-PLNTY
Optional: No
Call by Reference: No ( called with pass by value option)

PLNAL_IMP -

Data type: PLPOD-PLNAL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TCA11_IMP - GI of the objects to be loaded

Data type: TCA11
Optional: No
Call by Reference: No ( called with pass by value option)

STLTY_W -

Data type: PLMZ-STLTY_W
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

STLNR_W -

Data type: PLMZ-STLNR_W
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

STLAL_W -

Data type: PLMZ-STLAL_W
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CP_B0_PLAN_READ_FROM_DB

FLG_NOT_FOUND_EXP - No data found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CP_B0_PLAN_READ_FROM_DB Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_flg_adm_imp  TYPE STRING, "   'X'
lv_flg_not_found_exp  TYPE STRING, "   
lv_flg_chk_loekz  TYPE PLMZ-LOEKZ, "   SPACE
lv_flg_ref_imp  TYPE PLMZ, "   'X'
lv_plnnr_imp  TYPE PLPO-PLNNR, "   
lv_plnty_imp  TYPE PLPO-PLNTY, "   
lv_plnal_imp  TYPE PLPOD-PLNAL, "   SPACE
lv_tca11_imp  TYPE TCA11, "   
lv_stlty_w  TYPE PLMZ-STLTY_W, "   SPACE
lv_stlnr_w  TYPE PLMZ-STLNR_W, "   SPACE
lv_stlal_w  TYPE PLMZ-STLAL_W. "   SPACE

  CALL FUNCTION 'CP_B0_PLAN_READ_FROM_DB'  "Read data from database in document tables in C?BT groups
    EXPORTING
         FLG_ADM_IMP = lv_flg_adm_imp
         FLG_CHK_LOEKZ = lv_flg_chk_loekz
         FLG_REF_IMP = lv_flg_ref_imp
         PLNNR_IMP = lv_plnnr_imp
         PLNTY_IMP = lv_plnty_imp
         PLNAL_IMP = lv_plnal_imp
         TCA11_IMP = lv_tca11_imp
         STLTY_W = lv_stlty_w
         STLNR_W = lv_stlnr_w
         STLAL_W = lv_stlal_w
    IMPORTING
         FLG_NOT_FOUND_EXP = lv_flg_not_found_exp
. " CP_B0_PLAN_READ_FROM_DB




ABAP code using 7.40 inline data declarations to call FM CP_B0_PLAN_READ_FROM_DB

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

DATA(ld_flg_adm_imp) = 'X'.
 
 
"SELECT single LOEKZ FROM PLMZ INTO @DATA(ld_flg_chk_loekz).
DATA(ld_flg_chk_loekz) = ' '.
 
DATA(ld_flg_ref_imp) = 'X'.
 
"SELECT single PLNNR FROM PLPO INTO @DATA(ld_plnnr_imp).
 
"SELECT single PLNTY FROM PLPO INTO @DATA(ld_plnty_imp).
 
"SELECT single PLNAL FROM PLPOD INTO @DATA(ld_plnal_imp).
DATA(ld_plnal_imp) = ' '.
 
 
"SELECT single STLTY_W FROM PLMZ INTO @DATA(ld_stlty_w).
DATA(ld_stlty_w) = ' '.
 
"SELECT single STLNR_W FROM PLMZ INTO @DATA(ld_stlnr_w).
DATA(ld_stlnr_w) = ' '.
 
"SELECT single STLAL_W FROM PLMZ INTO @DATA(ld_stlal_w).
DATA(ld_stlal_w) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!