Hoe top create summary and detail report using ABAP QUERY

Hi ,
Can any one suggest me how to create summary and detailed report using ABAP Quey.
Regards,
Raghu.

Hi,
Table Declaration
tables:mara,mast.
*Declaring the internal table
data: begin of itab_new occurs 0,
      matnr like mara-matnr,     "Material No
      ernam like mara-ernam,     "Material Created by
      mtart like mara-mtart,     "Material Type
      matkl like mara-matkl,     "Material Desc
      werks like mast-werks,     "Plant
      aenam like mast-aenam,     "BOM created
      stlal like mast-stlal,     "Alternative BOM
      end of itab_new.
select-options: p_matnr for mara-matnr.
CODE A : Retrieving the data from the database
     select  f~matnr f~ernam f~mtart f~matkl m~werks m~aenam m~stlal
     into table itab_new
     from mara as f inner join mast as m
     on f~matnr = m~matnr
     where f~matnr in p_matnr.
CODE B : Retrieving the data from the database.
    SELECT FMATNR FERNAM FMTART FMATKL MWERKS MAENAM M~STLAL
    INTO TABLE ITAB_NEW
    FROM MARA AS F INNER JOIN MAST AS M
    ON FMATNR = MMATNR
    WHERE F~MATNR = P_MATNR.
    SORT ITAB_NEW BY ERNAM.
loop at itab_new.
write:/5  itab_new-matnr,itab_new-ernam,itab_new-mtart,itab_new-matkl,itab_new-werks,itab_new-aenam,itab_new-stlal.
endloop.
*TABLES: MARA , MAST.
*DATA:BEGIN OF ITAB_NEW OCCURS 0,
             MATNR LIKE MARA-MATNR,
             ERNAM LIKE MARA-ERNAM,
             MTART LIKE MARA-MTART,
             MATKL LIKE MARA-MATKL,
             END OF ITAB_NEW.
   SELECT MATNR ERNAM MTART MATKL
   INTO TABLE ITAB_NEW
   FROM MARA
   WHERE MTART = 'T'
   ORDER BY MATNR ERNAM MTART MATKL.
*DATA: BEGIN OF ITAB OCCURS 0,
     MATNR LIKE MARA-MATNR,
     END OF ITAB.
Thank U,
Jay....

