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

Similar Messages

  • Create Variant for dynamic population of current date

    hi,
      How do i create a variant for a DATE to populate the current date in the selection screen?
       Please let me know
    Thanks in advance.

    Hi,
    Go to SE38..
    Press F8..
    Press save button..
    Give the variant name..and description..
    For the corresponding date column Check the check box under the column "L" which says selection variable..
    Press the selection variable button in the application toolbar..
    Click the hotspot Under the column D..Now it will be green..
    Press the drop down ...Choose the current date...
    Save the data and save the variant..
    Now if you choose that variant...The date will automatically be set to the current date.
    THanks
    Naren

  • AFAB dynamic variant creation for Posting period.

    HI,
    Business Requirement :
    Business want to run AFAB transaction code every month automatically with schedule job.
    system should pick present month period in posting period field.
    i checked in variant creation  against posting period there is no dynamic " D " in selection variable column.
    how can i fix this.

    Hi Jani,
    Check with abaper if TVARV table can Help you in this case, or create a z program from AFAB. And add date field to it, and schedule job based on that,
    I think TVARV table will be a better approach.
    Another point to consider here would be that dep should be run once business is ready to do so, and has its own hick ups in business if corrections are required to be made after executing AFAB by job
    Regards
    Pankaj B.

  • Dynamic Variant creation

    Hi Folks,
    I have a requirement where-in i need to schedule report 1 in background from report 2.
    Report 1 has a selection screen which contains one select-option and variant for the same is created.
    Now i need to schedule report 1 in such a way so that the select-option that is created is automatically changed every time i have scheduled the report.
    Please let me know how is it possible to create a variant for report 1 so that the select-option is changed every time i schedule the report.
    Please note that report 2 will know the list of values to be used for select-option in report 1 (to be used for job scheduling).
    Also if there is any other approach of tackling this problem then let me know.
    Thanks,
    Imran

    Hi,
    With selection variant you can start a report with fixed selection values again.
    You need not use them for documentation. You are able to see the used selection screen in a job step.
    For time/date selections often selection variables are very useful.
    Perhaps in your case it would be a good idea to store the last selection value with each job start in a Z-table.
    Regards
    Walter

  • 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 Varian Creation

    Hello Friends,
    I need to create one Dynamic variant for the Date Field in one of the Report.Where the date is supposed to be
    From Date : Fist day of the Month
    To Date : Current Date-1
    I am aware of the process to create dynamic variant but i am not getting such option to put the date field.
    Regards,
    Karuna T

    Is it for the ABAP side in the firefighter? or for JAVA side?
    Thanks!
    Chinmaya

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Dynamic current date variant with static date

    I have a report that I want to execute with a variant that defaults dynamically to today's current date, but I also want to select based on if that date field is initial too.  In one execution.  So select record if date is either today's date (dynamically calculated) or date is initial.
    Anyone know how I can do that?
    Thanks so much
    Cathy

    hi
    Did you try to force value in the variant in the multiple value with a value equal to space? So it will be like default date as today's date and fixed values as space.
    Force value in the sense we use fixed values in the selection screen.
    If this is not working then do coding in infoset
    Br
    Vijay V

  • 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

  • Current date - x in variant

    Hi,
    I want to use program RHALEINI (tcode PFAL) with a variant.
    In the field "Data selection period from" I want to have a value like current date - x.
    In the Variant Attributes I select "D" for Selection variable (Dynamic date calculation) and as Variable name I select Current date +/- 30.
    Then I get the message "Lower limit of interval is greater than upper limit"
    Could somebody help?
    Thanks and regards
    Patrick

    Hi,
    at the moment I have selected "Current date" for "Name of Variable" of the field "Data selection period from".
    If I try to select for example "First day of previous month" nothing happens.
    If I select "Current date - 30" I still have the same error message mentioned above "Lower limit of interval is greater than upper limit".
    But the lower limit should be less than before.
    I would be very thankful if someone could explain this behaviour.
    It works in ERP 5.0 but it's not working in ECC 6.0.
    Regards
    Patrick
    Edited by: Patrick Koehnen on Aug 28, 2008 3:28 PM

  • Dynamic Date Calculation for Current Date - 1

    I am trying to create a variant with a dynamic date calculation attribute.
    I am following the instructions as they are posted to the web but I get an error message.
    I want to get all data EQ to the current date -1
    In the object for selection screen I enter a D for Selection Variable, for Name of Variable I enter an I to include specific values and the option EQ for current date +/- ??? days.  Then I enter 1- for the number of days.  I have tried to enter this many times and in many ways but it doesn't work.  I keep getting this message "lower limit of interval is greater than upper limit"

    Hi,
    Welcome to SDN.
    Selection-screen has four values -
    SIGN
    OPTION
    LOW
    HIGH
    Pass your date value in the option low for the screen.
    Sign you have already pass as I and option as EQ.
    Regard,
    Amit
    Reward all helpful replies.
    Can you paste your code here.
    Message was edited by:
            Amit Khare

  • 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 for Date filed

    Hi All,
    I need to create a dynamic variant for date fields for standard report.
    in date Low field...value will be harcoded as '01.01.2011' and S_Date-high date field should be current date - 1.
    I dnt want to go for code in report to handle this.
    I tried with many option but could not able to see up the dates like as above.
    Kindly help.
    Piyush

    Hi,
    try this code
    data prevday like sy-datum.
    SELECT-OPTIONS s_date for sy-datum DEFAULT '20110101'   .", sy-datum-1.
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
    *  S_DATE-HIGH = PREVDAY.
      prevday = sy-datum.
    s_date-high = prevday.
    modify s_date index 1.
    Hope the help
    Edited by: j.ortiz on Jan 27, 2011 3:01 PM

  • 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^

  • MDX to dynamically create period to date for each month of current year

    I need some help with MDX. I am not even sure if this is possible to do but here is what I need.  Any help is greatly appreciated.
    I have a Date dimension with a hierarchy defined as Year-Qtr-Month-Date
    I have a measure called Rentals
    Assume the current date is 10/24/2014.  I want to display by month for the year 2014, the sum of rentals equivalent to the current MTD.  So January would sum 1/1 thru 1/24.  February would sum 2/1 thru 2/24.  March would sum 3/1 thru
    3/24, etc.
    On the end of the current month, all months would display the sum of the whole month. I am not concerned if a month ends on the 30th or 31st.  The end is end.
    It needs to be dynamic enough so that if the current date is the 27th, each month would sum from the 1st to the 27th.

    Hi Rocko,
    According to your description, you want to compare the sum amount of rentals for each month, right?
    In MDX, we can use
    PARALLELPERIOD function returns a member from a prior period in the same relative position as a specified member. So you can use the query like
    with set Period as {[Arrival Date].[Date].[Month].&[2014]&[1]:[Arrival Date].[Date].[Month].&[2014]&[27]}
    member [Arrival Date].[Date].[0] as sum({Period})
    member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Month], 1, [Arrival Date].[Date].[Year].&[11]), [Measures].[Total Amount])
    Here is a sample query on AdventureWorks cube.
    SELECT ParallelPeriod ([Date].[Calendar].[Calendar Semester]
    , 3
    , [Date].[Calendar].[Month].[October 2003])
    ON 0
    FROM [Adventure Works]
    Regads,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Bw report as data source

    Hello toghether, Let's say we have a query on a cube and a lot of calculations made in the query. I have to load the results of the query into another BW project (cube). For the moment I create flat files from the query and I load them manually into

  • How to restrict the changes in Relesed PO?.

    Hi all, How to restrict the users to make a changes in the Released PO?. User should make the changes only if it is unreleased by the respective codes. 1. Is there any user parameters like functional authorisation? 2. I have already suggested two sol

  • How do I turn off Contact Shortcuts in IOS 8?

    When I double tap the home button, I see a list of recent calls I have made as well as contacts in my favorite list. I dislike this feature and want to turn it off.  I often use my phone where others can see and for privacy reason I do not want this

  • Youtube resolution and premiere settings

    hi, youtube on his site state the resolution are: https://support.google.com/youtube/answer/2853702?hl=fr 240p 360p 480p 720p 1080p* new platform only Résolution 426 x 240 640 x 360 854x480 1280x720 1920x1080 but on the setting i have export to 640x4

  • Error: BAPI_ACC_DOCUMENT_POST in down payment

    Hi, I am using the BAPI_ACC_DOCUMENT_POST in down payment  for creating an down payment document.(Similar to F-47 transaction). Here i am only filling the header and the vendor(ACCOUNTPAYABLE), currency(CURRENCYAMOUNT) structures...(With only one lin