Dynamic Variant (Variables)

Hi all,
I'm trying to create a variant to the program SAPF080. This program runs as a job once a month.
In here I need to create a variant to automatically determine the entry date. This entry date should be the last financial period (not equal to the month) until the day it runs.
Lets imagine that the period is from the 28 of January until the 25 of February. The report runs in the 10th of March.
The selection for the entry date should start on the 28th of january until the 10th of March.
How can I create a rule to dynamically use in the variant with this logic?
Regards,
Pedro

Try this, When you save variant after you given the values (but dont give the fiscal date) you can see 'Selection variables' column, Select 'D' there and when you click on 'Name of Variable' you can see different variables selections, check to use one of them .  I am not sure how to include our own calculated variable there. I will try to find it.
Thanks
Satyasuresh Donepudi

Similar Messages

  • Variable values of  dynamic variants

    Hello all,
    For dynamic variants we use variable like  RV_ACTUAL_PERIOD ,  RV_ACTUAL_YEAR etc .  They all are part of TVARVC table .
    But how we set values for these variables ?
    Is there any SAP Program which updates their value periodically , some Macro or what , I am really confused .
    Please help me out .
    Thanks.

    Go to SE11 and do a where-used on table TVARVC. This will list all the programs that update TVARVC. If you don't find a program for the variables you are interested in, then you'll need to write one.
    matt

  • Dynamic Variant for Date Range

    Making the Variant for Date or Date Range Dynamic in the Selection Screen of any Program.
    There are actually many ways you can make the Variant for Dateu2019s Dynamic.
    1.     Providing he Values in the Variant Variables.
    2.     By creating the variables in the table TVARVC
    3.     By Initializing the values in the program itself.
    I saw many posts with respect to these and found that everyone has their own way of dealing. Even I wrote code in the program initialization to get this done.
    Here in this post I am showing you the easiest option which is available in the Variant creation.
    EX : If you want to execute the batch job based on a date range.
         SY-DATE u2013 60 days , that means always your program should execute the batch job based on System Date. And the variant should change accordingly.
    Following are the step by stop to do that.
    1. Select your program and select the Variant Radio button and then Click on Display.
    2. It will pop up a screen with variant option below the program name.
    3. Enter the Variant name and click on Create
    4. You will see a screen, with the Attributes button.
    5. Once you click on the Attributes button, it will take you a screen with selection option.
    6. In my scenario my input is based on Calender Day, so select the Selection Variable for Calender Day: You will find 2 options T & D.
    7. Select D: Dynamic date Calculation, then select the Name of Variable (input using f4). You can find many options.
    8. Scroll down the Variant Attributes and select current date u2013 xxx, current date + yyy
    9.Though it seems to be inactive, just double click on the row to provide the date range.
    10. Just enter the value for xxx and yyy to get you dynamic range based on number of days
    11. In my scenario I have to consider System Date u2013 60 days. 0 means current day.
    12. Click on OK to check the range has been reflected or not. Then save the Variant and check the value by executing the program with saved Variant.
    You can check the same in blog with all the screen shots attached but this thing is so easy you don't require screen shots.
    Regards
    Shankar Chintada

    Hi Shankar,
    It would be great if you can put this information in Wiki .
    Pravender

  • Dynamic Variant in ECC 6.0

    Hi All,
    Can any one tell me how to create a dynamic variant in ECC 6.0 for a exicutable program? In ECC 5.0 its easy to create but in ECC 6.0 the varinat creation screen has been changed.
    Thanks
    Manas

    it's buried in there
    this thread may help if you need to define custom variables
    Re: CASH SALES
    you'll see it under the variant attributes screen.  i know people get reluctant to choose something from a grayed out field but you will be able to choose a selection variable and then the name of the variable
    so for a date field you could choose say D and Previous Month

  • Dynamic variant creation, Current date "-NNNN" *(4 digit number)*

    Hi,
    Is there any way of creating "-NNNN (4 digit number)" for dynamic date calculation in variant variables?
    I need to set 4 digit number in the "DLFL to Change Date (Old ver: To Change date)" field but system only allow total 4 digit including +/-.   I'll be using the "Current date +/- ??? days" option to set date dynamically.
    In order to set deletion flag for PM orders older than 6 years, I need "Current date -2190".
    Or is there other way to set it as MONTH when calculating the change date?
    I'm using PM order initial archiving job whose report name is RIARCORV.
    Thanks in advance,
    Alex
    Edited by: Alex Kwon on Jul 16, 2009 2:44 AM
    Edited by: Alex Kwon on Jul 16, 2009 2:45 AM

    Alex,
    I dont think its possible to do the same using the variant functionality. You will have to do some workaround to accomplish the same by either using other fields like Order number.You could also look at enhancing the code implicitly in the RIARCORV program, if you are in ECC6.0 or above versions.
    Regards
    Narasimhan

  • Dynamic variant date range

    Hi experts,
    i need to create dynamic variant for date range (so_date-low, so_date-high): sy-datum-1.
    that will bring the data in the report for yesterday.
    How can i do this?
    i know how can i make variant for so_date-low
    i dont know how can i do that on so_date-high.
    thanks,
    Michal.

    1. Execute the report and you will get your selection screen then press save
    2. system will take u to variant screen , select the line of your date select-options field from the list and scroll right
    3. double clik on "selection variable " column and select "D"
    4. double clik on "Name of variable" last column and select "Current date - xxx,current date + yyy" system will provide you popup with "Enter a value xxx" and "Enter a value for yyy" and enter value 1 in xxx and 0 in yyy
    and save the variant . now your S_DATE_LOW will be system date - 1 ie yesterdays date

  • Dynamic variant

    hi all,
      i created a report and that report has to be execute in back ground daily with variant,but my report contains some date field, so i need to change the date value in that varient,how can i do it.How can i create dynamic variant,could you please help me.
    regards,
    Bujji.

    Hi Murali,
    You can do this in the variant itself.
    Please follow these steps
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    6. Save the variant.
    Kindly assign points if this is helpful.
    Cheers
    Vinod
    Message was edited by: Vinod C

  • Dynamic Variant -Current date  in selection screen - for batch jobs

    Hi Experts,
    My report runs in batch job with a variant, daily.
    One of the filed in selction screen should hv CURRENT DATE, with out providing as input explicitly by user.
    So, How Can I get it done?
    Its some thing with Dynamic variants + Selection Variables +  date selection, but, I forgot the navigation etc.
    pl. let me know
    thanq

    thanq.
    and pls. let me further clarify that,
    programitically am populating the date as current date minus 1 in the field of my_date in the selection screen.
    now, they wanna to run the report in back ground, daily.
    now, I followed ur tip/link and saved with_date_variant, fine.
    so, pls. let me know that,
    1) if the report runs in back ground tomorrow with with_date_variant(which is i created by seeing ur link), Is the selection screen my_date(prog. populates as June 5th) will be override with current date(i.e. June 6th)?
    In broad, Is the selection criteria wuld be over writes with the Dynamic varints?
    thanq

  • Dynamic Variant for Report

    Hi,
    How to put current date in report output through variants.
    I should not use events, when user selects variants then i should place the current date in my selection-screen.
    help full information will be appreciated.

    Hi Rams,
    U have to create a dynamic variant for this.
    Fallow these steps.
    1. Fill all the selection screen values including date(Current date).
    2. Save it as variant(ctrl+S), give variant name and description.
    3. In the same screen u can see some check boxes corrosponding to each selection screen parameter.
    Now for the date field select the check box under
    L Selection variable and then press the push button selection variables in the tool bar.
    4. Now u will get the date range in the next screen.
    5. Here press the yellow light under D, it will become green colour.
    5. Next press drop down(Small arrow pointing down at the end of date)
    6. Now u will get a list of options for calculations.
    7. Here select current date.
    8. Now save the variant.
    This completes setting up of dynamic variant.
    Now when ever u select this variant it will populate the selection screen with current date and remaining fields with the data u save while creating the variant.
    Hope this will solve ur problem.
    Thanks,
    Vinod.

  • BEx Broadcasting through e-mail, using dynamic variant

    Dear SAP Gurus,
    I'm new to SAP-BI, I came across the following situation:
    I've a query based on which the reports are being generated.
    My client wants to broadcast it every month, as they don't have any portal, so it has to be done through e-mail.
    the query has 3 system variable which are FISCALYEAR and CALDAY, i dont remember 3rd.
    So, I've to create DYNAMIC VARIANT, I tried the following procedure but its not working.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9075b11a-6e43-2c10-b7be-cfa0e97ec0cc?QuickLink=index&overridelayout=true
    please help me.

    Hi shivsam  ,
    1. What you need is dynamic filling the variant value.
    2. In transaction SE38 enter the variant name
    3.choose the attributes  button.
    4. Here you can set the field to u201Cselection variable.u201D
    5.Then you can define something like  SY-DATUM(4)  for fiscal year and in the same way for calday SY-DATUM+6(2) .
    Hope this will help .
    Regards,
    Jaya Tiwari

  • Dynamic variants for a background job

    Hi,
    I need to set up a background job for a dynamic variant. To elaborate my selection screen has date ranges which need to change dynamically , if the job is secheduled on weekly basis the selection date range should change automatically in the variant. I got to know that the same is possible through the table TVARV. Can I know about the method of setting up the same?
    Thanks,
    Shailaja

    You can set a dynamic date to today date or some other date without using the table TVARV.
    To set the dynamic date:
    Save variant on the selection screen.
    In the vairant screen, press F4 against your field in the column "Selection Variable"
    Select D here.
    In the column Name of the variable, press F4 to have the list of the possible rules.
    Here you can select "Current date - xxx,current date + yyy" if you want to have certain period.
    When you select this system will pop up to put the values for XXX and YYY.
    Say for last 7 days, you can set the values XXX as 7 and YYY as0.
    But the best way is to change the program, if possible, and fill the select option in the intialization event.
    Regards,
    Naimesh Patel

  • Create Dynamic variant for date field

    Hello all,
    I need to have the current month year displayed in my selection screen in format MM.YYYY and the field is of type SPMON (Period to analyze - month).
    and while saving the variant it is showing only 'T' (entries from TVARVC table)  in  "selection variable" field and not showing 'D' (Dynamic selection) for the above field.
    So,please help me in resolving this issue.
    Thanks in advance.

    hi
    good
    go through this code,i hope this ll help you to create the dynamic variant.
    Please find the sample using RS_CREATE_VARIANT (FM).
    It make use of other FM also , just have a look .
    Hope this may help you.
    REPORT ZEXAMPLE.
    DATA: JVARI_DESC LIKE VARID,
    RC LIKE SY-SUBRC,
    VARIANT_TEXT LIKE VARIT-VTEXT,
    JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
    SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
    JVARI_DESC-REPORT = SY-REPID.
    JVARI_DESC-VARIANT = P_VAR.
    JVARI_DESC-ENAME = 'EXAMPLES'.
    JVT-REPORT = SY-REPID.
    JVT-VARIANT = P_VAR.
    JVT-LANGU = SY-LANGU.
    JVT-VTEXT = 'FUNCTION EXAMPLES'.
    APPEND JVT.
    CLEAR SELPA.
    SELPA-SIGN = 'I'.
    SELPA-OPTION = 'EQ'.
    SELPA-KIND = 'P'.
    SELPA-SELNAME = 'P_VAR'.
    SELPA-LOW = P_VAR.
    APPEND SELPA.
    CHECK IF VARIANT EXISTS
    CALL FUNCTION 'RS_VARIANT_EXISTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    R_C = RC
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NO_REPORT = 2
    REPORT_NOT_EXISTENT = 3
    REPORT_NOT_SUPPLIED = 4
    OTHERS = 5.
    IF RC = 0 AND SY-SUBRC EQ 0.
    DELETE OLD VARIANT
    CALL FUNCTION 'RS_VARIANT_DELETE'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    FLAG_CONFIRMSCREEN = 'X'
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NOT_EXECUTED = 2
    NO_REPORT = 3
    REPORT_NOT_EXISTENT = 4
    REPORT_NOT_SUPPLIED = 5
    VARIANT_LOCKED = 6
    VARIANT_NOT_EXISTENT = 7
    NO_CORR_INSERT = 8
    VARIANT_PROTECTED = 9
    OTHERS = 10.
    IF SY-SUBRC NE 0.
    WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
    EXIT.
    ELSE.
    WRITE:/ P_VAR, 'DELETED'.
    ENDIF.
    ELSE.
    WRITE:/ P_VAR, 'DOES NOT EXIST'.
    ENDIF. " ALREADY EXISTS
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    CURR_REPORT = JVARI_DESC-REPORT
    CURR_VARIANT = P_VAR
    VARI_DESC = JVARI_DESC
    TABLES
    VARI_CONTENTS = SELPA
    VARI_TEXT = JVT
    EXCEPTIONS
    ILLEGAL_REPORT_OR_VARIANT = 1
    ILLEGAL_VARIANTNAME = 2
    NOT_AUTHORIZED = 3
    NOT_EXECUTED = 4
    REPORT_NOT_EXISTENT = 5
    REPORT_NOT_SUPPLIED = 6
    VARIANT_EXISTS = 7
    VARIANT_LOCKED = 8
    OTHERS = 9.
    IF SY-SUBRC EQ 0.
    WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    ELSE.
    WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    TABLES
    VALUTAB = PARMS
    OBJECTS = OBJS
    EXCEPTIONS
    VARIANT_NON_EXISTENT = 1
    VARIANT_OBSOLETE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    WRITE : / 'ERROR READING VARIANT CONTENTS.'.
    ELSE.
    CALL FUNCTION 'RS_VARIANT_TEXT'
    EXPORTING
    LANGU = SY-LANGU
    CURR_REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    V_TEXT = VARIANT_TEXT.
    WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
    LOOP AT PARMS.
    CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
    READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
    WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
    45 PARMS-KIND,
    PARMS-SIGN,
    PARMS-OPTION,
    PARMS-LOW,
    PARMS-HIGH.
    NEW-LINE.
    ENDLOOP.
    SKIP.
    ENDIF.
    some other approach....
    This function module selects the Selection Screen contents
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = sy-repid
    TABLES
    selection_table = loc_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
    LEAVE LIST-PROCESSING.
    ENDIF.
    Craete the variant VAR1
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    curr_report = sy-repid
    curr_variant = wf_variant
    vari_desc = loc_varid
    TABLES
    vari_contents = loc_int_tab
    vari_text = loc_varit
    EXCEPTIONS
    illegal_report_or_variant = 1
    illegal_variantname = 2
    not_authorized = 3
    not_executed = 4
    report_not_existent = 5
    report_not_supplied = 6
    variant_exists = 7
    variant_locked = 8
    OTHERS = 9.
    IF sy-subrc <> 0.
    MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
    LEAVE LIST-PROCESSING.
    ENDIF.
    reward point if helpful.
    thanks
    mrutyun^

  • Job with dynamic variant

    Hello everybody,
      Could somebody help me to run a job with a dynamic variant (for instance a report with the changes for the last N days).
      I read things about SAP_StoreVariant and RedwoodScript but I'm not able to perform the job...
      Thanks for your help.

    Go through this link...
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
    In this page
    ABAP Workbench tools -->
                      VARIANTS  -->
                            VARIABLE VALUES IN VARIANTS.
    Hope this helps u a lot...
    reward if it helps u...
    sai ramesh.

  • Dynamic variant type B

    How i use the selection variable type B in dynamic variant??
    I have 2 parameters: month and year. Both have been filled with currenth month and year in background job that will be run every day.
    In sap help, is mentioned something about memory ID for to do that but i didn´t understand.
    Please, help me!

    Check this
    report zaRs
           no standard page heading line-size 255.
    parameters : p_month(2) type c.
    parameters : p_year(4) type c.
    Initialization.
    p_month = sy-datum+4(2).
    p_year = sy-datum+0(4).

  • Dynamic Variant to determine current wednesday  date

    Hi,
    I would like to know how to create a custom Dynamic Selection Variable to determine current wednesday date of the week which I can use in variant.
    Your response is much appreciated and awarded.
    Regards
    Kasi

    Hi Kasi,
    Please try this and assuming your week starting from Monday to Sunday.
    REPORT ZZFL_TEST07.
    PARAMETERS: P_DATE LIKE SY-DATUM.
    DATA: DAY LIKE SCAL-INDICATOR.
    INITIALIZATION.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
        EXPORTING
          DATE = SY-DATUM
        IMPORTING
          DAY  = DAY.
      CASE DAY.
        WHEN '1'.
          P_DATE = SY-DATUM + 2.
        WHEN '2'.
          P_DATE = SY-DATUM + 1.
        WHEN '3'.
          P_DATE = SY-DATUM.
        WHEN '4'.
          P_DATE = SY-DATUM - 1.
        WHEN '5'.
          P_DATE = SY-DATUM - 2.
        WHEN '6'.
          P_DATE = SY-DATUM - 3.
        WHEN '7'.
          P_DATE = SY-DATUM - 4.
        WHEN OTHERS.
      ENDCASE.
    Regards,
    Ferry Lianto

