Dynamic date variant in selection screen

I have a selection option s_date in my program where I want to use the dyanmic variant with.
it is a date range and for the lower range, I would like to have a static value of 04/01/2010 and for the higher range I want to have last date of the prev month.
I see last date of the prev month in the drop down (F4) Dynamic table, but selecting that is overwriting the s-date-low instead of s_date-high. How can I use the dynamic variant for this ? Can i create my own custom drop downs for these dates?
S_DATE      FROM  (_04/01/2010_)  TO (LAST DATE OF PREV MONTH)
Thanks in advance..

In variant you can specify dates dynamically.
When you save a variant, system ask you enter variant name and Meaning. On the same screen you can specify these dynamic values.
For the parameter/select-option where you want to specify dynamic value, press F4 on 'Selection Variable' column.
Choose type of variable as 'D' (Dynamic date calculation).
Press F4 on 'Name of Variable(Input only using F4) column and select 'Current date +/- ??? days' on next screen.
On input screen enter -1.
Repeat same for To Date' field.
Prabhudas

Similar Messages

  • Dynamic date in the selection according to fiscal year variant

    Hi
    Is it possible to set dynamic date input parameter from the fiscal year variant sap table (OB29 transaction).
    For example when I run valuation (F.05) I want the value date input field to be the last day of the previous period.
    Thanks
    Ofer

    Hi,
    The dynamic dates on the selection parameters may come from the variant.
    You need to create the variants accordingly to your requirements and specify how the date on the selection screen has to be calculated.
    You have different options for this purpose.
    T     T: Table Variable from TVARVC
    D     D: Dynamic date calculation

  • Dinamic variant for selection screen

    Hi,
    I got a requirement where i need  a Dynamic variant for selection screen .There is a date field in the selection screen i want to create  a variant such that when i choose it,it should give the current day date in selection screen.can anyone help me.
    Regards,
    Ravi

    Hi,
    Using Customer Exit code you can give it.
    Create a Customer Exit Variable and write simple code in CMOD. See the usefull Exit code for reports in the following url.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    WHEN 'ZV_DAT'.
        IF i_step = 1 .
          CLEAR l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-opt = 'EQ'.
          l_s_range-sign = 'I'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    Thanks
    Reddy

  • How to display the dynamic text in the selection screen

    Hi All,
    I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
    EX: If i have the date of today 31st  it has to show message like " today date is 31 like some thing "  when i execute the report .
    Could any one face this sort of requirment, Please let me know.
    Thanks in advance.
    Reagrds,
    Bharani

    Where would you like this dynamic text being displayed? As an "message" or in some parameter field?
    If first
    parameters date type d.
    data: text type string.
    at selection-screen.
       concatenate 'Today is' date into text.
       message text type 'I'.
    If second
    parameters pa_text type c length 50.
    at selection-screen on date.
      if date is not initial.
        concatenate 'Today is' date into  pa_text.
      enidf.
    at selection-screen output.
       "show it as read only
       loop at screen.
        if screen-name = 'PA_TEXT'.
               screen-input = abap_false.
              modify screen.
        endif.
       endloop.
    Regards
    Marcin

  • FISCAL year from Date  in the Selection Screen.

    Hi Folks,
    Is there any function module which returns the Fiscal year if we provide the date in ranges.
    I mean, I have a select option for date in the selection screen.So,if a user enters the date say 01042007 01042007 it should return the corresponding fiscal year.
    Kindly let me know if anyone here has any idea regarding this.
    Thanks,
    K.Kiran.

    Hello,
    Check these FM's
    FTIS
    FTI_FISCAL_YEAR_MONTH_GET
    KBPA                           Budget/Plan - application-specific
    KBPA_GET_START_FISCAL_YEAR     Determine Start Year for Funds Management
    KBPA_GET_START_FISCAL_YEAR_OPT
    Vasanth

  • Adding layout variant to selection screen

    Hi all,
             Currently I am working on report program, where I have to allow user to select his own output pattern. i.e layout variant is to be added to selection screen. The report uses object oriented ALV for display purpose. [set_table_for_first_display]
    I made following steps,
    1.     Declared one parameter of type disvariant.
    2.     At selection-screen on value-request I called function REUSE_ALV_VARIANT_F4.
    3.     Passed internal table to method set_table_for_first_display.
    Now I am able to create save new variant, on selection screen I can select the variant that I have created, but output shows the all the fields though
    Only few are selected. Please tell me any modification so as to reflect the changes in output.
    I  am searching for a function which maintains fieldcat according to user defined variant.
    Regards,
    Nilesh kulkarni.

    U have to use REUSE_ALV_VARIANT_EXISTENCE inorder to use the layout u have selected
    After ur code of REUSE_ALV_VARIANT_F4.
    try this way
    AT SELECTION-SCREEN.
       PERFORM PAI_OF_SELECTION_SCREEN.
    G_REPID = SY-REPID.
    G_SAVE = 'A'.
    FORM PAI_OF_SELECTION_SCREEN .
      IF NOT P_LAYOUT IS INITIAL.
        MOVE G_VARIANT TO GX_VARIANT.
        MOVE P_LAYOUT TO GX_VARIANT-VARIANT.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
             EXPORTING
                  I_SAVE     = G_SAVE
             CHANGING
                  CS_VARIANT = GX_VARIANT.
        G_VARIANT = GX_VARIANT.
      ELSE.
        PERFORM VARIANT_INIT.
      ENDIF.
    ENDFORM.                    " PAI_OF_SELECTION_SCREEN
    FORM variant_init .
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = G_REPID.
    ENDFORM.                    " variant_init
    Then when u call ALV for display, pass ur display variant, in this case  = g_variant
    Reward if useful
    Cheers
    ~Arun
    Message was edited by:
            Arun Shekhar

  • How to set Variant as selection-screen

    I have a variant i want to set that variant as selection-screen can anyone please tell me how to do that

    Hi Pradeep,
    What is your requirement?
    If you just want to create the variant for the selection screeen, then after entering the values on selection screen just press SAVE button.
    Regards,
    Atish

  • Dynamic date variant

    Hi Gurus,
    I've a dynamic system date variant for my program, which runs in background. I have no issue with variant, it works fine. But when I went to job log to check the old jobs that has dynamic date variant, it always refer to current system date. Anybody can suggest me how to fix it to show the actual variant at the time of job run?
    Regards, Raju.

    The dynamic date overwrites the value that it was saved with at the time of processing.  What you see when you display it is the value at the time it was saved (the non-dynamic value).  There is no way to see the value at the time it was run.  At least not that I know.
    You can however compute it if you know that the variant hasn't been changed since it was run.
    Neal

  • Dynamic Date Variant in SAP ver 3.1

    How to create a dynamic date variant in SAP ver 3.1 ?

    Hi,
    I guess that you know how manage dynamic dates in a variant. (Please, tell me if you need help about it)
    You can try with two DATUM type fields in the ABAP program. Fix the first one with a fixed date u201901.01.2009u2019 and the second one will be fixed with the dynamic date u2018Current Dateu2019
    Regards,
    OLA

  • Requirement date in ME2O selection screen.

    Hi Friends,
    I see that requirement date in ME2O selection screen is no where available in the output . Is this equal to PO creation date?

    Actually in ALV grid list out put, the document date is the Requirement date.
    If you analysis the same, you will find the solution.
    See I have analysis the same.
    In my ME2O transaction, I can see the document date as follow for the Purchase order number
    4700048844.
    Here the document date is showing 20.12.2011.
    When I go to to ME23N to display the PO number 4700048844, I can see the document date is different.
    But when I checked the requirement date, then I can see the same date for the PO number.

  • How to create variant for selection screen which is in subscreen

    Hi,
    How to create variant for selection screen which is in subscreen in a module pool program?
    it is very urgent.
    Thanks in advance.

    Hi,
    You can create the 'Parameter Transaction' so that whenever you run the particular transaction it will run with the initial value given when the Tcode was created and hence you can skip the initial screen of the module pool program.
    To create Parameter transaction from SE93 you have to choose the last option i.e Parameter Transaction.
    Regards
    Sudheer

  • Tricky dynamic date variant in ABAP query

    Hello All,
    In an abap query there is a date field in the selection screen with from & to values.
    I am trying to create a dynamic variant that will fill the following data into those fields:
    From date: will be left blank
    To date: will show today's date - 90 days
    For example, if today's date is 01/12/2006 the variant should fill the following data into the fields:
    From date: <blank>
    To date: 01/09/2006
    I have tried all the methods I know with dynamic dates calculation in the variant definition but did not manage to create such variant.
    Any help will be very appreciated and points would be rewarded generously !
    Thank you very much,
    Ronen

    If the "from" date is meant to be left blank (beginning of time) and the "to" date is some date plus or minus number of days from today, you use the "current +/- days" dynamic date calculation format as was mentioned earlier.  Likewise if the "from" date is some date plus or minus today's date, and the "to" date is infinity -- you only need the one Dynamic Date calculation.
    To do this, first don't think about this as a date range, think of your Dynamic Date calculation as if this were a single parameter and not a select-option.  You are really saying "my date is anything LT/LE this date" or "my date is anything GT/GE this date" -- not a range
    In the Save Variant screen, find the desired date select-option and:
    1. Choose in column "Selection Variable", a "D" (Dynamic date calculation)
    2. Use F4 in the "Name of Variable" column
    3. Find "Current date +/- ??? days" or "Current date +/- ??? work days" in the popup, as appropriate
    4. For "I/E" (include/exclude) column select as appropriate
    5. For "Option" column, choose "LE", "LT", "GE", "GT", "NE" as appropriate
    6. After clicking green check mark, enter your plus or minus days (and factory calendar if using work days).
    7. Finish saving your variant.
    8. You may not see your changes in your variant until you back all the way out of the variant and then redisplay it.  You'll see a greyed out date along with the symbol matching your choice (LT, LE, etc.)
    Unfortunately if you don't have infinity on either end of the date you are limited to 999 days differences as far as I am aware.  If that is the case you can populate TVARVC table with parameter or selection variables, maintain them with STVARV transaction by hand, or use an ABAP program in batch to regularly calculate the values.  Then you can reference the TVARVC values in your variant instead of the Dynamic Date calculation.
    If someone knows a way to bypass the use of TVARVC for date ranges that are more than 999 days apart please let me know.  TVARVC works well but it is extra effort whereas Dynamic Date calculation would be much easier to maintain if the date range could be made larger than 999 days.

  • Setting default date range in selection screen when executing as batch job.

    Hi Guys,
    I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
    Lower value = today date
    higher value= next week run date.
    How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM

    Hi Vinod,
    Would suggest you to this.
    Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
    Now goto create a variant from SE38 for the report.
    While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
    Select the option "D: Dynamic date calculation" for both the date fields.
    For p_start_date - select the option "Current Date"
    For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.
    Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
    Now, in the program, first step after START-OF-SELECTION code the following:
    RANGES: r_date FOR sy-datum.
    start-of-selection.
    refresh r_date.
    r_date-sign = 'I'. r_date-option = 'BT'.
    r_date-low = p_start_date. r_date-high = p_end_date.
    append r_date.
    Hence this way, you would have built your range and use it as needed.
    Cheers,
    Aditya

  • Layout variants in Selection screen

    Hi All,
        I have a requirement where i need to create a functinal key on selection screen'Disp Variant' and i need to provide F4 help when user click on button and when layout is selected the report should show the layout according to selected layout variant.
    I have written following code but it is not workin for me.Please help.
    initialisation.
        wa_functxt-icon_id   =  icon_variants.
        wa_functxt-quickinfo = 'CHOOSE'.
        wa_functxt-icon_text = 'DISP VAR'.
        sscrfields-functxt_01 = wa_functxt.
    wa_functxt of type smp_dyntxt and sscrfields have been declared at top.
    CLEAR: wa_variant2.
      wa_variant2-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = ' '
        CHANGING
          cs_variant = wa_variant2
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc EQ 0.
        PERFORM f_select_alv_variant.
      ENDIF.
    even this is in initialisation.
    form F_SELECT_ALV_VARIANT .
      MOVE sy-repid TO wa_variant1-report.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
        EXPORTING
          i_dialog            = space
          i_user_specific     = 'X'
          i_default           = space
          it_default_fieldcat = i_fieldcat[]
          i_layout            = wa_layout
        IMPORTING
          et_fieldcat         = i_fieldcat[]
        CHANGING
          cs_variant          = wa_variant2
        EXCEPTIONS
          wrong_input         = 1
          fc_not_complete     = 2
          not_found           = 3
          program_error       = 4
          OTHERS              = 5.
      IF sy-subrc EQ 0.
        "Do nothing.
      ENDIF.
    endform.  
    AT SELECTION-SCREEN.
    CASE sscrfields-ucomm.
    *When Display Variant button is clicked
        WHEN c_fc01.
          PERFORM f_f4_for_variant.
        WHEN OTHERS.
      ENDCASE.
    form F_F4_FOR_VARIANT .
      CLEAR: wa_variant1,
             wa_variant2.
      wa_variant1-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = wa_variant1
          i_save     = 'U'
        IMPORTING
          e_exit     = v_variant_exit
          es_variant = wa_variant2.
      PERFORM f_select_alv_variant.
      IF v_variant_exit EQ 'X'..
        PERFORM f_get_default_variant.
      ENDIF.
    endform.
    Thanks in Advance,
    Anjana

    Let's discuss based on something. On that program, I don't have any issue, check it.
    INCLUDE <icon>.
    TABLES sscrfields.
    DATA wa_variant1 TYPE disvariant.
    DATA wa_variant2 TYPE disvariant.
    SELECTION-SCREEN FUNCTION KEY 1.
    PARAMETERS dummy.
    INITIALIZATION.
      DATA wa_functxt TYPE smp_dyntxt.
      wa_functxt-icon_id = icon_variants.
      wa_functxt-quickinfo = 'CHOOSE'.
      wa_functxt-icon_text = 'DISP VAR'.
      sscrfields-functxt_01 = wa_functxt.
      PERFORM f_get_default_variant.
    FORM f_get_default_variant.
      CLEAR: wa_variant2.
      wa_variant2-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = ' '
        CHANGING
          cs_variant = wa_variant2
        EXCEPTIONS
          not_found  = 2.
    ENDFORM.                    "f_get_default_variant
    AT SELECTION-SCREEN.
      PERFORM at_selection_screen.
    *&      Form  at_selection_screen
    *       text
    FORM at_selection_screen.
      CASE sscrfields-ucomm.
    *When Display Variant button is clicked
        WHEN 'FC01'.
          PERFORM f_f4_for_variant.
        WHEN 'ONLI'.
          DATA gt_output TYPE TABLE OF t000 WITH HEADER LINE.
          SELECT * FROM t000 INTO TABLE gt_output.
          DATA lo_table TYPE REF TO cl_salv_table.
          TRY.
              CALL METHOD cl_salv_table=>factory
                IMPORTING
                  r_salv_table = lo_table
                CHANGING
                  t_table      = gt_output[].
            CATCH cx_salv_msg.
          ENDTRY.
          DATA lo_layout TYPE REF TO cl_salv_layout.
          lo_layout = lo_table->get_layout( ).
          lo_layout->set_save_restriction( cl_salv_layout=>restrict_none ).
          DATA ls_layout_key TYPE salv_s_layout_key.
          ls_layout_key-report = sy-repid.
          lo_layout->set_key( ls_layout_key ).
          DATA l_variant TYPE slis_vari.
          l_variant = wa_variant2-variant.
          lo_layout->set_initial_layout( l_variant ).
          DATA lo_functions_list TYPE REF TO cl_salv_functions_list.
          lo_functions_list = lo_table->get_functions( ).
          lo_functions_list->set_all( ).
          lo_table->display( ).
      ENDCASE.
    ENDFORM.                    "at_selection_screen
    FORM f_f4_for_variant .
      CLEAR: wa_variant1, wa_variant2.
      wa_variant1-report = sy-repid.
      DATA v_variant_exit TYPE flag.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = wa_variant1
          i_save     = 'U'
        IMPORTING
          e_exit     = v_variant_exit
          es_variant = wa_variant2.
      IF v_variant_exit EQ 'X'..
        PERFORM f_get_default_variant.
      ENDIF.
    ENDFORM.                    "F_F4_FOR_VARIANT

  • Dynamic Parameters in the Selection screen

    Hi,
    I want to have a pair of Parameters (Source & Target Field) in the Selection Screen. Is it possible to create more pairs of Parameters by click of a Button or something else?
    Sinan

    hi,
    Dynamic generation of selection-screen is bit confusing.
    I have a sample program which takes an integer as an input. After giving input, click on the button on selection screen. You can make a similar logic in your case also.
    Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
    Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
    REPORT  Z_13317_DYN_CHKBOX.
    types :begin of t_itab1,
            line(72),
           end of t_itab1.
    data: incl type table of t_itab1 with header line.
    parameters: p_tab type i,
                p_frst type c no-display.
    selection-screen begin of line.
    selection-screen: pushbutton 2(20) but1 user-command cli1.
    selection-screen end of line.
    include z_13317_dyn_incl if found.
    initialization.
    at selection-screen output.
      if p_frst = ' '.
        p_frst = 'X'.
        perform crt_dyn_incl.
      endif.
    at selection-screen.
      case sy-ucomm.
        when 'CLI1'.
        perform crt_dyn_incl.
      endcase.
    *&      Form  crt_dyn_incl
    *       text
    form crt_dyn_incl .
      perform populate_incl.
      perform del_incl.
      insert report 'Z_13317_DYN_INCL' from incl.
      commit work.
      submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
    endform.                    " crt_dyn_incl
    *&      Form  del_incl
    *       text
    form del_incl .
      call function 'RS_DELETE_PROGRAM'
        exporting
         program                          = 'Z_13317_DYN_INCL'
         suppress_checks                  = 'X'
         suppress_popup                   = 'X'
         with_cua                         = ' '
         with_documentation               = ' '
         with_dynpro                      = 'X'
         with_includes                    = ' '
         with_textpool                    = ' '
         with_variants                    = ' '
      if sy-subrc <> 0.
      endif.
    endform.                    " del_incl
    *&      Form  populate_incl
    *       text
    form populate_incl .
      data: v_cnt type n.
      do p_tab times.
        v_cnt = v_cnt + 1.
        incl-line = 'parameters: '.
        concatenate incl-line 'p_chk' v_cnt into incl-line.
        concatenate incl-line 'as checkbox.' into incl-line separated by space.
        append incl.
        clear incl.
      enddo.
    endform.                    " populate_incl
    Regards
    Sailaja.

Maybe you are looking for

  • How to make a calc script on a dense dimension ?

    Dears, I want to make a calculation script on a dense dimension where : - I want to get an input from a member, then make a mathematical calculation , then populate the result in another member at the same dimension . For More Clarification : I have

  • Encountering with the error Client out of memory in Bex. . .

    Hello All, In the Bex report when I run for the 2000 sales organization selection the initial display is coming fine. When I try to drill down to the next levels in the result, I am encountering with the error 'CLENT OUT OF MEMORY'. The report is dis

  • Get the font names and image names in QXD

    Hi, How to get the font names and image name in Quarkxpress document file using java?. Is any third party packages for getting font n image names in QXD? thanks, nithya

  • Not seeing the synchronized clip icon

    Not seeing it in either the Clip viewer (actually event browser might be the correct term for the window at the top) or when I append it (the selected clip) pressing "E" into the timeline I also see no synchronized clip icon to click on and drill dow

  • DataGrid and XML

    Can anyone spot a problem with the following code: <mx:Model id="readingData" source="reading.xml"/>     <mx:ArrayCollection id="readingAC" source="{readingData.row}"/> <mx:DataGrid id="readingGrid" dataProvider="{readingAC}" x="10" y="40" rowCount="