Alternatives to display 3x3 grid of merchandise

so I was looking through Ben Forta's code for their merchDisplay custom tag from the Web Application Construction Kit CF8  and was surprised so see they perform a select / where clause on every item of merchandise displayed on the page.
Effectively they do this on the page that displays merchandise
<cfquery getMerch cachedwithin 0,1,0,0>
select *
from merchanidse
</cfquery>
<cfloop query getMerch>
   <cf_MerchDisplay merchID=#merchandiseID#>
</cfloop>
the <cf_MerchDisplay> custom tag has this code in it
<cfquery name="getMerch" datasource="#APPLICATION.dataSource#" cachedWithin="#createTimeSpan(0,1,0,0)#">
SELECT *
FROM 00_merchandise
WHERE merchandise_ID = #ATTRIBUTES.merchID#
</cfquery>
<cfoutput>
     #merchandise_title#
</cfoutput>
My question is, doesn't performing an individual select / where on each item of merchandise impact performance ? Or because it's cached, does it not matter ?
My alternative is to not have the custom tag and to just use the initial select query to <cfoutput>merchandise_title(1), merchandise_title(2), merchandise_title(3) etc... ?

Is that really the code from the CFWACK?  Dear god.
Obviously (?) one should neither be doing SELECT *, nor should - as you surmise - be looping over one query, using data from it to call another query per row.  That's really really poor practice.  I don't care whether the code's been simplified to demonstrate some tangential technique, there's no excuse for encouraging coding like that, especially to an unwitting newbie audience, which is the audience of those books.
Whoever wrote that code - IMO - should be shot.
Adam

