F4 help for month and Year field in ztable please

I have created a ztable. 
The first field in my ztable is a primary key field and it holds MM/YYYY(eg.  08/2011).
How ever my requirement is when ever we want to see the output, uer wants F4 help on that fields and when he selects the range , the ztable should display the values in that range.
For eg.
1). if user selects   01/2011  to 08/2011 using F4 Help,
2). then the ztables should display all the records in that range.
Thanks in advance for your help.
Best regards,Sam
Moderator message : Spec dumping / Outsourcing is not allowed.  Thread locked.
Edited by: Vinod Kumar on Aug 8, 2011 11:17 AM

Hi Sam,
Create an F4 help using this FM
l_t_date" has month and date
l_f_programm = sy-repid.
    l_f_dynnr    = sy-dynnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield         = 'Date'"Field name of coloum of value tab
        dynpprog         = l_f_programm
        dynpnr           = l_f_dynnr
        dynprofield      = <>"Screen field name'
        value_org        = 'S'
        callback_program = l_f_programm
        callback_form    = ''
      TABLES
        value_tab        = l_t_date"Value table for date and month
*      FIELD_TAB        = L_T_RETURN
        return_tab       = l_t_return_tab
      EXCEPTIONS
        parameter_error  = 1
        no_values_found  = 2
        OTHERS           = 3.
    READ TABLE l_t_return_tab INDEX 1.
    IF  sy-subrc = 0 .
    <fields> = l_t_return_tab-fieldval.
    ENDIF.
Regards,
Amit
then filter the ztable accordingly