Maybe you are looking for

  • Profit Center design by plant wise

    Hi Experts, My client is having central procurement unit and having 8 branches(warehouses) and they transfer the goods from head office to branch later on for their sale.And the legal requirement here is that cost is same across all warehouses and we

  • How to turn off wifi autodetect

    It seems that the wifi autodetect is slowing down my networkspeed considerably. Since I'm working on an iMac I do not need to switch networks. How can I switch off autodetect?

  • Saving SET VARIABLE LOGLEVEL=2,DISABLE_CACHE_HIT=1; in a report

    Hi Experts, The scenario is: When I open a report and set the prefix to 'SET VARIABLE LOGLEVEL=2,DISABLE_CACHE_HIT=1;' then I save it. Then I close that specific report then open that report again. The 'SET VARIABLE LOGLEVEL=2,DISABLE_CACHE_HIT=1;' i

  • How to use sandbox files with UIImagePickerController

    I am developing an app for the iPhone that allows the user to choose an image. the image can come from the camera roll or from one of 10 images that will come with the app. it seems that UIImagePickerController only allows the source to come from one

  • Disk Space Monitoring Tools

    I'm looking for a tool that will monitor all of my X-Servers and display the disk space for all of them within one application. If anyone knows of one, please let me know. Thanks, Peter