List of Month and Year in SSRS report parameter?

Hi, I have two parameters in my SSRS Report i.e. Month and Year. I want to show the list of all Months in dropdown and years for a particular range say 1995-Current Year.
Can any one suggest me the query for how to get it to work.Thanks!!
MCP

I am not sure I what you're business needs are for this report.  You stated that you need the month and year for parameters.  If this is the case then there has to be a date and time column in which you can query against to provide both the month(s) and year.  In order to accomplish this using t-sql without querying an existing column would require a loop or cursor based approach,which can negatively impact performance, or a union statement specifying a string literal and the effort to write either of these would exceed the effort required to statically assign the parameter values in reporting services.  The below query shows how to statically create a query for each month and its ordinal position in the year and the same could be done with the year(s) 1995-2009, but this process involves more resources than assigning the static values for the parameters
SELECT DATENAME(MONTH, 1 ) AS MONTH,
1
UNION
SELECT DATENAME(MONTH, 2 ) AS MONTH,
2
UNION
SELECT DATENAME(MONTH, 3 ) AS MONTH,
3
UNION
SELECT DATENAME(MONTH, 4 ) AS MONTH,
4
UNION
SELECT DATENAME(MONTH, 5 ) AS MONTH,
5
UNION
SELECT DATENAME(MONTH, 6 ) AS MONTH,
6
UNION
SELECT DATENAME(MONTH, 7 ) AS MONTH,
7
UNION
SELECT DATENAME(MONTH, 8 ) AS MONTH,
8
UNION
SELECT DATENAME(MONTH, 9 ) AS MONTH,
9
UNION
SELECT DATENAME(MONTH, 10) AS MONTH,
10
UNION
SELECT DATENAME(MONTH, 11) AS MONTH,
11
UNION
SELECT DATENAME(MONTH, 12) AS MONTH,
12
David Dye