Similar Messages

  • Data element for Month and Year

    Hello All,
    Is there any data element which will have only Month and Year.
    I have to introduce this field in a table. It should have convesion exits also.
    Ex: If i give 092009, it sould come like 09.2009
    Thank you.
    Best Regards,
    Sasidhar Reddy Matli.

    Kindly Try this code for Month and year as input and having standard F4 help..
    INCLUDE RMCS0F0M.
    TYPES : BEGIN OF TY_SELECT,
              MONTH TYPE FTI_MONTH_YEAR,
            END OF TY_SELECT.
    DATA : WA_SELECT TYPE TY_SELECT.
    SELECTION-SCREEN : BEGIN OF BLOCK SANDEEP WITH FRAME.
      SELECT-OPTIONS : S_MONTH FOR WA_SELECT-MONTH OBLIGATORY NO INTERVALS NO-EXTENSION.
    SELECTION-SCREEN : END OF BLOCK SANDEEP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MONTH-LOW.
      PERFORM MONAT_F4.
    SANDEEP JAIN

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • SELECTION SCREEN FIELD FOR MONTH AND YEAR

    Hi All.
    We are developing a 'Monthly Sales Tax(payable) Report.
    they want the report based on the date(in the selection screen it will come only month and year only.).Depends on that month and year for that select-options ,it will pick up the record.
    like if, jan 2005  to march 2006.
    then it will  pick up from 01.01 .20005 to 31.03.2006  records.
    Can any body help me to resolve this.
    Thanks in advance,
    Regards,
    Venkat

    Hi Venkat,
    Copy the following code.
    DATA :  ws_billfrom    TYPE dats,
            ws_billto      TYPE dats.
    DATA : mon TYPE fcltx.
    SELECT-OPTIONS: s_month FOR mon
                MATCHCODE OBJECT zsdhtch_sh_mnth
                OBLIGATORY. "o get values for F4
    PARAMETER :  p_year LIKE bkpf-gjahr
                 MATCHCODE OBJECT zsdhtch_sh_year
                 OBLIGATORY.
    RANGES : s_date FOR sy-datum.
    DATA : ws_fcmnr TYPE fcmnr.
    START-OF-SELECTION.
      SELECT SINGLE mnr
             INTO ws_fcmnr
             FROM t247
             WHERE ltx = s_month-low.
      CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
           EXPORTING
                iv_date             = ws_billfrom
           IMPORTING
                ev_month_begin_date = ws_billfrom
                ev_month_end_date   = ws_billto.
      s_date-low = ws_billfrom.
      s_date-high = ws_billto.
      s_date-sign = 'I'.
      s_date-option = 'BT'.
      IF NOT s_month-high IS INITIAL.
        SELECT SINGLE mnr
               INTO ws_fcmnr
               FROM t247
               WHERE ltx = s_month-high.
        CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
             EXPORTING
                  day_in            = ws_billfrom
             IMPORTING
                  last_day_of_month = ws_billto.
        s_date-high = ws_billto.
      ENDIF.
      APPEND s_date.
      WRITE s_date.
    You can write your select statement here.  
      select * from dbtable where date in s_date.
    If 'HR_JP_MONTH_BEGIN_END_DATE' is nto there in your server, you can use 'RP_LAST_DAY_OF_MONTHS' in both cases.
    Regards,
    Susmitha.
    Dont forget to reward points for  useful answers

  • How to set filter criteria for month and year using in timestamp input field?

    Hi,
    I am using jdev 11.1.2.3,
    I have one problem with Report generation,,,,,,I have one report table which is in the form of VO(query based) and i want to search this table as month and year basis
    but in this table(query) that field having timestamp based value.. how to search with month name and year only.. Here i am using totally query base VO's for generating
    reports........ Can any one guide me.
    Thank You.

    You can use a inputdate, which allows you to selecte a moth, year and a day. Once the selection is made you convert it to only allow moth and date like
            <af:inputDate label="Label 1" id="id1" autoSubmit="true" value="#{bindings.myMonthYear1.inputValue}">
              <f:convertDateTime pattern="MM/yyyy"/> 
            </af:inputDate>
            <af:outputText value="Selected #{bindings.myMonthYear1.inputValue}" id="ot1" partialTriggers="id1"/>
    then you have a string holding month and year only. This value you split into two variables you or pass it as a whole parameter to the query and split it there.
    Another way is to add two static lovs one for month and one for year and use them to get to the filter values.
    Timo

  • F4 option for Month and Year

    hi
    In Selection Screen i have Month and Year as input.....
    How to give "F4" Option for both Month and Year?
    Regards
    Smitha

    hi,
    this will help u get the month in f4 help .
    similarly u can fill up the itab for year and get that f4 help too i guess.
    TABLES: T247 ,
            DFIES.
    PARAMETERS:P_MONTH LIKE T247-MNR.
    DATA: BEGIN OF ITAB OCCURS 0,
    MNR LIKE T247-MNR,
    KTX LIKE T247-KTX,
    END OF ITAB .
    DATA : LT_FIELDS TYPE TABLE OF DFIES,
           LWA_FIELD TYPE DFIES.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MONTH.
      SELECT MNR
             KTX
      FROM T247 INTO CORRESPONDING FIELDS OF TABLE ITAB
      WHERE SPRAS = 'EN'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD    = 'P_MONTH'
          DYNPPROG    = SY-CPROG
          DYNPNR      = SY-DYNNR
          DYNPROFIELD = 'MNR'
          VALUE_ORG   = 'S'
        TABLES
          VALUE_TAB   = ITAB
          FIELD_TAB   = LT_FIELDS.

  • FM for month and year to Fiscal year period

    Hello ABAP Experts,
    Please suggest a FM to convert month+year to fiscal year period.
    Suggestions appreciated.
    Thanks in advance,
    BWer

    use the function moduleGM_GET_FISCAL_YEAR
    pass date and fiscal year variant as 24..
    see all the values of the fiscal year variant in the table T009
    Check with fm FI_PERIOD_DETERMINE
    Thanks
    Seshu

  • How to save and month and year wise values

    Hi friends,
    in my ztable i have to enter values manually for month and year wise..
    so i have to create parameter for month and year how to create it.
    in my parameter month and year fields..
    once he given month and year  then he should enter values for fields..
    i have doubt how to give parameter for this...table..
    example: month: 1
                 year : 2007
    after that user enter values for following fields.
           kunnr
           name
           core values
           noncorevalues
    above fields user will enter values month wise ..
    once he enter the values for january it should save ...
    next he enter values for february and it will save..
    when ever he want to see the january month data how can he see..
    is there any logic for the above problem...

    Hai venkat,
    I am not totally clear with your question some how i understood. I give my opinion may be it ll help ful to you.
    In your ztable you want to enter the values for the fields kunnr, name, core values ,noncorevalues as per month. 
    As i say in your ztable add another field as  month  with other 4 fields. Provide the table maintenance for your table or else in se11 -> table display ->utilities -> table contents -> create entries is one way.
    If you proivided  maintenance for your table go to SM30. where you can manually enter values .
    <b>reward if useful</b>
    Regards,
    sunil kairam.

  • Elapse days - calculation from month and year

    Duplicate thread ...
    coding  required for converting month into days
    I have Month and year field in my DSO --Year( 2009), Month(4)
    I want below logic to calculate -
    MTD qty % = (qty * elapse days) / no of days in month
    so from the above, I want to know,
    1. How can we get the no of days from the above 2 objects (year and month).
    2. Elapse days are the days that are over from current date to Ist day of that month.
    eg: current date - 04.03.2009 , 1st day of the month - 04.01.2009,
    elapse days = 2. (you need to consider all days in the month, not only working days)
    so my questions is how can we get, # of days n a month from above 2 fields and elapse days based on the above condition.
    also want to know, where can I have the logic in transformations or query level.
    please provide your suggestions.
    Thanks,
    Pra
    Edited by: Arun Varadarajan on Apr 5, 2009 10:44 PM
    Edited by: Arun Varadarajan on Apr 5, 2009 10:45 PM

    Hello,
    I think the sample program below does what you ask: it finds the days in the month (bit of an overkill to use function modules for that) and then computes the QTD.
    Note that the internal string representation of a data variable is always YYYYMMDD, regardless of the "externalized" form (e.g. yyyy/mm/dd or dd.mm.yyyy), so this code will work regardless of your custom date format.
    Regards,
    Mark
    REPORT  zqty_to_date.
    PARAMETERS:
      p_date     TYPE dats,
      p_qty      TYPE i.
    DATA:
      days      TYPE i,
      n_year    TYPE numc4,
      n_month   TYPE numc2,
      n_day     TYPE numc2,
      qtd(6)    TYPE p DECIMALS 1.
    START-OF-SELECTION.
      n_year = p_date+0(4).
      n_month = p_date+4(2).
      n_day = p_date+6(2).
      PERFORM days_in_month USING n_year n_month CHANGING days.
      qtd = ( p_qty * ( n_day - 1 ) ) / days.
      WRITE: / 'Days in month:', days,
             / 'Qty  to date :', qtd.
    *&      Form  days_in_month
    *       text
    FORM days_in_month USING year month CHANGING days.
      DATA: ymod4   TYPE i,
            ymod100 TYPE i,
            ymod400 TYPE i.
      CASE month.
        WHEN 4 OR 6 OR 9 OR 11.
          days = 30.
        WHEN 2.
          ymod4 = year MOD 4.
          ymod100 = year MOD 100.
          ymod400 = year MOD 400.
          IF ( ymod4 = 0 AND ymod100 > 0 ) OR ( ymod100 = 0 AND ymod400 = 0 ).
            days = 29.
          ELSE.
            days = 28.
          ENDIF.
        WHEN OTHERS.
          days = 31.
      ENDCASE.
    ENDFORM.                    "days_in_month

  • How to get currect date by using month and year

    hai,
    By using month like 'Jul' and year like 2007 i want to get full date like 01/06/2007(format).Please give me query for this?My fields for month and year are respectively vr_mnth(varchar) and in_year(number)

    i used to_date function but it accepts only one string .if i give like this
    to_date(vr_mnth,in_year,'dd/mm/yy') it will gives me syntax error.
    If i give like this vr_mtnh='Jan'
    to_date(vr_mtnh,'Mon') it will give output
    01/01/2008 it shows me current year
    if i choose from table wich is strored with month-'Jul' and year=2006 it shows me
    01/07/2008 only .It doesn't shows me that 2006 year
    If i give in_year in to_date it gives me that currect year.
    Ex:to_date(in_year,'YY')..............>01/01/2006
    Individually to_date function works fine but i want to club both to get accurate date format of specified month and year.Is there any function for that in sql to get 01/07/2006?

  • Calculate different month and year

    Dear experts,
    Hereby, i have 2 questions:
    1)Are any data type for month and year format (YYYYMM)? Generally, we have the data type for date which is 'D', but it is in YYYYMMDD format. Currently, i define the data type as length 6 type c.
    2) Does SAP function module have functions to calculate the different month? For example: 11.2009 - 01.2010 = 2
    Because currently, i define the type as length 6 type c, thus, the calculation for this difference are quite tedious. Or does anyone have any sample for this type of function?
    Thanks in advance.

    Hi, Starry
    Please Search in SCN or Google, Date Related Question are not allowed. Check the bellow Thread for more info.
    How to post code in SCN, and some things NOT to do...
    Regards,
    Fasial

  • Returning  'Day' value based on month and year parameters

    Hi,
    Is there a code that would return an end of the month  Day value based on month and year parameters?
    For example if my parameters yield 9 or September for a month value and 08 or 2008 for the year value, can a formula generate a value of 30 (the last day of the given month in the specific year)?
    This way the formula would pick up the different last day of the month in February for the leap years.
    Thank you.
    Vic

    1. Open the formula workshop.
    2. From the Repository Custom Functions, under Crystal and then Date, RIGHT click on cdlastdayofmonth, click on ADD TO REPORT.
    3. Create a new formula, in the formula workshop, under FUNCTIONS, go down the list till you see "CUSTOM FUNCTIONS", expand that till you see cdlastdayofmonth.
    4. In your formula, type cdlastdayofmonth(currentdate)
    5. Save and close and display the formula in your report, you should see 11/30/2008.
    If you want just the day then modify the formula to:
    totext(day(cdlastdayofmonth(currentdate)),0,'','');
    since you have parameters for month and year, do this:
    totext(day(cdlastdayofmonth(date({?year},{?month},01))),0,'','');
    to give you the last day of the month.

  • Month and Year in Input Field

    Hi Gurus,
    I m Using SPMON(Period to analyze month and year) as input Field in my BSP Application.
    If i Click the Input Help i want to call a Function module "popup_to_display_month" ..
    How to acheive this.
    I have used onValueHelp attribute in which it will call only the Javascript.
    Please guide me...
    Thanks n Regards
    Aravindh

    Hi Aravindh,
    First thing if this FM 'POPUP_TO_SELECT_MONTH' gives a popup in SAPGUI , you can not use it in BSP since SAP GUI popups are not supported in BSP.
    I have used onValueHelp attribute in which it will call only the Javascript.
    If triggering a server side event using onValueHelp solves you  problem that you can do it as follows..
    1)In the layout somewhere use a blankimage that will not be visible in UI.
    2)Suppose ID of this image is 'blank'
    now call javascript function for onValueHelp
    and in this javascript function use
    dacument.getElementById('blank').click();
    change dacument to document.
    This will trigger a server event which you can process in onInputProcessing and call the FM.
    Regards,
    Anubhav

  • I want to accumulate rain for the day, month and year; What formula can I use?

    I want to accumulate rain for the day, month and year; What formula or expression can I use.
    I am using a Rain Wise product that converts pulses to an analog value.  The Rain Wise device can be
    set to measure up to 1", 5", or 10".  I will be setting the unit to 10 inches in increments of 0.01 inches.
    What I would like to do is everytime the signal increments I would like to count it as 0.01 then after reaching
    a period of time whether it be a day or a month reset back to zero.
    Need some advise on this problem.
    Solved!
    Go to Solution.

    Hello Ryan,
    Lookout gets a Modbus over Ethernet signal which originates as a 4-20mA input to a Moxa Ethernet I/O Module (E1240) in the field.  In Lookout I created a ModbusEthernet Driver and a tag which scales 0 - 65534 RAW to 0-10 Eng.  [0 - 10 is inches of rain]  Also, another piece of information is that after the rain gauge maxes out at 10 inches it will zero out and start over.
    I though the accumulator was time based and took a sample over a specific time period, for instance, one sample every 30 seconds then accumulate.  If this is so then if I have 5 inches of rain and then it stopped raining, then 30 seconds latter it would sample, it would see 5 inches and add that to be 10 inches when actually it had only rained 5 inches. 
    I really need some help with this process,
    David Lopez
    City of Corpus Christi

  • Concatenate Date fields as month and year

    Hi,
      I want to concatenate the field bseg-augdt as month and year.
    And have to append as a seperate field (Fiscal month | fiscal year) in the output.
    Plz help me to overcome this issue.
    Thanks and Regards,
    Karthik
    Moderator message: very basic, please try yourself and search for information before asking.
    locked by: Thomas Zloch on Aug 4, 2010 1:22 PM

    Env : ORACLE REPORTS 9I
    I am passing 3 parameters to the report:
    Parameters are of type CHAR
    Report Parameters
    Year / Month :   2005 / AUG
    Effective Date :
    The colunm in table is eff_date
    eff_date
    01/08/2005
    02/08/2005
    03/08/2005
    15/09/2005
    17/09/2005
    18/09/2005
    29/09/2005The problem is:
    1)If I dont enter anything,I just get displayed 2 record for the above.
    It should display all records rather than 2.
    2)If I enter Effective date as 01-AUG-2005,no records are displayed.
    This is my code:
    Select col1,col2
    from   TableA
    where ( TRUNC(ch.eff_date) = nvl (:E_DATE, TRUNC(ch.eff_date) ) 
    AND     TRUNC(ch.eff_date, 'MONTH') = nvl (TO_DATE(:YR||:MTH,                                                                                                          'yyyymon') ,
                                               TRUNC(ch.eff_date) )
          )Shud i change the AND to OR?

Maybe you are looking for