Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using RV_CONDITION_COPY Change "Validity to" date in MEK2

former_member196157
Active Participant
0 Kudos

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.


1 ACCEPTED SOLUTION

Former Member

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'.

17 REPLIES 17

nabheetscn
Active Contributor
0 Kudos

Hi Mahdeo

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

Nabheet

0 Kudos

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

Former Member

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'.

0 Kudos

hiii kiran,

yes I check with this parameters but it not works

0 Kudos

Hi,

It is working through the standard transaction

Can you share your part code, how you are getting the condition record and using the FM?

0 Kudos

Do one thing put a break point in this FM and then change via standard and see what parameters are passed to iot and after this FM call what other calls are made check those

Nabheet

0 Kudos

Hi Nabheet,

I am sure the FM is not working for changing the dates. Inside the FM there is one more function is calling RV_CONDITION_MAINTENANCE.

I think he should have to use the function RV_CONDITION_MAINTENANCE to change the dates

what do you think?

0 Kudos

hiii,

It works at standard fine!!!!!!!!!!!

the code is ,

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
*          SELECTION_DATE              = date_from
*          OVERLAP_CONFIRMED           = 'X'
*          keep_old_records            = 'X'
         IMPORTING
           e_komk                      = e_komk
           e_komp                      = e_komp
*          new_record                 = new_record
           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.


         CALL FUNCTION 'RV_CONDITION_SAVE'.
         CALL FUNCTION 'RV_CONDITION_RESET'.
         COMMIT WORK AND WAIT .

0 Kudos

Actually Kiran you are right he can use this FM directly rather than that

Nabheet

0 Kudos

hiii Kiran,

Lets try with RV_CONDITION_MAINTENANCE

But at VK12 previously I develop the report the FM  "RV_CONDITION_COPY" its working but at MEK2 its not working.....why????

0 Kudos

Hi,

Ideally it should work! for me is also not working and some where the parameters are missing!

Investigating little bit more on copy ! you try with another FM?

0 Kudos

Ok Kiran

0 Kudos

Hello mahadeo,

i am facing the same problem in "RV_CONDITION_COPY" for vk12.

You mentioned that it was working for you.

Pl help  with the code.

Thnx

0 Kudos

This message was moderated.

0 Kudos

Hello I am Also facing same issue is this Issue is resolved ?

How to change condition records with RV_CONDITION_COPY?

mahabaleshwar_patil
Participant
0 Kudos

Hello I am Also facing same issue is this Issue is resolved ?

How to change condition records with RV_CONDITION_COPY?

0 Kudos

Hello sir, i am working on similar requirement but i am facing same issues. can you provide me solution how you overcome this issues.

Thanks,

Ajit Singh