Get drill down report on click of 2d column using javascript

Hi ,
Am using 2d column chart in apex, the query am using is as below using query source type as : Query returning sql query
DECLARE
l_qry VARCHAR2(4000);
l_ec_member varchar(4000);
BEGIN
l_qry := '
select
''javascript:dhtml_GetReport_r5(0,0,0,''''''||''''||Source||''''||'''''',0,0,0)'' link,,
source,
GET_RDB_EXEC_ESC(''Closed'','''',source) Closed ,
GET_RDB_EXEC_ESC(''WIP'','''',source) WIP
from abc a
where source is not null';
etc etc
Now am facing problem when clicked on 1st column its taking both closed and WIP and populatin drill down, but what i want is how to pass the 1st column and 2nd column value separtely in session using javascript.
Thanks in advance

Hi,
Now page 900 works.
I did set link URL target to
javascript:void(0)link attributes
onclick="update_queue_status(this,'#EMPNO#')"javascript
<script type="text/javascript">
function update_queue_status(pThis,pEmpno){
var j=$(pThis).parents('tr:eq(0)').find('[name="f01"]').val();
var ajaxRequest=new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=AP_UPD_STAT',&APP_PAGE_ID.);
ajaxRequest.addParam('x01',j);
ajaxRequest.addParam('x02',pEmpno);
var ajaxResult=ajaxRequest.get();
//alert(ajaxResult);
</script>I did also create developer user HELPER to your workspace
Regards,
Jari

Similar Messages

  • [1.1.0.23.64] Drill down reports - right click actions

    The release notes of SQL Developer version 1.1 includes a line concerning 'increased right click actions' for the reports category. One of the new actions is 'Go to <object>', if you select this action it will show you the properties of the object. For instance, when performing a right click and selecting 'Go to EMP' on the EMP row in
    the result set of the 'All objects' report, SQL Developer shows you the properties of the EMP table. This feature is also known as drill down capability (for screen shots see http://jornica.blogspot.com/2006/12/changing-preferences-by-executing.html).
    In the previous version 1.0, the 'Go to' object name was implemented by double-clicking a row in the result set. In version 1.1, if you double-click a row SQL Developer shows a button (this button appears in the cell you double-click). If you click this button SQL Developer shows the Edit Value window for Line terminator value.You can change this value by clicking the change button and SQL Developer shows the Preferences window.
    Because the line terminator value is a global setting (this value is used for every report) I'm wondering why you can change the line terminator value in version 1.1 from every result set cell? You can also use the main menu Alt-Tools Preferences. I find the version 1.0 drill down capability much more intuitive and easier to use than the version 1.1 implementation.
    With kind regards,
    Jornica

    This is exactly the same problem I have.
    Not able to start remote debug listener

  • Delete frozen data in drill down report

    hi guys,
    does any one know how to delete the frozen data in a drill down report?
    thanks

    Hi HariKan,
    Based on my understanding, you create a drilldown report, when you click the plus button to expand the subreport, some rows doesn’t have data. You want to only display those rows which contain data.
    In your scenario, you should specify the query in where clause to eliminate blank data rows within the subreport. Then use this report as subreport on main report, then create a toggle button. Please refer to the steps:
    1. Go to the subreport, specify the query like below:
    2. Back to the drill down report, create a subreport control and use the changed report as subreport, then specify the Visibility option like below and preview the report.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • How to get the output data of Standard drill down report into z-program?

    HI every one,
            I want to get the output data of drill down report into z-program.
           Actually,if the output is only one, I can get into z-program,
          But, Here the report consists 3 alv outputs. when double clicking function happens, it will direct to another alv output.
        Those, all the outputs of report i want to get into z-program.
    PLease , give reply as early as possible.
    Thank u in advance,
    karthik

    HI,
      When i download,only one output i will get.
      But,if i double-click the particular record it will show another output. I want that output also.
      Like that,when i double-click particular record, it will show some other alv ouput based on record,     
    i wanted all those outputs.
    If  i copy the code, whether i face any problems?

  • How to get the back button if we to go the 2nd drill down report??

    Hi,
    I have a drill down report for the main report. And have detailed drill down as in 1st report>2nd report>3rd report.
    But once i goto drill down, the return button is there which directs to main report i.e. 2>1,
    But once i goto 3rd, i do not get the back button so that i can access reports in 3>2>1, instead its going directly to 1st from 3rd.
    hope i have made the point clear.
    Someone suggest me how do i get the back button??
    Thanks!!

    use the below code in Narrative view
    <script&gt;
    function goBack()
    window.history.back()
    </script&gt;
    <input type="button" value="Back" onclick="goBack()"&gt;
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 13, 2013 12:08 AM

  • Hiding fields in ALV DRILLED DOWN REPORT

    Hi
    My scenario is like this i created a alv drilled down report , in that once the user executes it ,it will displays the header contents of the purchase order.
    If the user double clicks on any of the header line item it will displays the item detials of the particular header data..
    My probelm is if i double click  it i am getting the header details added with the item fields..i want to hide the header detials if i want to c the item level details..
    Can any suggest me some better ways to hide the header contents ??
    Arun Joseph

    hi,
    check ur field cat...
    R u using same name?
    If possible paste ur code here...

  • Drill down report...

    HI abapers,
    How to create drill down report in alv.
    When i double click the particular field, another report has to pop up and display the details of that particular field.
    for eg,
    When double click the amount spent field other report has to say, For which material the amonut has spend.
    Thanking You
    arvind

    hi arv,
    for me your scenario is not clear..
    you want to drill down the alv .. and show the report in the same program or you want to call another program when u try to hit the alv report..
    well for drilling down the same program.. you can use the following method
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                 =  GV_REPID
        I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND            = 'TOP1'     " drill down
         I_CALLBACK_TOP_OF_PAGE             = 'TOP2'
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    FORM TOP1 USING UCOMM TYPE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
    READ TABLE GT_FINAL_TOTAL INTO GS_FINAL INDEX SELFIELD-TABINDEX.
    CASE SELFIELD-TABINDEX.
    WHEN SELFIELD-TABINDEX.
    perfrom itab2_operation. " in this form you will write the code to get the data for drill dispplay
    now defing fieldcatalog again : example :
        GS_FCAT-COL_POS = 1.
        GS_FCAT-FIELDNAME = 'EBELN'.
        GS_FCAT-SELTEXT_L =  TEXT-001.
        GS_FCAT-FIX_COLUMN = 'X'.
        GS_FCAT-OUTPUTLEN = 13.
        APPEND GS_FCAT TO GT_FCA
    and  call alv display again :
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                =  GV_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_TOP_OF_PAGE            = 'TOP2'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      = ''
      I_GRID_SETTINGS                   =
        IS_LAYOUT                         = GS_LAYOUT
          IT_FIELDCAT                     = GT_FCAT
    and if you want to call another progam when u hit..u have to use..submit key work
    like  SUBMIT  ZAFI013R VIA SELECTION-SCREEN AND RETURN.

  • Drill Down Report in screen painter

    Hi Experts,
    I have a requirement in dialog programming/screen painter to create a 2 level drill down report. for eac page of the report, it should only contain 10 entries then to view the other entries (11 and up), the button for next page should be click (there is also back button).
    First question is how will I have the drill down report (alv list type?) in screen painter?
    Second question is how should I process the logic mentioned above (next and back) in screen painter/dialog programming?
    Thanks in advance for all teh support. Points will be rewarded.
    Cheers,
    Kurtt

    Hai,
    Go thru this Threads u ll get an idea,
    Drill down report help
    Re: regarding Drill Down Reporting
    drill down capabilities for an alv grid display field using oops concept
    Regards,
    Padmam.

  • Calendar with Drill Down Report

    Hello,
    Everybody.
    I am new to Application Express.
    Please any one tell me step by step how to make calendar with drill down report.
    Waiting for valuable reply.
    Thanks
    Rahul

    Not sure if this is what you wanted, but I have links on a calendar, and when you click them, it branches to another page with details about the event.
    To do this, create a calendar region. The SQL statement should have at least 2 columns: The date of the "event", and the text to display as a link. You should also choose a primary key that you want to pass to the drill down report when the user clicks. Something like this:
    select hiredate date_scheduled,
              ename display_column,
              empno
       from empIn the calendar attributes of that region, there is a place to designate which column is the date, and which should be displayed. Go down a little further and set the column link. Put the page you want to show the drilldown report on, and set any variables you need to.
    Hopefully that helped. Its pretty simple once you play around with it - start simple and then once you get the hang of it, make it more complex.

  • REPORT PAINTER DRILL DOWN REPORT

    Hi,
    i need to develop report painter report with drill down for cost elments and month wise
    out should be cost elements and all months
    Please suggest how to use drill down
    Thanks and Regards
      RAVi

    Along these same lines. I have a user that cannot drill down into a drill down report. Let me clarify. This  report does have drill down capability as some people can drill down into it but others cannot. If a user has authorization to run a report via GRR3. When they click on an item to drill down they do not get an authorization error statement, all they get is a statment that says "list contains no data". Any ideas why some can drill down and some can't? Thanks
    Mark

  • Drill Down Report using Crystal reports in eclipse and jspviewer

    Hi
    I want to understand how to write a drill down report since I have a requirement for my project, so I tried to run the sample drill down.rpt that is available with Crystal Reports 2008 Complete Reference book by George Peck.
    I can see the results correctly( i.e. can drill down) in the preview tab . Since I am working inside the eclipse, the way I run the reports is first  "Create report viewer JSP" by right clicking the report and have a url mapping to this jsp. I am running the reports from a hyperlink that maps to the url which will launch the jsp.
    the jsp is:-
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %><%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %><crviewer:viewer reportSourceType="reportingComponent" viewerName="Drill Down-viewer" reportSourceVar="Drill Down" isOwnPage="true" allowDrillDown="true">
         <crviewer:report reportName="reports/Drill Down.rpt" />
    </crviewer:viewer>
    The one that was created by  "Create report viewer JSP" did not had "allowDrillDown" attribute at all .But I added it since it isnt working.
    So when I launch my web app and click on the link to run the report, I get the report results but only to the summary level. When I double click the summary level I get a 404 error page.
    Can please anyone suggest what is going on.
    Thanks
    poonam

    Ok. So, you added the report to the project. Now we have to add the CR assemblies to the project, add the viewer (if need be) and fire it off. Simplest code would be:
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            CrystalReportViewer1.ReportSource = ("path to report")
        End Sub
    In this case you are using the viewer SDK to runt he report. The report will prompt for any logon parameters - but you can code these also. You can load the report via the engine as bellow. Again, the report will prompt. I prefer to use the engine as it is way more "extensible"...
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
            crReportDocument.Load("path to report")
            'Bind the report to the viewer
            CrystalReportViewer1.ReportSource = crReportDocument
        End Sub
    If you have a report added to the project (strongly typed) the code would be:
    CrystalReportViewer1.ReportSource = New myReport()
    For more details, I'd recommend looking at the sample app vbnet_win_simplepreviewreport.zip available from the following location:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    The developer help files are here:
    [SAP Crystal Reports .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip]
    [SAP Crystal Reports .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip]
    - Ludek

  • Multi-Use Drill Down Reports?

    Hi,
    I'm just starting out with reporting in SSRS so this may be a silly question but I'm struggling to find a way to do what I want :)
    I have a large graphical report with several top 10 reports on different a cube. (eg. top 10 number of events, top ten numbers of computers affected) 
    I want drill down reports for both the Event Name and Computer Name, also to be able to click on the header of the report and get a complete unrestricted report. I have created a drill down report that has all the data and if I choose one item (say computer
    name) I can drop down to the drill down and filter the table in that with the computer name and return any results for that computer. I cant figure out how to have a secondary link that passes a wildcard to returns all results. I'd also like to have the ability
    to send an event name to the same drill down and a wildcard for the computer name. However I cant figure out how to get the filter on the table to accept any wildcards. 
    I dont want to have to create multiple reports for each of the different drilldowns, is this possible? (Easy to understand answers for a newbie if possible :) )

    Hi Chris_C2000,
    If I understand correctly, you have configure “Go to report” action in your report. It is Drillthrough in SSRS. You want to pass a value link to the corresponding report. We can add parameters in the drillthrough report, then pass parameters values to the
    report.
    I have create a simple report in my test environment. Suppose we have the same dataset (DataSet1) in main report and subreport with two fields: CalendarYear, SalesAmount. Please refer to it.
    Subreport:
    Add a table in the report body, fill with CalendarYear, SalesAmount fields.
    Add another dataset (DataSet2) with CalenderYear field.
    Add a parameter (CalenderYear) get Available Values from DataSet2 CalenderYear field.
    Add filter in the DataSet1, with values below:
    Expression: [CalenderYear]
    Operator: =
    Value: [@CalenderYear]
    Main report:
    Add a chart in the report, fill SalesAmount in the Values dialog box, CalenderYear in the Category Groups dialog box.
    Right click the bar in the chart, click Series Properties.
    Click Action in the left pane. Select “Go to report” option.
    Select the subreport below “Specify a report” prompt.
    Click Add icon below, and fill with following values:
    Name: CalenderYear                 Value: [CalenderYear]
    Then, when we preview the report, we can click the specific bar link to the subreport get the corresponding data.
    Reference:
    http://technet.microsoft.com/en-us/library/aa337477(v=sql.105).aspx
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Agregated value in original report in not same as the drill down report

    Hello experts,
    I have a issue with the drill down reports.
    Agregated value in the main report is not equal to the agregarated value in the drill down report.
    In my report I have a sales for jan 2011,feb 2011 so on
    For jan 2011 it is some thing $56000
    when I click on this amount it giving the detail level for each region sales and at the end it is giving the total sales for jan 2011 as $98000
    My question is why there such difference in the total amount when we are drilling down?
    Please help me in this regard. I am new to obiee.

    hello
    do you have any filters on this report that would related to measures?
    if so, remove these filters and see if you still get different values;
    rgds

  • DRILL DOWN REPORT FOR DIFFERENT DATA SETS in 11G

    Hello.
    My requirment is to do a drill down report with 2 data sets.
    My first data set have all the chart of accounts , My second data set have all the transactions.
    in my report i have 2 data tables. One with the accounts , and when i click in one account get all the transactions for selected account in the second data table.
    Anyone know how i can do this
    Any help would be apreciatted
    Paulo

    You can use the drill down strategy, well described by my friend Kan:
    http://bipconsulting.blogspot.com/2010/02/drill-down-to-detail-or-another-report.html
    regards
    Jorge
    p.s If this answers your question then please grant the points and close the thread

  • Regd : drill down report

    hi,
    I need to get drill down on each row
    if i click on revenue.i should get on drill down.
    and if i click on expense i need to get another drill down.
    Please help me out defenetly points will be rewarded
    *& Report  ZIN1
    REPORT  ZIN1.
    *&           Table declaration
    TABLES : coep,
             coas,
             tkv11,
             cepc,
             cskb,
             tka01,
             cska,
             aufk,
             setleaf.
    *&          type-pool declaration
    TYPE-POOLS : slis.
    *&           Internal tables  declaration
    DATA : BEGIN OF itab_coep OCCURS 0,
           kokrs LIKE coep-kokrs,           " Controlling Area
           gjahr LIKE coep-gjahr,           " FiscalYear
           perio LIKE coep-perio,           " Period
           kstar LIKE coep-kstar,           " CostElement
           bukrs LIKE coep-bukrs,           " CompanyCode
           wkgbtr LIKE coep-wkgbtr,         " Amount in Object Currency
           mbgbtr LIKE coep-mbgbtr,         " Total quantity entered
           meinh LIKE coep-meinh,           " unit
           objnr like coep-objnr,
           line_color(4) TYPE c,
           END OF itab_coep.
    DATA :BEGIN OF itab_cepc OCCURS 0,
           kokrs LIKE cepc-kokrs,
           prctr LIKE cepc-prctr,
           khinr LIKE cepc-khinr,           " Profit Center Group
           bukrs like cepc-bukrs,
           END OF itab_cepc.
    DATA : BEGIN OF itab_aufk OCCURS 0,
           kokrs LIKE aufk-kokrs,
           aufnr LIKE aufk-aufnr,           " Order Number
           bukrs LIKE aufk-bukrs,
           prctr LIKE aufk-prctr,           " ProfitCenter
           auart LIKE aufk-auart,           " OrderType
           autyp LIKE aufk-autyp,           " Order Category
           objnr like aufk-objnr,
           END OF itab_aufk.
    DATA : BEGIN OF itab_cskb OCCURS 0,
           kokrs LIKE cskb-kokrs,
           kstar LIKE cskb-kstar,
           katyp LIKE cskb-katyp,           " Cost Element Type
           aufnr LIKE cskb-aufnr,
           END OF itab_cskb.
    data : begin of itab_setleaf occurs 0,
           setclass like setleaf-setclass,
           subclass like setleaf-subclass,
           setname like setleaf-setname,     " CostElementGroup
           valfrom like setleaf-valfrom,
           valto like setleaf-valto,
           end of itab_setleaf.
    data : begin of itab_setleaf1 occurs 0,
           setclass like setleaf-setclass,
           subclass like setleaf-subclass,
           setname like setleaf-setname,     "InternalOrderGroupName
           valfrom like setleaf-valfrom,
           valto like setleaf-valto,
           end of itab_setleaf1.
    DATA : BEGIN OF itab_final OCCURS 0,
           kokrs LIKE coep-kokrs,
           gjahr like coep-gjahr,
           perio LIKE coep-perio,
           kstar LIKE coep-kstar,
           bukrs LIKE coep-bukrs,
           wkgbtr LIKE coep-wkgbtr,
           mbgbtr LIKE coep-mbgbtr,
           meinh LIKE coep-meinh,
           aufnr LIKE aufk-aufnr,
           auart LIKE aufk-auart,
           katyp LIKE cskb-katyp,
           prctr LIKE aufk-prctr,
           khinr LIKE cepc-khinr,
           kagru LIKE tkv11-kagru,
           periol like coep-perio,
           perioh like coep-perio,
           gjahrl like coep-gjahr,
           gjahrh like coep-gjahr,
           objnr like coep-objnr,
           setclass like setleaf-setclass,
           subclass like setleaf-subclass,
           setname like setleaf-setname,     " CostelementGroup
           setname1 like setleaf-setname,    " InternalOrderGroup
           valfrom like setleaf-valfrom,
           valto like setleaf-valto,
           ca like coep-kokrs,
           ccl like coep-bukrs,
           cch like coep-bukrs,
           pgl like cepc-khinr,
           pgh like cepc-khinr,
           pcl like cepc-prctr,
           pch like cepc-prctr,
           kul like coep-kstar,
           kuh like coep-kstar,
           kgl like setheader-setname,
           kgh like setheader-setname,
           orl like cskb-aufnr,
           orh like cskb-aufnr,
           orgl like setleaf-setname,
           orgh like setleaf-setname,
           line_color(4) TYPE c,
           END OF itab_final.
    DATA : ifinal like itab_final occurs 0 with header line.
    DATA : BEGIN OF itab1 OCCURS 0,
            katyp1(100) type c ,
            katyp like cskb-katyp,
            gjahr like coep-gjahr,
            bukrs like coep-bukrs,
            wkgbtr LIKE coep-wkgbtr,
            perio1(100) type C,
            gjahr1(100) type c,
            perio LIKE coep-perio,
            periol like coep-perio,
            perioh like coep-perio,
            gjahrl like coep-gjahr,
            gjahrh like coep-gjahr,
            prctr like cepc-prctr,
            setname like setleaf-setname,     " CostelementGroup
            setname1 like setleaf-setname,    " InternalOrderGroup
            ca like coep-kokrs,
            ccl like coep-bukrs,
            cch like coep-bukrs,
            pgl like cepc-khinr,
            pgh like cepc-khinr,
            pcl like cepc-prctr,
            pch like cepc-prctr,
            kul like coep-kstar,
            kuh like coep-kstar,
            kgl like setheader-setname,
            kgh like setheader-setname,
            orl like cskb-aufnr,
            orh like cskb-aufnr,
            orgl like setleaf-setname,
            orgh like setleaf-setname,
            line_color(4) TYPE c,
          END OF itab1.
    DATA : lin type i.
    *&         fieldcatalog  declaration
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
           t_fcat1 TYPE slis_t_fieldcat_alv,
           t_fcat2 TYPE slis_t_fieldcat_alv,
           t_fcat3 TYPE slis_t_fieldcat_alv,
           t_fcat4 TYPE slis_t_fieldcat_alv,
           t_eve TYPE slis_t_event,
           t_subtot TYPE slis_t_sortinfo_alv,
           t_subtot1 TYPE slis_t_sortinfo_alv,
           t_subtot2 type slis_t_sortinfo_alv,
           t_subtot3 type slis_t_sortinfo_alv,
           t_subtot4 type slis_t_sortinfo_alv,
           subtot LIKE LINE OF t_subtot,
           d_fieldcat_wa LIKE LINE OF t_fcat,
           gd_layout TYPE slis_layout_alv.
    DATA : t_header type slis_t_listheader,
           wa_header type slis_listheader.
    *&        variables   declaration
    DATA : gt_gross LIKE coep-wkgbtr,
           st_rev LIKE coep-wkgbtr,
           st_rev1 LIKE coep-wkgbtr,
           st_pc1 LIKE coep-wkgbtr,
           st_pc LIKE coep-wkgbtr,
           st_all1 LIKE coep-wkgbtr,
           st_all LIKE coep-wkgbtr,
           st_gross LIKE coep-wkgbtr,
           st_gross1 LIKE coep-wkgbtr,
           st_net1 LIKE coep-wkgbtr,
           st_net LIKE coep-wkgbtr,
           st_pt1 LIKE coep-wkgbtr,
           st_pt LIKE coep-wkgbtr,
           st_nt1 LIKE coep-wkgbtr,
           st_nt LIKE coep-wkgbtr.
    DATA : gd_repid LIKE sy-repid.
           gd_repid = sy-repid.
    data : ok_code like sy-ucomm.
    data :  DC like ok_code.
            DC = ok_code.
    *&        Selection-Screen declaration
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS     : p_ca LIKE coep-kokrs obligatory .
    SELECT-OPTIONS : s_year FOR coep-gjahr obligatory matchcode object zyear."default 2007 to 9999.
    SELECT-OPTIONS : s_pd FOR coep-perio  obligatory .
    SELECT-OPTIONS : s_code FOR coep-bukrs.
    SELECT-OPTIONS : s_pg FOR cepc-khinr MATCHCODE OBJECT zprofitcentergroup.
    SELECT-OPTIONS : s_pc FOR aufk-prctr.
    SELECT-OPTIONS : s_ku FOR coep-kstar matchcode object zcost.  "no-display
    select-options : s_kg for setleaf-setname matchcode object zsetname.
    SELECT-OPTIONS : s_or FOR aufk-aufnr.
    select-options : s_org for setleaf-setname matchcode object ZSETNAME1.
    SELECTION-SCREEN : END OF BLOCK blk1.
    *&        Selection-Screen Validation
    at selection-screen on p_ca.
    select kokrs gjahr perio bukrs from coep
                    into corresponding fields of table itab_coep
                                                where kokrs = p_ca.
      if sy-subrc <> 0.
       message e001(zerror) .
    endif.
    at selection-screen on s_year.
    select kokrs gjahr perio bukrs from coep
                    into corresponding fields of table itab_coep
                                                where gjahr in s_year.
       if sy-subrc <> 0.
       message e005(zerror).
    endif.
    at selection-screen on s_code.
    select kokrs gjahr perio bukrs from coep
                    into corresponding fields of table itab_coep
                                                where bukrs in s_code.
       if sy-subrc <> 0.
       message e006(zerror).
    endif.
    at selection-screen on s_pd.
    select kokrs gjahr perio bukrs from coep
                    into corresponding fields of table itab_coep
                                                where perio in s_pd.
       if sy-subrc <> 0.
       message e007(zerror).
    endif.
    at selection-screen on s_pg.
    select kokrs khinr prctr from cepc
                      into corresponding fields of table itab_cepc
                                                      where khinr in s_pg.
    if sy-subrc <> 0.
      message e002(zerror).
    endif.
    at selection-screen on s_pc.
    select prctr from aufk
                      into corresponding fields of table itab_cepc
                                              where prctr in s_pc.
    if sy-subrc <> 0.
      message e008(zerror).
    endif.
    at selection-screen on s_or.
    select single * from aufk where aufnr in s_or.
      if sy-subrc <> 0.
       message e003(Zerror).
      endif.
    at selection-screen on s_kg.
    select single * from setleaf where setname in s_kg.
    if sy-subrc <> 0.
       message e017(zerror).
    endif.
    *&        Start-Of-Selection
    START-OF-SELECTION.
    clear st_pc.
    clear st_rev.
    clear st_all.
    clear st_net.
    clear st_gross.
    clear itab1[].
      PERFORM get_data.
    perform sel.
      PERFORM build_cat USING t_fcat.
      PERFORM build_layout.
      PERFORM display.
    *& Form build_cat
    text
    -->TEMP_FCAT text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
      d_fieldcat_wa-fieldname = 'KATYP1'.
      d_fieldcat_wa-seltext_m = 'CostelementType'.
      d_fieldcat_wa-hotspot = 'X'.
      d_fieldcat_wa-col_pos = 1.
      APPEND d_fieldcat_wa TO temp_fcat.
      CLEAR d_fieldcat_wa.
      d_fieldcat_wa-fieldname = 'PERIO1'.
      d_fieldcat_wa-seltext_m = 'For The Period'.
      d_fieldcat_wa-key = 'X'.
      d_fieldcat_wa-col_pos = 3.
      APPEND d_fieldcat_wa TO temp_fcat.
      CLEAR d_fieldcat_wa.
      d_fieldcat_wa-fieldname = 'GJAHR1'.
      d_fieldcat_wa-seltext_m = 'Year to Date'.
      d_fieldcat_wa-key = 'X'.
      d_fieldcat_wa-col_pos = 4.
      APPEND d_fieldcat_wa TO temp_fcat.
      CLEAR d_fieldcat_wa.
    ENDFORM. "build_cat
    *& Form build_eve
    text
    FORM build_eve.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type     = 0
           IMPORTING
                et_events       = t_eve
           EXCEPTIONS
                list_type_wrong = 1
                OTHERS          = 2.
      IF sy-subrc EQ 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.
    *& Form get_data
    text
    FORM get_data.
    --To fetch Amount, Period ,Year, CompanyCode--
      SELECT kokrs gjahr perio kstar bukrs wkgbtr objnr
                          FROM coep INTO CORRESPONDING FIELDS OF TABLE itab_coep
                                                               WHERE kokrs = p_ca
                                                                AND perio IN s_pd
                                                                AND bukrs IN s_code
                                                                AND gjahr IN s_year
                                                                and kstar in s_ku.
      LOOP AT itab_coep.
        itab_final-kokrs = itab_coep-kokrs.
        itab_final-gjahr = itab_coep-gjahr.
        itab_final-perio = itab_coep-perio.
        itab_final-kstar = itab_coep-kstar.
        itab_final-bukrs = itab_coep-bukrs.
        itab_final-wkgbtr = itab_coep-wkgbtr.
        itab_final-objnr = itab_coep-objnr.
        APPEND itab_final.
        CLEAR itab_final.
      ENDLOOP.
    IF NOT itab_coep[] IS INITIAL.
    --To fetch Amount,ProfitCenter,InternalOrder--
       SELECT kokrs aufnr prctr bukrs auart objnr
                           FROM aufk INTO CORRESPONDING FIELDS OF TABLE itab_aufk
                                                                  WHERE aufnr IN s_or
                                                                    and prctr in s_pc.
    loop at itab_final.
        READ TABLE itab_aufk WITH KEY kokrs = itab_final-kokrs
                                      objnr = itab_final-objnr.
        IF sy-subrc = 0.
          itab_final-aufnr = itab_aufk-aufnr.
          itab_final-prctr = itab_aufk-prctr.
          MODIFY itab_final TRANSPORTING aufnr prctr.
          else.
           delete itab_final.
        ENDIF.
    endloop.
      IF NOT itab_aufk[] IS INITIAL.
    --To fetch ProfitCenter ,ProfitCenterGroup--
      SELECT kokrs khinr prctr
                          FROM cepc INTO CORRESPONDING FIELDS OF TABLE itab_cepc
                                                                 WHERE kokrs = itab_aufk-kokrs
                                                                  and  khinr in s_pg.
    LOOP AT itab_final.
        READ TABLE itab_cepc WITH KEY kokrs = itab_final-kokrs
                                      prctr = itab_final-prctr.
        IF sy-subrc = 0.
          itab_final-khinr = itab_cepc-khinr.
          MODIFY itab_final TRANSPORTING  khinr.
    else.
         delete itab_final.
        ENDIF.
    endloop.
    if not itab_coep[] is initial.
    --To fetch InternalOrderGroup--
    clear itab_final-setname.
    select setclass subclass setname valfrom valto from setleaf into corresponding fields of table itab_setleaf
                                                                          where setclass = '0102'
                                                                          and   subclass = 'VMIN'
                                                                          and   setname  in s_kg
                                                                          and   valfrom  in s_ku
                                                                          and   valto    in s_ku.
    loop at itab_final.
       read table itab_setleaf with key valfrom = itab_final-kstar.
        if sy-subrc = 0.
        itab_final-setname = itab_setleaf-setname.
        modify itab_final transporting setname.
    else.
         delete itab_final.
      endif.
    endloop.
    if not itab_aufk[] is initial.
    --To fetch CostElementGroup--
    clear itab_final-setname.
    select setclass subclass setname valfrom valto from setleaf into corresponding fields of table itab_setleaf1
                                                                          where setclass = '0103'
                                                                          and   setname  in s_org
                                                                          and   valfrom  in s_or
                                                                          and   valto    in s_or.
    loop at itab_final .
    read table itab_setleaf1 with key valfrom = itab_final-aufnr.
        if sy-subrc = 0.
        itab_final-setname1 = itab_setleaf1-setname.
        modify itab_final transporting setname1.
        else.
         delete itab_final.
    endif.
      ENDLOOP.
    IF NOT itab_coep[] IS INITIAL.
    SELECT kokrs katyp aufnr kstar
                          FROM cskb INTO CORRESPONDING FIELDS OF TABLE itab_cskb
                                                        FOR ALL ENTRIES IN itab_coep
                                                                 WHERE kokrs = itab_coep-kokrs.
    loop at itab_final.
        READ TABLE itab_cskb WITH KEY kstar = itab_final-kstar
                                      kokrs = itab_final-kokrs.
        IF sy-subrc = 0.
          itab_final-katyp = itab_cskb-katyp.
          MODIFY itab_final TRANSPORTING katyp.
        ENDIF.
    ENDLOOP.
    endif.
        endif.
          ENDIF.
        ENDIF.
      ENDIF.
    loop at itab_final where katyp = '11' or katyp = '12'.
    move-corresponding itab_final to ifinal.
    append ifinal.
    clear ifinal.
    endloop.
    --calculation for revenue--
      SORT ifinal BY katyp.
      loop at ifinal where perio = s_pd-high.
       st_rev1 = st_rev1 + ifinal-wkgbtr.
       endloop.
           st_rev1 = ( st_rev1 * ( -1 ) ).
       LOOP AT ifinal .
                st_rev = st_rev + ifinal-wkgbtr.
       ENDLOOP.
            st_rev = ( st_rev * ( -1 ) ).
            itab1-katyp1  = ' '.
            itab1-wkgbtr  = st_rev .
            concatenate s_pd-high  ' ' into itab1-perio1 separated by space.
            Concatenate s_pd-low '-' s_pd-high into itab1-gjahr1 separated by space.
            itab1-line_color = 'C710'.
            APPEND itab1.
            itab1-line_color =  ' '.
            CLEAR : itab1,ifinal.
             itab1-katyp1  = 'Revenue '.
             itab1-perio1  = st_rev1 .
             itab1-gjahr1  = st_rev .
            APPEND itab1.
            CLEAR : itab1,ifinal.
    ---calculation for DirectExpense--
    clear : ifinal[].
    loop at itab_final where katyp = '01'.
    move-corresponding itab_final to ifinal.
    append ifinal.
    endloop.
    SORT ifinal BY katyp .
      LOOP AT ifinal.
           st_pc = st_pc + ifinal-wkgbtr.
      ENDLOOP.
    loop at ifinal where perio = s_pd-high.
       st_pc1 = st_pc1 + ifinal-wkgbtr.
       endloop.
            itab1-katyp1  = 'DirectExpense'.
            itab1-wkgbtr  = st_pc.
            itab1-perio1  = st_pc1.
            itab1-gjahr1  = st_pc.
            APPEND itab1.
            CLEAR : itab1,ifinal.
    ---calculation for Gross Margin--
           st_gross1 = st_rev1 - st_pc1.
           if st_pc1 > st_rev1.
           st_gross1 = ( st_gross1 * ( -1 ) ).
           endif.
           itab1-katyp1 = 'GrossMargin '.
           st_gross     = ( st_rev - st_pc ).
           if st_pc > st_rev.
           st_gross = ( st_gross * ( -1 ) ).
           endif.
           itab1-wkgbtr = st_gross.
           itab1-perio1 = st_gross1.
           itab1-gjahr1 = st_gross.
           itab1-line_color = 'C500'.
           APPEND itab1.
           CLEAR: itab1,ifinal.
            itab1-katyp1 = ' Percentage (%)'.
            if st_rev1 = 0.                         " Handle Divide by Zero exception
            st_pt1 = 0.
            endif.
            if st_rev = 0.
            st_pt = 0.
            else.
            st_pt1       = ( st_gross1 / st_rev1 ) * 100.
            st_pt        = ( st_gross / st_rev ) * 100.
            endif.
            itab1-perio1 = st_pt1.
            itab1-gjahr1 = st_pt.
            itab1-line_color = 'C710'.
            APPEND itab1.
            CLEAR: itab1,ifinal.
    ---Calculation for Allocated  cost--
    clear : ifinal[].
    loop at itab_final where katyp <> '01'
                        and  katyp <> '11'
                        and  katyp <> '12'.
    move-corresponding itab_final to ifinal.
    append ifinal.
    endloop.
    SORT ifinal BY katyp .
      LOOP AT ifinal.
           st_all = st_all + ifinal-wkgbtr.
      ENDLOOP.
      loop at ifinal where perio = s_pd-high.
       st_all1 = st_all1 + ifinal-wkgbtr.
       endloop.
           itab1-katyp1  = 'AllocatedExpenses'.
           itab1-wkgbtr  = st_all.
           itab1-perio1  = st_all1.
           itab1-gjahr1  = st_all.
           APPEND itab1.
           CLEAR: itab1, ifinal.
    --calculation for Net Margin--
            st_net1 = st_gross1 - st_all1.
            itab1-katyp1  = 'NetMargin'.
            st_net        = ( st_gross - st_all ).
            itab1-wkgbtr  = st_net.
            itab1-perio1  = st_net1.
            itab1-gjahr1  = st_net.
            itab1-line_color = 'C500'.
            APPEND itab1.
            CLEAR: itab1, ifinal .
            itab1-katyp1 = ' Percentage (%)'.
            if st_rev1 = 0.                    " Handle Divide by Zero exception
            st_nt1 = 0.
            endif.
            if st_rev = 0.
            st_nt = 0.
            else.
            st_nt1       = ( st_net1 / st_rev1 ) * 100.
            st_nt        = ( st_net / st_rev ) * 100.
            endif.
            itab1-perio1 = st_pt1.
            itab1-gjahr1 = st_pt.
            itab1-line_color = 'C710'.
            APPEND itab1.
            CLEAR: itab1,ifinal.
    ENDFORM. "get_data
    *& Form display
    text
    FORM display.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = gd_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'Internal Order Analysis Report'
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = gd_layout
       IT_FIELDCAT                       = t_fcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
       IT_SORT                           = t_subtot
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         = t_eve[]
      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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      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
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout .
    gd_layout-zebra = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-info_fieldname = 'LINE_COLOR'.
    ENDFORM.                    " build_layout

    When you define your USER_COMMAND you receive parameters :
    > FORM user_command  USING r_ucomm LIKE sy-ucomm
    >                         rs_selfield TYPE slis_selfield.
    rs_selfield-fieldname is the name of the clicked field. Use this field in a CASE to dispatch drill down.
    Regards

Maybe you are looking for

  • Debugging not working in weblogic portal

    When I am running my portal app built on weblogic portal 8.1, its throwing an error cannot start debugger. App might not be deployed properly. I have redeployed 2-3 times, and its running also fine, but debugger is not working. when the app domain st

  • Tolerance Group for G/L Accounts

    Hello, In the spro Financial Accounting>General Ledger Accounting>Business Transactions>Open Item Clearing>Clearing Differences-->Define Tolerance Groups for G/L Accounts, according to SAP documentation it is possible: "For G/L account clearing, tole

  • CD won't mount

    Gang - My son's Mac mini won't mount this one install disk for a typing program. I've checked the disk and it will mount in my G5 as well as even on a PC. (!?) But, when I put it in this machine, the drive starts to wind up like it's about to read an

  • Stress Test on Portal

    Hello, We are on EP7.0 and trying to run the Open Enrollment for Benefits in the month of Nov. ...I want to know whether there is any tool to log in a number of users on the EP at one time to do a Stress test ... Also, usually how many users logged o

  • PS elements 4.0 MAC osx snow leopard

    After todays apple update for security , I now get a sigbus ( bad access) error when trying to save any files. I did a clean and a reload , no dice . PSE still crashes. All other prgrams run on the machine. ANY HELP TX