ALVs with Interactive reports

Hi Friends,
I want to build a report based on <b>ALVs</b> and also like a <b>Interactive reports</b>.
Eg: First I want to display customer details in first <b>ALV Grid</b>. IF the user click on the <b><u>Cust No</u></b> the next screen should shown the <b>order headers</b> of that <b>customers</b>, when the user click on <u><b>Order No</b></u> in this screen I want to display in the next screen with the details of that <b>Sales orders</b>.
       Here I m having the doubts where I have to <u><b>Hide the Cust No or Order No</b></u>. Where I have to use
<b>AT LINE-SELECTION</b> command. In each screen is necessary to call the Function Module <b>REUSE_ALV_GRID_DISPLAY</b>.
Plz send me asap.
Regards
Praveen Kumar

YOu can achive this by populating the field I_CALLBACK_USER_COMMAND in the final function module, used to display the list. This field should be assigned a FORM name. THis form will be executed when the user clicks a field on the screen.
THis form imports two parameters namely sy-ucomm and SELFIELD of type SLIS_SELFIELD. this field contains the details of the list selected. check the below code for your reference... the below code will navigate to Sales Order display.
report test.
type-pools : slis.
data : itab_events type slis_t_Event with header line,
it_output like vbak occurs 0 with header line,
itab_fldcat type SLIS_T_FIELDCAT_ALV.
data : v_Repid type sy-repid,
WA_FLDCAT TYPE SLIS_FIELDCAT_ALV .
start-of-selection.
v_repid = sy-repid.
select * from vbak into table it_output.
if sy-subrc = 0.
sort it_output by vbeln.
endif.
Field the field catalog
WA_FLDCAT-TABNAME = 'IT_OUTPUT'.
wa_fldcat-fieldname = 'VBELN'.
WA_FLDCAT-SELTEXT_M = 'Sales Document' .
WA_FLDCAT-COL_POS = 1 .
WA_FLDCAT-DDICTXT = 'M'.
WA_FLDCAT-KEY = 'X'.
WA_FLDCAT-HOTSPOT = 'X'.
append wa_fldcat to itab_fldcat.
clear wa_fldcat.
wa_fldcat-fieldname = 'AUART'.
WA_FLDCAT-TABNAME = 'IT_OUTPUT'.
WA_FLDCAT-SELTEXT_M = 'Order Type' .
WA_FLDCAT-COL_POS = 2 .
WA_FLDCAT-DDICTXT = 'M'.
append wa_fldcat to itab_fldcat.
clear wa_fldcat.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'FRM_ALV_USER_COMMAND'* I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = ITAB_FLDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = ITAB_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = it_output
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.
form frm_alv_user_command USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
case ucomm.
when '&IC1'.
IF SELFIELD-TABNAME = 'IT_OUTPUT'.
IF SELFIELD-FIELDNAME = 'VBELN'.
read table it_output index SELFIELD-TABINDEX.
if sy-subrc = 0.
SET PARAMETER ID 'AUN' FIELD IT_OUTPUT-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
endif.
endif.
endif.
endcase.
endform.
The UCOMM will always contain '&IC1'.
Use this code, should help you.
Coutesy : SDN Forum
Manohar

