Interactive report column filters to display differently than column values

Greetings...
We use images a lot in our interactive reports to provide a visual representation to a status, or something locked for update, or what-have-you. By default, when a user clicks the column heading of a column which contains images, the drop-down list that shows up displays the actual images, which is nice for the user to identify exactly which thing they want to filter on. The problem is when the user selects on of the options in the filtering drop-down, the resulting condition that is displayed under the interactive report search bar is the HTML code of the image. I'd like something else to display there because showing the user the HTML code is atrocious.
I didn't think what I want is possible, but then I came across the Page Locks page within ApEx (page 4000:291 in ApEx 4.0.1) which displays a list of all the pages of an application and whether they are locked or not. It also allows you to bulk lock or bulk unlock a bunch of pages. That page uses an interactive report with a column called "Status" which contains images that represent whether the page is locked or not. When you click the "Status" column heading to filter, instead of seeing the images of an open and closed lock, you see the words "Page Locked" and "Page Unlocked." And even better... when you select on of them, the condition that is displayed to the user is very user-friendly.
Can someone tell me how this is done so I can replicate it in my own apps?
Shane.

Why not create the IR using the text you require e.g. 'Lock', 'Unlock' and then use JQuery to replace the text in the report with the image you want. All the filters should then show the plain text and the report will display the image. e.g.
http://apex.oracle.com/pls/apex/f?p=46801:1
Here's what I did:
Firstly make sure the IR has a region template.
Then create a Dynamic Action with the following attributes:
1. Advanced
2. Event: After Refresh
3. Selection Type: Region
4. Region: [select the IR Region]
5. Action: Execute JS Code
6. Fire on page load: [checked]
7. Code:
$('td [headers="TEST"]').each(function(index) {
  if ($(this).text() == 'Lock') {
    $(this).empty().html('<img src="/i/htmldb/icons/locked_small.gif" alt="Lock" />');
  else {
    $(this).empty().html('<img src="/i/htmldb/icons/unlocked_small.gif" alt="Unlock" />');
});Where TEST is the column name.
That's it, this may also be of interest:
http://simonhunt.blogspot.com/2011/10/adjusting-interactive-report-column.html
I hope it helps
Shunt

Similar Messages

  • I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I a

    I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I adjust it to look normal?

    Hi Paul ,
    It could be a compatibility issue as well as Acrobat 8 is an older version.
    Do you get any error message while registering for the product?
    Try repairing it and once and also check for updates as well.
    Is it happening with all the word files or any specific one'?
    Regards
    Sukrit Dhingra
    Acrobat 8 and Windows 7 Don't Work

  • Power view display more than 500 values in a field

    From my research, it looks like the limit of values in a Power View filter is 500.  does anyone if this is configurable to increase (which
    I am doubting based on Microsoft’s website as I’ve copied below).  If it is not configurable and we cannot display more than 500 values when filtering, then what should be done
    https://technet.microsoft.com/en-us/library/hh231514%28v=sql.110%29.aspx

    You could always do the concatenation on the client. ie: "select action1, action2 from tableX" and then create a boilerplate object with text that references both of these columns. (eg: "&<action1> &<action2>"). This should give you the concatenation you're after.
    Another alternative is to return a "long" column instead. The 4000 is probably down to the varchar datatype restriction.

  • Display more than 15 Values in Chart

    Hi,
    I am pretty new to apex, and while this looks like a very basic problem, I couldn't find an answer to it on the web:
    How do I display more than 15 value in a simple 'Horizontal 2D Column' chart?
    I know that the SQL-Query returns 26 rows, but only the first 15 are displayed in the graph.
    Thanks,
    Martin

    Hi Martin,
    have a look at the page with the SQL query. There is a field labeled "Data Point Limit" or "Maximum Rows"
    which is defaulted to 15. Just increase this number ...
    Does this help ...
    -Carsten
    Infoseite der deutschsprachigen Application Express Community
    http://www.oracle.com/global/de/community/index.html
    BLOG: SQL und PL/SQL: Tipps, Tricks & Best Practice
    http://sql-plsql-de.blogspot.com

  • In the new Numbers, How can I get a 2D stacked column chart to display only 1 column?

    In the new Numbers, How can I get a 2D stacked column chart to display only 1 column?

    This is one of those things that I find really strange about Numbers 3. The control for what you want to do is not where anyone would expect to find it.
    Select the Chart
    Click on Edit Data References
    Look at the bottom left corner of the Numbers window. It should say "Plot Columns as Series" or "Plot Rows as Series"
    Click on it and change it to the other

  • Interactive Report: how can I display carriage returns?

    Hello everybody.
    Here is my problem: I created a table containing a field COMMENT varchar2(4000) and using APEX 4.1 I built an interactive report on it.
    Users can fill the field COMMENT with sentences on different rows, ex:
    " this is the first line
    this is the second line
    this is the third line"
    This is correctly managed in the FORM, where I defined the field COMMENT as 'Text Area', but in the REPORT I wasn't able to set it in a way which permits to see it whit the carriage returns: the content is displayed on one row only : "this is the first linethis is the second linethis is the third line".
    I tried and set all the possible field types, but I found no ways to display the content exactly as it is (with carriage returns).
    Obviously I cannot use HTML
    , since I cannot ask users to digit it when inserting their text.
    Could someone suggest me how to reach this result? In need to use the interactive report because the searching/filtering tool is fundamental.
    Thanks in advance,
    Daniele

    >
    Please update your forum profile with a real handle instead of "user9211286".
    Here is my problem: I created a table containing a field COMMENT varchar2(4000) and using APEX 4.1 I built an interactive report on it.
    Users can fill the field COMMENT with sentences on different rows, ex:
    " this is the first line
    this is the second line
    this is the third line"
    This is correctly managed in the FORM, where I defined the field COMMENT as 'Text Area', but in the REPORT I wasn't able to set it in a way which permits to see it whit the carriage returns: the content is displayed on one row only : "this is the first linethis is the second linethis is the third line".
    I tried and set all the possible field types, but I found no ways to display the content exactly as it is (with carriage returns).
    Obviously I cannot use HTML
    , since I cannot ask users to digit it when inserting their text.
    Could someone suggest me how to reach this result? In need to use the interactive report because the searching/filtering tool is fundamental.Use a CSS style sheet with attribute selectors. Put this in the page HTML Header, replacing the <tt>T_EMP_NAME</tt> etc selectors with the actual <tt>id</tt> attributes of your column headers:
    <style type="text/css">
    .apexir_WORKSHEET_DATA td[headers="T_EMP_NAME"] {
      white-space: pre;
    </style>
    Interactive Report Control Break disregards HTML Header style.

  • Interactive Report "in" filters do not maintain trailling spaces

    I recently came across an interesting situation regarding interactive reports and "in" filters. When building the in list through the filter wizard, any trailing spaces in the column data is trimmed, which leads to inaccurate report results. This doesn't happen on a "=" filter, it seems limited to "in" filters.
    I have an example here: http://apex.oracle.com/pls/apex/f?p=39226:1
    If you click on the "=" filter you'll see the one record with the trailing space is properly displayed. Clicking on the "in" filter and no records are displayed.
    In my particular case, the trailing space shouldn't have been in the data, so I was able to update the table and the filters worked, but if the trailing space was important then the "in" behavior would be troublesome.
    Tony

    Well, considering the fact that there is a space in the data, and NOT in your in clause I bet, then what is the problem??
    Thank you,
    Tony Miller
    Webster, TX
    You know, I used to think that it was awful that life was so unfair. Then I thought, wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? So, now I take great comfort in the general hostility and unfairness of the universe.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Link to interactive report with filters

    I want to put a link to a page with an interactive report. But the link should setup a filter for the interactive report.
    For example, if I'm looking at a client, I want a link that sends me to the activity reports, but filtered to show only that client already.
    Is there a way to do that?
    Thanks
    Edited by: user1415525 on Sep 21, 2009 7:34 AM

    Hello,
    Set a parameter IR_<COLUMN_NAME_IN_IR> to #<COLUMN_NAME_IN_LINK>#
    Example : Set IR_ORDER_ID to #ORDER_ID#
    or for you
    Set IR_CUSTOMER_ID to #CUSTOMER_ID#
    (Of course you have to change the column names)
    Greetings,
    Roel
    http://roelhartman.blogspot.com/

  • Interactive report's data not displaying on the edit form.

    I have an interactive report that contains 3 rows. When I click on the edit button next to one of these rows, the edit form displays the data from that row.
    But when I click the edit buttons next to the other 2 report rows, I get an error message that states: "ORA-01403: no data found. Error Unable to fetch row."
    I do not see why this is happening. The PK of the table involved is "Request Date", so the report's "Link Column" region sends the value "Request Date" to the item P54_Request_Date in the form page.
    Any idea why this would work correctly for one of the report rows but not for the other 2?
    Clearly, each of the report rows must have a value for the PK, so why would the form not be able to find the same row that the report displays? Is it a problem with the form's "Fetch Row from" process?
    Thanks.

    Hello:
    Your problems are primarily related to in your choice of a 'Date' type as the PK for your table. The Automated Row Fetch (ARF) process uses a SQL statement similar to the one below to retrieve a record from a table select c1, c2, c3 ... from tab where PK_col = :page_item_containing_PK_value . This would work find if the the 'page_item_containing_PK_value' were of the DATE data type. However, all APEX binds are done using varchar2. This means that the 'page_containging_PK_value' needs to have the char representation of the date that matches the default date setting on your database. So the page-item needs to be something like 'DD-MON-YYYY HH24:MI'. In your case the PK item is probably being set to 'DD-MON-YYYY' and therefore the fetch fails.
    Now, for the 'issue with the :' in the character representation of the date.The link on the report page uses the standard APEX URL syntax to construct the link
    f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
    As you can see, the ':' acts as the separator that delineates the components that make up the APEX URL. So, having a ':' in the 'itemValues' component will make the APEX engine treat whatever follows the ':' in the value passed as a delimiter as opposed to being part of the value being passed.
    Varad

  • Interactive Report Hide Filters

    I have built an interactive report with some formatting filters.
    I do not want the users to change anything in this report, so I have disabled
    the search bar.
    They are still able to access these filters and change and delete them.
    How can I stop this ?
    Help appreciated
    Gus

    Hello Gus,
    Put following CSS in page footer text..
    <style>table#apexir_CONTROL_PANEL {display:none;}</style>Regards,
    Hari

  • Interactive Report accumulates Filters

    Hi all
    I have a menu of links, each of them sends you to the same Interactive Report with a certain Filter. All of them are like this:
    :IR_REPORT_30627346:RIR::IRLIKE_MODULES:%25Order%20Management%25
    But each of them get stuck with the other ones, accumulating all the previous filters
    Is there a way to restart the filters and only pass the one I'm sending through the URL?
    See the picture
    [http://oi56.tinypic.com/296n911.jpg]

    Hello Gus,
    Put following CSS in page footer text..
    <style>table#apexir_CONTROL_PANEL {display:none;}</style>Regards,
    Hari

  • Interactive report: third screen not displaying

    Hi Experts,
    I am doing a interactive report in ALV grid...and my requirement is
    when the user clicks on SPMON which is displayed on the initial screen the first screen
    should display and in first screen when the user clicks LIFNR second screen should display..
    I am able to display initial and first screen but second screen is not displaying...I am
    pasting a pinch of my code please have a look and advice me..
    FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
                               R_SELFIELD TYPE SLIS_SELFIELD.
      DATA : OK_CODE TYPE SY-UCOMM.
      OK_CODE = P_UCOMM.
      CASE OK_CODE.
        WHEN '&IC1'.
          IF R_SELFIELD-FIELDNAME = 'SPMON'.
            READ TABLE IT_TAB INDEX R_SELFIELD-TABINDEX.
            REFRESH IT_TAB_1[].
            CLEAR IT_TAB_1.
            LOOP AT IT_FIRST WHERE WERK EQ IT_TAB-WERK AND SPMON EQ IT_TAB-SPMON
                               AND ART = IT_TAB-ART.
              MOVE IT_FIRST-WERK       TO  IT_TAB_1-WERK.
              MOVE IT_FIRST-LIFNR      TO  IT_TAB_1-LIFNR.
              MOVE IT_FIRST-MEANQ      TO  IT_TAB_1-MEANQ.
              MOVE IT_FIRST-BASME_QM   TO  IT_TAB_1-BASME_QM.
               APPEND IT_TAB_1.
              CLEAR: IT_FIRST, IT_TAB_1.
            ENDLOOP.
            REFRESH IT_FIELDCAT1[].
            S_LAYOUT-ZEBRA = 'X' .
            S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
            PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1
            USING:
              'IT_TAB_1' 'WERK' ' ' 'PLANT' ' ' ' ',
              'IT_TAB_1' 'LIFNR' ' ' 'VENDOR NUMBER' ' ' ' ',
              'IT_TAB_1' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
              'IT_TAB_1' 'BASME_QM' ' ' 'BuM' ' ' ' ',
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
               I_CALLBACK_PROGRAM                = SY-CPROG
               I_CALLBACK_USER_COMMAND             = 'USER_COMM_1'
               IS_LAYOUT                         = S_LAYOUT
               IT_FIELDCAT                       = IT_FIELDCAT1[]
             TABLES
                T_OUTTAB                          = IT_TAB_1[]
          ENDIF.
      ENDCASE.
    ENDFORM.                    "USER_COMM
    For second screen : which is not working
    FORM USER_COMM_1 USING P_UCOMM LIKE SY-UCOMM
                               R_SELFIELD TYPE SLIS_SELFIELD.
      DATA : OK_CODE TYPE SY-UCOMM.
      OK_CODE = P_UCOMM.
      CASE OK_CODE.
        WHEN '&IC2'.
          IF R_SELFIELD-FIELDNAME = 'LIFNR'.
            READ TABLE IT_TAB_1 INDEX R_SELFIELD-TABINDEX.
            REFRESH IT_TAB_2[].
            CLEAR IT_TAB_2.
            LOOP AT IT_SECOND WHERE WERK EQ IT_TAB_1-WERK AND
    SPMON EQ IT_TAB_1-SPMON AND ART = IT_TAB_1-ART AND LIFNR = IT_TAB_1-LIFNR.
              MOVE IT_SECOND-ART        TO  IT_TAB_2-ART.
              MOVE IT_SECOND-SPMON      TO  IT_TAB_2-SPMON.
              MOVE IT_SECOND-MATNR      TO  IT_TAB_2-MATNR.
                   APPEND IT_TAB_2.
              CLEAR: IT_SECOND, IT_TAB_2.
            ENDLOOP.
            REFRESH IT_FIELDCAT2[].
            S_LAYOUT-ZEBRA = 'X' .
            S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
            PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT2
                    USING:
                      'IT_TAB_2' 'MATNR' ' ' 'MATERIAL NUMBER' ' ' ' ',
                      'IT_TAB_2' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
                      'IT_TAB_2' 'BASME_QM' ' ' 'BuM' ' ' ' ',
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
               I_CALLBACK_PROGRAM                = SY-CPROG
               IS_LAYOUT                         = S_LAYOUT
               IT_FIELDCAT                       = IT_FIELDCAT2[]
              TABLES
                T_OUTTAB                          = IT_TAB_2[]
          ENDIF.
      ENDCASE.
    ENDFORM.                    "USER_COMM_1
    Please advice
    Karthik
    Edited by: Karthik R on Apr 29, 2009 12:22 PM

    Use both conditions in USER_COMM.
    FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
                               R_SELFIELD TYPE SLIS_SELFIELD.
      DATA : OK_CODE TYPE SY-UCOMM.
      OK_CODE = P_UCOMM.
      CASE OK_CODE.
        WHEN '&IC1'.
          IF R_SELFIELD-FIELDNAME = 'SPMON'.                      " Field name SPMON
            READ TABLE IT_TAB INDEX R_SELFIELD-TABINDEX.
            REFRESH IT_TAB_1[].
            CLEAR IT_TAB_1.
            LOOP AT IT_FIRST WHERE WERK EQ IT_TAB-WERK AND SPMON EQ IT_TAB-SPMON
                               AND ART = IT_TAB-ART.
              MOVE IT_FIRST-WERK       TO  IT_TAB_1-WERK.
              MOVE IT_FIRST-LIFNR      TO  IT_TAB_1-LIFNR.
              MOVE IT_FIRST-MEANQ      TO  IT_TAB_1-MEANQ.
              MOVE IT_FIRST-BASME_QM   TO  IT_TAB_1-BASME_QM.
               APPEND IT_TAB_1.
              CLEAR: IT_FIRST, IT_TAB_1.
            ENDLOOP.
            REFRESH IT_FIELDCAT1[].
            S_LAYOUT-ZEBRA = 'X' .
            S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
            PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1
            USING:
              'IT_TAB_1' 'WERK' ' ' 'PLANT' ' ' ' ',
              'IT_TAB_1' 'LIFNR' ' ' 'VENDOR NUMBER' ' ' ' ',
              'IT_TAB_1' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
              'IT_TAB_1' 'BASME_QM' ' ' 'BuM' ' ' ' ',
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
               I_CALLBACK_PROGRAM                = SY-CPROG
               I_CALLBACK_USER_COMMAND             = 'USER_COMM_1'
               IS_LAYOUT                         = S_LAYOUT
               IT_FIELDCAT                       = IT_FIELDCAT1[]
             TABLES
                T_OUTTAB                          = IT_TAB_1[]
          ELSEIF R_SELFIELD-FIELDNAME = 'LIFNR'.              " ELSE FIELDNAME LIFNR
            READ TABLE IT_TAB_1 INDEX R_SELFIELD-TABINDEX.
            REFRESH IT_TAB_2[].
            CLEAR IT_TAB_2.
            LOOP AT IT_SECOND WHERE WERK EQ IT_TAB_1-WERK AND
            SPMON EQ IT_TAB_1-SPMON AND ART = IT_TAB_1-ART AND LIFNR = IT_TAB_1-LIFNR.
              MOVE IT_SECOND-ART        TO  IT_TAB_2-ART.
              MOVE IT_SECOND-SPMON      TO  IT_TAB_2-SPMON.
              MOVE IT_SECOND-MATNR      TO  IT_TAB_2-MATNR.
                   APPEND IT_TAB_2.
              CLEAR: IT_SECOND, IT_TAB_2.
            ENDLOOP.
            REFRESH IT_FIELDCAT2[].
            S_LAYOUT-ZEBRA = 'X' .
            S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
            PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT2
                    USING:
                      'IT_TAB_2' 'MATNR' ' ' 'MATERIAL NUMBER' ' ' ' ',
                      'IT_TAB_2' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
                      'IT_TAB_2' 'BASME_QM' ' ' 'BuM' ' ' ' ',
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
               I_CALLBACK_PROGRAM                = SY-CPROG
               IS_LAYOUT                         = S_LAYOUT
               IT_FIELDCAT                       = IT_FIELDCAT2[]
              TABLES
                T_OUTTAB                          = IT_TAB_2[]
          ENDIF.
      ENDCASE.
    ENDFORM.                    "USER_COMM
    Regards,
    Gurpreet

  • Interactive Report - is it possible to stop a column being hidden?

    I have an interactive report region where i have a column that has a link that performs an action, in this case it links to a screen where the user can then add a row. I want to make this column mandatory and not let the user hide it. I can remove other functionality, but cant seem to control the hide/show functionality.
    anybody got any ideas?
    craig
    [oracleapplicationexpress.com|http://www.oracleapplicationexpress.com]

    Dear Hemanth,
    To your question:
    "Is it possible to stop a campaign from being cancelled if it has purchase orders attached to it, using standard functionality".
    This might be possible with a BADI implementation. In enhancement spot CRM_MKTPL there exist a BAdI CRM_MTKPL_OL_OBJ where the interface method CHECK_BEFORE_DELETE is offered.
    Regards,
    Anik

  • Interactive report with control break displays no data, until control break is unchecked

    Hello,
    I have an interactive report that is base upon a collection. When one first access the page the report shows no data(no errors are given) and the control break box is red. Once the control break box is unchecked, all the data is shown. Furthermore, navigating to another page causes the same issue.
    Any idea into how I can solve this issue will be appreciated.
    Thank you,
    Apex 4.2
    Oracle 11g 2.0.3
    Apache Tomcat
    Guyenko

    Vincent,
    The aggregates are applied to each control break group, or, if you don't have any, then they're applied to the full report. So, in your case the "count" (= count of non-null values for a column, same as in SQL) should mean there is 1 non-null value in each group.
    Does that description match what you're seeing?
    - Marco

  • How we can get an interactive report  in alv grid display?

    Hi experts
    Plz tell me how we can get an interactive report in alv grid disply pls send me one sample code to understand this
    thanks in advance

    hi,
    check this one
    *& Report  ZALV_FIELD_GRID1
    REPORT  ZALV_FIELD_GRID1
            NO STANDARD PAGE HEADING.
    TABLES MARA.
    type-pools :slis.
    TYPES : BEGIN OF TMARA ,
            MATNR LIKE MARA-MATNR,
            MEINS LIKE MARA-MEINS,
            ERSDA LIKE MARA-ERSDA,
            color(4) type c,
            SEL type c,
            LIGHT TYPE C,
            END OF TMARA.
    TYPES: BEGIN OF TMAKT,
           MATNR LIKE MAKT-MATNR,
           MAKTX LIKE MAKT-MAKTX,
           MAKTG LIKE MAKT-MAKTG,
           SEL TYPE C,
           COLOR(4),
           END OF TMAKT.
    DATA:  ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
           ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
           wa_fieldcat type slis_fieldcat_alv,
           fieldcat type slis_fieldcat_alv occurs 0,
           i_layout type slis_layout_alv,
           WA_LISTHEADER TYPE SLIS_LISTHEADER,
           i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
           V_EVENTS TYPE SLIS_T_EVENT ,
           WA_EVENT TYPE SLIS_ALV_EVENT,
           I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
           I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
           SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
           PRINT_CONT type slis_print_alv.
    SELECTION SCREE
    selection-screen  begin of block screen1  with frame title TEXT-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /32(35) COMM1.
    SELECTION-SCREEN ULINE /27(35).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS MATNR FOR MARA-MATNR.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN COMMENT /30(50) COMM2.
    SELECTION-SCREEN ULINE /27(40).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
    SELECTION-SCREEN SKIP.
    selection-screen  end of block screen1.
        INITIALIZATION
    INITIALIZATION.
      MATNR-low = '23'.
      MATNR-high = '1000'.
      MATNR-option = 'BT'.
      MATNR-sign = 'I'.
      APPEND MATNR.
      ERSDA-low = '20030124'.
      ERSDA-high = '20050302' .
      APPEND ERSDA.
      PERFORM FILLFIELD.
      PERFORM FILLLAYOUT.
      PERFORM build_print_params.
      PERFORM FILL_SORT.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
            SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      comm1 ='SELECT MATERIAL NUMBER  RANGE'.
      comm2 ='SELECT MATERIAL CREATION DATE'.
               START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM READDATA.
      PERFORM POPDATA.
    *&      Form  READDATA
          text
    FORM READDATA .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-LOW
        IMPORTING
          OUTPUT = MATNR-LOW.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-HIGH
        IMPORTING
          OUTPUT = MATNR-HIGH.
      SELECT MATNR
             ERSDA
             MEINS
             FROM MARA
             INTO CORRESPONDING FIELDS OF
            TABLE ITAB
            WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
      LOOP AT ITAB.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        IF ITAB-MATNR < '000000000000000100'.
          ITAB-LIGHT = '1'.
        ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
       '000000000000000100' .
          ITAB-LIGHT = '2'.
        ELSE.
          ITAB-LIGHT = '3'.
        ENDIF.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab-color.
        modify itab.
        CLEAR ITAB.
      endloop.
    ENDFORM.                    " READDATA
         Form  FILLFIELD
    FORM FILLFIELD .
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
      WA_FIELDCAT-outputlen   = 20.
      WA_FIELDCAT-HOTSPOT = 'X'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
    *WA_FIELDCAT-EMPHASIZE = 'C210'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-COL_POS = '2'.
    *WA_FIELDCAT-EMPHASIZE = 'C510'.
      WA_FIELDCAT-outputlen   = 10.
      wa_fieldcat-seltext_m = 'UNIT'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'ERSDA'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-outputlen   = 15.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
    *WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'CREAT DATE'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    "FILLFIELD
          Setup print parameters
    form build_print_params.
      PRINT_CONT-reserve_lines = '3'.   "Lines reserved for footer
      PRINT_CONT-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
         Form  POPDATA
    FORM POPDATA .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                 =  sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND            = 'USER-COMMAND'
         I_CALLBACK_TOP_OF_PAGE             = 'TOPPAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                       = I_TITLE_MARA
      I_GRID_SETTINGS                   =
         IS_LAYOUT                          = I_LAYOUT
         IT_FIELDCAT                        = fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           =  SORT[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                          = V_EVENTS
      IT_EVENT_EXIT                     =
       IS_PRINT                          = PRINT_CONT
        TABLES
          T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    ENDFORM.                    " POPDATA
         Form  TOPPAGE
    FORM TOPPAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "TOPPAGE
         Form  FILLLAYOUT
    FORM FILLLAYOUT .
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-lights_fieldname = 'LIGHT'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
      I_LAYOUT-no_totalline = 'X'.
    ENDFORM.                    "FILLLAYOUT
        Form  FILL_SORT
    FORM FILL_SORT .
      SORT-DOWN = 'X'.
      SORT-SPOS = 1.
      SORT-FIELDNAME = 'MATNR'.
      SORT-tabname = 'MARA'.
      APPEND SORT.
    ENDFORM.                    " FILL_SORT
         Form  EVENT_CALL
    FORM EVENT_CALL .
      DATA: I_EVENT LIKE V_EVENTS.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = V_EVENTS.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " EVENT_CALL
        Form  POPULATE_EVENT
    FORM POPULATE_EVENT .
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
        WA_EVENT-NAME.
    READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
                                          INTO WA_EVENT.
    IF SY-SUBRC = 0.
       move 'END_OF_PAGE' to WA_EVENT-FORM.
       MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
       WA_EVENT-NAME.
      endif.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    FORM END_OF_PAGE.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    ENDFORM.
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          CASE RS_SELFIELD-FIELDNAME.
            when 'MATNR'.
              read table itab with key matnr = RS_SELFIELD-VALUE.
              if sy-subrc = 0.
                PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
                PERFORM BUILD_FIELDCATLOG_MAKT.
                PERFORM FILLLAYOUT_MAKT.
                PERFORM DISPLAY_ALV_MAKT.
                CLEAR RS_SELFIELD.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_command
         Form  DATA_RETRIEVAL_MAKT
    FORM DATA_RETRIEVAL_MAKT USING TMATNR .
      SELECT MATNR
             MAKTX
             MAKTG
             UP TO 100 ROWS
             FROM MAKT
             INTO TABLE ITAB1
             WHERE SPRAS = 'EN' AND MATNR = TMATNR.
      LOOP AT ITAB1.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab1-color.
        modify itab1.
        CLEAR ITAB1.
      ENDLOOP.
    ENDFORM.                    "DATA_RETRIEVAL_MAKT
         Form  FILLLAYOUT_MAKT
    FORM FILLLAYOUT_MAKT .
      CLEAR I_LAYOUT.
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
    ENDFORM.                    " LAYOUT_MAKT
        Form  BUILD_FIELDCATLOG_MAKT
    FORM BUILD_FIELDCATLOG_MAKT .
      REFRESH FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
      WA_FIELDCAT-EMPHASIZE = 'C510'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT-COL_POS = '2'.
      WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTG'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-EMPHASIZE = 'C210'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATLOG_MAKT
         Form  DISPLAY_ALV_MAKT
    FORM TOP-OF-PAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB1 lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "TOP-OF-PAGE
    *&      Form  DISPLAY_ALV_MAKT
          text
    FORM DISPLAY_ALV_MAKT .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = SY-REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
          I_GRID_TITLE           = I_TITLE_MAKT
          IS_LAYOUT              = I_LAYOUT
          IT_FIELDCAT                       = fieldcat
        TABLES
          T_OUTTAB               = ITAB1
        EXCEPTIONS
          PROGRAM_ERROR          = 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.
    ENDFORM.                    " DISPLAY_ALV_MAKT
    Rewards points

Maybe you are looking for