Changing Variant

Hello Everyone,
I have one requirement where I have to change the variant of one program from another program.
The requirement is like this:
If have one program lets say A with variant VAR1.
I want to change the contents of variant VAR1 from another program B.
Kindly let me know how I go ahead with program B to change the contents of variant VAR1.
Program B I have to develop from scratch for changing the contents of variant VAR1.
Thanks in advance for your help.
Regards,
Tarun

Hi..
If u check table TVARV..it contains the select-options and parameters values .
U first check if ur selection-criteria appears in this table...
If yes....in ur program B u can simply put this code....
FORM set_z17_today_date.
*/03  UPDATE tvarv
  UPDATE tvarvc                                             " /03
SET low = sy-datum
WHERE name = 'Z17_TODAY_DATE_(YYYYMMDD)'
AND type = 'P'.
ENDFORM.                    "set_z17_today_date
In my case when A was executed 'Z17_TODAY_DATE_(YYYYMMDD)' had system date...so whenevr i ran B it use to overwrite this parameter...
Hope this is helpful....
Thanx...

Similar Messages

  • Change variant SAP&HVOM

    Hi,
    I need to apply OSS note 384956, which involves changing variant SAP&HVOM for program ppio_entry.
    The problem is that the variant is protected, and I am therefore not allowed to change it.
    I already tried using program RSVARENT to unlock the variant, but the variant doesn't seem to be stored in table VARID.
    Does anybody know how I can apply the note?
    Thx!

    Please look at SAP note : 80526
    "Protected variants can only be changed by the creator or by
    the user who last changed them.If you want to make these
    variants globally accessible again, use report RSVARENT."

  • Changing Variant Pop up window name in Portal for BI reports

    Hi All,
    I have integrated Bex analyzer with portal, from which when i select variant it will open pop window to select options.. here i want to change the  pop window name as " sale order report name itself. I have changed the name of the report and it is showing in internet explorer...
    when i select variant...im getting Bex internet explorer name, instead of sales order report name.
    Please suggest where can i change this settings in portal or BIW level.
    Thanks
    Pradeep

    See if this link helps
    http://www.vrusso.com.br/blog/2011/03/unobtrusive-confirm-javascript-replacement-with-jquery-ui-dialog/Effectively you are calling a jQuery dialog box with custom buttons and events. Optionally you can hide the close button(or even the titlebar) and prevent closing the modal window when escape key is pressed.

  • Changing variant in FBL5N

    Hi all,
    In FBL5N (Customer line item display), users would like to change and save a variant but they are not authorized.
    Which authorization object allows changing and saving a variant?
    Thank you very much,
    Annabelle

    Hi,
    Just run FBL5n T.Code.
    Try to change the variant.Error message will appear immediately run SU53 T.Code and show this to your Basis Person.
    In this you will get the authorisation object missing.
    Check this one in SUIM T.Code.There is a tab authorisation objects.Click on that.
    Regards,
    Krishna.

  • How to change Variant in Code inspector from Global to local.

    Hi,
    I have created my own variant,object set and inspection through T-code SCI and this has been created only for my id.
    Now when i go to SE38 and run Code Inspector i want the CI to use my variant instead of the Global DEFAULT variant.
    Kindly tell me how can i change from DEFAULt to my Local Variant.
    Many Thanks.

    Hi,
    abap_learner_das wrote:
    > Now when i go to SE38 and run Code Inspector i want the CI to use my variant instead of the Global DEFAULT variant.
    in that case you have to create a variant called "DEFAULT" as your local one. That variant will be used in SE38.
    In SE38 you can only use the DEFAULT variant. either the global one (if your user does not have a local one named DEFAULT) or the local one of your user.
    HTH,
    Hermann

  • Find/Change Varying dates..

    I have a varied dates that appear throughout a LONG document.. for instance "January 14, 1945" date changes all the time of course.. usually appears at start of a paragraph.. i need to set up a find/change to be able to select it, and I need to change it's style.. is this the wildcard choice somehow in find/change?

    try a GREP search for      \<\w+\.? \d\d?, \d{4}\>      (those are ordinary typed spaces after the first ? and the comma). If should find dates with months spelled out or abbreviated with or without a period. You can use this in a GREP Style as part of a paragraph style to apply your character style so you don't need find/change

  • Changing Variant Parameters Programmatically

    Hi Guys/Dolls
    I've developed a program that has a user selection date range on it and I have saved this program as a variant. I submit this program has a batch job on a monthly basis but need to change the dates on the variant each month to be the start and end date of the previous month.
    I believe I need to use the following Function Modules; please correct me if I am barking up the wrong tree. Unfortunately I have absolutely no idea how to use them within ABAP. Do I need anything else to change my variant parameters?
    RS_VARIANT_CONTENTS
    RS_CHANGE_CREATED_VARIANT
    Does anybody have a very small snippet of code that will allow me to change the date of the variant.
    Many thanks in advance.
    Raj

    Ok Guys/Dolls
    I've managed to hack a solution and have posted this for reference.
    The code is as follows:-
    FORM change_variant .
      DATA: h_rc LIKE sy-subrc.
      DATA: ival TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
      DATA: ls_variantdesc LIKE varid.
    *1st check to see that the variant exists.
      CALL FUNCTION 'RS_VARIANT_EXISTS'
        EXPORTING
          report              = sy-repid
          variant             = variant_name
        IMPORTING
          r_c                 = h_rc
        EXCEPTIONS
          not_authorized      = 01
          no_report           = 02
          report_not_existent = 03
          report_not_supplied = 04.
    * If variant exists then obtain the contents of the variants.
      IF h_rc = 0.
        CALL FUNCTION 'RS_VARIANT_CONTENTS'
          EXPORTING
            report                      = sy-repid
            variant                     = variant_name
            move_or_write               = 'W'
    *   NO_IMPORT                   = ' '
    *   EXECUTE_DIRECT              = ' '
    * IMPORTING
    *   SP                          =
          TABLES
    *   L_PARAMS                    =
    *   L_PARAMS_NONV               =
    *   L_SELOP                     =
    *   L_SELOP_NONV                =
            valutab                     = ival
    *   OBJECTS                     =
    *   FREE_SELECTIONS_DESC        =
    *   FREE_SELECTIONS_VALUE       =
    * EXCEPTIONS
    *   VARIANT_NON_EXISTENT        = 1
    *   VARIANT_OBSOLETE            = 2
    *   REPORT_NOT_EXISTENT         = 3
    *   OTHERS                      = 4
        IF sy-subrc = 0.
    *     Change value of the variants to what you want it to be.
          LOOP AT ival WHERE selname EQ 'PNPBEGDA' OR
                             selname EQ 'PNPBEGPS' OR
                             selname EQ 'PNPENDDA' OR
                             selname EQ 'PNPENDPS'.
            ival-low = ''.
            MODIFY ival.
          ENDLOOP.
          LOOP AT ival WHERE selname EQ 'P_CNGDAT'.
            ival-low  = '20000201'.
            ival-high = '20001231'.
            MODIFY ival.
          ENDLOOP.
    *   Now re-save the variant with the appropriate changes.
    *     Clear and re-populate the variant description.
          CLEAR ls_variantdesc.
          ls_variantdesc-aename   = sy-mandt.
          ls_variantdesc-aename   = sy-uname.
          ls_variantdesc-aedat    = sy-datum.
          ls_variantdesc-aetime   = sy-uzeit.
          CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
            EXPORTING
              curr_report                     = sy-repid
              curr_variant                    = variant_name
              vari_desc                       = ls_variantdesc
    *   ONLY_CONTENTS                   =
            TABLES
              vari_contents                   = ival
    *   VARI_TEXT                       =
    *   VARI_SEL_DESC                   =
    *   OBJECTS                         =
           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 = 0.
            PERFORM set_pnp_default.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " change_variant
    FORM set_pnp_default.
    * The following 2 statement will set Today as the default on the PNP
    * selection and also move the cursor to that field.
    * IMPORTANT NOTE - you must have 'PNPTIMR1' in capitals otherwise it
    * doesn't work.
      pnptimed = 'D'.
      SET CURSOR FIELD 'PNPTIMR1'.
    ENDFORM.                    " set_pnp_default

  • Change variant for background scheduled jobs

    Hi experts,
    I want to schedule the report RKO7KO8G in background.
    Two of the selection parameters of this report are Settlement period & Settlement year.
    This report should be executed in the background every month. For this the period parameter should change every month
    , like for example when the report executes in background in May then period should be 05, June - period should be 06
    and so on.
    i.e. the variant should change.
    For this how do i create a dynamic variant. I tried to create dynamic variant but it says that the parameter
    should be a date field. However, the settlement period field over has input from 001 to 999 & not date field.
    I want to schedule this report in background on a monthly basis and change its input parameter Settlement period
    as per the month.
    Please suggest.
    Regards,
    Priti.

    Links to sap.technical are NOT permitted. Even via Tiny.
    Hi,
    Have a look at the below tutorial;
    [Dynamic Variant|http://joyjitghosh.blogspot.com/2008_09_01_archive.html]
    Regards,
    Karthik D
    Edited by: Matt on May 27, 2010 10:57 AM - changed url to the source

  • Changing variant's values

    Hi,
    I want to change the variant's values through my program.
    The problem is: one field contents are 60 characters long and I can't use the FM 'RS_CHANGE_CREATED_VARIANT' because it has limitation of changing/creating field's content up to 45 characters.
    Secondly, field CLUSTD of table VARI contains the field's value in some different format than CHAR.
    It's urgent.
    Hope to get some solution soon.
    Regards,
    Bobby

    hi
    good
    go through these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_webas620/helpdata/en/c0/98038ce58611d194cc00a0c94260a5/content.htm
    thanks
    mrutyun

  • Not  able  to  change  variant  data

    i  am  changing  selection  screen  date  range  and  clicking  on  save  and  it  is  asking  for  overwriting  and  got  message  like  variant  saved  ,  but  when  i  come  back  and  checked  dates  remains  same.
    please  help  here.

    Hi,
    check in the variant attribute page to see if this check box "Save Parameter without Values" is checked for the date fields. If this is checked then,values you change in the screen will not be saved. You need to either uncheck this box or reconfigure your dynamic variant so that it will change to the dates you want to see there.
    Thanks & regards.

  • Change Variant Created by Another User

    Hi,
    Is there a way to make changes to a variant created by user ID other than yourself? I want to modify an existing variant that was created by a user ID that is no longer with the company. I don't want to use the user ID that created the variant.
    Thanks,
    Wes

    Yes it does the job, but please take note of the warnings in my above post because RSVARENT will not warn you if you do not use (and protect it) carefully.
    If you do not maintain the input parameters for exactly that which you want, it will do more than you intended.... and by default it cannot be excluded that anyone can run it to the selection screen.
    The Rolls-Royce approach is to use the S_PROGRAM authorization group to protect the variants of the reports via field p_action = 'VARIANT' to a group of users authorized to maintain them (via transaction VARCH) and therefore also schedule them or change programs scheduled with those variants. The developer can in special cases also determine that the report is submitted in the background only via the parameters set by the variant, without a user being able to influence the selection screen in the foreground.
    Take care,
    Julius
    Edited by: Julius Bussche on Nov 26, 2008 12:50 AM

  • Change Variant Issue [RS_VARIANT_CHANGE]

    Hi,
    I'm hoping to get some help with the problem below.
    There are currently a number of variants set-up to be used with Program RGJVUXDT. On the bottom of the screen on the 2nd tab "Selections" there is a GL Accounts Range. I want to change the GL Accounts Selection Parameters that are associated with the variants.
    The problem is I want to do this in an automated manner. A potential solution to this would be to use the RS_Variant* FM's to achieve this. But I have limited experience in the use of them.
    Can I achieve the above by using RS_VARIANT_CHANGE? As I can't see any way for me to pass in the parameters I want to change.
    Any sample code of a simple example of how to do this would be greatly appreciated.
    Many thanks,
         Philip Johannesen

    I've managed to write up some template code that works after looking at the range of RS_Variant FM's. If anyone else had a similiar question to mine above then here is a template solution:
    REPORT  ZCHANGE_VARIANT.
    data:  LS_VARIANTDESC      LIKE VARID,
           ls_report_name type VARI_REPRT,
           ls_variant type VARIANT,
           it_selparam like standard table of RSPARAMS,
           wa_selparam like line of it_selparam.
           CLEAR LS_VARIANTDESC.
      wa_selparam-selname ='S_MATNR'.
      wa_selparam-kind ='S'.
      wa_selparam-sign ='I'.
      wa_selparam-option ='EQ'.
      wa_selparam-low ='10830'.
      append wa_selparam to it_selparam.
      wa_selparam-selname ='S_MATNR'.
      wa_selparam-kind ='S'.
      wa_selparam-sign ='I'.
      wa_selparam-option ='EQ'.
      wa_selparam-low ='10860'.
      append wa_selparam to it_selparam.
      ls_report_name = 'ZDEMO_ALV_001'.
      ls_variant = 'TEST1'.
      LS_VARIANTDESC-REPORT  = ls_report_name.
      LS_VARIANTDESC-VARIANT = ls_variant.
      LS_VARIANTDESC-ENVIRONMNT = 'A'.
      LS_VARIANTDESC-AENAME   = sy-mandt.
      LS_VARIANTDESC-AENAME   = SY-UNAME.
      LS_VARIANTDESC-AEDAT    = SY-DATUM.
      LS_VARIANTDESC-AETIME   = SY-UZEIT.
    CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
      EXPORTING
        CURR_REPORT                     = ls_report_name
        CURR_VARIANT                    = ls_variant
        VARI_DESC                       = LS_VARIANTDESC
    *   ONLY_CONTENTS                   =
      TABLES
        VARI_CONTENTS                   = it_selparam
    *   VARI_TEXT                       =
    *   VARI_SEL_DESC                   =
    *   OBJECTS                         =
    * 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
    Points to note:
    Make sure the values of <b>wa_selparam-selname</b>, <b>ls_report_name</b> & <b>ls_variant</b> are Uppercase. Otherwise the variant will not be updated, as the select query makes no match on Table: VARID.
    Regards,
       Philip Johannesen

  • Change Variant

    Hi Friends,
    I have R/3 transaction which runs programm in the background to get data.
    Now I want to get same data in BW, for that I have created datasource using this program and function module.
    For that I need to create variant which can get data from selection screen used by above programm.
    Now in selection screen I have date field.
    I need to populate system date, everytime BW system fetches data from datasource, which uses above variant.
    So, If anybody can help me suggest where should I search or where should I write code so that when variant runs it takes system date.
    Any kind of help is greatly appreciable.
    Thanks,
    John.

    to create a variant first enter data into the selection fields and then save the data
    using save buton. now it will open a variant screeen give the variant name and description and save it.
    now the variant will be created.
    you can click on the variant to get the data.
    pls assign points if helpful.

  • Does not allow to change source system in Variant

    Hi Gurus,
    I am creating a variant for the program RSIMPCUST, but it does not allow me to change source system name. It is showing me gray color. Do you how to fix this issue ?.
    Thanks
    Liza

    Hello Liza,
    Did you try my solution?
    [Re: Change source system name in variant in BWQ]
    There are solutions to change variants properties, but that particular program has the logsys parameter not able to change, so you cannot change the value of that variant (only with debug).
    It's best to go for that solution I already provided to you...
    Diogo.

  • Difference between sy-datm and sysdate in a variant of a report

    hi,
    I am working on a report which fills the database and i had assigned variant called SYSDATE -1 bcoz it will update the database table for all the plants for the previous date. can anybody guide me that whether i should use the variable SYSDATE- 1 or the sy-datum-1 ,so that uploading the data can be performed.

    These are few options you may try
    1. Create a wrapper program which will first modify date in variant and save it again. FM RS_VARIANT_CONTENTS, RS_CHANGE_CREATED_VARIANT and
    RS_CREATE_VARIANT, RS_VARIANT_DELETE will be useful.
    Submit program with this changed variant.
    2. Same as above except variant change program can be scheduled and dependent step can be created to run from that variant.
    3. While saving the variant you may assign "Selection Variable". This will fetch data from table TVARVC. You will need to periodically update value of your date field in this table.
    Regards,
    Mohaiyuddin

Maybe you are looking for

  • Too Small on Webpage

    I am totally new to all of this, so I need some assistance. I've made a quick table, and I was reading on a site that it was a recommended 700x400 pixels for size. But that looks way too small on a webpage. I have it set to 100%. Any tips for me?

  • JScrollPane scroll setting first column is not visible?

    Hi All, i am using jtable and jscrollpane. in this my first column of 70 pixal width and rest 125 pixal width.set focus is on 1 cell(1 row, 1 column) in table. but due to this scrollbar is slightly on right side whice coz first column not visible.(ne

  • USB Protection Help

    Hello Apple Communities. I hope I'm not asking too much of you all here, but here is the dilemma. I have a 8GB SanDisk Cruzer Edge flash drive. I'd like to set it up to where there are two separate logins for two partitions of the drive. I want one p

  • Dispay of aavailable batches for a material

    Dear Friends, I want to see the available batches for a specific material-plant/storage location combination. Can anybody guide me how to find out the available batches for this combination. Thanks & Regards Satya

  • Sync Space Problems as removed apps being added back

    I had a problem with the original laptop in which I had itunes on so I haven't backed up or sync'd my phone for over 6 months. I finally got around to moving the itunes file to another computer.  Now when I try to sync my phone it is trying to add th