SAP Function Modules

K_PLAN_OK_CODE_PP SAP Function module







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

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


Pattern for FM K_PLAN_OK_CODE_PP - K PLAN OK CODE PP





CALL FUNCTION 'K_PLAN_OK_CODE_PP' "
  EXPORTING
    i_ok_code =                 " rseu1-func_1
*   i_kpp1l_cursor =            " kpp1l_key
  IMPORTING
    e_ok_code =                 " rseu1-func_1
    e_mesg =                    " mesg
* TABLES
*   i_tkpp1l =                  " kpp1l
*   i_tkpp1lr =                 " kpp1lr
*   i_tkpp1lc =                 " kpp1lc
* CHANGING
*   x_cf_rebuild = SPACE        " c
    .  "  K_PLAN_OK_CODE_PP

ABAP code example for Function Module K_PLAN_OK_CODE_PP





The ABAP code below is a full code listing to execute function module K_PLAN_OK_CODE_PP 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_e_ok_code  TYPE RSEU1-FUNC_1 ,
ld_e_mesg  TYPE MESG ,
it_i_tkpp1l  TYPE STANDARD TABLE OF KPP1L,"TABLES PARAM
wa_i_tkpp1l  LIKE LINE OF it_i_tkpp1l ,
it_i_tkpp1lr  TYPE STANDARD TABLE OF KPP1LR,"TABLES PARAM
wa_i_tkpp1lr  LIKE LINE OF it_i_tkpp1lr ,
it_i_tkpp1lc  TYPE STANDARD TABLE OF KPP1LC,"TABLES PARAM
wa_i_tkpp1lc  LIKE LINE OF it_i_tkpp1lc .

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

DATA(ld_i_ok_code) = some text here
DATA(ld_i_kpp1l_cursor) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_tkpp1l to it_i_tkpp1l.

"populate fields of struture and append to itab
append wa_i_tkpp1lr to it_i_tkpp1lr.

"populate fields of struture and append to itab
append wa_i_tkpp1lc to it_i_tkpp1lc. . CALL FUNCTION 'K_PLAN_OK_CODE_PP' EXPORTING i_ok_code = ld_i_ok_code * i_kpp1l_cursor = ld_i_kpp1l_cursor IMPORTING e_ok_code = ld_e_ok_code e_mesg = ld_e_mesg * TABLES * i_tkpp1l = it_i_tkpp1l * i_tkpp1lr = it_i_tkpp1lr * i_tkpp1lc = it_i_tkpp1lc * CHANGING * x_cf_rebuild = ld_x_cf_rebuild . " K_PLAN_OK_CODE_PP
IF SY-SUBRC EQ 0. "All OK 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_x_cf_rebuild  TYPE C ,
ld_e_ok_code  TYPE RSEU1-FUNC_1 ,
ld_i_ok_code  TYPE RSEU1-FUNC_1 ,
it_i_tkpp1l  TYPE STANDARD TABLE OF KPP1L ,
wa_i_tkpp1l  LIKE LINE OF it_i_tkpp1l,
ld_e_mesg  TYPE MESG ,
ld_i_kpp1l_cursor  TYPE KPP1L_KEY ,
it_i_tkpp1lr  TYPE STANDARD TABLE OF KPP1LR ,
wa_i_tkpp1lr  LIKE LINE OF it_i_tkpp1lr,
it_i_tkpp1lc  TYPE STANDARD TABLE OF KPP1LC ,
wa_i_tkpp1lc  LIKE LINE OF it_i_tkpp1lc.

ld_x_cf_rebuild = 'Check type of data required'.

ld_i_ok_code = some text here

"populate fields of struture and append to itab
append wa_i_tkpp1l to it_i_tkpp1l.
ld_i_kpp1l_cursor = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_tkpp1lr to it_i_tkpp1lr.

"populate fields of struture and append to itab
append wa_i_tkpp1lc to it_i_tkpp1lc.

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