Similar Messages

  • Generating a report using ABAP query

    Hi All,
    I want to generate a anlytical report using ABAP query, There are 3 different transactions/steps have to be executed to get this data in an actionable form.
    1. MB52 - Unrestricted Stock
    2. ZCustomquery - Custom query in SAP R3
    3. Combine above two in a single report.
    Please suggest me how can i proceed,
    1. Example i have created query name called Finalrepot
    2. How can i call above zcustomquery and Transaction (MB52) in the Query.
    Thanks for your help
    Pradeep

    Hi,
    Check below link to create ABAP query (SAP Query)
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Best regards,
    Brijesh

  • Development of Reports using ABAP Query

    Hi
    can anyone please tell me about 'Development of Reports using ABAP Query' and how to use it in real time
    Thanks
    jay

    look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/b7/26ddebb1f311d295f40000e82de14a/frameset.htm
    A.

  • Interactive reports using ABAP query

    I have developed an ABAP query which prints the sales documents in ALV list display.
    In that  list display I would do develop a functionality is , when ever i double click on the sales doc number it will directly go to the VA03 transaction for the corresponding VBELN.
    Can anybody explain how to do this?

    Hi,
    When you double-click on any cell of alv, use this code to fetch the data of the line that you currently clicked, its working:-
    When you double click on the ALV line, you will have sy-ucomm = '&IC1'.
    So when you define a i_callback_user_command for the FM reuse_alv_list_display,
         i_callback_user_command           = 'COMMAND' " for User-Command
    and create it as:-
    FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
      DATA : ok_code TYPE sy-ucomm.
      ok_code = ucomm.
      CASE ok_code.
        WHEN '&IC1'. "for double click on alv line
          " your code
      ENDCASE.
    ENDFORM.
    As you have used selfield TYPE slis_selfield, the field selfield will hold all the values.
    To know on which row you have clicked and to retain that line, use code:-
    Suppose you are currently displaying data from internal table itab and corresponding to it you have work area wa.
    read table itab into wa index selfield-tabindex. "index value of line you clicked
    " now you have the contents of line that you double clicked currently
    Now to know the field name that you clicked, use:-
    selfield-fieldname " will fetch you the name of field that you clicked
    Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.
    Refer:-
    CASE selfield-fieldname.
      WHEN 'VBELN'.
        SET PARAMETER ID 'AUN' FIELD <wa-vbeln>. "value for work area for vbeln
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    ENDCASE.
    Hope this helps you.
    Regards,
    Tarun

  • Excess Inventory/Scheduled Receipts Report using ABAP Query.

    Hi All,
    I want to create a ABAP query for Excess inventory & Scheduled receipts in a single report. I have identified tables, fields and some extra calculated fields in the report. Here are the following tables and fields.
    EKPO-MATNR      ( Material number)
    EKPO-WERKS     ( Plant)
    MAKT-MAKTX       (Material Discription)
    MARC-MAABC      ( ABC indicator)
    LFA1-NAME1        ( Supplier name)
    MBEW-STPRS      (Total value)
    EKET-EINDT         ( Item delivery date)
    RIBOF-AMOUNT
    S939-SPWOC or S032-SPWOC
    Calculation fields : Value execess this week.extend value, over or under this week, onhand inventory for last week and this week.
    Here my question is, when i was creating a infoset, how do i maintain relationship or joins from one table to another table...Is there any sequence for the above tables? Pl suggest. When i was adding all the tables in a infoset and try join the tables...it says illegal join...
    Pl suggest me.
    Thanks for your help
    PRadeep
    Edited by: Venkata Pr Papulugari on Jul 18, 2008 1:37 AM

    Hi Gordon,
    What i need to display is the remainder of the transaction that was received... if it is zero (0), i don't want to display it.
    i.e.
    transact # 100 inqty = 5
    transact # 200 outqty =1
    I'd like to display
    transact # 100     qty on hand = 4
    right know the transaction # that i am displaying is transact # 200.
    And also, it needs to be warehouse oriented. because i can have multiple warehose transactions.... and i am getting that wrong too.
    Regards,
    Manuel Roman

  • How to create YTD and MTD reports using Sql Server 2008 r2 report builder 3.0

    Hi All,
    How can I create YTD report from the below data. please help me
    ProdA     ProdB     ProdC     Month     Year
    10       50        40          January      2012
    Data for full Year i.e. from Jan - December 2012
    50       90       100        January       2013
    Data for full Year i.e. from Jan - December 2013
    90       40         30        January        2014
    Data for full Year i.e. from Jan - Till Date 2014
    MercuryMan

    You can use a correlated subquery to calculate YTD in query behind. You can use APPLY operator for that
    so something like
    SELECT *
    FROM Table t1
    CROSS APPLY (SELECT SUM(ProdA) AS TotA,SM(prodB) AS TotB,SUM(prodC) AS TotC
    FROM Table
    WHERE Year = t.Year)t1
    And show TotA,TotB and TotC in the required total row
    Another method is to add required totals in SSRS by clicking on relevant group and choosing Add Total option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Use different Layouts for Summary and Details in Drill down report

    Hi All,
    I have a 2 level drill down report in ALV.
    The summary report has certain fields and the Detail report has different fields. Now my problem is that when i use a default layout (with all fields of summary report) for the summary report, and drill down to the detail report i'm missing the fields on detail that are not in Summary. And if i save the default layout as default (with all fields of Detail) and go back to sumary, I'm missing the some other fields on summary (which are not on detail report).
    Is there a way to make different default layouts for each of those summary and detail reports:
    Also as the layouts are choosen by the user, i cannot hardcode any particular layout;
    So if the user chooses a layout for detail; it has to stay the same layout for the detail report if he goes to summary and then back to detail; unless the user changes the layout again.
    I'm using two different Layout types for each report. but i still cannot get the desired effect.
    Data:
          gt_layout_s             type slis_layout_alv,
          gt_layout_d             type slis_layout_alv,
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = g_repid
          is_layout                = <b>gt_layout_s</b>
          i_callback_top_of_page   = g_top_of_page
          i_callback_user_command  = g_user_command
          i_callback_pf_status_set = g_status
          i_save                   = g_save
          is_variant               = gs_variant
          it_fieldcat              = gt_fieldcat[]
          it_events                = gt_events[]
        importing
          es_exit_caused_by_user   = gs_exit_caused_by_user
        tables
          t_outtab                 = it_summary.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = g_repid
          is_layout                = <b>gt_layout_d</b>
          i_callback_top_of_page   = g_top_of_page
          i_callback_user_command  = g_user_command
          i_callback_pf_status_set = g_status
          i_save                   = g_save
          is_variant               = gs_variant
          it_fieldcat              = gt_fieldcat[]
          it_events                = gt_events[]
        importing
          es_exit_caused_by_user   = gs_exit_caused_by_user
        tables
          t_outtab                 = it_detail_disp.

    Here is how you differentiate between the layout of two different grids. There is the parameter, IS_VARIANT in the function. You usually leave it empty or pass only the report name and username. <b>What you need to do is to pass unique string for each grids to the HANDLE field of the parameter IS_VARIANT.</b> You can probably hard code it as HEADER and DETAILS in your case. Once that is done, system identified that these two different layout for different grids.
    Regards,
    Ravi
    Note : Please mark all the helpful answers<u></u>

  • How to create Profit and loss account using report painter

    Dear All,
    Can some one guide me as to how to create Profit and loss account using report painter.
    If some one can share the document having steps to be done,would be of great help.
    Thanks in advance.
    Regards,
    Gokul

    Hi,
    Could you please re-phrase your question? As the report painter is a reporting tool I assume you want to report on P&L accounts and not u201Ccreateu201D them. A few more details on what you intend to report would be useful.
    Regards
    Karl

  • Master Detail Report using Report Query

    I am using APEX Report Query component to try and create a mater/detail report with BI plug-in. The Report Queries doesn't give you mush flexibility as each query is independent of the other. I'm trying to see if I need to create 2 queries or 1 AND what option would let me create a master detail report like so in BI Desktop:
    Employee: Bob ID:100 Dept: HR
    Jobs
    Job 1
    Job 2
    Job 3
    Employee: Tom ID:200 Dept: ACCt
    Jobs
    Job 1
    Job 2
    Job 3
    Option1.
    I could combine the Employee Job info with the Employee info, but that would report the Employee info for every Employee Job. I didn't think that was good.
    <Rowset1_Row>
    <EMPID>
    <NAME>
    <DEPT>
    <JOB>
    </Rowset1_Row>
    Option 2.
    I could create 2 queries. The 1st getting all of the Empoyee info. The 2nd getting all of the Employee jobs.
    <Rowset1_Row>
    <EMPID>
    <NAME>
    <DEPT>
    <JOB>
    </Rowset1_Row>
    <Rowset2_Row>
    <EMPID>
    <JOB>
    </Rowset2_Row>
    <Rowset2_Row>
    <EMPID>
    <JOB>
    </Rowset2_Row>
    Any advice?
    Edited by: bobmagan on Jun 1, 2009 5:29 AM

    Can you check for the settings please.
    Thanks and Regards
    Riyas

  • Created Webi report using BEx Query.

    Hi All,
    I am going to upgrade in BW and using BEx  & Webi Report. I have created webi report using BEx query. Now I need to test data in webi report.
    Can anyone tell me how to test data?
    Regards,

    Hi,
    compare the webi report data with Bex report. more you can compare webi report with SAP R3 system for random records.
    Thanks,
    Amit

  • How to create a master detail from using jdeveloper

    i am using developer 9.0.2 is it possible to create a master detail from using developer like in forms and also the detail form should be in tabular form
    thank u

    Yes. Just use BC4J and JClient
    Frank

  • How to fillter both main and detailed reports

    Hi im usine 2 reports
    main report like productcategory,amount
    detailed report like productcategory,probname,id,loc,coun,amount
    if i click on main report any value then it open the detailed report and show that particular value details only
    im using acion link to to open detailed report with all values
    how it
    im sunig master detailed but im not get that
    plz help me

    Hi,
    if you want to see all the records in detail report using action link, then remove is prompted filters from the detail report.
    Thanks
    Edited by: Maqsood Hussain on Dec 5, 2012 9:44 PM

  • How to create a master detail form using single table

    Hi,
    how to create a master detail form using single table.
    Regards,
    M. Satish

    Hi
    how to create a master detail form using single table.Make the Master ur pks the details the rest of ur data base field in the detail it's a mater of organizing fields on a form M-Detail...
    Now What ?
    Regards,
    Amatu Allah

  • Backup SQL Agent Jobs - whats the difference between "create to" and "drop to" using "script job as"?

    Hi,
    This should be straightforward, but being new to SQL Server 2008, can someone advise the difference between "create to" and "drop to" using "script job as"?
    Thanks
    IT Support/Everything

    hello,
    "CREATE TO" create a CREATE statement for the job, e.g. to execute this script on a other server to create the same job there.
    "DROP TO" means you get a script to delete an existing job.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SSRS report using mdx query to display sales of product by yearwise

    There is a requirement to create SSRS report as 
    Product                         +Calender2011               -Calender 2012            +Calender 2013      
             + Calender 2014
    Jan12 Feb12 Mar12...
    Product 1 50    100       200 ..
    Product 2 150    900       200 ..
    Product 3 250    180       900 ..
    Product 4 450    100       200 ..
    Product 5 50    100       200 ..
    Product 6 50    100       200 ..
    When I click on Calender2011 corresponding all months of 2011 has to appear and likewise for Calender2012, CalenderN 
    The MDX query I have like as follows-
    Select    Non Empty{
    [Measures].[Product1], 
     [Measures].[Product2], 
     [Measures].[Product3], 
     [Measures].[Product4],
      [Measures].[Product5], 
      [Measures].[Product6], 
      [Measures].[Product7], 
      [Measures].[Product8], 
      [Measures].[Product9], 
      [Measures].[Product10], 
      [Measures].[Product11], 
       } ON Rows ,
       Non Empty  { ([Dim Calendar H].[Year Name].[Year Name] ) *([Dim Calendar H].[Month name].[Month name])
     ON COLUMNS
      FROM ( SELECT ( { [Dim Calendar H].[Year Name].&[Calendar 2014], 
     [Dim Calendar H].[Year Name].&[Calendar 2013], 
     [Dim Calendar H].[Year Name].&[Calendar 2012], 
     [Dim Calendar H].[Year Name].&[Calendar 2011] } ) 
     ON COLUMNS 
     FROM [Cube]) 
    Please help me. 
    Advance thanks...

    Hi Afans,
    According to your description, you want to create a drill-down report using SQL Server Analysis Services database, right?
    In this case, you need add the Year and Month fields to the column group, and set the Month column can be toogled by Year column group. I have teste it on my local environment, here is the sample query for your reference.
    select [Measures].[Internet Sales Amount] on 0,
    [Product].[Category].members*[Date].[Calendar].[Calendar Year].members*[Date].[Month of Year].members on 1
    from
    [Adventure Works]
    Reference
    http://popbi.wordpress.com/2012/03/02/ssrs-how-to-add-a-column-group-to-an-existing-table/
    http://msdn.microsoft.com/en-IN/library/dd207042.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • How to add an image in a hub section header

    Hi. I want to add an Image in a hub section header. Is it possible to add an image with the section header so that like the section header when I click on the image it would also navigate me to that section page ? samEE

  • Environment....

    Hi all, I'm bored so I just thought i'd throw this into the mix for fun! Having been a Cubase/Nuendo user up until earlier this year and plunging for a Mac Pro and LP7, I for one am glad to see the environment has been shifted toward the back of the

  • Error in SQL Code

    Hi, My below code works fine if i execute it... SELECT A.cno ,      B.inceptiondate      FROM A LEFT OUTER JOIN select TRIM(cno) cno,      max(inceptiondate) inception_date      FROM [email protected] group by cno)B ON A.cno=B.cno AND A.inceptiondate

  • Two datatables in a form problem. Please help!

    Hi, I have two datatables in one form. Every row renders an input which is bound to a Double propery of a list item. I fill both tables with some data and in one input i enter a String. I submit the form, the conversion fails and I come back to the s

  • Can't watch any video on my Curve 8530!

    I've looked around recently to try to find an answer to why my BlackBerry Curve 8530 will not play videos, and nothing I've read seems to work. When try to play a YouTube video, one of the following 3 errors occurs: 1) "The device media processor is