SAP Function Modules

RV_CONDITION_COPY SAP Function module







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

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


Pattern for FM RV_CONDITION_COPY - RV CONDITION COPY





CALL FUNCTION 'RV_CONDITION_COPY' "
  EXPORTING
    application =               " t681a-kappl   Application
    condition_table =           " t681-kotabnr  Condition Table Number
    condition_type =            " t685a-kschl   Condition type
*   date_from = '00000000'      " rv13a-datab   Valid-from date
*   date_to = '00000000'        " rv13a-datbi   Valid-to Date
*   enqueue = ' '               "               Lock indicators of condition recor
*   enqueue = ' '               "               Condition record is locked
*   i_komk = ' '                " komk          Communication block header (pricing)
*   i_komp = ' '                " komp          Communication block item (pricing)
    key_fields =                " komg          Key fields
*   maintain_mode = 'B'         "               Mode: Create, Change, Display
*   no_authority_check = ' '    "               Do not carry out authorization check
*   no_field_check = ' '        "               Do not carry out field checks
*   selection_date = '00000000'  " syst-datum   Selection date
*   keep_old_records = ' '      "               Indicator: Old records are not deleted
*   material_m =                " mt06e         MAPOV segment (application V)
*   used_by_idoc = ' '          "               Controls special handling in case of IDoc processing
*   i_kona =                    " kona          Transfer of KOMA (for IDoc processing)
*   overlap_confirmed = ' '     "               Automatic confirmation in case of overlapping periods
*   no_db_update = ' '          "
*   used_by_retail = ' '        "
  IMPORTING
    e_komk =                    " komk          Communication block header (pricing)
    e_komp =                    " komp          Communication block item (pricing)
    new_record =                "               New condition record was created
    e_datab =                   " vake-datab
    e_datbi =                   " vake-datbi
    e_prdat =                   " vake-datbi
  TABLES
    copy_records =              " komv          Table of conditions to be copied
*   copy_staffel =              " condscale
*   copy_recs_idoc =            " komv_idoc
  EXCEPTIONS
    ENQUEUE_ON_RECORD = 1       "               Condition record is locked
    INVALID_APPLICATION = 2     "               Application is not provided
    INVALID_CONDITION_NUMBER = 3  "             Condition number is not provided
    INVALID_CONDITION_TYPE = 4  "               Condition type is not provided
    NO_AUTHORITY_EKORG = 5      "               No authorization for purchasing organization
    NO_AUTHORITY_KSCHL = 6      "               No authorization for condition type
    NO_AUTHORITY_VKORG = 7      "               No authorization for organization
    NO_SELECTION = 8            "               No data records for specified selection
    TABLE_NOT_VALID = 9         "               Table and condition type are not allowed
    NO_MATERIAL_FOR_SETTLEMENT = 10  "
    NO_UNIT_FOR_PERIOD_COND = 11  "
    NO_UNIT_REFERENCE_MAGNITUDE = 12  "
    INVALID_CONDITION_TABLE = 13  "
    .  "  RV_CONDITION_COPY

ABAP code example for Function Module RV_CONDITION_COPY





The ABAP code below is a full code listing to execute function module RV_CONDITION_COPY 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_komk  TYPE KOMK ,
ld_e_komp  TYPE KOMP ,
ld_new_record  TYPE STRING ,
ld_e_datab  TYPE VAKE-DATAB ,
ld_e_datbi  TYPE VAKE-DATBI ,
ld_e_prdat  TYPE VAKE-DATBI ,
it_copy_records  TYPE STANDARD TABLE OF KOMV,"TABLES PARAM
wa_copy_records  LIKE LINE OF it_copy_records ,
it_copy_staffel  TYPE STANDARD TABLE OF CONDSCALE,"TABLES PARAM
wa_copy_staffel  LIKE LINE OF it_copy_staffel ,
it_copy_recs_idoc  TYPE STANDARD TABLE OF KOMV_IDOC,"TABLES PARAM
wa_copy_recs_idoc  LIKE LINE OF it_copy_recs_idoc .


SELECT single KAPPL
FROM T681A
INTO @DATA(ld_application).


SELECT single KOTABNR
FROM T681
INTO @DATA(ld_condition_table).


SELECT single KSCHL
FROM T685A
INTO @DATA(ld_condition_type).


DATA(ld_date_from) = 20210129

DATA(ld_date_to) = 20210129
DATA(ld_enqueue) = 'some text here'.
DATA(ld_enqueue) = 'some text here'.
DATA(ld_i_komk) = 'Check type of data required'.
DATA(ld_i_komp) = 'Check type of data required'.
DATA(ld_key_fields) = 'Check type of data required'.
DATA(ld_maintain_mode) = 'some text here'.
DATA(ld_no_authority_check) = 'some text here'.
DATA(ld_no_field_check) = 'some text here'.

DATA(ld_selection_date) = 20210129
DATA(ld_keep_old_records) = 'some text here'.
DATA(ld_material_m) = 'Check type of data required'.
DATA(ld_used_by_idoc) = 'some text here'.
DATA(ld_i_kona) = 'Check type of data required'.
DATA(ld_overlap_confirmed) = 'some text here'.
DATA(ld_no_db_update) = 'some text here'.
DATA(ld_used_by_retail) = 'some text here'.

