Skip to Content

Using RV_CONDITION_COPY Change "Validity to" date in MEK2

Hii Experts,

I am updating the condition record using RV_CONDITION_COPY in MEK2 . I want to change validity to date but it not works.

In given FM I use the Maintain_Mode 'B' for this it does not change the validity date for eg.

Validity From Validity To

29.01.2014 31.12.9999

Now I want to change validity to date......

Validity From Validity To

29.01.2014 31.01.2014

but it not works for maintain_mode 'B'

and now when I use Maintain mode 'A' it works but it create one more record eg

Validity From Validity To

29.01.2014 31.12.9999

for this I use Maintain mode 'A' and it gets

Validity From Validity To

29.01.2014 31.01.2014

01.01.2014 31.12.9999


In above I want just first record that change the Validity to Date

Could anyone please suggest what needs to be done?

CALL FUNCTION 'RV_CONDITION_COPY'
EXPORTING
application = application
condition_table = condition_table
condition_type = condition_type
date_from = date_from
date_to = date_to
enqueue = 'X'
i_komp = i_komp
key_fields = key_fields
maintain_mode = 'A' " A= Create " B= Change, " C= Display " D= Create With Reference
IMPORTING
e_komk = e_komk
e_komp = e_komp
e_datab = e_datab
e_datbi = e_datbi
e_prdat = e_prdat
TABLES
copy_records = copy_records
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.


IF sy-subrc IS INITIAL.
CALL FUNCTION 'RV_CONDITION_SAVE'.
CALL FUNCTION 'RV_CONDITION_RESET'.
COMMIT WORK AND WAIT .

endif.


Please help me to solve my issue.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2014 at 04:55 AM

    Hi,

    Can you check the below parameters of the FM

    no_authority_check = 'X'
    no_field_check = 'X'
    keep_old_records = 'X'
    overlap_confirmed = 'X'


    after that


    Save condition records

    call function 'RV_CONDITION_SAVE'.

    * Commit
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2014 at 04:53 AM

    Hi Mahdeo

    When you use mode B does it throw some error..?

    Nabheet

    Add a comment
    10|10000 characters needed characters exceeded

    • hii Nabhit,

      Thanks for reply,

      When I use Maintain Mode B it does not change the record that means the records same as it is no change happen in record....

      But when I use maintain mode A then Change to seen but one more record created i.e.

      Validity From Validity To

      29.01.2014 31.12.9999

      for this I use Maintain mode 'A' and it gets

      Validity From Validity To

      29.01.2014 31.01.2014

      01.01.2014 31.12.9999

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.