Similar Messages

  • What is the  difference between list display and grid display in alv report

    Hai genious
    i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me  what is the main difference between list display and grid display in alv report
    thanks&regards
    chinnu

    Hi ,
    1. For all practical purposes, they are the same.
    2. Some differences:
    a) from abap coding point of view,
    alv list is done with Function modules,
    alv gris can also be done with FM,
    but can also be done using OO concepts.
    b) Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    c) ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    d) ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    e) In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    I hope it helps.
    Regards,
    Mamta
    Edited by: Mamta Verma on Nov 27, 2008 6:41 AM

  • Reg. can we display alv grid using field groups (extracts)

    Hi,
    can we display alv grid using field groups (extracts). is this possible. i have to develop a blocked alv.
    tnks
    Yerukala Setty

    No, you will need the data in an internal table to use ALV.
    Cheers
    Allan

  • Report to display in Grid for VAL10C TC even if I dnt select any variant

    Hi everybody,
            I am facing the problem with VL10C trasaction code. It is displaying report in normal list if we dnt select any variant. But I want to display in grid .
    I have tried through settings for managing the layout but I was invain.
    If select any variant then it is displaying in grid.
    But with out grid how to display the report in grid.
    its an urgent issue.
    eagerly waiting for reply.
    Thanks and regards
    Jp

    HI,
    In the Third Button of Save Layout.Check the USer Specific settings of the Report Layout and save the Varaint.This will help.
    Bala.M

  • Problem in displaying Alv grid output  using oops........

    hi,
    i have two problems in displaying ALV grid output Using Oops.
    1) How to modify the fieldcatalog after we getting a field catalog using general FM.
    2) initialy it is displaying 13 fields but there are 63 fields .
       eventhough we chage the layout to 63 fields it is displaying only 13 fields , these 13 fields may be different based on our selection but count  of displayed fileds are same . how can display 63 fields at a time .

    Hi,
    You can chnage using below code:
    loop at gt_fieldcat.
    if <gt_fieldcat-field_name> = 'FIELDNAME'.
    endif.
    modify gt_fieldcat.
    clear gt_fieldcat.
    endloop.
    Make sure that all the field should not have no_out = 'X' and tech = 'X'.
    Thanks,
    Sriram Ponna.

  • Module Pool for displaying the Grid values in Matrix format

    Hi Experts,
    I have one requirement which as follows,
    In Module pool program i need to display the Grid Values in Matrix format i.e,
    Row = Color
    Column = Size
    Like what we can see in Sales order or Purchase Order if you click Grid Entries Button.
    Can you Please Help me out.
    Thanks n Advance.
    Logu

    Hi
    the sources ate the function groups WMMB and WMMA.
    In a new release you should find the function module MGW_UTILITIES_MATRIX_SHELL_RA
    the report RWRFMATCHARVAL is a good example
    Regards
    Björn

  • Set personal thumbnails in the 3x3 grid/ new tab view?

    Hi there,
    is it possible to set personal thumbnails in the 3x3 grid/ new tab view? E.g. I doN't want the current facebook page to be shown as a thumbnail but a big blue facebook-logo.
    Does anyone know about an Add on that's able to do that?
    Thanks in advance.

    This extension will create the 3 "user" files for you, and gives you an interface within Firefox for editing those files. <br />
    http://webdesigns.ms11.net/chromeditp.html

  • Hide some cells while displaying ALV GRID !

    Hi guyz!
        Back with lill query,
        While displaying ALV GRID using REUSE_ALV_GRID... FMs ,i need to hide
        some cells by default, when the lists is generated.But those cells should
        be  availble to be displayed by the user from ALV layout settings.
        Please advise
    Thanks
    jahan

    Hi, Check for fm documentation.
    Only relevant if layout parameter
    LAYOUT-GET_SELINFOS of IMPORTING structure IS_LAYOUT is set.
    Complex type for modifying information displayed on the selection dialog box:
    mode:              'R' = Only entries passed in internal table
                              IS_SEL_HIDE-T_ENTRIES are output on
                              the dialog box. Selection information
                              obtained by the list tool by reading the
                              selection screen again (only if the report
                              is called with selection screen) are
                              replaced by the entries passed.
                       'S' = The selection information obtained by the
                              list tool by reading the selection screen
                              of the calling report again, are modified
                              by the entries of table
                              IS_SEL_HIDE-T_ENTRIES.
    t_entries:         Table with selection information
    t_entries-mode:   'A' = Display selection information of the current
                             table row on the information dialog box.
                      'D' = Do not display selection information of the
                             the Select option or of parameter SELNAME
                             on the dialog box.
    t_entries-selname: (required only if t_entries-mode = 'D')
                       name of Select option or parameter
    The following table fields are only required if t_entries-mode = 'A'. They contain the selection information to be added.
    t_entries-field:  DDIC field name of the field for which selection
                       information is to be displayed
    t_entries-table:  DDIC table name of t_entries-field.
    t_entries-stext:  Field description on the information dialog box.
                      If t_entries-field and t_entries-table were
                      filled, this text is taken from the DDIC.
    t_entries-valuf:  Selection condition from-value (external format)
    t_entries-valut:  Selection condition to-value (external format)
    t_entries-sign0:  (I)nclusive (E)xclusive
    t_entries-optio:  All values of the option field of the Select
                      option are allowed.
    The remaining fields are used internally and are irrelevant to the caller.
    aRs

  • How to display two grids in same screen using SALV Method

    Hi Freinds,
    Please let me know how to display two grids in same screen using SALV Method.
    Thank you
    Regards,
    SDV

    Using the same concept as described in How to dispaly Three Internal Table  Data (One below another) in ALV OOPS .
    All you need to add is passing your new containers as r_container parementer of factory method.
    "1st one
          cl_salv_table=>factory(
             EXPORTING
               R_CONTAINER    = g_top_container
    "2nd one
          cl_salv_table=>factory(
             EXPORTING
               R_CONTAINER    = g_bottom_container
    Regards
    Marcin

  • How to retrieve Task Lists from All Subsites to the Parent Site and display in Grid view using CAML Query

    How to retrieve Task Lists from All Subsites to the Parent Site and display in  Grid view using CAML Query + object model

    do u just want task list or items under task list for all subsites
    for items use spsitedataquery ref
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx use recursive to get it from alll subsite under site collection
    for tasklist only u can a simply use a for loop to find in all subsite
    Manish Sati

  • Display ALV GRID Using Dynamic Internal Table

    Hi all,
    I try to display ALV Grid using Dynamic Internal Table, but when i activate my program, i get an error message "DYN_TABLE" is not type-compatible with formal parameter "IT_OUTTAB". ( DYN_TABLE is my Dynamic Itab).
    Anybody can help me how to passing Dynamic Itab into ALV Grid ?? Of ALV Grid only accept static Itab ??
    Thanks,

    Hi Vijay,
    It's doesn't work, and make new error "Formal parameter "IT_OUTTAB[]" does not exist. However, the parameter "IT_OUTTAB" has a similar name."
    Because the method is:
    CALL METHOD <ref. var. to CL_GUI_ALV_GRID>->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE = <any type (ANY)>
    I_STRUCTURE_NAME = <string of type DD02L-TABNAME>
    IS_VARIANT = <structure of type DISVARIANT>
    I_SAVE = <var. of type CHAR01>
    I_DEFAULT = <var. of type CHAR01>
    IS_LAYOUT = <structure of type LVC_S_LAYO>
    IS_PRINT = <structure of type LVC_S_PRNT>
    IT_SPECIAL_GROUPS = <internal table of type LVC_T_SGRP>
    IT_TOOLBAR_EXCLUDING = <internal table of type UI_FUNCTIONS>
    IT_HYPERLINK = <internal table of type LVC_T_HYPE>
    IT_ALV_GRAPHICS = <internal table of type DTC_T_TC>
    CHANGING
    IT_OUTTAB = <internal table>
    IT_FIELDCATALOG = <internal table of type LVC_T_FCAT>
    IT_SORT = <internal table of type LVC_T_SORT>
    IT_FILTER = <internal table of type LVC_T_FILT>
    Thanks,

  • Icons no longer display in grid view in Yosemite

    Hello,
    All of a sudden, the icons in folders no longer display in Grid view, but only in the other kinds of view list etc.
    Please, I need your help since that is the preferred method I use to display my icons
    Here is a link to the screenshot of what I see for further reference:
    http://monosnap.com/image/jxliJJrL8dvX8cSsLFFlRm899BqYRN
    Any help would be more than appreciated! I am desperate!

    Right click the Application icon in the Dock.
    Select "Grid" or "Automatic" under "View content as" from the menu that pops up.

  • Calling smartform and displaying ALV grid in ABAP WEBDYNPRO

    Hi all,
    I am new to ABAP web dynpro.I ahve few custom reports which are simple ALV list reports which I now need to convert to ABAP web dynpro application .
    For one particular report,based on the selection screen input,I need to display the ALV list and when I select the records from the ALV list,I need to call a smartform on clik of a push button.
    My questions:
    1. Im using 'REUSE_ALV_GRID_DISPLAY' FM  to display the o/p in my report.Is there any similar FM in webdynpro ABAP which will display my list in ALV GRID in my web dynpro application??/
    2. How to call a smartfrm in ALV grid in web dynpro??
    Edited by: abap_1000 on Jan 9, 2011 6:09 PM

    Hi,
    You can search SDN, there are several posts available. Just to get some idea, you can check --
    [Beginneru00B4s questions on WDA ALV;
    [Reg ALV Display;
    For clicking event on ALV --
    [Reg Row Data fetching on click in ALV;
    For ALV display on WDA --
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110?quicklink=index&overridelayout=true]
    Thanks.
    Kumar Saurav.

  • Can I filter by value which is not displayed in grid columns?

    In excel it is possible to filter by value of measure which is not displayed in the report.
    How can I possibly do this in Performance Point Grid? (in filter by value there I only see the measures in columns).
    Please advise
    Namnami

    I found it is possible to filter by value by changing the MDX in the query tab.
    (I filtered by certain existing value in design, then switched to Query and changed to the measure which is not displayed). I shows up correctly.
    The problem is, once I change the query, I get an error when tring to connect a filter on a grid column:
    "consumer parameter no-longer exists in the consumer webpart"
    The grid looks "frozen"- cannot drill up / down etc.
    How can I filter by value which is not displayed without loosing the ability to attach a filter to the grid?
    Namnami

  • REGARDING ALV BLOCK DISPLAY AND GRID DISPLAY

    HI FRIENDS,
    I HAVE A TROUBLE IN DISPLAYNG TWO TABLES TOGETHER IN THE GRID DISPLAY, BUT I CAN DISPLAY USING BLOCKS. I DONT WANT TO  USE JOIN STATEMENT IN THE SELECT QUERY.
    HELP WITH BY DISPLAYING THE RESPECTIVE CODES FOR THAT.
    THANK U IN ADVANCE

    hi,
    type-pools  : slis,icon.
    data : gd_repid like sy-repid.
    data : d_fieldcat type slis_t_fieldcat_alv,
              d_fieldcat_wa type slis_fieldcat_alv.
    data : begin of itab_mara occurs 0,
             matnr like mara-matnr,
             ernam like mara-ernam,
            end of itab_mara.
    data : begin of itab_marc occurs 0,
             matnr like marc-matnr,
             werks like marc-werks,
             end of itab_marc.
    data : begin of itab_final occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              werks like marc-werks,
              end of itab_final.
    gd_repid = sy-repid.
    loop at itab_emp.
    itab_final-matnr = itab_emp-matnr.
    itab_final-ernam = itab_emp-ernam.
    append itab_emp.
    clear itab_emp.
    endloop.
    d_fieldcat_wa-fieldname = 'MATNR'.
    d_fieldcat_wa-seltext_l = 'material number'.
    d_fieldcat_wa-col_pos = 1.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    d_fieldcat_wa-fieldname = 'ERNAM'.
    d_fieldcat_wa-seltext_l = 'created by'.
    d_fieldcat_wa-col_pos = 2.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    d_fieldcat_wa-fieldname = 'WERKS'.
    d_fieldcat_wa-seltext_l = 'plant number'.
    d_fieldcat_wa-col_pos = 1.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    call function module 'REUSE_ALV_GRID_DISPLAY'.
    Reward with points if helpful.

Maybe you are looking for

  • How do I stop the cursor from having a mind of its own?

    I just received this computer T400.  A mac user wswitching over to pc - not famliar with the land.  I am using a notebook and the cursor clicks on its own when I let it rest and then transports me to whatever information/page that it happens to rest

  • Adobe Reader XI will not open any PDF file

    I have tried removing and reloading reader.  I have also tried using the WIndows Control Panel to repair the Adobe file.  Nothing has helped.  I cannot open Adobe Reader XI directly from the programs folder.  Nor will it open any PDF file when I doub

  • Red Giant Looks not showing preview on Premiere Pro CC ?

    We used to use the Looks on Premiere Pro CS6 since last year and it was the best color grading tool for us. Now we just got the update for CC and installed. Looks installed and showing on effects panel. But the main thing is missing! THE PREVIEW to a

  • Sync TV shows to iPad?

    How do I do it? I have it checked in iTunes, and they copy to my iPhone perfectly fine. They don't sync to my iPad at all. Can anyone help me?

  • Hardcoded values within XML tags

    Inorder to generate an XML file, is it a requirement to have all the data in the database? For example, if I do: Select 'MyValue' From Dual -> it will return me with MyValue. Essentially, this is hardcoding values. Is this achievable using sql to gen