"populate fields of struture and append to itab
append wa_copy_records to it_copy_records.

"populate fields of struture and append to itab
append wa_copy_staffel to it_copy_staffel.

"populate fields of struture and append to itab
append wa_copy_recs_idoc to it_copy_recs_idoc. . CALL FUNCTION 'RV_CONDITION_COPY' EXPORTING application = ld_application condition_table = ld_condition_table condition_type = ld_condition_type * date_from = ld_date_from * date_to = ld_date_to * enqueue = ld_enqueue * enqueue = ld_enqueue * i_komk = ld_i_komk * i_komp = ld_i_komp key_fields = ld_key_fields * maintain_mode = ld_maintain_mode * no_authority_check = ld_no_authority_check * no_field_check = ld_no_field_check * selection_date = ld_selection_date * keep_old_records = ld_keep_old_records * material_m = ld_material_m * used_by_idoc = ld_used_by_idoc * i_kona = ld_i_kona * overlap_confirmed = ld_overlap_confirmed * no_db_update = ld_no_db_update * used_by_retail = ld_used_by_retail IMPORTING e_komk = ld_e_komk e_komp = ld_e_komp new_record = ld_new_record e_datab = ld_e_datab e_datbi = ld_e_datbi e_prdat = ld_e_prdat TABLES copy_records = it_copy_records * copy_staffel = it_copy_staffel * copy_recs_idoc = it_copy_recs_idoc EXCEPTIONS ENQUEUE_ON_RECORD = 1 INVALID_APPLICATION = 2 INVALID_CONDITION_NUMBER = 3 INVALID_CONDITION_TYPE = 4 NO_AUTHORITY_EKORG = 5 NO_AUTHORITY_KSCHL = 6 NO_AUTHORITY_VKORG = 7 NO_SELECTION = 8 TABLE_NOT_VALID = 9 NO_MATERIAL_FOR_SETTLEMENT = 10 NO_UNIT_FOR_PERIOD_COND = 11 NO_UNIT_REFERENCE_MAGNITUDE = 12 INVALID_CONDITION_TABLE = 13 . " RV_CONDITION_COPY
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 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_e_komk  TYPE KOMK ,
it_copy_records  TYPE STANDARD TABLE OF KOMV ,
wa_copy_records  LIKE LINE OF it_copy_records,
ld_application  TYPE T681A-KAPPL ,
ld_e_komp  TYPE KOMP ,
ld_condition_table  TYPE T681-KOTABNR ,
it_copy_staffel  TYPE STANDARD TABLE OF CONDSCALE ,
wa_copy_staffel  LIKE LINE OF it_copy_staffel,
ld_new_record  TYPE STRING ,
ld_condition_type  TYPE T685A-KSCHL ,
it_copy_recs_idoc  TYPE STANDARD TABLE OF KOMV_IDOC ,
wa_copy_recs_idoc  LIKE LINE OF it_copy_recs_idoc,
ld_e_datab  TYPE VAKE-DATAB ,
ld_date_from  TYPE RV13A-DATAB ,
ld_e_datbi  TYPE VAKE-DATBI ,
ld_date_to  TYPE RV13A-DATBI ,
ld_enqueue  TYPE STRING ,
ld_enqueue  TYPE STRING ,
ld_e_prdat  TYPE VAKE-DATBI ,
ld_i_komk  TYPE KOMK ,
ld_i_komp  TYPE KOMP ,
ld_key_fields  TYPE KOMG ,
ld_maintain_mode  TYPE STRING ,
ld_no_authority_check  TYPE STRING ,
ld_no_field_check  TYPE STRING ,
ld_selection_date  TYPE SYST-DATUM ,
ld_keep_old_records  TYPE STRING ,
ld_material_m  TYPE MT06E ,
ld_used_by_idoc  TYPE STRING ,
ld_i_kona  TYPE KONA ,
ld_overlap_confirmed  TYPE STRING ,
ld_no_db_update  TYPE STRING ,
ld_used_by_retail  TYPE STRING .


"populate fields of struture and append to itab
append wa_copy_records to it_copy_records.

SELECT single KAPPL
FROM T681A
INTO ld_application.


SELECT single KOTABNR
FROM T681
INTO ld_condition_table.


"populate fields of struture and append to itab
append wa_copy_staffel to it_copy_staffel.

SELECT single KSCHL
FROM T685A
INTO ld_condition_type.


"populate fields of struture and append to itab
append wa_copy_recs_idoc to it_copy_recs_idoc.

ld_date_from = 20210129

ld_date_to = 20210129
ld_enqueue = 'some text here'.
ld_enqueue = 'some text here'.
ld_i_komk = 'Check type of data required'.
ld_i_komp = 'Check type of data required'.
ld_key_fields = 'Check type of data required'.
ld_maintain_mode = 'some text here'.
ld_no_authority_check = 'some text here'.
ld_no_field_check = 'some text here'.

ld_selection_date = 20210129
ld_keep_old_records = 'some text here'.
ld_material_m = 'Check type of data required'.
ld_used_by_idoc = 'some text here'.
ld_i_kona = 'Check type of data required'.
ld_overlap_confirmed = 'some text here'.
ld_no_db_update = 'some text here'.
ld_used_by_retail = 'some text here'.

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