SAP Function Modules

KBPP_COPY_VERSION SAP Function module







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

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


Pattern for FM KBPP_COPY_VERSION - KBPP COPY VERSION





CALL FUNCTION 'KBPP_COPY_VERSION' "
  EXPORTING
    im_version_src =            " bpin-versn    Source version
    im_version_dest =           " bpin-versn    Destination version
    im_time =                   " bptime        Time information for copying
*   im_costs = SPACE            "               Copy cost element planning ON/OFF
*   im_revenues = SPACE         "               Copy revenue element planning ON/OFF
*   im_statistic = SPACE        "               Copy statistical key figures ON/OFF
*   im_detail_plan = SPACE      "               Copy detail planning ON/OFF
*   im_fin_code = SPACE         " bpin-geber    Financing code
    im_copy_mode =              "               Copy Mode
*   im_overwrite_check = SPACE  "               Safety popup: "Overwrite data?"
    im_bpin =                   " bpin          Further budget processor entries (application-dependent)
*   im_imp01 = SPACE            "               Additional parameters (application-dependent)
*   im_imp02 = SPACE            "               Additional parameters (application-dependent)
*   im_funds_param_ex = SPACE   " kbpp_copy_version_param_ex
  IMPORTING
    ex_subrc =                  "               Copy Result
    e_datachanged =             "               Data Was Changed
    e_error =                   "               An error has occurred
    e_commit =                  "
  TABLES
    t_copy =                    " bpcopy        Activities and value types to be copied
  EXCEPTIONS
    SRC_VERSION_NOT_FOUND = 1   "               Source version does not exist
    SRC_VERSION_NOT_USEABLE = 2  "              Source version may not be used
    SRC_VERSION_NOT_COPY = 3    "               Source version may not be copied
    DEST_VERSION_NOT_FOUND = 4  "               Destination version does not exist
    DEST_VERSION_NOT_UPDATE = 5  "              Destination version may not be changed
    SRC_AND_DEST_VERSION_EQUAL = 6  "           Source version and target version identical
    DEST_VERSION_NOT_USEABLE = 7  "             Destination version must not be used
    PROFILE_NOT_FOUND = 8       "               Entry not found in profile table
    CONTROLLING_AREA_NOT_FOUND = 9  "           Controlling area does not exist
    FM_AREA_NOT_FOUND = 10      "               FM area does not exist
    PROFILE_ERROR = 11          "               Profile is defective (no overall, annual, period values allowed)
    PROFILE_ERROR_YEAR = 12     "               Profile error: annual value processing not allowed
    PROFILE_ERROR_TOTAL = 13    "               Profile error: overall value processing not allowed
    YEAR_RANGE = 14             "               Year in area not allowed
    NO_TIME_SELECT = 15         "               Neither annual nor overall values chosen
    TIME_SELECT_ONE_YEAR = 16   "               You may choose one year only
    TIME_SELECT_NEG_RANGE = 17  "               Negative year area chosne
    TIME_SELECT_SRC_DEST_START = 18  "          Reference and target have different start years
    NO_ACTIVITIES = 19          "               No activities selected for copying
    PROFILE_ERROR_PERIOD = 20   "               Profil error: period value processing not allowed
    .  "  KBPP_COPY_VERSION

ABAP code example for Function Module KBPP_COPY_VERSION





The ABAP code below is a full code listing to execute function module KBPP_COPY_VERSION 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_ex_subrc  TYPE STRING ,
ld_e_datachanged  TYPE STRING ,
ld_e_error  TYPE STRING ,
ld_e_commit  TYPE STRING ,
it_t_copy  TYPE STANDARD TABLE OF BPCOPY,"TABLES PARAM
wa_t_copy  LIKE LINE OF it_t_copy .


DATA(ld_im_version_src) = some text here

DATA(ld_im_version_dest) = some text here
DATA(ld_im_time) = 'Check type of data required'.
DATA(ld_im_costs) = 'some text here'.
DATA(ld_im_revenues) = 'some text here'.
DATA(ld_im_statistic) = 'some text here'.
DATA(ld_im_detail_plan) = 'some text here'.

