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.

Similar Messages

  • Create dynamic variante in report

    hello masters, im trying to create a dynamic variant for a report, im following the instructions of document that exists in <blocked site removed by moderator> but the option D- Dynamic date calculation doesnt appear to me in the field that i want to calculate date... the field it is of type S - selection-option... someone have any clue that could be.
    regards and thanks in advance
    Mario
    Edited by: Thomas Zloch on Jul 11, 2011 2:34 PM

    hello Alvaro, thanks for your answer.
    you are right, my field isnt DATE it is CHAR.
    thanks for your help.
    Mário

  • 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

  • Set dynamic variant for time

    Hi,
    I have selection options for field as defined as TIME . I need to set dynamic variant for this field as
    TIME should be "from"='current time-30 minutes' and "to"='24:59:59'.
    This report going to run in 00 hours and 30 hours (48 times ie 24 X 2)
    PS : Pl. remember this is for a SAP standard report
    Any Info?

    Naimesh Patel wrote:
    > I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
    As you suggested due to hardcoded values here , we could not able to do much on this.
    So i came in round away solution. Whenever program A called ( program with TIME selection input) i have called another custom program C . (This custom program will using the following function module RS_VARIANT_CONTENTS, and RS_VARIANT_CHANGE , So get the DEFAULT variant content of program A and change the variant content with LOW as current time - 30 and HIGH with 24:59:59)  as preceding job.
    In PI 7.01 system program A always called in JOB mode
    Thanks for info.

  • Dynamic Variants for RSEXARCA

    Dear All,
    Please let me know how to create Dynamic Variant for
    the report RSEXARCA.
    Kindly let me know the procedure.
    Regards,
    KCR.

    Hi,
      Use this function Module  : RS_VARIANT_ADD
    U can even get list of Variant Related function module
    like RS_VARIANT_CHANGE.
    Just go se37 enter RS_VARIANT* and press F4.
    One Ex.
    U can use RS_VARIANT_CONTENTS for find out the values for the varient fields.
    U can use RS_VARIANT_ATTR_SAVE to save changes to the variants
    Mark the Helpfull answers & close the thread.
    Regards
    Manoj
    Message was edited by: Manoj Gupta

  • How to set up Dynamic Variants for job which is based on Pay Period

    Hi,
    We need to set up dynamic variant for payroll interface.  This interface is based on Pay periods and that is why we need to use different variant for each month.  Letus know how to set up dynamic variant which will take care of Pay Periods

    Hi,  Thnx for reply.
    We are not changing the control records, current period will be some old period in system. 
    payroll is not processed in SAP,

  • Selection screen variant for report

    Hi,
    Can we restrict the selection screen variants for reports by user? For example my report is ZREPORT. Different users can save variants for the report. When they choose a variant for executing the report, they would like to see only the variants they created.
    By default SAP lists all variants created (irrespective of who created).
    Thanks
    Anil

    Hi,
      If you want the other users doesn't want to execute (Not see) other variant..you can check if that user has created the variant in the AT SELECTION-SCREEN event..
      By checking VARI-VARIANT against the table VARID and check if sy-uname <> VARID-ENAME.
    Thanks,
    naren

  • ALE Error + Mass deletion of variants for Reports

    Hi,
           I have two questions
    1- is there any transaction in SAP, which delete the mass variants for reports for all users?
    2- I am getting an error  “An Idoc without a message type was passed to the ALE layer”.
    I have already check file port is set up correctly and I am passing message type “HROT_BRM”.
    This also happen in previous test, as user does not have the proper authorization, so I assign the authorization and ran it. It worked.
    However, this time a user has the authorization and still the error messaging is coming. Am I missing something?
    Waiting
    Bye

    There are some function modules like "KYVA_REPORT_VARIANTS_DELETE” or get user variants "RM_GET_VARIANTS_4_REPORT_USER".
    - is there any transaction in SAP, which delete the mass variants for reports for all users?
    2- I am getting an error “An Idoc without a message type was passed to the ALE layer”.
    I have already check file port is set up correctly and I am passing message type “HROT_BRM”.
    This also happen in previous test, as user does not have the proper authorization, so I assign the authorization and ran it. It worked.
    However, this time a user has the authorization and still the error messaging is coming. Am I missing something?

  • Dynamic VARIANT FOR Fiscal Period and dates

    Hi
    We have a custom transaction with date and fiscal period as vairable parameters and need to know if we can generate a DYNAMIC VARIANT for these based on FISCAL PERIOD.
    Replies will rewarded

    Hi,
              Use transaction OB29, this is in the IMG.
    Or
    Path..
    SPRO -> SAP REFERENCE IMG -> FINANCIAL ACCOUNTING -> FINANCIAL ACCOUNTING GLOBAL SETTINGS -> FISCAL YEAR -> MAINTAIN FISCAL YEAR...
    <b>Reward points</b>
    Regards
    Message was edited by:
            skk

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

  • Setting Default Variant for Report Trans

    Hi All,
    Is there a way to set a default Variant to a reporting transaction? for example for ME2N how do I set a default Variant to be imported to the selection screen automatically once the report transaction is called?
    This is useful if the user uses the same variant all the time.
    Thanks in advance!

    Pls try the below example
    I give you one example,
    Enter t-code ME2N, Then click on Dynamic field selection button.
    Then double click on created by field enter enter any user id in it.
    Then click on save button.After click on this screen your can see one other screen for variant.
    Here you have to assign variant name and meaning. You can also change field status for report with help of this screen.
    Before click on save button, tick on protect check box button and then click on save.
    Then exit from transaction and enter ME2N.
    Click on Get variant button. Here you can see list of variant, select your variant and get report as per your requirement.
    by
    Rajj

  • How to set a dynamic variant for date in select-options in the upper field

    Hi  Variant experts Good Evening!
           I have the following problem while setting up a dynamic varinat .
    Ex: select-options: dat for sy-datum.  
    I am able to save the lower limit as a dynamic value but not able to save the upper values as dynamic in the select-options. Could any of you please help me in this.
    Regards
    Ravi.

    i hope dynamic variant concept is not there,
    but u can use the fn module DYPRO_GET_VALUES  and
    DYNPRO_SET_VALUES
    DYNPRO_GET_VALUES gets the values in the screen,
    DYNPRO_SET VALUES sets the values.
    first get the values, compare and set the values as u want

  • Dynamic variant for select option High value

    Hi ,
    Please help me in creating dynamic variable for a select option date field high value.
    II tried the following method:
    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 (i.e. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    5. Save the variant.
    But it is saving the date value in Field LOW of select option( From value).
    I need it in TO field( High value).
    Please help.
    regards,
    Sheeba

    Hi Sheeba
        we can do it other way .. Select the same steps as you have done but after the assigning the value current date to low ..click on the selection option push button at the application bar and choose the 'less than or equal to' option to your select option value and try the same ....
    I guess this would throw you same results as that of the value in the high value button
    Cheers,
    Jacks.

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

Maybe you are looking for

  • Automatic PO with ME59

    Hello, We use the transaction ME59 to automatically convert PR with agreement into PO. We can have several PR lines with different release strategies according to the amount in the same PR (e.g. 1 line for a material and 1 line for the delivery). If

  • How to turn on iMac wifi

    Apple recall for exchange my iMac HDD and now there is no icon for wifi and I have no wifi?! any body can help?!

  • Relay message when the target system is down.

    Dear all, I've got a question relating to the MII. I have the following scenario where the system A sends data to the system B, using SAP MII. My question is If the MII sends the message to system B, the target system, and the same is down, the MII c

  • Custom Form using query_find in R11i

    Hi Gurus, I have a master-detail custom form in EBS, header details are based on a view ( joing headers tabels and some po tables) and i dont have any editable fields at header level hence i made all the items as text_item_display_only. Line level co

  • Changing Metadata Deletes Artwork-Why?!

    So, I'm 40, and I like whole albums. Spotify and Pandora are not things that work with me. And I'm not jumping into this cloud thing because I end up in areas with no service. I want my music with me, on my own terms, because I own it. It's mine. I'm