Skip to Content
0
Former Member
Feb 03, 2011 at 01:44 PM

FM to store dynamic variant date

269 Views

Hi all,

I have created a report program to change the variant of a report program. In this program, I have to change the dynamic variant days also. Means, the date could be 'Current date +/- ??? days' or 'current date +/- ??? work days'.

If 'Current date +/- ??? days' the FM used iin calculating the dynamic date is 'RS_VARI_V_TODAY_X' and if 'current date +/- ??? work days', the FM used is 'RS_VARI_V_TODAY_XWD'

My requirement is, using my custom program I have to change the date as 'Current date +/- ??? days' or 'current date +/- ??? work days'.

But the FM to save the variant ('RS_CHANGE_CREATED_VARIANT') doesn't have the provision to pass this data. Is there any FM to pass these data too and save it in the database. Or is there any table in which this data is stored so that I can update the table?

I am using the following code,

CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
    EXPORTING
      curr_report               = gc_program
      curr_variant              = gv_variant
      vari_desc                 = gw_varid
    TABLES
      vari_contents             = gi_valuetab
    EXCEPTIONS
      illegal_report_or_variant = 1
      illegal_variantname       = 2
      not_authorized            = 3
      not_executed              = 4
      report_not_existent       = 5
      report_not_supplied       = 6
      variant_doesnt_exist      = 7
      variant_locked            = 8
      selections_no_match       = 9
      OTHERS                    = 10.

  IF sy-subrc EQ 0.
    COMMIT WORK AND WAIT.
  ENDIF.