Similar Messages

  • List of months and years

    How i can get list of months and years from my tables(ex. tab1), when i have start date ex. 072003 and end date ex. 042005 . That i use in report 6i.. . .
    months | years| . . . . .
    ----------------------------------

    If i am not wrong you want these result
    SQL> SELECT hiredate FROM emp;
    HIREDATE
    17-DEC-80
    20-FEB-81
    22-FEB-81
    02-APR-81
    28-SEP-81
    01-MAY-81
    09-JUN-81
    19-APR-87
    17-NOV-81
    08-SEP-81
    23-MAY-87
    03-DEC-81
    03-DEC-81
    23-JAN-82
    14 rows selected.
    SQL> INSERT INTO emp (empno,hiredate,deptno) VALUES (1,SYSDATE,10);
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT hiredate FROM emp;
    HIREDATE
    17-DEC-80
    20-FEB-81
    22-FEB-81
    02-APR-81
    28-SEP-81
    01-MAY-81
    09-JUN-81
    19-APR-87
    17-NOV-81
    08-SEP-81
    23-MAY-87
    03-DEC-81
    03-DEC-81
    23-JAN-82
    01-SEP-06
    15 rows selected.
    SQL> SELECT TO_CHAR(a,'MON-YYYY') b FROM
      2  (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
      3  (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
      4  MINUS
      5  SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp;
    B
    APR-2006
    AUG-2006
    DEC-2006
    FEB-2006
    JAN-2006
    JUL-2006
    JUN-2006
    MAR-2006
    MAY-2006
    NOV-2006
    OCT-2006
    11 rows selected.
    SQL> SELECT b FROM
      2  (SELECT TO_CHAR(a,'MON-YYYY') b FROM
      3  (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
      4  (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
      5  MINUS
      6  SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp)
      7  WHERE b BETWEEN 'NOV-2006' AND 'SEP-2006';
    B
    NOV-2006
    OCT-2006
    SQL> Khurram

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • Daily, Monthly, and Yearly Report

    Hi I am new to the BAM. I have a BPM process. I want to generate the daily, monthly and yearly report for it. Please advise how can I achieve it. I have a one dimension variable on the process.
    Thanks in advance!

    Hi,
    Try this query to get default ware house and its quantity and modify above query.
    SELECT T0.[ItemCode], T0.[WhsCode], T0.[OnHand] FROM OITW T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[WhsCode] =  T1.[DfltWH] and  T1.[ItemCode]  = [%0]
    Thanks & Regards,
    Nagarajan

  • Display month and year in dropdown list on selection screen

    Hi
      Can anyone tell me how to display months and year in a dropdown list on a selection screen?
      also please tell me how to get the first and the last dates upon selecting the month and year on the dropdown list.
    Month: January Year:2007 . 
    After selecting the required month and year, the first date and last date i.e '01.01.2007 - 31.01.2007' should be displayed on the right side.
    Reward Points assured..
    thanks,
    Chetan

    Hi..,
    <b>
    Just copy, paste and execute this program !!</b>
    type-pools: vrm.
    parameters : p_month(2) type n as listbox visible length 10,
    p_year(4) type n as listbox visible length 10.
    DATA : W_DATE type d, w_ldate type d.
    initialization.
    perform user_drop_down_list_fordt.
    perform user_drop_down_list_foryr.
    start-of-selection.
    concatenate p_year p_month '01' into w_date.
    call function 'BKK_GET_MONTH_LASTDAY'
      exporting
        i_date        = w_date
    IMPORTING
       E_DATE        = w_ldate
    write /: w_date,w_ldate.
    build user_drop_down_list
    form user_drop_down_list_fordt.
    data: name type vrm_id,
    list type vrm_values,
    value like line of list.
    data: t_months type t247 occurs 0 with header line.
    clear list. refresh list.
    name = 'P_MONTH'.
    select * into  table t_months
    from t247 where spras eq 'EN'.
    sort t_months ascending by mnr.
    loop at t_months.
    clear value.
    value-key = t_months-mnr.
    value-text = t_months-ltx.
    append value to list.
    endloop.
    Set the values
    call function 'VRM_SET_VALUES'
    exporting
    id = name
    values = list.
    endform.
    for year...
    form user_drop_down_list_foryr.
    data: name type vrm_id,
    list type vrm_values,
    value like line of list.
    clear list. refresh list.
    name = 'P_YEAR'.
    do 9999 times.
    clear value.
    value-key = sy-index.
    append value to list.
    enddo.
    Set the values
    call function 'VRM_SET_VALUES'
    exporting
    id = name
    values = list.
    endform.
    <b>
    Hope this solves ur problem..</b>
    regards,
    sai ramesh

  • DRQ: Isolate the Daily, Monthly and Yearly CheckBoxes in Selection Criteria

    Module: Financials => Financial Reports => Accounting => General Ledger
    Request to Isolate the Daily, Monthly and Yearly Check Boxes in the General Ledger - Selection Criteria screen, instead of an option in the report window.
    Problem:  If there is BP/General Ledger having long transaction list, then once user un-check any of the check boxes system takes long time to remove/hide those rows which contains Totals. Which is effecting the performance of the report also.  Also those checkboxes appeared with check marked by default.
    If user has an option in the selection criteria screen, then they can choose which Total they want before previewing the report and mark accordingly.
    Thanks & Regards
    Anjan Bhowmick

    Being reached to 10 open question, I am forced to close this thread

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

  • SSAS report action to pass multi-value list of dimention key values to a SSRS report parameter

    This was originally posted on StackOverflow and suggested I try here as well.
    I want to create a report action in an SSAS OLAP cube that generates a list of formatted values to pass into an SSRS report parameter that accepts a multi-valued parameter list.  This would be applied at the
    cell level in the SSAS action.  I have found a solution that gets me most of the way:
    How to Pass Multiple Values from an SSAS Report Drill Through Action to an SSRS Multi-Value Parameter, but not quite.  The action does appear in Excel and works
    if I run the action from a cell that is at or below the dimension attribute I am generating the list for, in this case,
    Account Key.
    Below is a link to a screen capture (unable to embed it due to lack of reputation) showing the action and dimension structure in Excel.  The action works as long as I run it at the
    Account Key level or below.  I want to be able to run it at higher levels, such as
    Account Major and still have it generate all then related Account Key values for the SSRS report parameter.  Running it at the higher
    Account Major level does not trigger the report to run.
    Excel Action Screen Shot:
    http://i.stack.imgur.com/QCGSp.png
    Below is the MDX I am using to generate the value for the report parameter:
    UrlEscapeFragment(
    GENERATE(
    DESCENDANTS(
    [Account].[Account Key].CurrentMember,
    [Account].[Account Key].[Account Key]
    [Account].[Account Key].CURRENTMEMBER.Name,
    "&rp:Account="
    I am hoping that I can somehow modify the MDX above to make it return all the
    Account Keys for any attribute of the Account dimension when ran from any measure cell, not just when ran at self and children of
    Account Key in the pivot table.
    Also, if it helps, I can execute the following MDX query on the cube and get the results I am looking for.
    WITH MEMBER [Measures].[Account Key List] as
    GENERATE(
    DESCENDANTS([Account].[Account].CurrentMember, [Account].[Account].[Account]),
    [Account].[Account].CURRENTMEMBER.NAME,
    "&rp:Account=")
    SELECT {[Measures].[Account Key List]} on 0,
    ([Account].[Account Company Number].[Account Company Number],[Account].[Account Major].[Account Major]
    ) on 1
    FROM [Company 10 Action Demo]
    Below are partial results:
    10.116&rp:Account=10.116.010
    10.117&rp:Account=10.117.010&rp:Account=10.117.020
    10.120&rp:Account=10.120.005&rp:Account=10.120.006&rp:Account=10.120.010&rp:Account=10.120.020&rp:Account=10.120.030&rp:Account=10.120.040&rp:Account=10.120.050&rp:Account=10.120.060&rp:Account=10.120.380&rp:Account=10.120.999
    10.123
    Questions
    Any ideas what I might need to do to get Account Key to be returned for any attribute of the
    Account dimension?
    Would I possibly have to alter my Account dimension in the cube to get this to work?
    Thanks in advance.
    Edit 1 - Adventure Works Cube Version
    I was unable to get the suggested answer with the "Exists" function to work.  To better demonstrate this issue, I have recreated it using the Adventure Works Cube.
    I will focus on the Customer dimension, specifically the Customer and
    Education attributes.  I created a report action called Test Report Action.  Below is the XML created for it in the cube.
    <Action xsi:type="ReportAction" dwd:design-time-name="f35ad5ee-5167-4fb8-a0e0-0a74cc6e81c6">
    <ID>Report Action 1</ID>
    <Name>Test Report Action</Name>
    <TargetType>Cells</TargetType>
    <Target></Target>
    <Type>Report</Type>
    <ReportServer>SQLSERVER</ReportServer>
    <Path>ReportServer?/Test Report</Path>
    <ReportParameters>
    <ReportParameter>
    <Name>Test Customer Existing</Name>
    <Value>UrlEscapeFragment(
    GENERATE(
    EXISTING DESCENDANTS(
    [Customer].[Customer].CurrentMember,
    [Customer].[Customer].[Customer]
    [Customer].[Customer].CURRENTMEMBER.Name,
    "&amp;rp:Customer="
    )</Value>
    </ReportParameter>
    </ReportParameters>
    <ReportFormatParameters>
    <ReportFormatParameter>
    <Name>rs:Command</Name>
    <Value>Render</Value>
    </ReportFormatParameter>
    <ReportFormatParameter>
    <Name>rs:Renderer</Name>
    <Value>HTML5</Value>
    </ReportFormatParameter>
    </ReportFormatParameters>
    </Action>
    Below are the steps to re-create the issue.
    Connect to the cube in Excel
    Add dimension Customer -> More Fields -> Customer
    Add measure Internet Sales -> Internet Sales Amount
    Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action" and see customer values created for URL 
    When the action is ran at this point with Customer, I see the values created in the URL shown message box (since there is no SSRS report server at location specified).
    Now the part I'm unable to resolve
    Remove the Customer dimension and add Customer -> Demographic -> Education
    Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action"
    Nothing happens. If I ran the action on the cell next to "Bachelors", I would want it to build up all the list of all the "Customers"  that make up the "Bachelors" in the
    Customer dimension as part of the report parameter.  If no attributes where used in the cube from the
    Customer dimension for that cell, then I would like it to return "All Customers", or something similar to show that all customers are included in the aggregations.
    I am not too MDX savvy, thus far.  I think I need to somehow join the
    Customers to Internet Sales Amount in the Generate function portion.  I have tried several different combinations of the
    Customer dimension and Internet Sales Amount, along with various functions to see if I could get this to work with no success.  I am hoping that someone more knowledgeable the me will have a solution.   If you need more details,
    please ask and I will provide them.

    Simon,
    Thanks for you help with this.  This morning I found a workaround.  Below describes what that is.
    What I ended up doing was getting a list of values from a degenerate dimension that I could use to pass to SSRS to get a list of transactions for a report.  Below is how I did this, in relation to the Adventure Works cube using the degenerate dimension
    Internet Order Details.
    WITH MEMBER [Measures].[Order Param List] AS
    GENERATE(
    EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
    "Internet Sales"),
    [Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
    "&rp:OrderNum=")
    SELECT {[Measures].[Order Param List], [Measures].[Internet Sales Amount]} ON 0
    ,([Date].[Calendar].[Date]) ON 1
    FROM [Adventure Works]
    This will get a list of Sales Order Number in a text string, separated by "&rp:OrderNum=" for each measure of
    Internet Sales. This would allow me to create an SSRS report to bring back detail information for each
    Sales Order Number. Below are some sample results.
    May 16, 2007 SO50493&rp:OrderNum=SO50494&rp:OrderNum=SO50495&rp:OrderNum=SO50496&rp:OrderNum=SO50497&rp:OrderNum=SO50498&rp:OrderNum=SO50499&rp:OrderNum=SO50500 $12,157.80
    May 17, 2007 SO50501&rp:OrderNum=SO50502&rp:OrderNum=SO50503&rp:OrderNum=SO50504&rp:OrderNum=SO50505&rp:OrderNum=SO50506&rp:OrderNum=SO50507&rp:OrderNum=SO50508 $13,231.62
    May 18, 2007 SO50509&rp:OrderNum=SO50510 $4,624.91
    With this, I can then create a Report Action in SSRS with a Parameter Value of
    UrlEscapeFragment(
    GENERATE(
    EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
    "Internet Sales"),
    [Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
    "&rp:OrderNum=")
    The way I was going about it before was flawed, as I was trying to get a list of the granular values from each dimension used to build the measure value and pass each one of those as separate parameters. I just needed to set something unique for each fact
    measure transaction that represents the value and uses that in a query parameter for the SSRS report.

  • Table for Material Quantity and Value for particular month and year

    Hi All
    My requirement is that for a particular month and year I want to know the stock quantity and stock value for a particular material for a given plant.From which SAP table can I get this data as I want to fetch data for my Y report?
    Regards
    Satish Kumar

    Hi,
    You can use MB5B table as suggested earlier.also you can use:
    MBEW-VMKUM --> stock for previous month period
    MBEW-VJKUM --> stock for previous year period
    PLease view these links which migh tbe helpful to you:
    http://help.sap.com/saphelp_47x200/helpdata/en/39/55fee3bc6111d4b3960050dadf0791/content.htm
    TableStock
    Thanks
    Nisha

  • 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

  • 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

  • Can we modify the pnp selection screen and get only month and year?

    Dear Freinds,
                  I have requirement where i have to modify the PNP selection screen. So with the help of report category and coding in AT SELECTION-SCREEN OUTPUT  , i have modified all the fields relating to dates . i.e i have removed all the radio buttons (i.e Today, Current month,current year etc) and finally
    i have landed with only Period ( PNPBEGDA & PNPENDDA range) . But i dont want the PNPBEGDA & PNPENDDA range , but i want only is the month and year ( i.e just like the PNPPABRP & PNPPABRJ)
    on my selection screen along with the pernr .
    i have used the below code to close all the fields except pnpbegda and pnpendda.
    AT Selection-Screen output.
    loop at screen.
      IF screen-group4 = '098' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '092' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '094' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '100' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '104' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        MODIFY SCREEN.
    endloop.
    i.e on my selection screen i want only  month & year combination and pernr -
    when iam using the logical database PNP . Could any one please let me know how can i get only mon & year only on my selection screen .
    If it is possible please let me know .
    Thanks & regards
    divya.

    Hi ,
       The requirement is that the user doesnt want to enter the date range i.e for ex:  01012008 to 31012008.
    As per the requirement the user will enter only the month and year only . so i on the selection screen
    i want only the month and year only . Is there any means i can modify the date period which is there by
    default (PNPbegda and PNPendda) on PNP selection screen. Instead of we givign to the user the
    PNPBEGDA and PNPPENDA i want is only month and year .
    AS already the code has already been written and now they have asked that they want only the month and year on the selection screen.
    Please suggest me in this regard.If iam hiding all the buttons relating the dates fields, and now if iam adding the parameters for the month and year  it is coming below below the fields pernr , personnel ara and subara , company code , payroll area, employee group of the standard fields of PNP selection screen , there by any body could please suggest me how to change.
    regards
    divya.

  • Selection screen - month and year

    Hi friends,
    I have a selection screen where I need to have two fields one for Period(month) and the other for Fiscal year. So I used
    parameters    :  p_lfmon   like mbewh-lfmon.
    parameters    :  p_lfgja   like mbewh-lfgja.
    My requirement is when I execute the program I want to see the current period(08) and Year(2006) in these two fields. And also I was wondering if we can add the input help F4 for these two fields as they dont have one right now.
    Finally if I want to compare the these two fields month and year with a field in normal date format (08/25/2006), what is the easiest way to do that.
    Waiting for replies. Especially from Rich. Thanks

    If you need to default the current fiscal period, then you can do this.
    report zrich_0001.
    data: datum type sy-datum value '20060806'.
    parameters: p_spbup type spbup  .
    initialization.
      data: xgjahr type bkpf-gjahr.
      data: xpoper type t009b-poper.
      call function 'FI_PERIOD_DETERMINE'
           exporting
                i_budat = sy-datum
                i_bukrs = '0010'
           importing
                e_gjahr = xgjahr
                e_poper = xpoper.
      concatenate xgjahr xpoper+1(2) into p_spbup.
    start-of-selection.
      if datum+0(6) = p_spbup.
        write:/ datum, 'is in period', p_spbup.
      endif.
    Regards,
    Rich Heilman

  • Date concatenation using MONTH and YEAR

    Env : Oracle Reports 9I.
    I need to display reports based on dates.
    If the user enters in one field 'SEP' and in another '2005',
    how can I concatenate both the fields as one and then display
    all results for SEP 2005?
    The Table has a field called Eff_Date (of type Date)
    and containing values:
    Eff_Date
    ==============
    01-09-05
    02-09-05
    04-09-05
    05-09-05
    My code is
    SELECT col1,
           col2
    FROM   TableA
    Where  TRUNC(Eff_Date )=:MONTH  ?? PARAMETER: Here is the month : SEPT
    and      TRUNC(Eff_date) =:YEAR     ?? PARAMETER: Here  is the Year : 2005I need to concatenate parameters MONTH and YEAR in one and then
    display records for that month.
    How can I write the SQL Query to concatenate MONTH and YEAR and
    TRUNCATE the column eff_date?
    Please help.

    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

  • Mouse speed and precision at 1920x1200 are not good in OS X Tiger

    Hi, I am using the same logitech MX700 mouse on a intel mac mini in dual boot with OS X and Windows XP. The screen resolution is the same on both OSs: 1920x1200 The mouse is perfectly working while using Windows XP, while it is working badly under OS

  • JFrame doesn't really redraw...

    I made a Projekt for Seek and Exchange, using a JFrame as MainFrame. If a User klicks on 'Do it' the Program seeks in files, and shows the results in a Panel, I init. in another Panel of the MainFrame (BorderLayout:South), and... nothing, theres no e

  • Adobe CS6 and Enfocus Instant PDF 10

    I have had Enfocus Instant PDF 10 installed with CS6, for about 3 weeks and everything worked great uptil...last night! Enfocus seem to get stuck and does not finish up the jobs, which leaves them in the job que. Had to trash the application but same

  • Shipping Date & Factory Calendar

    Our factory calendar is set up to block of weekends & holidays correctly.  However, when entering sales orders, if we enter a requested delivery date for the customers order to ship on a holiday, the system does not push the date out to the next busi

  • New learning resource

    I recommend this new title to anyone interested in producing digital books from InDesign CC. It's available in both paperback and Kindle editions. (I have no connection with the book's publisher or the authors.) Digital Publishing with Adobe InDesign