Summary Column and repeating frames

I have a report that shows customer orders(1 per page). If a customer orders 3 pizzas and 2 of them are identical, same size, same toppings, crust i want the quanitity column to sum as 2. So for this example instead of having 3 rows with two of them being identical with the quanity column dispalying 1 for each, I want 2 rows with quanity showing 2 for the identical pizzas and 1 for the other.
I have everything in the same group/repeating frame right now and it is showing all 3 pizzas on there own row. Do i need a summary column and change my groupings? How can i achieve this the summed quanity for identical orders?
CURRENT:
Crust......Toppings......size.....quantity
Thin.......Cheese........small....1
Thin.......Cheese........small....1
thick.......meat.........large....1
NEW:
Crust......Toppings......size.....quantity
Thin.......Cheese........small....2
thick.......meat.........large....1

Forget summary columns. This can easily be just a group by query:
with t as (select 'Thin' crust, 'Cheese' top ,'Small' sze, 1 qty from dual
           union all
           select 'Thin' , 'Cheese'  ,'Small' , 2 from dual
           union all
           select 'Thick' , 'Meat'  ,'Large', 1  from dual
select t.crust, t.top, t.sze, sum(qty)
from t
group by crust,top,sze;
CRUST TOP    SZE     SUM(QTY)
Thin  Cheese Small          3
Thick Meat   Large          1

Similar Messages

  • Multiple child tables and repeating frames

    I have three tables(A,B,and C) where A is the parent of both B, and C. There is no relation between B and C.In the data model, There are three queries, one to each table and I have set up the parent/child relationship in the data diagram.
    In the layout Window I have a master repeating frame which breaks on each record for A. And within that master frame I have two constrained repeating frames for both B and C in that order designed to print all on the same page.
    The problem is that when there is more data for B, the extra records are not displayed .For overflow conditions, I would want A and C information to be reprinted along the top and bottom of each successive page while the middle section would contine on with the extra B records. (I realize this is similar to having header (A) and footer (B) information in the margin, but it is not quite the same thing since B and C depend on A's repeating frame.)

    I'm assuming that all the rows of (C) can always fit onto the page and don't overflow to the next. If so then you'll need the following:
    A Group frame "M_A" that completely surrounds (A) fields
    A Group frame "M_B" that surrounds (B) and defines the space available for (B) to print
    A Group frame "M_C" that surrounds (C)
    Set the properties against each frame:
    M_A:
    Vertical Elasticity: "Variable"
    Print Object On: "All Pages"
    Base Printing On: "Enclosing Object"
    M_B:
    Vertical Elasticty: "Fixed"
    (Re-size this frame in the layout to define the space available for (B))
    M_C:
    Vertical Elasticity: "Variable"
    Print Object On: "All Pages"
    Base Printing On: "Enclosing Object"
    You should end up with:
    A.....
    B1....
    B2....
    B3....
    C1....
    C2....
    A.....
    B4....
    C1....
    C2....

  • ALV report with dynamic columns, and repeated structure rows

    Hey Guys,
    I've done some ALV programming, but most of the reports were straight forward. This one is a little interesting. So here go the questions...
    Q1: Regarding Columns:
    What is the best way to code a report with columns being dynamic. This is one of the parameters the user is going to enter in his input.
    Q2: Regarding Rows:
    I want to repeat a structure(say it contains f1, f2, f3) multiple time in rows. What is the best way to do it? The labels for these fields have to appear in the first column.
    Below is the visual representation of the questions.
    Jan 06  , Feb 06, Mar 06....(dynamic)
       material 1
    Current Stock
    current required
    $Value of stock
       material 2
    Current Stock
    current required
    $Value of stock
       material 3
    Current Stock
    current required
    $Value of stock
    Thanks for your help.
    Sumit.

    Hi Sumit,
    Just check this sample from one of the SAP site
    ABAP Code Sample for Dynamic Table for ALV with Cell Coloring
    Applies To:
    ABAP / ALV Grid
    Article Summary
    ABAP Code Sample that uses dynamic programming techniques to build a dynamic internal table for display in an ALV Grid with Cell Coloring.
    Code Sample
    REPORT zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring.
    * Build a field catalog dynamically and provide the ability to color
    * the cells.
    * To test, copy this code to any program name and create screen 100
    * as described in the comments. After the screen is displayed, hit
    * enter to exit the screen.
    * Tested in 4.6C and 6.20
    * Charles Folwell - [email protected] - Feb 2, 2005
    DATA:
    r_dyn_table TYPE REF TO data,
    r_wa_dyn_table TYPE REF TO data,
    r_dock_ctnr TYPE REF TO cl_gui_docking_container,
    r_alv_grid TYPE REF TO cl_gui_alv_grid,
    t_fieldcat1 TYPE lvc_t_fcat, "with cell color
    t_fieldcat2 TYPE lvc_t_fcat, "without cell color
    wa_fieldcat LIKE LINE OF t_fieldcat1,
    wa_cellcolors TYPE LINE OF lvc_t_scol,
    wa_is_layout TYPE lvc_s_layo.
    FIELD-SYMBOLS:
    <t_dyn_table> TYPE STANDARD TABLE,
    <wa_dyn_table> TYPE ANY,
    <t_cellcolors> TYPE lvc_t_scol,
    <w_field> TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
    wa_fieldcat-fieldname = 'FIELD1'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 1'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    wa_fieldcat-fieldname = 'FIELD2'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 2'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table, save fieldcatalog to pass
    * to ALV call. The ALV call needs a fieldcatalog without
    * the internal table for cell coloring.
    t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    * CALENDAR_TYPE is a structure in the dictionary with a
    * field called COLTAB of type LVC_T_SCOL. You can use
    * any structure and field that has the type LVC_T_SCOL.
    wa_fieldcat-fieldname = 'T_CELLCOLORS'.
    wa_fieldcat-ref_field = 'COLTAB'.
    wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table including the internal table
    * for cell coloring.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = t_fieldcat1
    IMPORTING
    ep_table = r_dyn_table
    EXCEPTIONS
    generate_subpool_dir_full = 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.
    * Get access to new table using field symbol.
    ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
    CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
    ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere. Field names are
    * known at this point because field catalog is already
    * built. Read field names from the field catalog or use
    * COMPONENT <number> in a DO loop to access the fields. A
    * simpler hard coded approach is used here.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'ABC'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'XYZ'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'TUV'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'DEF'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. In this example, a test on
    * FIELD2 is used to decide on color.
    LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    * Get access to internal table used to color cells.
    ASSIGN COMPONENT 'T_CELLCOLORS'
    OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
    CLEAR wa_cellcolors.
    wa_cellcolors-fname = 'FIELD2'.
    IF <w_field> = 'DEF'.
    wa_cellcolors-color-col = '7'.
    ELSE.
    wa_cellcolors-color-col = '5'.
    ENDIF.
    APPEND wa_cellcolors TO <t_cellcolors>.
    MODIFY <t_dyn_table> FROM <wa_dyn_table>.
    ENDLOOP.
    * Display screen. Define screen 100 as empty, with next screen
    * set to 0 and flow logic of:
    * PROCESS BEFORE OUTPUT.
    * MODULE initialization.
    * PROCESS AFTER INPUT.
    CALL SCREEN 100.
    * MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
    IF r_dock_ctnr IS INITIAL.
    CREATE OBJECT r_dock_ctnr
    EXPORTING
    side = cl_gui_docking_container=>dock_at_left
    ratio = '90'.
    CREATE OBJECT r_alv_grid
    EXPORTING i_parent = r_dock_ctnr.
    * Set ALV controls for cell coloring table.
    wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    * Display.
    CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = wa_is_layout
    CHANGING
    it_outtab = <t_dyn_table>
    it_fieldcatalog = t_fieldcat2.
    ELSE. "grid already prepared
    * Refresh display.
    CALL METHOD r_alv_grid->refresh_table_display
    EXPORTING
    i_soft_refresh = ' '
    EXCEPTIONS
    finished = 1
    OTHERS = 2.
    ENDIF.
    ENDMODULE. " initialization OUTPUT
    Regards
    vijay

  • Summary columns and report

    Hi,
    We are using Oracle PL/SQL procedure to dynamically generate SQL to generate a report using HTMLDB.
    Could any one give me an idea about how to indirectly instruct HTMLDB to display 'sum' value if some of the fields are selected to be part of report? It is not possible to use report attribute 'sum' function, as we don't know what fields are on the report.
    Thanks,
    Neelam

    Even if you dont know what specific fields are on the report, you need to know their column positions at least. This way, you can use the Generic Columns on the report definition go to Report Attributes and select the Sum checkbox for column Cnn.
    If neither column positions, nor number of columns nor column names are known, well then, you are out of luck. Dynamic SQL is one thing, reading your mind is another! :)

  • How to get the number of rows in a repeating frame ?

    Hi all,
    When I launch a report from forms then sometimes there are data in the report and sometimes there are no data. And the problem is that when there are no data then the frame containing the repeating frame is still displaying and a blank page displays on the report.
    So I want to get the number of rows from the repeating frame so that I can code a format trigger on the frame to display or not the enclosing frame depending on the existence of data from the repeating frame.
    Thank you very much indeed.

    Dear Friend,
    You can achieve this. Define a summary column (say cnt). Select summary type as "COUNT". select any one of columns that are getting displayed in your repeating frame as summary column and provide "reset at" group name (or set this to report if you are defining this field at report level) . This "cnt" variable will contain how many records that will be fetched for your repeating frame (i.e. Group of Repeating frame). You can use this "CNT" variable in your format trigger.
    In this case there is no need to write before report trigger or anything.
    Regards,
    Manish Trivedi

  • How to put non-repeating field in a repeating frame?

    I have a formula field that creates the header for a list in a repeating frame. I seem to be in a quandary though-if I include the field inside the repeating frame the header gets repeated. If I put it outside the frame I get an error 'Field references Column at a frequency below its group'. If I move the formula column to the parent query it works except in the case where the child query returns no rows-then I get the header with no data.
    So, I either need a way to display the header inside the repeating frame, but only once, or I need a way to suppress the header when the child query returns no rows.

    So, I either need a way to display the header inside the repeating frame, but only once, or I need a way to suppress the header when the child query returns no rows.You can try one idea. Keep the formula column in detail group and create one more summary column as serial number for the detail records so in repeating frame place that field (formula column) in repeating frame and use the PL/SQL code for that field as below...
    IF :serial_no = 1 THEN
      RETURN TRUE;
    ELSE
      RETURN FALSE;
    END IF;Then it should display for the first record only.
    -Ammad

  • Repeating frame with anchor

    Hi all,
    I have a repeating frame in a report and it is anchored to a text field object (variable height). This repeating frame is Across/Down mode, but its behavior is like a Down mode repeating frame. Could anyone help me?
    Att.
    Diogo Domanski de Souza
    PS: I've already verified the width of the repeating frame and it fits twice per row.

    For easy to illustrate, let's call the variable height text field F_1, and repeating frame R_1. When you anchor from R_1 to F_1, the position of the anchor is very important and it affects the location and formatted size of R_1.
    For example, if the anchor starts on the left-top corner of R_1 and ends on the left-bottom corner of F_1, that means formatted R_1 and F_1 will anchor together with 0% on the left of F_1 and 0% on the left of R_1 from the original position. In this case, you should see two columns per row.
    If the anchor is in the top-middle of R_1 and bottom-middle of F_1, that means formatted R_1 (which has different width than you see on the layout model because it could expand across) and F_1 will anchor together from middle of R_1 (50%) to middle of F_1 (50%). Because of the anchor condition, you should notice even the left position of formatted R_1 would be different than on the layout model if R_1 still can contain more than one column.
    In summary, the anchor is defined based on the percentage of formatted object. Once you understand that, you can adjust the position of the anchor to achieve what you want.
    Hope this helps.
    Thanks,
    -Shaun

  • How Do I add new fields to Repeating Frames in existing Report

    Hi,
    How do I add new fields to Repeating Frames in existing Report. The Report has 2 GRPFR, 1 HDR and 2 Repeating Frames. I would like to add a new field(column) to inner most repeating frame. I added the new golumn to QUERY and GROUPs in Data Model. After adding the new column to inner most Repeating Frame in Layout Model, the Layout model is losing all other frame and it is showing only the modified one.
    How do I add new column to repeating frames without disturbeing other frames.
    Any hellp will be appreciated!!!!!!!!!!!.
    I am using Oracle Reports 6i.
    Thanks,
    Ravi.

    you must work in your layour editor
    expand your repeating frames do it more big
    for add your new items or field. after you inserted or add, can you put more little your repeating.
    too can you to do one copy of one field in your repeating frame and assign it in his source your new item in your data model.
    normally i begin with the principal frame and go one by one internally.

  • Can I reference a Summary Column in my sql query?

    Basically the subject asks it all. I have a very complex report that has many data linked queries from the "main" query. One of these data linked queries has a sub-query within it that references the primary key of the main query. I can't data link (I can, but it's useless) using this field as it's a sub-query that needs the link, and that link specifically. I've tried to create a Summary Column that gives me the "First" (and only, so it's safe) in order to reference it in the SQL block, but no go. I'm thinking this isn't even possible? Anyone have any ideas? Right now I'm referencing it as I would in a PL/SQL block (:CS_PK), but it's just treated as a parameter that's never passed. Doesn't read the summary column. Hmmm... I'm stuck.

    Hi all... this report is still not completed. I've tried the summary column, and created a formula column that sets the user parameter to the primary key that's needed elsewhere. The report runs, no errors, but my best guess is that it's simply not reading that formula column. Here's my formula column:
    function CF_1FORMULA0024 return Number is
    begin
    if :tblassessmentinst is null then
    :tblassessmentinst := :CA_ASSESS_INST;
    elsif :tblassessmentinst is NOT null then
    :tblassessmentinst := :CA_ASSESS_INST; -- this WAS :tblassessmentinst but not working with prod ver, so delay
    else
    :tblassessmentinst :=0;
    end if;
    return(:tblassessmentinst);
    end;
    For testing, I display both the :tblassessmentinst on the report, as well as this formula column. The formula column always displays the correct number, but the :tblassessment only displays 1 (of many) records that need to be displayed. It's like it's not refreshing the formula column for each record? Again, still super stumped, so throw any ideas my way please.
    Thanks again,
    TL

  • Multiple repeating frames with same source printing same Values

    Dear all,
    I have a report which is having more than 10 repating frames in this 4 repating frames have same source assingned,during the report execution just before printing the repeating frames at various levels am inserting records into the source table assignd to the 4 repating frames.i actually want the repeating frames to print values i just inserted in to the table,diffrent repeating frames should print diffrent values.
    i have put source query like this;
    select * from <table> where print_status is null.
    just before printing the repeating frames am inserting values in to this table
    insert into <table> values ();
    print repeating frame 1
    insert
    print repeating frame 2
    insert
    print repeating frame 3
    insert
    print repeating frame 4
    in this particular case the report is printing only one row which i have inserted before printing the repeating frame 1.(basically the query is not refreshing at various grups)
    I want to print records which is inserted at each level .using one source query and 4 diffrent repeating frames.
    Hope am clear with my query.

    Dear Kumar,
    You are exactly right, but during the execution of the report at different interval I am modifying the data of the source table.
    Dear Andreas,
    Currently am modifying an existing report which is designed few years before, and having hell lot of frames and repeating frames and I need to include the above said portion between these repeating frames. The major reason why i tried to adopt this method is, during the execution of the report at each different intervals I am doing some calculation and then inserting the results into a global temporary table, again the same global temporary table am trying to print it in different places .Since I have multiple rows to print from this table I am using a repeating frame.
    I have resolved this issue using packages and assigning values into packaged variables. But I had a gut feeling that declaring too much variables might confuse others especially some other developer.
    Edited by: mayannajeeb on Jun 8, 2010 12:27 PM

  • Repeating Frame leaves blank area on next page before record

    I have a report with multiple repeating frames. Near the bottom of the first page the last repeating frame starts to print. If there are too many records to fit on the first page, they show up on subsequent pages. That is OK. However, on the 2nd, 3rd, etc. pages the records are part way down the page with much blank space between them and the header above.
    I would like the records to start at the top of the next page just beneath the header. Also, because of another repeating frame before this one, I can't even be sure if this particular frame will always start printing on the first page.
    I have tried properties such as page break, print object on, page protect, etc. They hve not resolved this issue to date.
    Thanks in advance from a beginner.
    DT

    hello david
    in this case you must consider what is printed on next pages ... for this i recomend newbie to colorize each frame and repeating frame to see what is there. from your describtion is possible that there are some objects on your frame with print condition set only to first page ... so they is not displayed on second, ... pages - this could happen f.e. with added descriptions, colmn heading, ... so my advice is to look why the space is there and then (maybe) make a correction ...
    hth
    petr valouch, brainbench mvp for oracle rograming, http://www.brainbench.com

  • How to make an order on repeating frame using Formula Column?

    Hi All,
    I have a repeating frame dependent on some query, how to make an order on this repeating frame using a formula column defined in its group and dependet on values from the query?
    Note: I'm using Reports 6i

    Place your formula column at the top of the itm group and set the BREAK_ORDER to assc.. or desc...
    Hope this helps
    Hamid
    if problem solved, close the thread.

  • Is it possible to show the same repeating frame in 2 columns?

    Hello, and thank you all in advance for any help!
    Here is the situation:
    I have simple report with 1 repeating frame and 3 data columns in it.
    I want to be able to have a second column on each page that continues the data from the repeating frame. That is to say, one the left the data would go from top to bottom like normal, then instead of going to page 2, it would go into a column to the right on the same page.
    The repeating frame is small enough to fit at least 2 of them horizontally.
    I cannot seem to find the way to make this layout work. Is it possible?
    Thanks again,
    -Arin

    Nevermind everyone!
    I got it to work with Print Down/Across...silly me.
    Thanks anyway!
    -Arin

  • Rep-1338 Column mode not allowed on repeating frame

    I am new to Reports Builder (9i) and am having difficulties with the column mode option.
    I guess i have data in a repeating frame which i would like to appear as 3 columns.
    How do i go about doing this?
    Apologies for the lack of info as i am not sure what you guys need to help me out.
    Any pointers,hints or even answers are truly appreciated.
    Fec

    basically at the moment there is are 2 columns. Name and Address. It is grouped by name so the output will look something like this.
    Name: ¦ Address: ¦
    John Smith 1 This Street
    1 That Street
    4 That Street
    1 Over Street
    12 My Street
    80 Her Street
    I would like it to appear like this
    Name: ¦ Address: ¦
    John Smith 1 This Street 1 That Street 4 That Street
    1 Over Street 12 My Street 80 Her Street
    ie split the Address column into 3 columns and 2 rows

  • Using LEVEL Pseudo column to format repeating frame

    I am trying to display a hierarchy in Reports. I use the 'Connect By' Clause in SQL and gather the hierarchical data, and want to display the results in a tree fashion. How can I do it?
    I only come up with one answer, to use the LEVEL PSEUDO-Column and indent the repeating frame based on the value for LEVEL. I want to know how I can set the X and Y co-ordinates of the repeating frame dynamically?
    Please help me with this if you have other ideas?
    Thanks.
    -Shan

    Unfortunately, you can't programmatically set the geometry (x,y, width, height) values of any objects in the reports output.
    The best you can do is have another object (or number of objects) that are turned on/off and then use collapsing anchors and format triggers to move the repeating frame to the left. If you only have one object, you can set it's horizontal expansion to variable and then fill it with a number of characters to get the desired "indent".

Maybe you are looking for

  • How do I use the "What's Here" function in Google Maps on my Mac?

    Being a new convert to Mac I was used to using right-click to access the "What's Here?" function in Google Maps on my old Windows PC. How do I use it on the Mac?

  • MacBook Pro Software/Gaming software help??

    Ok, First of all im planning in getting myself a MacPro 13" This xmas for myself, And i had a couple questions. First of all: 1. Does Mac Pro already come with Mac OS X Snow Leopard?? Or do we have to buy the software also? 2. Would it be used for a

  • Enhancement request apex 4.0: fieldset

    Hallo, First thx a lot for the 3.1 version. The new features are realy great. I love the interactive report - showing this to the boss brings a lot of sympathy for apex - it's possible to implemnent this in just a view minutes and ready to play aroun

  • Issues while readin SQL server via ODBC connection

    Hi Experts, I havea SQL server db as a source. I have configured the Datastore using ODBC connection. Developed a job which simply reads a table and populates into a flat file. when we run the job, it doesnt show any progress, it just stops after a l

  • Treo 750 with windows mobile 5 and windows 7 compatability

     Help please. Can I get a update/download from microsoft for the windows 5 mobile o/s on my treo 750.  To make it compatible with windows 7 ? Post relates to: Treo 750 (AT&T)