Month-wise break.

Hi,
I have a requirement as follows :-
The user will submit the start date and end date. Based on the date parameters, the customized procedure should do some calculations month-wise.
For eg : start date - 01-Dec-2012 to end date - 31-Mar-2013
I want the break up as
Start date End date
01-dec-2012 31-dec-2012
01-jan-2013 31-jan-2013
01-feb-2013 28-feb-2013
01-mar-2013 31-mar-2013
How can i achieve this month-wise break ?
Regards,

Hi,
There are no DATE bind variables, at least not in SQL*Plus.
You can use VARCHAR2s to pass the start and end dates, like this:
VARIABLE  start_date     VARCHAR2 (11)
VARIABLE  end_date     VARCHAR2 (11)
EXEC     :start_date := '02-Dec-2012';
EXEC      :end_date   := '31-Mar-2013';
WITH      got_months   AS
     SELECT  TRUNC ( TO_DATE (:start_date, 'DD-Mon-YYYY')
                , 'MONTH'
                )          AS first_month
     ,       TRUNC ( TO_DATE (:end_date,   'DD-Mon-YYYY')
                , 'MONTH'
                )          AS last_month
     FROM    dual
SELECT     ADD_MONTHS (first_month, LEVEL - 1)     AS month_start
,     ADD_MONTHS (first_month, LEVEL    ) - 1     AS month_end
FROM     got_months
CONNECT BY     LEVEL     <= 1 + MONTHS_BETWEEN ( last_month
                                      , first_month
;Output:
MONTH_START MONTH_END
01-Dec-2012 31-Dec-2012
01-Jan-2013 31-Jan-2013
01-Feb-2013 28-Feb-2013
01-Mar-2013 31-Mar-2013

Similar Messages

  • SKfs Period wise break down

    Hi,
    I  am runnig the Report S_ALR_87013645( SKFs period wise break down for  cost centres)
    After executing the report for some cost centre i am seeing the future ACTUAL VALUES, period wise for the selected SKF.
    For the same SKF if i give some other cost centre i am able to see the ACTUAL VALUES up to the CURRENT MONTH only.
    Please advise.

    Hi Siva,
    The SKF you are referring might be the "FIXED" category type of the SKF.
    I assume you should have maintained the SKFs using  KB31N. Pl check the same using KB33N.
    Thanks,
    Pandu

  • Stock report with value and qauntity for given date not month wise

    Hi gems,
    can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location level

    Hi
    check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
    Thanks

  • Display schedule qty - Month wise in ALV Grid

    Hi Experts,
    I have a requirement to display the schedule line quantities month wise in ALV  Grid. The columns sholud be dynamic columns based on the input date range. I got some idea about how to create dynamic ALV but it is not clear to implement in my requirement.
    Please Guide me in achiving the same.
    Example:
    Jan 2011      Feb 2011     March 2011
    100               2000            300
    Thanks&Regards,
    Karthik

    Hi.,
    Create field catalog dynamically as like this.,
    select-options s_date for sy-datum.
    data: n type i,
          count type i,
          cnt type string,
          field type string,
          descr type string.
    DATA: m TYPE t247-mnr,
          month_name type char10,
          m1 type i.
    n = s_date-high+4(2) - s_date-low+4(2) .   " getting number of months
    m1 = s_date-low+4(2).
    m = m1.
    n = n + 1.
    DO n TIMES.   " building field catalog dynamically
      m = m + 1.
      count = count + 1.
      cnt = count.
      concatenate 'FIELD' cnt into field.
      CALL FUNCTION 'ISP_GET_MONTH_NAME'    " FM to get month name
          EXPORTING
            LANGUAGE           =  sy-langu
            MONTH_NUMBER       =   m
         IMPORTING
    *    LANGU_BACK         =
           LONGTEXT           =  month_name .
      concatenate month_name s_date-low+0(4) into descr separated by ''.
      wa_fieldcat-col_pos = count.
      wa_fieldcat-row_pos = '1'.
      wa_fieldcat-fieldname = field.
      wa_fieldcat-seltext_m = descr.
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    ENDDO.
    After this create dynamic table using,
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = t_fldcat
        IMPORTING
          ep_table        = t_newtable.
    then loop the internal table and assign the component to final internal table,.
    like .,
    CONCATENATE 'FIELD' index INTO  fieldvalue.     " do same like fieldcatalog
        ASSIGN COMPONENT  fieldvalue   OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
        <fs_fldval> = wa-fieldvalue.
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Display data in month wise

    Hi all,
    I have my data in the table as date wise. I need to sum this data in month wise.
    Can anyone tell me how to do it. Is their any fm to do it or any sample pgm of this kind.
    For ex my output should be like this :
    field1 field2 Month1 Month2 Month3 Month4 ..
    Waiting for reply,
    Regards,
    Priya

    hi priya,
    First of all sort the whole set of values as per date wise into an internal table.
    Sort the table as per the date .
    CONCATENATE PR_MONTH '01' INTO W_FIRST_DATE.
            CALL FUNCTION 'LAST_DAY_OF_MONTHS'
              EXPORTING
                DAY_IN            = W_FIRST_DATE
              IMPORTING
                LAST_DAY_OF_MONTH = W_LAST_DATE
              EXCEPTIONS
                DAY_IN_NO_DATE    = 1
                OTHERS            = 2.
            IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
                  W_DATE = W_FIRST_DATE.
    With this try to determine the first and last days of the month
    From where u want to start .
    Capture the month field from date field into pr_month.
    Set the first date of the month to 01 like 02/01/2006
    Suppose u had 02/02/2006 as the first occurance of the date then
    U r trying to determine the first date and last date of ur feb month for the year 2006 .
    Now 02/01/2006 and 02/28/2006 are determined by this process .
    Set date_low  = 02/01/2006 .
        Date_high = 02/28/2006.
    Now into ur select statement capture the fields between 02/01/2006 and 02/28/2006 just like range .
    U can use select between or range
    ,so this covers all the fields for feb ,
    Use collect on ur final output table which will give u the final sum values.
    Now next field is say 03/10/2006 , then use the same process to capture the values .
    Itab say is containg date fields
    Logic is
    Loop at itab.
    Month = itab-date+(x)
    At new month.
       Perform operation .
    Endat.
    Endloop.

  • Display information on Month wise

    We have one requirement and we need to display the Month wise information on the report (Sysdate - 1, sydate -2 ....etc)
    for example today is 08 Sept 2011 In template level we need to display below
    Sept 2011 Aug 2011 Jul 2011 Jun 2011 May 2011 Apr 2011
    Please let me know if it's possible to do in RTF Template.

    Pull all the required date and data from DB using queries,.

  • Month wise display

    Hi
    I have a requiement , I need to display a report which will give sales target and Actual , month wise for respective sales representative
    the format is as follows
    Sales Representative Jan           feb        upto Dec
                        target Actual  target Actual
    I have a ODS which will give the Actual Fig and I am using a flat file to upload the target values into another ODS
    I will use a Infoset or multiprovider to merge it
    Pl suggest how to go about it ?
    I mean do I need to create 12 Target Infoobjects(Key Fig)
    and how i will do mapping and  compare month wise target and actual values
    regrds
    kisholoy

    Hi kisholoy,
    According to me u need not to have separate ODS for the Target figures, u can have the target data into the Actual figure ODS with different infosource arrangement for the Target figures.
    I have done such thing previously and it works fine in the same situation.
    Well at a reporting side u can keep Sales representative in selection so that viewer can see report for the perticular sales representative or can see for all sales representative.
    For this arrangement follow the things i have mentioned hereabove.
    1. create a structure for the months in a year. PS: Also put Fiscal year in Selection. (Put this fiscal year and sales representative in the Free characteristics.)
    2. Show Text and key for sales representative by ticking ovet this display option in the properties.
    3. Go in the Columns create strcture for actual and target figures.
    Thus ur query is ready. Do some additional settings as per custemer need.
    Hope it helps.
    Assign the points if it works.

  • Monthly wise sales report

    hai,
         i m working on sales report where in i need to get month wise sales of the products and the related cost incured to company by the sales in the matrix form as shown below  can u help me in which way can i get this monthly report
              march     april     may   june    july......feb
    mtrl    25            30         0       19      23   ........(mtrl quantity)
    cost   30000     15000      0      45000  ..........(amt in rs)
    where in the above i m able to get yearly sales in one column (i.e i m able to show for one particular customer total sales in one column) but i m unable to split sales monthly and unable to show in a report so how can i able to sow in this matrix form

    Dear Raj,
    Please find the code for monthly wise report in PA0001 Table for calculation of Administrator time Recording.
    http://scn.sap.com/message/14216250#14216250

  • Monthly wise Sales report - Help me

    Dear SDN mates
    Is there any standard reports for Monthly wise sales report ...the SAP1 , SAP2 reports were not helpful....Does this can be solved by standard reports or it needs to be customized????
    kindly help me?

    hi,
    check VC05 transaction.

  • How to get monthly wise asset depriciation

    Hi all,
       I am developing a report to show mothly wise depreciation for an Asset.
       In transaction  'AW01 - Assset Explorer' if we give company code, Asset number and Fiscal
    year we get the details of the depriciation in 'Planned/Posted Depriciation values'. I want to get
    the same result.
      By debugging the transaction AW01 i got the funtion module 'AM_SHOW_POST_DEPR' which
    gives the monthly wise depreciation value as output.
       But I am not getting what are the exact inputs which we need to pass to the funtion module.
       So pls help to find out monthly wise asset depriciation for an asset through the same funtion module or some other simple funtion module or through the tables.
    Regard's,
    Jean.

    hi,
    please refer this link
    How to get specific acquisitions and related depreciations?
    thanks

  • How to find the month wise Overall result

    Hi,
    calculating share percentage of order quantity  based on Overal result.
    if given the fiscal period range in the variable(for ex 001.2006 to 009.2006) Overall result considering sum of all Order quantity data between this range.
    But need to calculate share percentage based on month wise in this fiscal period range,for this regard should consider the sum of overal result in month wise.
    How to calculate the month wise overall result?
    regards,
    Hari.

    Hi Hari,
    You need to enable the results row for your Month char in the query. Then use a new formula with the function %CT to get the percentage share of individual values wrt to overall result of that month.
    Hope this helps...

  • GRR3 report is not showing cost centers monthly wise totals

    Hi,
      we are having cost center report for full year company code currency report which was working in R3 system. after upgrade it is not showing monthly wise total currency values but when drill down it to actual line item level it is showing all totals. can anybody hlep me to identy issue.
    Thanks,

    Dear Venu
    Check any other standard summarisation report and see whether they are giving data or not. If not you need to implement note 1817039 to fetch summarisation data. But before that I suggest once again you do data collection upto the period and try running your report.If no success then read the note and apply it.
    Regards
    Rajneesh Saxena

  • Report to view the batch details of the products sold month wise

    Report to view the batch details of the products sold month wise.
    Please send it .

    Dear Goutam
    Use <b>MB51</b> where you can select the field "Batch".
    Thanks
    G. Lakshmipathi

  • How to get database growth month wise

    Hi All,
    Can any one help me getting the growth of production database month wise for the current year.
    I mean I need a script which will display the growth of my database month wise for the year 2010.
    Regards,

    hi,
    try something along the lines of this
    --Run the following create table to create segment info.
    create table stats$segment_info as
    select
      sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name /
    -- Run the following once a calendar month via dba_jobs.
    insert into stats$segment_info
    select
    sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name / commit;
    -- run the following report to get tablesapace growth
    column this_mon new_value this_mon
    column last_mon new_value last_mon
    column prev_mon new_value prev_mon
    select to_char(sysdate,'MON YYYY') This_mon
         , To_char(add_months(sysdate,-1),'MON YYYY') Last_mon
         , to_char(add_months(sysdate,-2),'MON YYYY') prev_mon from dual;
    column mins format 99999
    column size_mb heading '&&this_mon' format 99999 column size_mb2 heading '&&prev_mon' format 99999 column size_mb1 heading '&&last_mon' format 99999
    column growth heading 'Growth(%)|   in   |last month' format 9999.99
    select tablespace_name,
    --       to_char(snap_time,'MON YYYY') Month
           max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-2),'MON'),size_m,0))  size_mb2
          ,max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0))  size_mb1
          ,max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0))  size_mb
           ,100*(max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0))
         -    max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0)))
                     /max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,1)) growth from (select  tablespace_name, snap_time
         ,sum(bytes)/1024/1024 size_M
    from stats$segment_info
      where snap_time > trunc(add_months(sysdate,-2),'MON')-2
    group by tablespace_name,snap_time) a
    group by tablespace_name
    order by tablespace_name
    /as far as I am aware this is database independent.
    regards
    Alan

  • ANNUAL SALES REPORT (MONTH WISE)

    Hi,
    I have following query, which shows annual sales (month wise). But when i run this query it shows all the parts (my mass production and Spare parts as well). I want it should show only MASS Production items only.
    The differencation i have specified at Item level property. If item property no. 5 (name SPARES) is check then it is SPARE item otherwise it is MASS Production.
    Thanks,
    Vincent
    ======================================================
    SELECT T0.ITEMCODE, T0.ItemName, T0.U_MODEL,
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JAN QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'FEB QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAR QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'APR QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAY QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUN QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUL QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'AUG QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'SEP QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'OCT QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'NOV QTY',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'DEC QTY'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode, T0.ItemName, T0.U_MODEL, YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())

    Hi Rahul,
    Yes this report is very much available, but my idea was to integrate an udf (Model No., which i didn't specify in this query).
    But yes this report is very usefull for me.
    Thanks
    Vincent

Maybe you are looking for

  • How to write a pgm to change the existing encrypted password

    Hi all, can anybody tell me how to write a pgm to change the existing encrypted password. thanks in advance.

  • Open or Closed?

    New to iSight/iChat. Does my iChat application need to be 'open' in order for others to see if I'm available, online, or otherwise able to chat? Any tips welcome to this new user. Thanks, Barnaby

  • DVD -R or +R

    Hello All, I haven't posted for a while I've had no problems. I have always used printable -R DVDs but have had problems with them playing OK on a computer but not playing on peoples DVD players,they play fine on my JVC DVD player. I have done some r

  • Bill of Lading, Packing Slip report

    Hi Gurus, I have raised SO, picked, shipped, while doing Ship confirm, system generated 5 concurrent programs, completed all but Bill of Lading, Packing Slip report getting output as Blank, no data is appearing in report. If I want to see data in the

  • PSE 9 - Printing only center of image

    Hi - I am having a problem with printing a few jpegs in PSE 9.  I'm actually trying to use a virtual pdf "printer" to convert a jpeg to a pdf (I'm trying to ultimately merge several jpegs into a final pdf file so I want to convert the jpegs and use a