Production report displaying months

hi ,
can anyone help me in getting month wise production report...  i e from jan to dec.... it shoulld display all months and show month wise production....
example
ITEM ITEM DESCRIPTION   JAN FEB MARCH
DS01   SCREW                 10     10       30
regards,
Vignesh

Hi Vignesh,
Try this....
select T1.ItemCode,T1.Dscription,
sum(Case DATENAME(month,T0.Docdate) when 'January' then T1.Quantity else 0 end) Jan,
sum(Case DATENAME(month,T0.Docdate) when 'February' then T1.Quantity else 0 end) Feb,
sum(Case DATENAME(month,T0.Docdate) when 'March' then T1.Quantity else 0 end) Mar,
sum(Case DATENAME(month,T0.Docdate) when 'April' then T1.Quantity else 0 end) Apr,
sum(Case DATENAME(month,T0.Docdate) when 'May' then T1.Quantity else 0 end) May,
sum(Case DATENAME(month,T0.Docdate) when 'June' then T1.Quantity else 0 end) Jun,
sum(Case DATENAME(month,T0.Docdate) when 'July' then T1.Quantity else 0 end) Jul,
sum(Case DATENAME(month,T0.Docdate) when 'August' then T1.Quantity else 0 end) Aug,
sum(Case DATENAME(month,T0.Docdate) when 'September' then T1.Quantity else 0 end) Sep,
sum(Case DATENAME(month,T0.Docdate) when 'October' then T1.Quantity else 0 end) Oct,
sum(Case DATENAME(month,T0.Docdate) when 'November' then T1.Quantity else 0 end) Nov,
sum(Case DATENAME(month,T0.Docdate) when 'December' then T1.Quantity else 0 end) Dec
from oign T0
inner join ign1 T1 on T0.Docentry=T1.Docentry
Where T0.JrnlMemo like 'Receipt from %'
group by DATENAME(month,T0.Docdate),T1.ItemCode,T1.Dscription
Hope it will help you...........
Thanks
Sachin

