Get Report_Id of Interactive Report

I am atempting to get the report id of the currently selected report in a specific page.
The problem is that here are several diferent views (SAVED REPORT) and i don't how how to get the currently selected in the session.
How can I do that?
Thanks
Pedro

The report is selected using the interactive report tabs from the previous saved reports.
I have been trying this:
Javascript & 'apexir_REPORT_ID'
but it fails because the value is always the same, the based_report_id of the Working directory, not the selected tab (interactive report save).
Any thougths??

Similar Messages

  • Get ROWIDs from Interactive Report

    Hi,
    I'm using an interactive report but I'd like to use the rows returned in a process so is it possible to get the rowsids that have been selected and make up the filtered report
    Thanks Andy

    A little trial and error using Andy ATD's suggestions gave me the following query, which I can use to recreate the selected ROWIDs:
    SELECT /*c.interactive_report_id, report_id, application_user, report_name, */
    CONDITION_COLUMN_NAME as col_name, CONDITION_OPERATOR as col_operator,
    CONDITION_EXPRESSION as exp1, CONDITION_EXPRESSION2 as exp2,
    CONDITION_ENABLED AS enabled,
    LAST_UPDATED_ON as date_mod
    FROM APEX_APPLICATION_PAGE_IR_COND C
    WHERE c.application_id = :APP_ID
    AND c.page_id = :APP_PAGE_ID
    AND c.condition_type = 'Filter'
    AND application_user = :APP_USER
    AND condition_enabled = 'Yes'
    and report_name is null -- Just show current working report
    AND trunc(last_updated_on) = trunc(sysdate)
    ORDER BY last_updated_on desc, report_id;
    This gives results like:
    COL_NAME     COL_OPERATOR     EXP1     EXP2     ENABLED     DATE_MOD
    ASK_AMOUNT_CURRENT     between     2500     10000     Yes     03-DEC-08
    PREF_CLASS_YEAR     =     1968     -      Yes     03-DEC-08
    - Stew

  • Get condition from interactive report

    Hi all!
    I have an interactive report.
    After the user has set some filter conditions I would like to write the ID's of the selected datasets into a table.
    This should take place in an "after-submit-process" in pl/sql.
    Something like:
    INSERT INTO #OWNER#.log_table (OBJT_ID) VALUES (SELECT ID FORM #OWNER#.source_table WHERE
    ":APEX_REPORT_CONDITION");
    My question:
    Is there an apex-object like ":APEX_REPORT_CONDITION"?
    Thanks for your help!
    Kai

    Hi Jari,
    thank you for your reply. But I need s.th. different:
    If I load my report-page and display "Debug" the SQL behind the report looks like:
    select
    null as apxws_row_pk,
    +"ID",+
    +"NUMBER",+
    +"TITLE",+
    +"ENTRY_DATE",+
    +"PRIOPRITY",+
    +"PROBABILITY",+
    count(*) over () as apxws_row_cnt
    from (
    select  *  from (
    select
    r.ID,
    r.NUMBER,
    r.TITLE,
    r.RPRI_NAME,
    r.ENTRY_DATE,
    r.PRIORITY,
    r.PROBABILITY
    from #OWNER#.MY_TABLE r
    where r.usr_name = :APP_USER
    +) r+
    where ("PROBABILITY" = :APXWS_EXPR_1*
    and "PRIORITY" = :APXWS_EXPR_2)*
    +) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)+
    +0.44: binding: ":APP_USER"="APP_USER" value="USER"+
    +0.44: IR binding: ":APXWS_EXPR_1"="APXWS_EXPR_1" value="(10-50%)"+
    +0.44: IR binding: ":APXWS_EXPR_2"="APXWS_EXPR_2" value="Hoch"+
    +0.44: IR binding: ":APXWS_MAX_ROW_CNT"="APXWS_MAX_ROW_CNT" value="10000"+
    As we can see, apex put an own select-statement around the original statement.
    What I need is the part in bold letters and the APXWS_EXPR_x-values. How can I get it?
    Has anyone any ideas? Thanks in advance!
    Kai
    Edited by: user610935 on Nov 25, 2009 11:27 PM
    Edited by: user610935 on Nov 25, 2009 11:27 PM

  • Get ID of Interactive Report that Initiated Download Reqest

    Hi there.
    Does anyone know if it's possible to get Interactive Report ID (x01 on the POST Request I think) when a "Download" request is initiated?
    I need to log this value into a custom table so any help on how to grab this would be very helpful.
    Cheers
    Duncs

    Hmm. That's really useful but as far as I can see, it's geared towards only having 1 IR per page i.e.
    SELECT region_id
    INTO v_region_id
    FROM APEX_APPLICATION_PAGE_ir
    WHERE application_id = :app_id
      AND page_id = :app_page_id;
    When APEX 5 comes along, you can have more than 1 on a page and so any solution needs to be future proof which I am not too sure this one is.
    Nice start though.
    Cheers
    Duncs

  • Get results of interactive report

    After using the interactive report to narrow down my results, I now want to get the id's of the results. Can I add a check box to this report in order to do bulk operations on the result or is there another way to get the id's.
    Thanks
    Rob

    Hmm. That's really useful but as far as I can see, it's geared towards only having 1 IR per page i.e.
    SELECT region_id
    INTO v_region_id
    FROM APEX_APPLICATION_PAGE_ir
    WHERE application_id = :app_id
      AND page_id = :app_page_id;
    When APEX 5 comes along, you can have more than 1 on a page and so any solution needs to be future proof which I am not too sure this one is.
    Nice start though.
    Cheers
    Duncs

  • How to avoid line break ( br ) while exporting Interactive report in Excel

    Hi,
    I have a Interative report and I am using Apex download format as CSV.
    I have defined some of the column heading in multiple line using break < br >
    when I export this into the excel sheet..the column heading contains break also..
    - Any idea how to avoid line break while exporting in excel.
    - also how to put the columns heading in BOLD when exported in excel.
    Thanks,
    Deepak

    Hi Jari,
    I tried this but still getting the
    <br>Interactive Report
    Column Attributes Heading - Employee<br>Detail AddressWhen I download the Report in CSV Format
    I am getting the heading with <br>.
    I am looking for heading as - Employee Detail Address // with no <br> tagThanks,
    Deepak

  • Download Customization in Apex Interactive Report

    Hi All,
    I am using Apex 3.2.
    I have some requirement, for the download the interactive data into xl sheet we can go to action menu and download the report. But in the report there is one edit link ,I dont want down load edit link data. How to avoid this edit link data.
    Thanks,
    pnr
    Edited by: pnr on Mar 28, 2011 5:59 AM

    Hello Tony,
    Your suggestion on the other thread is interesting and will be helpful on some other reporting I am doing. However, I am still running into an issue. I am unable to get the 2nd interactive report query below 114 columns since I have to keep those fields together so they can look at those fields when they make computations.
    I never did say 100 + columns is "Always" needed. However, it is still a needed feature in my opinion. I been using APEX for 2 years. This is the first time I needed this many columns. I am currently working with Institutional Advancement, which by next month will want to have over 200 columns available to them since not only will they be looking at constituents but, they will want to look at corporations as well. Discover isn't an option at this time.
    "Maybe someone can build an ad-hoc report builder for APEX applications that can be attached to applications? We have such items in Oracle Forms application I maintain now.."
    That would be delightful...
    Regards,
    Kelly

  • Interactive report coding without using LVs

    hi...can i get coding for interactive report without using ALVs?

    Hi Rakkasi....
    here i am pastina a Two levels Code for NON ALV Interactive report....
    just copy and paste this code into your sample editor program and run it...
    and see the code ...its simple...
    <b>Reward points if helpful,</b>
    Here is the code....
    *& Report  ZTEJ_INTAB1                                                 *
    REPORT  ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
    HEADING.
    *TABLES DECLARATION
    TABLES : KNA1, VBAK, VBAP.
    *SELECT OPTIONS
    SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
    *INITIALIZATION
    INITIALIZATION.
        CUST_NO-LOW = '01'.
        CUST_NO-HIGH = '5000'.
        CUST_NO-SIGN = 'I'.
        CUST_NO-OPTION = 'BT'.
        APPEND CUST_NO.
    *SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN ON CUST_NO.
        LOOP AT SCREEN.
            IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
              MESSAGE E001(ZTJ1).
             ENDIF.
        ENDLOOP.
    *BASIC LIST SELECTION
    START-OF-SELECTION.
        SELECT KUNNR NAME1 ORT01 LAND1 INTO
               (KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
               FROM KNA1
               WHERE KUNNR IN CUST_NO.
              WRITE:/1 SY-VLINE,
                    KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
                    16 SY-VLINE,
                    KNA1-NAME1 UNDER 'NAME',
                    61 SY-VLINE,
                    KNA1-ORT01 UNDER 'CITY',
                    86 SY-VLINE,
                    KNA1-LAND1 UNDER 'COUNTRY',
                    103 SY-VLINE.
        HIDE: KNA1-KUNNR.
        ENDSELECT.
        ULINE.
    *SECONDARY LIST ACCESS
    AT LINE-SELECTION.
        IF SY-LSIND = 1.
            PERFORM SALES_ORD.
        ENDIF.
        IF SY-LSIND = 2.
            PERFORM ITEM_DET.
        ENDIF.
    *TOP OF PAGE
    TOP-OF-PAGE.
            FORMAT COLOR 1.
            WRITE : 'CUSTOMER DETAILS'.
            FORMAT COLOR 1 OFF.
            ULINE.
            FORMAT COLOR 3.
            WRITE : 1 SY-VLINE,
                    3 'CUSTOMER NO.',
                    16 SY-VLINE,
                    18 'NAME',
                    61 SY-VLINE,
                    63 'CITY',
                    86 SY-VLINE,
                    88 'COUNTRY',
                    103 SY-VLINE.
                    ULINE.
          FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR SECONDARY LISTS
    TOP-OF-PAGE DURING LINE-SELECTION.
    *TOP OF PAGE FOR 1ST SECONDARY LIST
        IF SY-LSIND = 1.
                     ULINE.
      FORMAT COLOR 1.
      WRITE : 'SALES ORDER DETAILS'.
                     ULINE.
      FORMAT COLOR 1 OFF.
      FORMAT COLOR 3.
            WRITE : 1 SY-VLINE,
                    3 'CUSTOMER NO.',
                    16 SY-VLINE,
                    18 'SALES ORDER NO.',
                    40 SY-VLINE,
                    42 'DATE',
                    60 SY-VLINE,
                    62 'CREATOR',
                    85 SY-VLINE,
                    87 'DOC DATE',
                    103 SY-VLINE.
                    ULINE.
          ENDIF.
          FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR 2ND SECONDARY LIST
    IF SY-LSIND = 2.
                     ULINE.
          FORMAT COLOR 1.
          WRITE : 'ITEM DETAILS'.
          ULINE.
          FORMAT COLOR 1 OFF.
    FORMAT COLOR 3.
            WRITE : 1 SY-VLINE,
                    3  'SALES ORDER NO.',
                    40 SY-VLINE,
                    42 'SALES ITEM NO.',
                    60 SY-VLINE,
                    62 'ORDER QUANTITY',
                    103 SY-VLINE.
                    ULINE.
        ENDIF.
    FORMAT COLOR 3 OFF.
    *END OF PAGE
    END-OF-PAGE.
         ULINE.
    WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
    SY-PAGNO.
          SKIP.
    *&      Form  SALES_ORD
    *&      FIRST SECONDARY LIST FORM
    FORM SALES_ORD .
    SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
           (VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
           FROM VBAK
           WHERE KUNNR = KNA1-KUNNR.
           WRITE:/1 SY-VLINE,
                   VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
                   16 SY-VLINE,
                   VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
                   40 SY-VLINE,
                   VBAK-ERDAT UNDER 'DATE',
                   60 SY-VLINE,
                   VBAK-ERNAM UNDER 'CREATOR',
                   85 SY-VLINE,
                   VBAK-AUDAT UNDER 'DOC DATE',
                   103 SY-VLINE.
          HIDE : VBAK-VBELN.
    ENDSELECT.
    ULINE.
    ENDFORM.                    " SALES_ORD
    *&      Form  ITEM_DET
    *&      SECOND SECONDARY LIST FORM
    FORM ITEM_DET .
      SELECT VBELN POSNR KWMENG INTO
             (VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
             FROM VBAP
             WHERE VBELN = VBAK-VBELN.
             WRITE : /1 SY-VLINE,
                       VBAP-VBELN UNDER 'SALES ORDER NO.',
                       40 SY-VLINE,
                       VBAP-POSNR UNDER 'SALES ITEM NO.',
                       60 SY-VLINE,
                       VBAP-KWMENG UNDER 'ORDER QUANTITY',
                       103 SY-VLINE.
            ENDSELECT.
            ULINE.
            ENDFORM.                    " ITEM_DET
    Regards,
    Tejas

  • Interactive Report NLS Language

    Hi again,
    Apex 3.2.0
    Oracle XE
    I was wondering if you could help.
    I have a combo box on a form region that selects a language. The idea of this is to change the number and date formats when displaying data in reports and on forms.
    On my reports and forms my format strings are set to a page item e.g. :P10_CURRENCY_FORMAT which contains the oracle currency format I need, e.g. FML999G999G999G999G990D00.
    I can then set the NLS_CURRENCY value by either altering the session or via the apex.util:
    ALTER SESSION SET NLS_CURRENCY='£';
    or
    APEX_UTIL.SET_SESSION_STATE('FSP_LANGUAGE_PREFERENCE','en-gb');
    and the correct currency symbol appears in front of the number in the report.
    This all works fine until I get to filtering interactive reports.
    The problem is when I want to filter interactive reports all the currency settings are set back to the APEX defaults set in APPLICATION/GLOBALIZATION.
    I then created a BEFORE HEADER process to alter the session, however when filtering interactive reports, the page isn't refreshed so this takes no effect.
    So I have ended up with £ symbols in my report columns and when I filter it, they all change to $ symbols, the next page reverts back to £ until I filter again.
    Am I going about it all the wrong way, or does anybody have any ideas?
    Thanks,
    Blackstone.

    This approach won't work with interactive reports as the Before Header process is not executed by the AJAX call that refreshes the report.
    This is a deficiency in IR operation that we can hope will be addressed by a future enhancement to provide the ability to run processes pre- and post-IR refresh.
    In the meantime, IR refreshes do run the Virtual Private Database PL/SQL call defined in the application security attributes, so putting the NLS modification code there will work. Go to Application > Shared Components > Edit Security Attribute | Virtual Private Database (VPD), and make the call from there. Due to the specific requirements of the code that has to be called from here when used for security purposes, this is probably best done by setting this up to make 2 separate calls to packages defined outside APEX, one to handle security-related details and the other to orchestrate any other code that has to be run. (For example, in this case it may not be desired to alter the NLS environment on every page, so the program could take a parameter specifying the current page and apply the ALTER SESSION conditionally on this.)
    [See this thread|http://forums.oracle.com/forums/thread.jspa?threadID=936753] for a similar issue.

  • Help - How to colour columns in interactive reports

    Hi,
    How do I colour columns in an interactive report ?
    I have created a solution to help student explore the many thousands of courses in the UK - with the results showing in an interactive report:
    https://production001-demandanalysis.db.em1.oraclecloudapps.com/apex/f?p=20300118:1
    (To get to results, interactive report, click a subject and then pick a subject from the course cloud.)
    What I want to achieve is the colouring of the columns - as currently shown - but programatically - without the user being able to see all the highlights I had to enter to achieve this.
    Any help greatly appreciated.
    Steve
    Apex version 4.2.2

    U can change the sql code for report in following way to color column.
    select
    AFFIRMATION_STATUS as AFFIRMATION_STATUS ,
    AFFIRMATION_DATE as AFFIRMATION_DATE,
    case when AFFIRMATION_STATUS = 'Affirmed' then 'green'
          when AFFIRMATION_STATUS = 'Rejected' then 'red'
        end the_color
    from MAIN_INTERFACE
    so it will generate a report with three columns viz affirmation_status and affirmation_date and the_color . Now open the_color column in report attribute tab.In column formating put "<span style="color:#THE_COLOR#;font-weight:bold;">#AFFIRMATION_DATE#</span>". If value of affirmation_status is affirmed then affirmation_date's value will come in greeen color. If its rejected , it will come in red color.

  • APEX4.0.2 - Interactive Report total is not getting printed when downloaded

    I've an Interactive Report based on a sql in Apex 4.0.2. There is a Balance column whose total sum is displayed at the bottom of the table.
    When I download the report, the total sum of balance column is not getting printed in the bottom of the report.
    Could this be a bug or have I missed some setting?
    Thank you for the help.

    Hi,
    Whilst you can update the SQL to include totals, these would probably not be effective if the user filters the data (the total row may be filtered out) or sorts columns (as the total row would likely be sorted as normal data).
    Unless someone else has any other ideas on this, this may be something that needs to be logged with the Apex team as an enhancement request - create a new thread and start the Subject as "Enhancement Request:"
    Andy

  • Interactive Report: how to get value of given row/col cell in selected row

    Hi -- I have an interactive report. Instead of the default behavior of the link going to a single row view, I want it to
    go to a form for editing the row. This means I have to be able to populate the form w/ the correct row's information...
    so need to get the value(s) for the PK column(s) in the selected row of the interactive report, so I can select the row
    from the database.
    How can I do this? I see in the report attributes, Link Column section, I can set Rows Uniquely Identified by, and a Unique
    Column (though there could be more than one in a PK). I imagine I'd want to use the rowid, but I'm not sure how the
    rowid of the selected IR row can be referenced. And at that point, I'm not sure how to get the IR column value for
    that row. (Say I'm on the 8th row and I need the first column... How is the column referenced? By a number, it's name,
    its heading?)
    Or maybe I'm not on the right track at all...
    Ideas?
    Thanks,
    Carol

    Hi Carol,
    What I´m trying to do is: defining a button such as when you click it a pl-sql procedure is called, which needs as an input parameter the id of the row selected in my form. what I need first, then, is to get the id of the selected row. how did you get it?
    Thanks in advance
    Francesco

  • How to get .oce to talk to DAS & bring back data in Interactive Reporting?

    Hi Hyperion Experts,
    This is also a fairly basic question, I use Hyperion 9.3.1 and I have Shared Services, Workspace and Interactive Reporting Studio running on our Windows 2003 Server.
    My goal is to import a .bqy document I created in Interactive Reporting Studio into workspace, and be able to click on the "refresh" button and see it refreshes the data from the backend Oracle 10g database.
    I have completed the following steps so far,
    1. I have created a DSN. This DSN, named "Oracle 10g Data Source", when I clicked on "Test Connection" button, It ran successfully.
    2. I have created a new Datasource entry in the DAS service. If I double click on the newly created Datasource entry, the screen would display the following details.
    Connectivity Type = Oracle Net
    Database Type = Oracle
    Enter the name of the Data source = Oracle 10g Data Source
    Select the name of the Data source (it is grayed out, nothing selected)
    Server/File (it is grayed out, nothing entered)
    then, followed by some default connection parameters.
    3. I have created a "Oracle 10g Data Source.oce" file using the Interactive Reporting Studio. I saved the .oce file at
    C:\Hyperion\BIPlus\data\Open Catalog Extensions\Oracle 10g Data Source.oce
    4. I created a new constrProj_Oracle10gOCE.bqy, during the creation, I chose
    "Create a new document with Recent Database Connection File" option, then I chose the Oracle 10g Data Source.oce that I have created in step 3. After I log in with host user/password, I have created a data model and I see that it brings back a data set when I clicked on the "process" button. I saved this .bqy document.
    5.
    I imported the Oracle 10g Data Source.oce and constrProj_Oracle10gOCE.bqy into the workspace under a folder called
    Root/MYBI/Test
    6. I right click on the constrProj_Oracle10gOCE.bqy document, and chose "Open". It opened with Results section highlighted on the left hand side, and with data showing on the right hand side. However, when I clicked on the "refresh" button, I'd get a message box with a red X. It says,
    An Interactive Reporting Service error has occurred -
    Failed to acquire requested service.
    (2001)
    I guess the data I see in this constrProj_Oracle10gOCE.bqy was just the cached data that was brought back when I hit the process button of this .bqy when it was first created in the Studio, and that it never established any connection via the DAS service to the backend.
    Could someone please show me what I have done wrong here?
    thanks,
    hypuser1010

    EricaHarris,
    Yes, the issue is still open. Obviously, I have gone down the path of "Scenario One".
    Based on your reply, I have done the following.
    There are three things I am configuring here: DSN, DAS and OCE.
    1) When I created the DSN,
    I started the ODBC Data Source Administrator, Click on second tab "System DSN". I added a new ODBC Data Source.
    Data Source Name = Oracle 10g Data Source
    TNS Service Name = //146-abc.xyz.com:1521/MYORCL0617
    2) I re-created the DAS entry, per your suggestion, I made sure that "the name of the data source will be the host name you specified in your OCE".
    Connectivity Type = Oracle Net
    Database Type = Oracle
    Enter the name of the data source= //146-abc.xyz.com:1521/MYORCL0617
    3) for my OCE, I specified
    Connection Software = Oracle Net
    type of Database = Oracle
    on the first screen.
    then, on the next screen, I specified
    Host = //146-abc.xyz.com:1521/MYORCL0617
    I reployed the OCE, the .bqy document and restarted DAS. Yes, my .bqy document does refresh its data successfully from the backend.
    However, I am not 100% convinced that the .bqy uses the OCE which talks to the DAS, which talks to the DSN entry and brings data back to the .bqy document.
    Here is what I did,
    I opened up the DSN entry, changed the TNS Service Name from //146-abc.xyz.com:1521/MYORCL0617 to
    //146-abc.xyz.com:1521/NONSENSE. I then restarted DAS and redeployed the .bqy document. the .bqy document is still able to refresh its data. So, I have just proven that the .bqy document does not need a valid DSN entry to work, how come??
    Can you (or anyone) please explain the phenomenon that I see?
    Also, a very basic question. you know that when you create a .bqy in the Studio, you "import" an OCE into the .bqy document so that the .bqy knows that it should use this OCE to talk to the backend data source. but, when you deploy this .bqy in workspace, how does the .bqy know that it is supposed to go through DAS (and DSN) to interact with the database, rather than the "internal" OCE that was pre-built with this .bqy?
    thanks,
    hypuser1010

  • 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

  • Interactive report download in PDF - getting an error message

    Hi,
    while using default feature to download interactive report in PDF format, I am getting following error:
    Adobe Reader could not open 'filename.pdf'because it is either not a supported file type or because the file as been damaged ( for example, it was sent as an email attachment and wasn't correctly decoded
    please advice
    Thanks

    Hi,
    Adobe Reader could not open 'filename.pdf'because it is either not a supported file type or because the file as been damaged ( for example, it was sent as an email attachment and wasn't correctly decodedWhen I get this error, I rename the downloaded PDF file to TXT to look into it. Usually there is a human-readable error message in there generated by the web server, Apex or any other party involved in its generation...
    But, as pointed out, have you set up Apex to generate PDFs?
    Luis

Maybe you are looking for

  • First time user of Time Machine.  Have some questions....

    To All, Sorry for starting another thread as I could not find the answers I was looking for in other threads. Basically I have been on a Mac (iMac) for about a year, and I wanted to start using the Time Machine utility to back up my iMac to my extern

  • Bought Quicktime Pro and my computer died, do I have to buy it again?

    I bought Quicktime Pro back in 2006, recently my laptop died and I had to get it a new harddrive. I still have the serial number cause I bought it online. But it says it's an invalid number and I can't use it. Do I have to buy it again? Thank you!

  • Change language of output type in output type condition?

    Hey Team ABAP, subject is MM output type determination for PO. Standard finds his customized output type and sets communication language of supplier as output type language. I need to somehow change that, as we dont want to print our PO´s in supplier

  • Syncronize SELECTED calendar items

    When I synchronize my storm, I am told something similar to ... add 3 new items, change 6 items, delete 220 items. and I'm given the choice to accept, or reject. What if I want to accept the "adds" and "changes", but reject the "deletes" ?  Or accept

  • Configuring Cost Code along with Payroll elements in Timekeeper time entry

    Hi, I am trying to configure cost code as a separate entry along with payroll elements in timekeeper time entry screen. Can any one help me in completing the task. Regards BK