DATA(ld_im_fin_code) = some text here
DATA(ld_im_copy_mode) = 'some text here'.
DATA(ld_im_overwrite_check) = 'some text here'.
DATA(ld_im_bpin) = 'Check type of data required'.
DATA(ld_im_imp01) = 'some text here'.
DATA(ld_im_imp02) = 'some text here'.
DATA(ld_im_funds_param_ex) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_copy to it_t_copy. . CALL FUNCTION 'KBPP_COPY_VERSION' EXPORTING im_version_src = ld_im_version_src im_version_dest = ld_im_version_dest im_time = ld_im_time * im_costs = ld_im_costs * im_revenues = ld_im_revenues * im_statistic = ld_im_statistic * im_detail_plan = ld_im_detail_plan * im_fin_code = ld_im_fin_code im_copy_mode = ld_im_copy_mode * im_overwrite_check = ld_im_overwrite_check im_bpin = ld_im_bpin * im_imp01 = ld_im_imp01 * im_imp02 = ld_im_imp02 * im_funds_param_ex = ld_im_funds_param_ex IMPORTING ex_subrc = ld_ex_subrc e_datachanged = ld_e_datachanged e_error = ld_e_error e_commit = ld_e_commit TABLES t_copy = it_t_copy EXCEPTIONS SRC_VERSION_NOT_FOUND = 1 SRC_VERSION_NOT_USEABLE = 2 SRC_VERSION_NOT_COPY = 3 DEST_VERSION_NOT_FOUND = 4 DEST_VERSION_NOT_UPDATE = 5 SRC_AND_DEST_VERSION_EQUAL = 6 DEST_VERSION_NOT_USEABLE = 7 PROFILE_NOT_FOUND = 8 CONTROLLING_AREA_NOT_FOUND = 9 FM_AREA_NOT_FOUND = 10 PROFILE_ERROR = 11 PROFILE_ERROR_YEAR = 12 PROFILE_ERROR_TOTAL = 13 YEAR_RANGE = 14 NO_TIME_SELECT = 15 TIME_SELECT_ONE_YEAR = 16 TIME_SELECT_NEG_RANGE = 17 TIME_SELECT_SRC_DEST_START = 18 NO_ACTIVITIES = 19 PROFILE_ERROR_PERIOD = 20 . " KBPP_COPY_VERSION
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 ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 13. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 14. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 15. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 16. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 17. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 18. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 19. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 20. "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:
it_t_copy  TYPE STANDARD TABLE OF BPCOPY ,
wa_t_copy  LIKE LINE OF it_t_copy,
ld_im_version_src  TYPE BPIN-VERSN ,
ld_ex_subrc  TYPE STRING ,
ld_e_datachanged  TYPE STRING ,
ld_im_version_dest  TYPE BPIN-VERSN ,
ld_im_time  TYPE BPTIME ,
ld_e_error  TYPE STRING ,
ld_e_commit  TYPE STRING ,
ld_im_costs  TYPE STRING ,
ld_im_revenues  TYPE STRING ,
ld_im_statistic  TYPE STRING ,
ld_im_detail_plan  TYPE STRING ,
ld_im_fin_code  TYPE BPIN-GEBER ,
ld_im_copy_mode  TYPE STRING ,
ld_im_overwrite_check  TYPE STRING ,
ld_im_bpin  TYPE BPIN ,
ld_im_imp01  TYPE STRING ,
ld_im_imp02  TYPE STRING ,
ld_im_funds_param_ex  TYPE KBPP_COPY_VERSION_PARAM_EX .


"populate fields of struture and append to itab
append wa_t_copy to it_t_copy.

ld_im_version_src = some text here

ld_im_version_dest = some text here
ld_im_time = 'Check type of data required'.
ld_im_costs = 'some text here'.
ld_im_revenues = 'some text here'.
ld_im_statistic = 'some text here'.
ld_im_detail_plan = 'some text here'.

ld_im_fin_code = some text here
ld_im_copy_mode = 'some text here'.
ld_im_overwrite_check = 'some text here'.
ld_im_bpin = 'Check type of data required'.
ld_im_imp01 = 'some text here'.
ld_im_imp02 = 'some text here'.
ld_im_funds_param_ex = 'Check type of data required'.

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