Similar Messages

  • Reg. alv and interactive reports

    Hi Friends,
    What is the difference between alv and interactive reports?.
    rewards are helpful answers.

    Hi,
    ABAP List Viewer
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    Using ALV, we can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    Interactive Reports
    As the name suggests, the user can Interact with the report. We can have a drill down into the report data.
    Purpose
        Interactive report provides you with comfortable functions for navigating through your data.
    Use
    Interactive report are used to display multiple list in one single report
    It has basic list and then you can  navigate to one or other screens in one single report
    Enhance the efficiency & transparency of Business Processes
    Example :  Column one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can HIDE that data under those material numbers.
    And when the user clicks the material number, another report (actually sub report/secondary list) which displays the vendor details.
    Advantage of ALV over Interactive:--
    1> Graphic Can be added
    2> Less Amount Of coding
    Reward If Helpful

  • Dynamic action with interactive report region refresh

    Hi!
    I'm using APEX 4.02
    I've got a page with 2 regions.
    Region1 is a (input) form
    Region2 is an interactive report on the same table as region 1
    When entering values on the form I'm trying to dynmically lookup similar records in the table with the interactive report.
    I've made a dynamic action on the change of the form fields which should refresh the interactive report region. I can see this one fires if I add a alert to debug if it fires.
    The dynamic report is based on a query with bind variables pointing to the form fields, for example
    where
    field1 = :P2_FIELD1
    This works great on the page load, so no dynamic action is fired but I can see the rows in the report region are the ones I am looking for.
    But the refresh of the report region is not working, it is never refreshing and/or showing the correct data after a change of the form fields, so it looks like the dynamic action "refresh region" is not working on the interactive report.
    Any ideas why this can go wrong ?
    I would like to solve this using standard dynamic actions and preferrably not via PL/SQL or JS, shoudl be possible if I should believe the documentation... ;)
    Cheers
    Bas
    Edited by: bklerk on 26-apr-2011 3:07

    Hi,
    When you change value to item, I assume you do not set value to session state.
    Use interactive report advanced attributes "Page Items to Submit" , set items session state before report is refreshed.
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/app_comp.htm#sthref1235
    Similar post/issue here
    Hide and show region - hides on refresh
    Regards,
    Jari

  • Date format interfering with interactive report

    My APEX version is 3.1.1.00.09.
    I'm using a method described elsewhere to change the global date format of my application. I have application items for a start and end date. I have two application processes, one for On Load: Before Header, the other for On Submit: After Page Submission - Before Computations and Validations. They both do:
    DBMS_SESSION.SET_NLS(param => 'NLS_DATE_FORMAT', value => '''fmMM/DD/fmYY''')
    Okay, all is well with that, my dates seem to stay the way I want them to. Since our upgrade I'm going through each section of my application and updating as necessary, and I particularly want to use the interactive reports. They work fine when the page is loaded, but if I change any options on the interactive report and submit it, I get an "ORA-01843: not a valid month" error. If I refresh the page, everything works as it should.
    What can I do to get around this, or do I have something wrong with my method that is causing this to happen?
    Chris

    Hi Chris,
    I tried to replicate this, but could not. Now granted, I tried this using the new "modern" method of controlling the default application date format via the new application Globalization attribute "Application Date Format". I set the Application Date Format to fmMM/DD/fmYY and my IR on EMP worked just fine.
    If you can replicate this on apex.oracle.com (using Application Date Format), I'd be happy to take a look at it.
    Joel

  • How to send a conditional email with interactive report subscription

    Hi,
    i have an interactive report with subscription.
    I would like to send an email with the attachment only when the query returns one or more records.
    How to to this?
    Apex 4.0.2
    Thanks in advance
    lukx

    Well, to understand your requirements can I ask this:
    You said earlier you want a report sent whenever records that meet a criteria exist, correct? So you want the application to query for a condition, and when that condition occurs (a row with primary Key = X, a select COUNT(1) for rows with column X returns a result of 1 or more)
    Then you would schedule a batch job:
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Send_Email_Procedure',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Test_For_COND_SEND(); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=hourly; byminute=0',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    This would in theory run hourly and run your test_for_cond_Send process, in which you would test for the condition and send an e-mail if it was found that would contain the results from your query/report.
    Here is a link to generate a PDF report that could be sent via e-mail: Re: how to save pdf in APEX 3.0
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • I have a problem with interactive report in  horizontal scroll bar

    hi all,
      in my interactive report the horizontal scroll bar is not visible and i have created a scroll bar with the html code and i have a problem in that scroll bar when ever i will click the select list and if i will move the scroll bar and the select list is also moving but it the select list dont have to move .pls give me a solution for this urgent.
    thanks in advance 

    Kishore suresh wrote:
    hi all,
      in my interactive report the horizontal scroll bar is not visible and i have created a scroll bar with the html code and i have a problem in that scroll bar when ever i will click the select list and if i will move the scroll bar and the select list is also moving but it the select list dont have to move .pls give me a solution for this urgent.
    thanks in advance
    Hi,
    How you think anybody can help if you do not post single line how you have try create that scrolling report ?
    And if your issue is urgent, you are seeking help from wrong place.
    Regards,
    Jari

  • ALV and Interactive Reports

    Hi,
      Can anyone email me a documentation on ALV reports and Interactive reports at [email protected]
    Amit

    Hi,
    Check this link for ALV GRID control
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    You can check the development class SLIS for ALV related sample programs..
    Thanks,
    Naren

  • Issue with Interactive Report

    I have a report that grabs over 10,000 rows (it's an inventory). When I run it from sql plus, it is pretty fast. When I run it from a standard report, again it's pretty fast. However, my interactive report takes about 2 min to load. I did a p_trace and got this result from the accompanying TKPROF
    <pre>
    select
    ROWID as apxws_row_pk,
    "MASTER_STYLE",
    "STYLE_DESCR",
    "STYLE_LINK",
    "STYLE",
    "COLOR_NO",
    "COLOR_DESCR",
    "LINEPR",
    "RETAIL_PRICE",
    "AVL",
    count(*) over () as apxws_row_cnt
    from (
    select * from (
    select style,
    style_link,
    style_descr,
    color_no,
    color_descr,
    avl_qty,
    linepr,
    retail_price,
    master_style,div,
    k_apex.return_avl_matrix(style,color_no,k_apex.f_get_value('WHOUSE'),:global_cust_no) AVL
    from nkw.vw_style_chooser
    where (div = :global_div_no or :global_div_no is NULL)
    ) r
    ) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)
    order by ROWID
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 2 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 17 0.67 0.65 271 62548 8700 17
    total 19 0.67 0.65 271 62550 8700 17
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 61 (recursive depth: 1)
    Rows Row Source Operation
    17 WINDOW SORT
    10000 COUNT STOPKEY
    10000 NESTED LOOPS
    10000 NESTED LOOPS
    10000 NESTED LOOPS
    10000 NESTED LOOPS SEMI
    10000 TABLE ACCESS FULL INVENTORY_M
    10000 INDEX UNIQUE SCAN PK_ITL (object id 31210)
    10000 TABLE ACCESS BY INDEX ROWID COLOR_M
    10000 INDEX UNIQUE SCAN PK_COLOR_NO (object id 30737)
    10000 TABLE ACCESS BY INDEX ROWID COSTING_M
    10000 INDEX UNIQUE SCAN PK_CS_STYLE (object id 30759)
    10000 TABLE ACCESS BY INDEX ROWID COSTCOLS
    10000 INDEX UNIQUE SCAN PK_CCL_SKU (object id 30752)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 26 0.01 0.03
    db file sequential read 70 0.00 0.06
    </pre>
    Is there a way to only have it start with a few hundred rows to speed up the process?
    Thanks,
    Scott

    What is the pagination type that you have selected in the in the interactive report ? (Pagination type is under "Pagination" tab of interactive report attribute). Ensure that it is not set to "Row ranges X to Y of Z". That can be one of the reason for slow performance.
    Regards,
    Ashish
    http://www.dbcon.com

  • Attn Carl: Issue with interactive report and custom JavaScript

    I am trying to use interactive reports on the same page as a third-party JavaScript datepicker. The two components obviously interfere with each other, but I am not skilled enough in JavaScript to figure out why. It would be great if you could take a quick look.
    I am using the datepicker from http://yellow5.us/projects/datechooser/ (by the way, this is a really nice, lightweight datepicker that does not pop up a new window, and something like this should be built-in in the next version of Apex, instead of the cumbersome server-side popup that is currently in Apex. Consider this a post-3.1 enhancement request... :-).
    I have put up a simple demonstration page here:
    http://apex.oracle.com/pls/otn/f?p=36647:1
    When loading the page, Firefox complains (in the Error Console) that "event is not defined" on datechooser.js line 895, which looks like this:
    e = e || events.fix(event);
    (The error console in FF links to the full JS source code...)
    After the page has loaded, any clicks on the Interactive Report gives an error in the Error Console: "gReport has no properties".
    Internet Explorer (6.0) displays a similar warning message ("gReport.controls is null or not an object"), but the functionality (both datepicker and interactive report) still works.
    Would be eternally grateful if Carl or anyone JS-savvy could take a look at this problem...
    - Morten

    Hello,
    On line 931 of your file there is a call to attach the function to the window onload function
    events.add(window, 'load', function()......
    Try replacing that with this which is the way we do it in APEX , looks like that is where the conflict is.
    addLoadEvent(function().......
    I'm not sure this will fix it but hopefully it does, I can take a closer look tomorrow if it's doesn't.
    Consider this a post-3.1 enhancement requestCan you add to the enhancement thread.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Issue working with Interactive Reporting and Metaread option on Essbase 11

    Issue:
    I can´t see members/Generations of Essbase using the OLAP Query Object in Interactive Reporting, when Essbase Filters ( Metaread ) were applied on Dimensions
    Versions:
    Interactive Reporting 11 / Essbase 11
    Comments:
    -     If I’m connected, with an Admin user who don't have Metaread Filter Security it works fine.
    Tests:
    -     I do a test when I connect my query to Essbase 9.2, it works fine and I can see the members and generations without problems.
    It seems that could be a bug, did you have any ideas about what would happened with the Essbase 11.1.2 that IR could not interpret the same way as Essbase 9.2 do
    Regards
    Alberto

    <p>Are you creating the computed item on the Request line or theResults columns?</p>

  • Download/print problems with Interactive Reports on 10g

    Running APEX 3.1.1.00.9 on Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production with BI Publisher
    When downloading Interactive report using xls/rtf - no data is shown, pdf - corrupted file error is shown. This seems to only happen with row counts over 20. Same tables with less rows populates fine with all file types.
    This problem does not exist using the APEX.oracle.com site, same tables. Is this due to the DB version?

    For addional info, I'm putting down major steps that I followed so that it can be confirmed for any missing links. Sorry for a little bigger post
    1) $ORACLE_HOME\bin\rwserver.exe -install myRepSrv
    2) Created a report in the reports builder, saved as .rdf
    3) In Forms builder, attached the report as a new report object.
    4) In a procedure to call the report, following code is written
    ----------8<---------------
    repid := find_report_object('testreport');
    set_Report_object_property(repid,report_filename,'testreport');
    set_report_object_property(repid,report_COMM_MODE,synchronous);
    set_report_object_property(repid,report_server,'myRepSrv');
    v_rep_jobid := RUN_REPORT_OBJECT(repid);
    v_rep_stat := report_object_status(v_rep_jobid);
    IF v_rep_stat = 'FINISHED' THEN
    web.show_document('/reports/rwservlet/getjobid'||substr(v_rep,length('myRepSrv')+2,LENGTH(V_REP))||'?server=myrepsrv','_blank');
    else
    message (v_rep_stat||'- Report output aborted '||sqlerrm);
    END IF;
    ----------8<---------------
    5) Compiled the form and placed the form binary in approprite folder
    6) modified $ORACLE_HOME\reports\conf\myRepSrv.conf. Changed the property of engine tag(sourceDir) to correctly point to the appropriate directory where the report has been saved
    7) modified rwservlet.properties to turn off SSO
    8) Started the external reports service with modified values
    9) Invoked the form to launch the report
    Please also note that if I invoke directly web.show_document and paste the hardcoded path, as can be expected, my work is done. But as can be agreed, this is not a very good approach.
    Thanks and regards,
    Kinjal Sonpal

  • Problem with Interactive Reports and IE 7

    When using IE 7 a user clicks on any of the Interactive Reports options from the "Gear" pulldown and the popup apprears for a fraction of a second then disappears. This occurs in all of the options. I'm using IE 6 and it works fine for me. Has anyone seen this behavior with IE 7?

    Hello Bernd,
    The problems is that they can't read the Flash contents. Video let appear a black window and Animation let appear the Flash logo in B&W.
    I think, at less for Windows 8, that a plug in flash is installed on Internet Explorer. So when you want to get Flash player, an alert tell you that flash is already installed. ...

  • Custom traffic lighting with Interactive Reporting

    Has anyone written a custom javascript solution for cell-based traffic lighting in Interactive Reports? It does not appear that the object model gives access to cell-level properties in either the pivot or OLAPquery objects although spotlighting can be applied to individual columns and rows.

    Oh yes, understand perfectly what you want, sighing...
    I planned to write another blog post about reporting partial scores, but since Posterous closed down in March, I am not blogging any more, just paying to keep the old posts online on demand of a lot of users. There are several reasons for that, which I will not explain but it is mainly because I feel really exploited.
    Two possiblities:
    Using the mastery widget of InfoSemantics (but limited to SWF-output)
    Using JavaScript
    Lilybiri

  • ALV and Interactive Reports in SAP ABAP?

    Hi All,
           What type of reports we can generate in SAP ABAP using ALV & Interactive in real time Scenario? Do SAP provides some Standard reports? Plz give some examples?
    Thanks in Advance.

    Hi Mohnish,
    You can refer the following  ALV sample code :
    TYPE-POOLS: slis.
    TABLES : afko,afpo .
    +-- Data declarations--+
    DATA : BEGIN OF it_afpo OCCURS 0,
           AUFNR LIKE afpo-AUFNR,
           PSMNG LIKE afpo-PSMNG,
           WEMNG LIKE afpo-WEMNG,
           PWERK LIKE afpo-PWERK,
           DAUAT LIKE afpo-DAUAT,
          END OF it_afpo.
    DATA : BEGIN OF it_afko OCCURS 0,
           AUFNR LIKE afko-AUFNR,
           GSTRP LIKE afko-GSTRP,
           GSTRS LIKE afko-GSTRS,
           GSTRI LIKE afko-GSTRI,
           GSUZI LIKE afko-GSUZI,
           PLNBEZ LIKE AFKO-PLNBEZ,
          END OF it_afko.
    DATA : BEGIN OF it_makt OCCURS 0,
            matnr TYPE matnr,
            maktx TYPE maktx,
           END   OF it_makt.
    DATA : BEGIN OF it_output OCCURS 0,
          AUFNR LIKE afpo-AUFNR,
          PSMNG LIKE afpo-PSMNG,
          WEMNG LIKE afpo-WEMNG,
          DAUAT LIKE afpo-DAUAT,
          GSTRP LIKE afko-GSTRP,
          GSTRS LIKE afko-GSTRS,
          GSTRI LIKE afko-GSTRI,
          GSUZI LIKE afko-GSUZI,
          PLNBEZ LIKE AFKO-PLNBEZ,
          matnr LIKE makt-matnr,
          maktx LIKE makt-maktx,
          END OF it_output.
    DATA: wa_output LIKE it_output,
         wa_afpo LIKE it_afpo,
         wa_afko LIKE it_afko,
         wa_makt like it_makt.
    DATA : wk_date1(10) TYPE c,
           wk_date2(10) TYPE c,
           wk_datehead TYPE string.
    +--Selection screen parameters--+
    INITIALIZATION.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
      SELECT-OPTIONS: s_matnr FOR afpo-matnr.
      PARAMETERS : p_pwerk type afpo-pwerk OBLIGATORY.
      SELECT-OPTIONS: s_dauat for afpo-dauat OBLIGATORY,
                       s_gstrp for afko-GSTRP OBLIGATORY.
      SELECTION-SCREEN END OF BLOCK b1.
    --internal tables for alv--
      DATA : gt_fieldcat TYPE slis_t_fieldcat_alv, "catalog for alv
      gt_heading TYPE slis_t_listheader, "list for header1
      gt_sort TYPE slis_t_sortinfo_alv, "Sorting of the
      gt_event TYPE slis_t_event,
      gt_selfield TYPE slis_selfield,
      gv_alv_event TYPE slis_alv_event,
      gv_repname TYPE sy-repid,
      gs_layout TYPE slis_layout_alv,
      gv_save TYPE c.
      CONSTANTS gc_forname_top_of_page TYPE slis_formname VALUE
    'TOP-OF-PAGE'.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM output_data.
      PERFORM build_comment USING gt_heading[].
      PERFORM eventstab.
      PERFORM sub_t_sort_build.
      PERFORM build_field_catalog.
      PERFORM display_data.
    --Data selection--
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      select AUFNR
             PSMNG
             WEMNG
             MATNR
             PWERK
             DAUAT
             from afpo  CLIENT SPECIFIED
             INTO TABLE it_afpo
             WHERE mandt = sy-mandt
                      AND matnr IN s_matnr
                      and pwerk = p_pwerk
                      and dauat in s_dauat.
      select AUFNR
             GSTRP
             GSTRS
             GSTRI
             GSUZI
             PLNBEZ
             from afko CLIENT SPECIFIED
             INTO table it_afko
             FOR ALL ENTRIES IN it_afpo
             WHERE mandt = sy-mandt
                      AND aufnr = it_afpo-aufnr
                      and gstrp in s_gstrp.
      SELECT  matnr
                maktx
                FROM makt
                INTO  table it_makt
                FOR ALL ENTRIES IN it_afKo
                WHERE matnr = it_afKo-PLNBEZ.
    ENDFORM.                    " get_data
    *&      Form  output_data
          text
    -->  p1        text
    <--  p2        text
    FORM output_data.
      loop at it_afko into wa_afko.
        LOOP AT it_afpo into wa_afpo
        WHERE aufnr = wa_afKo-aufnr.
          wa_output-AUFNR = wa_afpo-AUFNR.
          wa_output-PSMNG = wa_afpo-PSMNG.
          wa_output-WEMNG = wa_afpo-WEMNG.
          wa_output-DAUAT = wa_afpo-DAUAT.
        ENDLOOP.
        loop at it_makt into wa_makt
        where matnr = wa_afKo-PLNBEZ.
          wa_output-matnr = wa_makt-matnr.
          wa_output-maktx = wa_makt-maktx.
        endloop.
        wa_output-GSTRP = wa_afko-GSTRP.
        wa_output-GSTRS = wa_afko-GSTRS.
        wa_output-GSTRI = wa_afko-GSTRI.
        wa_output-GSUZI = wa_afko-GSUZI.
        APPEND wa_output TO it_output.
      ENDLOOP.
      CLEAR wa_afpo.
      CLEAR wa_afko.
      CLEAR wa_output.
    SORT IT_OUTPUT BY GSTRP GSUZI.
    ENDFORM.                    " output_data
    --Header for ALV--
    *&      Form  build_comment
          text
         -->P_GT_HEADING[]  text
    FORM build_comment USING  p_heading TYPE slis_t_listheader.
      DATA : ls_header TYPE slis_listheader.
    *--poputale the report header info
      ls_header-typ = 'H'.
      MOVE : text-002 TO ls_header-info.
      APPEND ls_header TO p_heading.
      CLEAR ls_header.
      ls_header-typ  = 'S'.
      ls_header-key  = text-013 .
      "'User:'
      ls_header-info = sy-uname.
      APPEND ls_header TO p_heading.
      CLEAR: ls_header.
    ENDFORM.                    " build_comment
    *&      Form  eventstab
          text
    -->  p1        text
    <--  p2        text
    FORM eventstab.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type     = 0
           IMPORTING
                et_events       = gt_event
           EXCEPTIONS
                list_type_wrong = 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.
      READ TABLE gt_event
      WITH KEY name = slis_ev_top_of_page
      INTO gv_alv_event.
      IF sy-subrc EQ 0.
        MOVE gc_forname_top_of_page TO gv_alv_event-form.
        APPEND gv_alv_event TO gt_event.
      ENDIF.
    ENDFORM.                    " eventstab
    *&      Form  build_field_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM build_field_catalog.
      DATA ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos = 1.
      ls_fieldcat-fieldname = 'DAUAT'.
      ls_fieldcat-outputlen = 12.
      ls_fieldcat-tabname = 'it_output'.
      ls_fieldcat-seltext_l = 'Order Type'.
      ls_fieldcat-KEY = 'X'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos = 2.
      ls_fieldcat-fieldname = 'AUFNR'.
      ls_fieldcat-outputlen = 10.
      ls_fieldcat-tabname = 'it_output'.
      ls_fieldcat-seltext_l = 'Order Number'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos = 3.
      ls_fieldcat-fieldname = 'MATNR'.
      ls_fieldcat-outputlen = 12.
      ls_fieldcat-tabname = 'it_output'.
      ls_fieldcat-seltext_l = 'Material Number'.
      APPEND ls_fieldcat TO gt_fieldcat.
      ----you can add fields as per your requirement.*----
    ENDFORM.                    " build_field_catalog
    *-- Form top of page
    FORM top-of-page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = gt_heading.
    ENDFORM. "TOP-OF-PAGE
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data.
      gv_save = 'A'.
      gv_repname = sy-repid.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = gv_repname
                is_layout          = gs_layout
                it_sort            = gt_sort[]
                it_fieldcat        = gt_fieldcat[]
                i_default          = 'X'
                i_save             = gv_save
                it_events          = gt_event[]
           TABLES
                t_outtab           = it_output
           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_data
    *&      Form  sub_t_sort_build
          text
    -->  p1        text
    <--  p2        text
    FORM sub_t_sort_build.
      DATA  ls_sort TYPE slis_sortinfo_alv.
      ls_sort-spos = 1.
      ls_sort-tabname = 'it_output'.
      ls_sort-fieldname = 'DAUAT'.
      ls_sort-subtot = 'X'.
      ls_sort-up = 'X'.
      ls_sort-group = '*'.
      APPEND ls_sort TO gt_sort.
    ENDFORM.                    " sub_t_sort_build
    Reward points, if helpful
    Regards,
    Ramneet

  • Problem with Interactive Report

    Hi,
    I am trying to create a report using five tables named 1.Servers:- server_id,name,service_id,type_id 2.Servertype:-type_id,name 3.CPUutilzation:-cpuutil_id,server_id,parameter_id,average,maximum,timestamp 4.MEMutilzation:-memutil_id,server_id,parameter_id,average,maximum,timestamp 5.Serverparameter:-parameter_id,name
    i am using the below query:-
    select s.caption as "Server Name",st.caption as "Server Type",cp.maximum as "MAX CPU Utilization",cp.average as "Avg CPU Utilization",mp.average as "Avg Memory Utilization",mp.maximum as "MAX Memory Utilization"
    from servers s,servertype st,cpuutil cp,memutil mp
    where s.type_id=st.type_id
    and cp.server_id=s.server_id
    and mp.server_id=s.server_id
    The problem is that I have 24 records in cpu utilization and memory utilization tables. However the report is displaying 48 records.
    I would really appreciate if someone could help me to rectify the problem.
    Regards,
    Ash

    Hi Ash
    First off, when posting code on the forum please put {noformat}{noformat} (with the curly brackets and the word code in lower case) before and after you code. This will preserve formatting so that the rest of us can read it, like this...SELECT s.caption AS "Server Name",
    st.caption AS "Server Type",
    cp.maximum AS "MAX CPU Utilization",
    cp.average AS "Avg CPU Utilization",
    mp.average AS "Avg Memory Utilization",
    mp.maximum AS "MAX Memory Utilization"
    FROM servers s,
    servertype st,
    cpuutil cp,
    memutil mp
    WHERE s.type_id = st.type_id
    AND cp.server_id = s.server_id
    AND mp.server_id = s.server_id
    Basically your getting duplicate rows because one of your joins is returning two rows that match the condition.
    Best way to hunt this down is to change it to SELECT * and look at each row returned. You should be able to spot the difference then ie. there will be column where the value is different between two duplicate rows. The table that column comes from is the one that you need to be more selective on.
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Problem with printing graph larger than screen size in labview6 (plots are shopped).

    I have attached with my message the report I try to print. It is a Labview 6 vi. I had no problem with Labview 5. But with Labview 6, the plots are shopped (all the rest of the report is correct). What is printed is not what I see. The graph is inten

  • BB will not Display Incoming Calls Contact Info

    Hi there, I am a new user to the Black Berry world, and have encountered a problem I hope can be fixed. I have 84 contacts in my Adress Book in my Black Berry 8900, all with 10 digit phone numbers linked to each. I do not pay for caller ID through Ro

  • My Nokia 5230 blurs, any help?

    My Nokia 5230 has started to blur (there're lines shaking  vertically) when i click the red button or unlock it. This doesn't happen all he time.  I did some search and i found this is a common problem even for 5800. I have updated the firmware to th

  • How to change default response encoding for not jsp files

    Hi Question about Weblogic Portal&Serwer 10. For standard web applications from war archiwes, html etc. files are send with default server response "Content-Type: text/html; charset=ISO-8859-1". The question is how to disable this default header or h

  • Idoc processing - determine Basic Type in Program

    Hi Forums, I would like to determine the Basic type that is being processed by at the time of my Idoc creation. the function module I am using is being called by shipping document as well as delivery documents. I would like my code only to be execute