Similar Messages

  • Balance sheet report display month wise - F.01

    Hi Experts,
    We have requirement to display balance sheet report output monthwise, is any SAP Standard T.code is available.
    Do we need to create new customized report, if yes from which table i can pick the values.
    Please let me know the tables for F.01
    Regards,
    Raj.

    Hi Karthik,
    Thanks for reply.
    The output should be period wise, when user execute the report it should display period wise in the output.
    We are on 4.7 EE, so i have to go with GLT0 Table. Any other suggestions.
    Thanks.
    Regards,
    Raj

  • Daily/weekly/monthly production reports

    Hi Experts,
    IMy client needs daily/weekly/monthly production reports with graphical representation. I want to know in acase there are any standard reports which will be a work around solution for the above said reports.
    Thanks

    Hi nandi6346,
    Yes, COOIS : Order informaton system, it self gives graphical representation for production reports.
    Go to COOIS - execute as per required date, to get grafical representation select the coloumns you required, e.g. Production order, target qty, Confirmed Qty, Delivered Qty, Scrap Qty, etc and the click on "Display Grafic" tab, it will show you grafical report.
    Tara

  • Monthly Production Report for Excise

    Dear All,
    I need a monthly production report for Excise purpose as per Indian statutory requirement.
    The requirements are
    1] There should be a date range to select the period of the report
    2] It should show a report only  on those items which are marked as 'sales item' in the item master data [ so that all the other intermediaries / WIP's willn't appear in the report.
    3] If one item is produced / manufactured using different production orders, We need a consolidated quantity for the period under selection.
    Report Format :
    Item code   - Item Description  - Planned Quantity  - Manufactured Quantity - Open Quantity
    Thanks in advance,
    Regards,
    Suresh Kannan

    Hi Suresh,
    Try this query
    SELECT T0.ItemCode, T1.ItemName,
    SUM(T0.PlannedQty) 'Planned Qty',
    SUM(T0.CmpltQty) 'Manufactured Qty', SUM(T0.PlannedQty-T0.CmpltQty-T0.RjctQty) 'Open Qty'
    FROM dbo.OWOR T0
    INNER JOIN dbo.OITM T1 ON T1.ItemCode = T0.ItemCode AND T1.SellItem = 'Y'
    WHERE T0.RlsDate >=[%1] AND T0.RlsDate <=[%2]  and T0.Type != 'D'
    GROUP BY T0.ItemCode, T1.ItemName
    Regards,
    Bala

  • Displaying Months in Matrix Report like Jan-01  Feb-01

    How can I display Months like Jan-01 Feb-01 in Matrix Report of Oracle Report 6i.
    I tried using to_char(myDate,'Mon-YY') but it displayed months in Alphabetical Order like Apr-01 Aug-01 and so on.
    I need something like this.
    Item Jan-01 Feb-01 Mar-01 Apr-01
    Item-A 100 200 300 400
    Item-B 100 200 300 400
    Best Regards,
    Luqman

    Dear Dan,
    Thanks for your suggestion.
    My problem is to display Oracle Data (Hiredate Field of Oracle Scott.Emp Table) in Matrix Report of Oracle Report Version R6i in the format of :
    Dec-80,Feb-81 etc. as under:-
    EmpNo Dec-80 Feb-81 Apr-81 May-81
    7369 800
    7499 1600
    7521 1250
    7566 2975
    7698 2850
    The query I tried in Sql Statement Window of Oracle Report R6i is as under:-
    select empno,sal,to_char(hiredate,'Mon-YY') from emp
    order by to_char(hiredate,'YY-MM')
    The above query shows correct exactly what I need, when run in Oracle Sql Plus but in Matrix Report, it seems its Order By clause not working.
    Your suggesion is related to change the format of today's date and not with Oracle Data, I presume.
    I will appreciate if you please let me know directly at my E-Mail: [email protected] if you find any solution for my above problem.
    Best Regards,
    Luqman

  • Displaying Record Owner in Opportunity-Product Report

    Hello,
    How do I display the owner of the record's name in a column for an Opportunity-Product report.
    When we display the opportunity-owner currently we see the role instead of the user. When we display the created by we see the role as well.
    Instead of "Joe" we would see "Sales Rep"

    The opportunity Owner should show the Alias of the Opportunity Owner like JSMITH (i.e if the Alias for Joe Smith is JSMITH). Make sure on your opportunity Owner field is currently populated correctly. Make sure you are pulling Owner data from the Opportunity Section.
    If it's not working then your particular instance is having some bug - Am able to populate this info correctly.

  • Report displaying days of a month and projects

    Hi,
    I want to create a spreadsheet-like report displaying the days of a month as columns and the projects as rows. It is a report of the daily hours worked on the projects.
    It should look like this:
    Sat Sun Mon Tue ... Mon
    1. 2. 3. 4. ... 31.
    project1 3.5 1.0 2.5 etc.
    project2 5.0 2.5 etc.
    project3 1.0 4.5 etc.
    I got two tables (a little simplified), a table "day" with the columns
    id NUMBER(9)
    day DATE
    and a depending table "hours"
    id NUMBER(9)
    day_id NUMBER(9)
    project_id NUMBER(9)
    worked_hours NUMBER(6,2)
    I got it together (a little simplified) what I want for the current day:
    select
    '', to_char(sysdate, 'Day')
    from dual
    union all
    select
    '', to_char(sysdate, 'DD.MM.YYYY')
    from dual
    union all
    select
    h.project_id, h.worked_hours
    from day d, hours h
    where d.id = h.day_id
    Now the big question: How do I expand that to the full month as shown above?
    How do I display the whole month and the corresponding hours of a project every day?
    Anyone has a done something similar or has a hint?
    Any help is highly appreciated,
    regards,
    Roger

    I see others have already given answers the same... but hey, I spent a few minutes on it so I'm giving mine too. ;)
    SQL> ed
    Wrote file afiedt.buf
      1  with day as (select rownum as id, to_date('01/10/2007','dd/mm/yyyy')+rownum-1 as Day from dual connect by rownum <= 31)
      2      ,hours as (select rownum as id, x.rn as Day_id, y.rn as project_id, rownum as worked_hours
      3                 from (select rownum rn from dual connect by rownum <= 31) x
      4                     ,(select rownum rn from dual connect by rownum <= 5) y
      5                     )
      6  -- end of test data
      7  select h.project_id
      8        ,CAST(MAX(decode(to_char(d.day,'DD'),'01',h.worked_hours,NULL)) as varchar2(3)) as D01
      9        ,CAST(MAX(decode(to_char(d.day,'DD'),'02',h.worked_hours,NULL)) as varchar2(3)) as D02
    10        ,CAST(MAX(decode(to_char(d.day,'DD'),'03',h.worked_hours,NULL)) as varchar2(3)) as D03
    11        ,CAST(MAX(decode(to_char(d.day,'DD'),'04',h.worked_hours,NULL)) as varchar2(3)) as D04
    12        ,CAST(MAX(decode(to_char(d.day,'DD'),'05',h.worked_hours,NULL)) as varchar2(3)) as D05
    13        ,CAST(MAX(decode(to_char(d.day,'DD'),'06',h.worked_hours,NULL)) as varchar2(3)) as D06
    14        ,CAST(MAX(decode(to_char(d.day,'DD'),'07',h.worked_hours,NULL)) as varchar2(3)) as D07
    15        ,CAST(MAX(decode(to_char(d.day,'DD'),'08',h.worked_hours,NULL)) as varchar2(3)) as D08
    16        ,CAST(MAX(decode(to_char(d.day,'DD'),'09',h.worked_hours,NULL)) as varchar2(3)) as D09
    17        ,CAST(MAX(decode(to_char(d.day,'DD'),'10',h.worked_hours,NULL)) as varchar2(3)) as D10
    18        ,CAST(MAX(decode(to_char(d.day,'DD'),'11',h.worked_hours,NULL)) as varchar2(3)) as D11
    19        ,CAST(MAX(decode(to_char(d.day,'DD'),'12',h.worked_hours,NULL)) as varchar2(3)) as D12
    20        ,CAST(MAX(decode(to_char(d.day,'DD'),'13',h.worked_hours,NULL)) as varchar2(3)) as D13
    21        ,CAST(MAX(decode(to_char(d.day,'DD'),'14',h.worked_hours,NULL)) as varchar2(3)) as D14
    22        ,CAST(MAX(decode(to_char(d.day,'DD'),'15',h.worked_hours,NULL)) as varchar2(3)) as D15
    23        ,CAST(MAX(decode(to_char(d.day,'DD'),'16',h.worked_hours,NULL)) as varchar2(3)) as D16
    24        ,CAST(MAX(decode(to_char(d.day,'DD'),'17',h.worked_hours,NULL)) as varchar2(3)) as D17
    25        ,CAST(MAX(decode(to_char(d.day,'DD'),'18',h.worked_hours,NULL)) as varchar2(3)) as D18
    26        ,CAST(MAX(decode(to_char(d.day,'DD'),'19',h.worked_hours,NULL)) as varchar2(3)) as D19
    27        ,CAST(MAX(decode(to_char(d.day,'DD'),'20',h.worked_hours,NULL)) as varchar2(3)) as D20
    28        ,CAST(MAX(decode(to_char(d.day,'DD'),'21',h.worked_hours,NULL)) as varchar2(3)) as D21
    29        ,CAST(MAX(decode(to_char(d.day,'DD'),'22',h.worked_hours,NULL)) as varchar2(3)) as D22
    30        ,CAST(MAX(decode(to_char(d.day,'DD'),'23',h.worked_hours,NULL)) as varchar2(3)) as D23
    31        ,CAST(MAX(decode(to_char(d.day,'DD'),'24',h.worked_hours,NULL)) as varchar2(3)) as D24
    32        ,CAST(MAX(decode(to_char(d.day,'DD'),'25',h.worked_hours,NULL)) as varchar2(3)) as D25
    33        ,CAST(MAX(decode(to_char(d.day,'DD'),'26',h.worked_hours,NULL)) as varchar2(3)) as D26
    34        ,CAST(MAX(decode(to_char(d.day,'DD'),'27',h.worked_hours,NULL)) as varchar2(3)) as D27
    35        ,CAST(MAX(decode(to_char(d.day,'DD'),'28',h.worked_hours,NULL)) as varchar2(3)) as D28
    36        ,CAST(MAX(decode(to_char(d.day,'DD'),'29',h.worked_hours,NULL)) as varchar2(3)) as D29
    37        ,CAST(MAX(decode(to_char(d.day,'DD'),'30',h.worked_hours,NULL)) as varchar2(3)) as D30
    38        ,CAST(MAX(decode(to_char(d.day,'DD'),'31',h.worked_hours,NULL)) as varchar2(3)) as D31
    39  from day d, hours h
    40  where h.day_id = d.id
    41  group by h.project_id
    42* order by h.project_id
    SQL> /
    PROJECT_ID D01 D02 D03 D04 D05 D06 D07 D08 D09 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31
             1 1   6   11  16  21  26  31  36  41  46  51  56  61  66  71  76  81  86  91  96  101 106 111 116 121 126 131 136 141 146 151
             2 2   7   12  17  22  27  32  37  42  47  52  57  62  67  72  77  82  87  92  97  102 107 112 117 122 127 132 137 142 147 152
             3 3   8   13  18  23  28  33  38  43  48  53  58  63  68  73  78  83  88  93  98  103 108 113 118 123 128 133 138 143 148 153
             4 4   9   14  19  24  29  34  39  44  49  54  59  64  69  74  79  84  89  94  99  104 109 114 119 124 129 134 139 144 149 154
             5 5   10  15  20  25  30  35  40  45  50  55  60  65  70  75  80  85  90  95  100 105 110 115 120 125 130 135 140 145 150 155
    SQL>

  • How to display Month values in SSRS report

    Hi All,
        I have a requirement to display month values in SSRS Chart. x-axis should display all month names from January till current month. How can I set this properties and show it in a line graph
    Thanks & Regards,
    Regards RCP

    Hi,
        The above link is not meeting my requirement. I need January till July to be displayed in x-axis
    labels of graph. How this can be achieved ??
    Regards RCP
    You can create a calendar table on the fly and use it for your dataset to be used in the graph. Use logic as below
    http://visakhm.blogspot.in/2010/02/generating-calendar-table.html
    For getting January till current month use query as
    DECLARE @Start datetime,@End datetime
    SELECT @Start = DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0),
    @End = GETDATE()
    SELECT *
    FROM dbo.CalendarTable(@Start,@End,0,1) f
    As a long time persistent solution best option would be to create a calendar table in the database.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Customer exists for displaying monthly bugs per release

    I hav only little know ledge in ABAP. I hav to code for a variable, that has to display monthly incoming bugs per release.
    Dim Product
    Info Productrelease
    based on this i hav to display the data in report like this
    created week               2005.03 ...... 2006.03 2006.06 2006.09....
    06/17/2006                   32                   34              343         4324
    06/24/2006                   43                   45               56            454
    please specify a solution.
    Thanks in advance
    james

    I hav a cube with tech name zssen
    in that cube product is a Dimension with technical name zprdpid
    in that dimension i hav a infoobject called product description.
    product contains different like embedproducts like vg1, vg2 vg3 and so on
    productrelease contains descriptions of  releases 233.1 32.3 3443.34 and so on
    each new release i hav to create to restricted key(2006.09) figure based on the variable created on product release(for example 2006.09 ).
    instead of above procedure i have to create a new variable that has to automatically recognise the new version and it has to display on the report.
    please suggest me how to write the code for above scenerio.
    if u want a detailed description i will send a mail.
    please leave your mail id if possible.
    Thanks,
    James

  • T codes for production reports in REM

    Dear All,
    What are the std. t code for production reports in REM like daily production report,monthly production reports,shift wise production,bom reports etc.
    Thanx in advance
    rg
    Tushar

    Hi Tushar,
    Following are the standard reporting T-Codes REM
    MCP9 - SFIS: Select Run Schedule
    MCRM - Reporting Point Statistics: Selection
    MCRP - Material Consumption Analysis: Repetitive Manufacturing
    MCRK - Product Cost Analysis: Repetitive Manufacturing
    MCP6 - Goods Receipt Analysis: Repetitive Manufacturing
    MF26 - Display Reporting Point Quantity
    MF51 - Print Production Schedule
    MF52 - Display Master Production Schedule
    MF57 - Coll. Display of Planning Screens
    MF60 - Pull List 4.5
    LAS3 - Display Sequence Schedule
    If you won't find your requirement in these,you need to develop new one accordingly taking the technical consultants help.
    Regards.

  • Production Reporting + Automated Report Generation

    Hello,
    Does anyone know how to genarate reports automatically by using Production Reporting?
    The source data is in Essbase and the data on updated monthly. We should get the updated data on the reports automatically but I do not know how to do it?
    What tools (HAL, DIM?) and skills (JAVA, SQR) are needed to get data automatically? The creation of a normal report can be made with graphical user interface.
    Br
    Mikko

    You could set up a dbms_job (unix daemon) to call the report and execute at a given time.
    When you call the report then you can pass the parameters without any problem. (with no user intervention)
    I don't have any example but you should be able to find a lot of them.

  • Display Month and 12 previous Months

    I am trying to create a report (CRXI) which will display month data for the current month and the 12 previous months.   I am going to use subreports (similar to a calendar report) but am having trouble displaying the 12 previous month, year  headers.  
    I get the current month, year from a prompt date and then need to decrease a month for 12 months.  
    Any help would be appreciated.

    Hi Martha,
    If you want to create a report for last 12 months and don't want to include present month then use the record selection for main report as
    (month({DateField}) < month(currentdate)
    and
    year({DateField})= year(currentdate))
    or
    (month({DateField})>=month(currentdate)
    and
    year({DateField})=year(currentdate)-1)
    and in the subreport use the record selection to get current month date as
    (month({DateField}) =month(currentdate)
    and
    year({DateField})= year(currentdate))
    Regards,
    Raghavendra

  • Display Month as 07-Jan instead of 07-01

    A generated report displays a month as 07-01,But the user wants it to be displayed as 07-Jan.
    Could anybody guide in this regard?
    THANKS,
    Points would definitely be awarded.

    HI Sri ,
    You can use text variable to achieve this requirement, try the below link also
    http://help.sap.com/saphelp_nw2004s/helpdata/en/85/e0c73cccbdd45be10000000a114084/frameset.htm
    Hope this helps,
    sathy

  • Display Month verbiage on chart but sort by month number

    Hello,
    I have inserted a simple bar chart (values by month for a single year) and my goal is to get the data values to group by month.
    I found that I can achieve this by using a formula that extracts the month from my Date/TIme field MONTH({Command.OB_DELIVERY_DATE}).
    This works OK and displays months as 1, 2, 3,  etc. on my chart), but I want to display the month text instead (Jan, Feb, Mar)
    I tried a second variable:  ToText({Command.OB_DELIVERY_DATE},'MMMM')
    This works in displaying the verbiage of the months, however, the problem is that it groups the months on my chart alphabetically now (April is now my 1st month instead of January).
    What is the trick to displaying month verbiage on my chart, but still sorting these months in their proper numerical order?
    Many Thanks!

    Hi Dave,
    Try this please:
    1) Insert a Crosstab and place it on the Report Header. Use the Delivery Date field as the row and add the measure field as the Summary Field with the right Sum function
    2) Highlight the Delivery Date field > Group Options > set it to print 'For Each Mointh'
    3) While in the Crosstab Expert highlight the Delivery Date field > Click Group Options > Options  tab > check the option 'Customize Group Name field' > Select 'use formula as group name' and click the formula button beside. Use this code:
    ToText({Command.OB_DELIVERY_DATE},'MMMM')
    4) Right-click the Crosstab and select Insert Chart. Choose the right Chart Type
    5) Suppress the Section that holds the Crosstab
    Hope this helps.
    -Abhilash

  • Report for Monthly Quantiy sold by Customer (SOLD TO PARTY)

    Hi Gurus
    I had asked this question many times but no answer I got from the forum , I want to create a report which should show quantity , uom sold to customer(sold to party) by each month and plant (werks).
    I want to display monthly sales in the report when plant and delivery date is selected ( month = jan,feb,mar,apr,may......) and each quantity must display under jan,feb,mar,apr respectively.
    Can anyone help me please , I am still struggling with this stuff.
    Thanks in advanced
    Regards
    PE

    Hi Aatish
    I have developed the report for monthlywise quantity sold to party
    but it is giving some trouble in the calculation where there is zero value it is taking the above value and displaying in the report but when I search individually with sold to party it is comming correctly
    can you check my source and comment on it please
    REPORT soldtoparty
    line-size  170
    line-count 65 no standard page heading.
    TABLES : kna1,VBRP,vbrk.
    DATA:BEGIN OF itab OCCURS 0,
    kunag like VBRK-KUNAG,
    name1  like kna1-name1,
    werks LIKE vbrp-werks,
    vbeln LIKE vbrp-vbeln,
    fkdat LIKE VBRK-FKDAT,
    vrkme LIKE vbrp-vrkme,
    fkimg LIKE vbrp-fkimg,
    total like vbrp-fkimg,
    END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
    fkdat(2) TYPE c,
    kunag like VBRK-KUNAG,
    name1  like kna1-name1,
    werks LIKE vbrp-werks,
    vbeln LIKE vbrp-vbeln,
    vrkme LIKE vbrp-vrkme,
    fkimg LIKE vbrp-fkimg,
    total like vbrp-fkimg,
    END OF itab1.
    DATA : BEGIN OF itab2 OCCURS 0 ,
    fkdat like VBRK-FKDAT,
    fkimg like vbrp-fkimg,
    kunag like VBRK-KUNAG,
    name1  like kna1-name1,
    vrkme  like vbrp-vrkme,
    jan LIKE vbrp-fkimg,
    feb LIKE vbrp-fkimg,
    mar LIKE vbrp-fkimg,
    apr LIKE vbrp-fkimg,
    may LIKE vbrp-fkimg,
    jun LIKE vbrp-fkimg,
    jul LIKE vbrp-fkimg,
    aug LIKE vbrp-fkimg,
    sep LIKE vbrp-fkimg,
    oct LIKE vbrp-fkimg,
    nov LIKE vbrp-fkimg,
    dec LIKE vbrp-fkimg,
    TOTAL like vbrp-fkimg,
    END OF itab2.
    TOP-OF-PAGE.
      WRITE:/50(40) ' CUSTOMER SOLD BY QUANTITY' CENTERED   ,2 'Page', SY-PAGNO.
      WRITE:/50(40) '----
    ' CENTERED .
      FORMAT INTENSIFIED on.
      WRITE:/2 SY-DATUM COLOR 3, SY-UZEIT .
       "WRITE:/1 S903-SPMON ."p_yearf.
      ULINE.
      "CENTERED.
      skip.
      "FORMAT COLOR COL_HEADING.
      ULINE.
      FORMAT COLOR 3.
      WRITE:/1 SY-VLINE,
        0 'PARTY' ,10 SY-VLINE,
        11 'NAME' ,40 SY-VLINE,
        41 'JAN' centered  , 50 SY-VLINE,
        51 'FEB',60 SY-VLINE,
        61 'MAR',70 SY-VLINE,
        71 'APR',80 SY-VLINE,
        81 'MAY',90 SY-VLINE,
        91 'JUN',100 SY-VLINE,
        101 'JUL',110 SY-VLINE,
        111 'AUG',120 SY-VLINE,
        121 'SEP',130 SY-VLINE,
        131 'OCT',140 SY-VLINE,
        141 'NOV',150 SY-VLINE,
        151 'DEC',160 SY-VLINE,
        161'TOTAL',170 SY-VLINE.
      FORMAT COLOR 3 on.
      ULINE.
    END-OF-PAGE.
    data wa_itab1 like itab1.
    DATA : mm(2) TYPE c,
    value type p decimals 2,
    total type p decimals 2,
    sum1 type p decimals 1,sum2 type p decimals 1,sum3 type p decimals 1,
    sum4 type p decimals 1,sum5 type p decimals 1,sum6 type p decimals 1,
    sum7 type p decimals 1,sum8 type p decimals 1,sum9 type p decimals 1,
    sum10 type p decimals 1,sum11 type p decimals 1,sum12 type p decimals 1,
    sum13 type p decimals 1,
    t_s LIKE vbrp-fkimg.
    "g_total like vbrp-fkimg.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_yearf TYPE SPMON,
    p_yeart type SPMON.
    SELECT-options:
                    p_kunag for VBRK-KUNAG , "no-extension no intervals,
                    s_werks for vbrp-werks no-extension no intervals obligatory,
                    s_vrkme for vbrp-vrkme no-extension no intervals obligatory.
    "p_matnr for vbrp-matnr no-extension no intervals,
    "p_augru for vbrp-augru_auft no-extension no intervals,
    "p_vbeln for vbrk-vbeln no-extension no intervals.
    RANGES : p_fkdat FOR sy-datum.
    RANGES: r_date FOR sy-datum.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS: NRW RADIOBUTTON GROUP g1,
    MWD RADIOBUTTON GROUP g1,
    RWS RADIOBUTTON GROUP g1,
    EDU RADIOBUTTON GROUP g1,
    Standard RADIOBUTTON GROUP g1 default 'X'.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    start-of-selection.
    break developer.
    case 'X'.
    when mwd.
    CONCATENATE p_yearf(4) p_yearf+4(2) '01' INTO p_fkdat-low.
    concatenate p_yeart(4) p_yeart+4(2) '01' into p_fkdat-high.
    p_fkdat-sign = 'I'.
    p_fkdat-option = 'BT'.
    CALL FUNCTION 'RE_LAST_DAY_OF_MONTH'
    EXPORTING
    i_datum = p_fkdat-high
    IMPORTING
    e_tt = p_fkdat-high+6(2).
    APPEND p_fkdat.
    *start-of-selection.
    SELECT *
    from VBRK
    INNER JOIN vbrp ON vbrk~vbeln = vbrp~vbeln
    INNER JOIN kna1 on vbrk~kunag = kna1~kunnr
    INTO corresponding fields of TABLE itab
    where
    vbrp~werks in s_werks and
    VBRK~KUNAG in p_kunag and
    VBRP~vrkme in s_vrkme and " 'M3' and
    VBRK~fkdat in p_fkdat order by KUNAG.
    *left outer join kna1
    **from S903 INNER JOIN kna1
    *ON VBRKKUNAG = kna1kunnr
    *INTO corresponding fields of TABLE itab
    *where
    *"vbrp~werks in s_werks and
    *VBRK~KUNAG in p_kunag and
    *VBRP~vrkme in s_vrkme and " 'M3' and
    *VBRK~fkdat in p_fkdat order by KUNAG.
    LOOP AT itab.
    mm = itab-fkdat+4(2). " Monthly for Ageing
    clear itab2.
    Read table itab2 with key KUNAG = itab-KUNAG.
    *IF SY-SUBRC EQ 0.                      " Record for Customer exists so modify existing record updating the quantities
         PERFORM itab2_rec USING 'M' mm.
      ELSE.                                  " Record for Cusotmer does not exist so Append a new record for Customer
         PERFORM itab2_rec USING 'A' mm.
      ENDIF.
    itab1-fkdat = itab-fkdat+4(2).
    *itab1-vrkme = itab-vrkme.
    itab1-KUNAG = itab-KUNAG.
    itab1-name1 = itab-name1.
    itab1-fkimg = itab-fkimg.
    APPEND itab1.
    clear itab1.
    ENDLOOP.
    SORT itab1 BY KUNAG fkdat name1.
    "delete adjacent duplicates from itab1.
    LOOP AT itab1.
    move itab1 to wa_itab1.
    AT NEW KUNAG.
    t_s = 0  .
    ENDAT.
    t_s = t_s + itab1-fkimg .
    AT END OF KUNAG.
    mm = itab1-fkdat.
    "break angle.
      IF SY-SUBRC = 0.                     " Record for Customer exists so modify existing record updating the quantities
    CASE mm.
                         " Record for customer does not exit so append a new record for customer
      WHEN '01'.
      itab2-jan = t_s  .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum2 = sum2 + itab2-jan.
      APPEND itab2.
      WHEN '02'.
      itab2-feb = t_s  .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum2 = sum2 + itab2-feb.
      APPEND itab2.
      WHEN '03'.
      itab2-mar = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum3 = sum3 + itab2-mar.
      APPEND itab2.
      WHEN '04'.
      itab2-apr = t_s  .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum4 = sum4 + itab2-apr.
      APPEND itab2.
      WHEN '05'.
      itab2-may = t_s.
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
       sum5 = sum5 + itab2-may.
      APPEND itab2.
      WHEN '06'.
      itab2-jun = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
      sum6 = sum6 + itab2-jun.
      APPEND itab2.
      WHEN '07'.
      itab2-jul = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum7 = sum7 + itab2-jul.
      APPEND itab2.
      WHEN '08'.
      itab2-aug = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
      sum8 = sum8 + itab2-aug.
      APPEND itab2.
      WHEN '09'.
      itab2-sep = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum9 = sum9 + itab2-sep.
      APPEND itab2.
      WHEN '10'.
      itab2-oct = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
        sum10 = sum10 + itab2-oct.
      APPEND itab2.
      WHEN '11'.
      itab2-nov = t_s .
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
      sum11 = sum11 + itab2-nov.
      APPEND itab2.
      WHEN '12'.
      itab2-dec = t_s.
      itab2-KUNAG = wa_itab1-KUNAG.
      itab2-name1 = wa_itab1-name1.
      itab2-total = wa_itab1-total.
      sum12 = sum12 + itab2-dec.
      APPEND itab2.
    itab2-total = itab2-jan + itab2-feb + itab2-mar + itab2-apr + itab2-may + itab2-jun + itab2-jul + itab2-aug + itab2-sep
    + itab2-oct + itab2-nov + itab2-dec .
    total = sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7 + sum8 + sum9 + sum10 + sum11 + sum12.
    IF MM = 'A'.  " Mode for Append
        APPEND itab2.
    ELSE.             " Mode for Modify
        itab2-KUNAG = itab1-KUNAG.
        itab2-name1 = itab2-name1.
        "MODIFY itab2 WHERE kunag = itab1-kunag.
    ENDIF.
    "loop at itab2  .
    on change of itab2-KUNAG." ,itab2-name1,itab2-jan,itab2-feb,itab2-mar,itab2-apr,itab2-may,itab2-jun,itab2-jul,itab2-aug,itab2-sep,itab2-oct.
              WRITE:/1 SY-VLINE,
                itab2-KUNAG   under   'PARTY' LEFT-JUSTIFIED ,0  SY-VLINE COLOR 2,
                itab2-name1   under     'NAME' LEFT-JUSTIFIED ,10 SY-VLINE,
                itab2-jan DECIMALS 1  under    'JAN' LEFT-JUSTIFIED,40 SY-VLINE,
                itab2-feb DECIMALS 1 under    'FEB' LEFT-JUSTIFIED,50 SY-VLINE,
                itab2-mar DECIMALS 1  under    'MAR' LEFT-JUSTIFIED,60 SY-VLINE,
                itab2-apr DECIMALS 1 under    'APR' LEFT-JUSTIFIED,70 SY-VLINE,
                itab2-may DECIMALS 1 under    'MAY' LEFT-JUSTIFIED,80 SY-VLINE,
                itab2-jun DECIMALS 1 under    'JUN' LEFT-JUSTIFIED,90 SY-VLINE,
                itab2-jul DECIMALS 1 under    'JUL' LEFT-JUSTIFIED,100 SY-VLINE,
                itab2-aug DECIMALS 1 under    'AUG' LEFT-JUSTIFIED,110 SY-VLINE,
                itab2-sep DECIMALS 1 under    'SEP' LEFT-JUSTIFIED,120 SY-VLINE,
                itab2-oct DECIMALS 1 under    'OCT' LEFT-JUSTIFIED,130 SY-VLINE,
                itab2-nov DECIMALS 1 under    'NOV' LEFT-JUSTIFIED,140 SY-VLINE,
                itab2-dec DECIMALS 1 under    'DEC' LEFT-JUSTIFIED,150 SY-VLINE,
                itab2-Total DECIMALS 1 under  'TOTAL' LEFT-JUSTIFIED,160 SY-VLINE COLOR 3,
                170 SY-VLINE COLOR 3.
                uline.
      "itab2-total = itab2-jan +value itab2-febitab3-maritab2-apritab2-mayitab2-junitab3-julitab2-augitab2-sepitab2-octitab3-nov+itab2-dec).
    "itab2-total = sum(itab2-jan)  .
    endon.
    "endloop.
    ENDCASE.
    ENDIF.
    "ENDFORM.
    ENDAT.
    ENDLOOP.
    ENDCASE.
    write:  sum1 DECIMALS 1  under    'JAN' LEFT-JUSTIFIED,40 SY-VLINE,
             sum2 DECIMALS 1 under    'FEB' LEFT-JUSTIFIED,50 SY-VLINE,
             sum3 DECIMALS 1  under    'MAR' LEFT-JUSTIFIED,60 SY-VLINE,
             sum4 DECIMALS 1 under    'APR' LEFT-JUSTIFIED,70 SY-VLINE,
             sum5  DECIMALS 1 under    'MAY' LEFT-JUSTIFIED,80 SY-VLINE,
             sum6 DECIMALS 1 under    'JUN' LEFT-JUSTIFIED,90 SY-VLINE,
             sum7 DECIMALS 1 under    'JUL' LEFT-JUSTIFIED,100 SY-VLINE,
             sum8 DECIMALS 1 under    'AUG' LEFT-JUSTIFIED,110 SY-VLINE,
             sum9 DECIMALS 1 under    'SEP' LEFT-JUSTIFIED,120 SY-VLINE,
             sum10 DECIMALS 1 under    'OCT' LEFT-JUSTIFIED,130 SY-VLINE,
             sum11 DECIMALS 1 under    'NOV' LEFT-JUSTIFIED,140 SY-VLINE,
             sum12 DECIMALS 1 under    'DEC' LEFT-JUSTIFIED,150 SY-VLINE,
             sum13 DECIMALS 1 under  'TOTAL' LEFT-JUSTIFIED,160 SY-VLINE COLOR 1.
    uline.
    regards
    Piroz

Maybe you are looking for

  • How to creat a view in

    Hi all, i am new to can u tell me how to creata a view. and how we can create node.and how we can create outbound plug and inbound plug. thanks & regards naveen

  • ITS Mobile Date Field Problemn

    In ITS Mobile I developed a screen which contains a date field. I click question button to select a date, it opens a new screen which includes a calendar. But I can not select a date because no clickable days in new date selection screen. What can i

  • The iReport's

    I'm now using iReport to generate a PDF file but the PDf file Can't Display any Chinese but only English my code are as below thanks to any help // set file name - it is in string reportFile String rFile = "classic.jasper"; // set or null hash map Ha

  • How to reset your security questions if you forgot

    How do you reset your security answers/questions if you have forgotten them?

  • MBP OS X Mavericks stuck on grey screen with Apple logo & spinning wheel

    My Macbook Pro has been dead for slightly more than 6 months now (I don't use it as regularly as my school laptop). A few days before its death earlier this year, I upgraded the OS from Mountain Lion to OS X Mavericks (not sure exactly which version)