Subtotals in Discoverer

Can anyone help me with calculating subtotals in Discoverer. I know discoverer offers subtotal by break in Region or Dist Value. Or like CD, DVD etc.
What I want to achieve is subtotal of all used products as below
CD 120
USED CD 100
DVD 80
USED DVD 20
USED TTL 120
NEW TTL 200
So in above is there any way to subtotal USED TTL, NEW TTL
Thanks is advance

Well, you can't have 'smarts' in a subtotal (ie: a formula), so one method - although not your favourite - would be to alter the 1 column with amounts, to 2 columns with amount - 1 being for used and 1 being for new.
So, you would simply create 2 calculations such as:
1. column labelled USED:
CASE
WHEN SUBSTR(description,1,4) = 'USED' THEN amount
ELSE 0
END
2. column labelled NEW:
CASE
WHEN SUBSTR(description,1,4) <> 'USED' THEN amount
ELSE 0
END
You have to do 2 calculations, not put the second one as an ELSE or something as you want 2 new columns.
Now hide the amount column you had originally.
Now use the normal totalling to sum both columns.
That's one way. (note: sql case statements not tested, but look correct to me).
Russ

Similar Messages

  • Labels on Totals in 10g

    Hi,
    We recently upgraded our test instance to 10g and have begun testing Discoverer reports using Discoverer Plus 10g (10.1.2.48.18). I have encountered a random issue with totals and subtotals in some workbooks.
    An example would be my Sales by Salesrep report that shows the total tons and revenue for each customer with a total by salesrep. The total is correct, but the labels (e.g. Qty Subtotal and Rev Subtotal) appear in the detail portion of the data.
    In 4i the report appears as follows:
    Salesrep     Customer     Tons     Revenue
    Joe Smith     ABC     1000.00     30000.00
         XYZ     100.00     2000.00
         Qty Subtotal: 1100.00     Rev Subtotal: 32000.00
    However, in 10g the report appears like this:
    Salesrep     Customer     Tons     Revenue
    Joe Smith     ABC     Qty Subtotal: 1000.00     Rev Subtotal: 30000.00
         XYZ          100.00          2000.00
                   1100.00          32000.00
    The label isn’t always displayed on the first row. Sometimes it appears in the correct place and other times it appears on any random row.
    Has anyone seen this before? Any ideas on how to correct it?
    Thanks,
    Angela

    Hi Angela
    Are you perhaps using a group sort that inserts additional lines between the group sorted values? If you do this and use subtotals in Discoverer 10g R2 then things get out of sync and Discoverer places the labels in the wrong place. It actually places them where they would have been if there were no additional lines.
    Of course while Discoverer has many undocumented, desirable features this is not one of them. I'd actually call this an undocumented, undesirable feature (in other words - it's a bug).
    Could this be what you are seeing?
    Best wishes
    Michael

  • Urgent!! Sum function for subtotals.,Exporting BA does not list Workbooks

    Hi,
    I m facing this issue when calculating subtotals in the report. When i use the sum function, the subtotals are not getting displayed. I tried usin the Cell Sum Distinct function and it sums up only if the amounts are different. For example when i have two amounts of 5.00 each, it sums as 5.00 only in the subtotal. Can anyone help me resolve this?
    Also, i m facing one more issue. When i export the BA, the user wants the list of workbooks under that that would be exported. (The list is shown when exporting the EUL as such), but the list is just blank in BA export. Is this a set up issue?
    Thanks in advance.

    Hi,
    Not all calculations can be summed correctly by Discoverer. What is the calculation that you are trying to sum?
    The workbooks are not tied to a BA as the folders used in a workbook may be in many different BAs. Therefore the workbooks are not exported with a business area. The workbooks must be exported separately.
    Rod West

  • Subtotals in matrix reports

    I know that in discoverer it's very easy to ad subtotals in a matrix report. In reportsbuilder i do not find any function that can help met I've a report like this
    GROUP YEAR (subtotals are possible)
    ROW jan feb march
    group1 subgroup 1
    subgroup 2 value value value TOTAL
    group2 subgroup 1
    etc
    Now i want to create subtotals for group 1 group 2.
    Like this
    ROW jan feb march
    group1 subgroup 1
    subgroup 2 value value value TOTAL
    subtotal subvalue subvalue subtotal
    group2 subgroup 1
    subtotal
    Can somebody help me?
    gr,
    Francus Simonetti

    Hi,
    Go through the following link to learn about how to create summaries for matrix reports (Chapter 25.4 of Building Reports manual).
    http://otn.oracle.com/products/reports/htdocs/getstart/docs/B10310_01/orbr_matrix.htm#1010980
    thanks,
    The Oracle Reports team

  • Want to avg only a range of subtotals

    My customers want a worksheet that displays summarized FY subtotals and then an average of the FY subtotals. Easy so far. The problem is that they want data summarized as subtotals for the previous (complete) six FYs as well as the current (incomplete) FY. They then want an average of only the complete FYs. So they want a display (with drilldown) of seven summarized FYs; but a final average of the sums for only a range of the sheet. I can, of course, write a condition to exclude 2003 and the average is then correct; but the display no longer shows all seven years.
    I have tried creating a new item for the folder using AVG(col) OVER (order by FY range interval '6' year preceding) to creating a running six year avg window; but then this displays as a detail item and I can't get it to aggregate to the FY subtotal level (and as a detail, it is only correct for what the customer is looking for on 30-Sept of the year).
    Any ideas? Discoverer won't let me edit the totals to put in an avg(decode(fy, 2003, null, value) construct. I'm stuck.
    Thanks!
    L Gravitt

    Ive seen this question asked many times. Sadly, I think this is just a Discoverer limitation. I needed this functionality myself, but still have not found a soultion.
    CC

  • Total or sub-total won't show for any of our Discoverer reports

    We are using Oracle BI Discoverer 11g (11.1.1.4.0) and Operating System: amd64 Windows 7 6.1.
    For some reason, either totals or subtotal won't work in any our DISCO reports. I just realized this a few days back and have tested a few reports. None of them gives me the totals or subtotals. In the cell, it is just 'Sum:' and no values. The amount columns contains no null values for those reports, absolute values either > 0.00 or = 0.00.
    One example: a report for GL journals and here is what I tested after open a DISCO report as a Plus user:
    - In edit mode
    - Under select items page
    - Click on calculation tab
    - Click on My Totals
    - Click on New Totals
    - Then choose a detail amount such as period_cr, total=f(x)sum, choose either grand total at bottom or subtotal at each change in: (I picked journal name)
    - When the result comes back, in total or subtotal cell, there is only Sum: and not like Sum: 12,345.67
    Very strange and I remember those reports worked for us before. We just moved to 11 a few months back and I am not sure if that has anything to do with this.
    Thanks,
    Ning

    Thanks for your suggestions. Yes, I have tried all the possible ways for aggregations, plus setting up way to deal with null values, but so far nothing helps. I forgot to mention that the subtotal for single row works and for multiple rows, sometimes it works, sometimes it won't. The only difference I can tell is that when the query is from a detailed table, such as po_distributions_all, it works and if the query is from higher level table, such po_lines_all, it won't. Any ideas why?

  • Crosstab Subtotals

    Hello,
    I am trying to create a cross tab report in Discoverer Plus 9iAS (version 9.02.54.06) that has subtotals. For example, I have three columns across the left(Account Type (A), Title(B), and Cost Type(C)). My data points are various financial numbers (budget, expenses, variances, etc.) I want the report to subtotal based on the Cost Type column (C). However, when I use the totals function, I am allowed to create the total (i.e. no error message), but the total does not appear on the report. Does Discoverer Plus allow subtotals in cross tab reports?
    Thanks in advance.
    Jeff

    Hmm...I've done something similar. I tried creating subtotals and they don't appear unless I specify they appear at the bottom, the right or after each group sorted item. Sometimes I switch the columns from one axis to the other and then the subtotal appears.

  • Discoverer Summary Adviser and GROUP BY / ROLLUP

    Can anyone answer the following for me?
    1. Does the Discoverer Summary Adviser ever create materialized views using the new ROLLUP function, to create summaries that calculate all the subtotals along all hierarchies and dimensions?
    2. If the Discoverer Summary Adviser cannot create them using GROUP BY and ROLLUP, but I generated them manually or using OEM, would the Discoverer queries ever be eligable for query rewrite, as I presume the SQL generated by Discoverer doesn't use the GROUP BY / ROLLUP feature found in Oracle 9i?
    Any advice gratefully received.
    Mark

    Can anyone answer the following for me?
    1. Does the Discoverer Summary Adviser ever create materialized views using the new ROLLUP function, to create summaries that calculate all the subtotals along all hierarchies and dimensions?
    2. If the Discoverer Summary Adviser cannot create them using GROUP BY and ROLLUP, but I generated them manually or using OEM, would the Discoverer queries ever be eligable for query rewrite, as I presume the SQL generated by Discoverer doesn't use the GROUP BY / ROLLUP feature found in Oracle 9i?
    Any advice gratefully received.
    Mark

  • Open Pages from Discoverer Report

    Hi,
    Is there a way to invoke a webpage or even better, an oracle function (that links to forms or self-service) from a discoverer report row ?
    for example, I want a report for employees where the person looking at the report will click on the employee name and is taken straight to the person details page for that employee.
    Regards.

    Hi,
    You can create a link to a form function using fnd_run_function.get_run_function_url. You can create a calculation either in a view or using a calculated item in the EUL (you will have to map the get_run_function_url in the EUL to do this). You then set the content type property of the EUL item to FILE so that when the item is selected in the workbook it appears as a hyperlink.
    Most forms in apps except parameters so that you can pass the employee id to the form and the form will open up with the employee record. For example, if you are using a seed HR person form you create a calculation,
    fnd_run_function.get_run_function_url(3494      -- PERWSHRG-404
                                         ,800       -- HR
                                         ,fnd_global.RESP_ID     -- caller's responsibility
                                         ,0        -- Business Group
                                         ,         -- Parameters
         'P_PERSON_ID='||TO_CHAR(person_id, 'fm9999999999999')||
         ' P_EFFECTIVE_DATE='||TO_CHAR(SYSDATE, 'YYYY/MM/DD'))Rod West

  • In ALV report is possible to display the subtotals in separate column

    Hi,
    I have made one ALV report, i need to show the subtotals of ekpo-brtwr (Gross Value)  grouped by or sorted by
    ekko-ebeln (Purshasing Doc) but in separate column  not at the end of the line items of each purshasing doc
    any idea how can i do this?
    let us say i have the following cols in my report:
    ekko-bukrs
    ekko-ebeln,
    ekko-aedat,
    kko-lifnr,
    ekpo-brtwr
    i want to add one more col for example (T-Gross) and to fill it with the suptotals of (ekpo-brtwr) sorted by the
    ekko-ebeln (Purshasing Doc).
    thanks a lot.

    If you need one more column, then you need to expand the field catalog table and data table as you did for all other fields and you need to code the logic to calculate the subtotals and populate the new column, but if you want to have row, that will be easy. For more info you can [refer |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4063c42a-2549-2c10-fab6-a8c99d98b9b5?quicklink=index&overridelayout=true]this:

  • ALV Totals , Subtotals for a particular field in ALV Grid report

    Hi,
    I have an issue in ALV totals and subtotals.
    Scenario is like this.
    i have a vendor data to be pulled out of SAP and to be shown in the form of report.
    i am populating all the data and doing do_sum based on Vendor ( has expansin & collapse option ) and display the number of reports .
    Vendor -
    100
    Vendor1 -
    1
    Vendor2----
    2.
    Vendor100----
    100.
    but my problem is in the same report i have a date field .
    if i have a five vendors created on 03/03/2008. in the same report for the date field having ( expansion & collapse ) , when i expand based on that date can i be able to sum up all the vendors created on 03/03/2008 and display in the same report along with the vendor count.
    Let me know . Thank you in advance
    Regards,
    Ry

    Hi Roby,
    Have a look at this sample code
    It will help u,
    REPORT ZIN_FI_AGEING
           message-id zbdc
           no standard page heading.
    Title                   : For Ageing Details
    Author                  :
    Date                    : 22/11/2004
    Transport/Correction Id :
    Clarify case ID         :
    Application             : FI
    Program Type            :
    Frequency               :
    Purpose                 :
    Comments                :
    Request No              :
      TABLES DELCARATIONS
    Tables: zzgeinz9a,    "Actual line item table
            t001.         "Plants/Branches
      ALV TTPE DELCARATIONS
    type-pools: slis.
    *Type Declarations for Field Catalog
    data : i_fldcat_head type slis_t_fieldcat_alv,
           wa_fldcat_head type slis_fieldcat_alv.
    *Type Declarations for ALV Events
    data : i_events type slis_t_event,
           wa_event like line of i_events.
    *Type Declarations for Layout Design
    data : wa_layout type slis_layout_alv.
    *Type Declarations for Sorting Fields
    data:  it_sort type slis_sortinfo_alv occurs 0 with header line.
    *Type Declarations for Displaying Images on Grid
    data : i_comment type slis_t_listheader,
           wa_comment type slis_listheader.
    *Type Declarations for Grouping fields
    data : wa_group type slis_sp_group_alv,
           i_group type slis_t_sp_group_alv.
      DATA DELCARATIONS
    data: v_flag,                 "Status Flag
          v_repid like sy-repid,  "Program Name
          p_year(4) type c,       "Year
          v_due_days type i.      "To hold the due days
      CONSTANTS DELCARATIONS
    constants: c_x type c value 'X',
               c_bukrs(4) type c value '0373'.
      INTERNAL TABLES DELCARATIONS
    *--Internal table to hold the required data
    data: begin of it_final_vendor occurs 0,
            rzzlifnr    like zzgeinz9a-rzzlifnr,  "Vendor
            name1       like lfa1-name1,          "Vendor Name
            docnr       like zzgeinz9a-DOCNR,     "Accounting Doc No
            refdocnr    like zzgeinz9a-REFDOCNR,  "Reference document no
            belnr       like bkpf-belnr,          "FI Doc No
            doc_date    like bkpf-awkey,          "Document Date
            zbd1t       like bsik-zbd1t,          "Cash discount days 1
            bldat       like bkpf-bldat,          "Document Date
            due_date    like bkpf-bldat,          "Due Date
            due_days    type i,                   "Due Days
            rzz_ebeln   like zzgeinz9a-rzz_ebeln, "P.O. Ref No
            not_due     like zzgeinz9a-hsl,       "Not Yet Due
            hsl         like zzgeinz9a-hsl,       "local currency
            found       type c,                   "Existance Flag
          end of it_final_vendor.
    data: begin of it_final_vendor_temp occurs 0,
            rzzlifnr    like zzgeinz9a-rzzlifnr,  "Vendor
            name1       like lfa1-name1,          "Vendor Name
            belnr       like bkpf-belnr,          "FI Doc No
            bldat       like bkpf-bldat,          "Document Date
            rzz_ebeln   like zzgeinz9a-rzz_ebeln, "P.O. Ref No
            hsl        like zzgeinz9a-hsl,        "local currency
            due_date    like bkpf-bldat,          "Due Date
            due_days    type i,                   "Due Days
            not_due     like zzgeinz9a-hsl,       "Not Yet Due
            buck_0_30   like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_31_60  like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_61_90  like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_91_180 like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_180    like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            docnr       like zzgeinz9a-DOCNR,     "Accounting Doc No
            refdocnr    like zzgeinz9a-REFDOCNR,  "Reference document no
            doc_date    like bkpf-awkey,          "Document Date
            found       type c,                   "Existance Flag
          end of it_final_vendor_temp.
    data: begin of it_final_customer occurs 0,
            rzzkunnr    like zzgeinz9a-rzzkunnr,  "Customer
            name1       like kna1-name1,          "Customer Name
            docnr       like zzgeinz9a-DOCNR,     "Accounting Doc No
            refdocnr    like zzgeinz9a-REFDOCNR,  "Reference document no
            belnr       like bkpf-belnr,          "FI Doc No
            doc_date    like bkpf-awkey,          "Document Date
            zbd1t       like bsik-zbd1t,          "Cash discount days 1
            bldat       like bkpf-bldat,          "Document Date
            due_date    like bkpf-bldat,          "Due Date
            due_days    type i,                   "Due Days
            rzz_ebeln   like zzgeinz9a-rzz_ebeln, "P.O. Ref No
            not_due     like zzgeinz9a-hsl,       "Not Yet Due
            hsl         like zzgeinz9a-hsl,       "local currency
            found       type c,                   "Existance Flag
          end of it_final_customer.
    data: begin of it_final_customer_temp occurs 0,
            rzzkunnr    like zzgeinz9a-rzzkunnr,  "Customer
            name1       like kna1-name1,          "Customer Name
            belnr       like bkpf-belnr,          "FI Doc No
            bldat       like bkpf-bldat,          "Document Date
            rzz_ebeln   like zzgeinz9a-rzz_ebeln, "P.O. Ref No
            hsl        like zzgeinz9a-hsl,        "local currency
            due_date    like bkpf-bldat,          "Due Date
            due_days    type i,                   "Due Days
            not_due     like zzgeinz9a-hsl,       "Not Yet Due
            buck_0_30   like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_31_60  like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_61_90  like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_91_180 like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            buck_180    like zzgeinz9a-hsl,       "Invoiceamt in localcurr
            docnr       like zzgeinz9a-DOCNR,     "Accounting Doc No
            refdocnr    like zzgeinz9a-REFDOCNR,  "Reference document no
            doc_date    like bkpf-awkey,          "Document Date
            found       type c,                   "Existance Flag
          end of it_final_customer_temp.
    *--Internal Table to hold the Cash discount days 1 for Vendors
    data: begin of it_final_bsik occurs 0,
            belnr like bsik-belnr,
            zbd1t like bsik-zbd1t,
          end of it_final_bsik.
    *--Internal Table to hold the Cash discount days 1 for Customers
    data: begin of it_final_bsid occurs 0,
            belnr like bsid-belnr,
            zbd1t like bsid-zbd1t,
          end of it_final_bsid.
      INITIALIZATION
    v_repid = sy-repid.
      SELECTION SCREEN
    selection-screen: begin of block b1 with frame title text-h01.
    selection-screen skip.
    select-options: s_vendor for zzgeinz9a-rzzlifnr modif id ven.
    parameters: p_comp1 like t001-bukrs modif id ven.
    parameters: p_rundt1 like bkpf-bldat modif id ven.
    select-options: s_cust for zzgeinz9a-rzzkunnr modif id cst.
    parameters: p_comp2 like t001-bukrs modif id cst.
    parameters: p_rundt2 like bkpf-bldat modif id cst.
    selection-screen skip.
    selection-screen: begin of block b2 with frame title text-h02.
    parameters : p_vendor radiobutton group gr1 default 'X'
                                      user-command test,
                 p_cust  radiobutton group gr1.
    selection-screen: end of block b2.
    selection-screen: end of block b1.
    **************************AT Selection Screen OutPut ******************
    at selection-screen output.
      loop at screen.
        if p_cust = 'X'.
          if screen-group1 = 'VEN'.
            screen-active = '0'.
            screen-input = '0'.
            screen-output = '0'.
            screen-invisible = '0'.
          endif.
        elseif p_vendor = 'X'.
          if screen-group1 = 'CST'.
            screen-active = '0'.
            screen-input = '0'.
            screen-output = '0'.
            screen-invisible = '0'.
          endif.
        endif.
        modify screen.
      endloop.
      SELECTION SCREEN ON
    at selection-screen on s_vendor.
    *--Validating Vendor
      if not s_vendor[] is initial.
        perform validate_s_vendor.
      endif.
    at selection-screen on s_cust.
    *--Validating Customer
      if not s_cust[] is initial.
        perform validate_s_cust.
      endif.
    at selection-screen on p_comp1.
    *--Validating Company Code.
      if not p_comp1 is initial.
        perform validate_p_comp1.
      endif.
    at selection-screen on p_comp2.
    *--Validating Company Code.
      if not p_comp2 is initial.
        perform validate_p_comp2.
      endif.
      START OF SELECTION
    start-of-selection.
    if p_vendor = 'X'.
       perform get_vendor_data.
    elseif p_cust = 'X'.
       perform get_customer_data.
    endif.
      END OF SELECTION
    end-of-selection.
    if p_vendor = 'X'.
    *--Generating the output for vendor
      perform generate_field_catalog_vendor.
      perform get_events_vendor.
      perform generate_layout_vendor.
      perform generate_sort_vendor.
      perform generate_group_vendor.
      perform disp_alv_grid_vendor.
    elseif p_cust = 'X'.
    *--Generating the output for customer
      perform generate_field_catalog_cust.
      perform get_events_customer.
      perform generate_layout_customer.
      perform generate_sort_customer.
      perform generate_group_customer.
      perform disp_alv_grid_customer.
    endif.
    *&      Form  validate_s_vendor
          Validating the Vendor
    form validate_s_vendor.
      select rzzlifnr up to 1 rows
      into (zzgeinz9a-rzzlifnr)
      from zzgeinz9a
      where rzzlifnr in s_vendor.
      endselect.
      if sy-subrc ne 0.
        message e004 with 'Invalid Range of Vendor'(002)
    s_vendor-low 'To'(006) s_vendor-high.
      endif.
    endform.                    " validate_s_vendor
    *&      Form  validate_s_cust
          Validating the Customer
    form validate_s_cust.
       select rzzkunnr up to 1 rows
       into (zzgeinz9a-rzzkunnr)
       from zzgeinz9a
       where rzzkunnr in s_cust.
       endselect.
       if sy-subrc ne 0.
         message e004 with 'Invalid Range of Customer'(005)
    s_cust-low 'To'(006) s_cust-high.
      endif.
    endform.                    " validate_s_cust
    *&      Form  validate_p_comp1
          Validating the Company Code
    form validate_p_comp1.
      select single bukrs
             into   (t001-bukrs)
             from   t001
             where  bukrs eq p_comp1.
      if sy-subrc ne 0.
        message e004 with 'Company Code'(004) p_comp1 'Does not Exists'(003)
      endif.
    endform.                    " validate_p_comp1
    *&      Form  validate_p_comp2
          Validating the Company Code
    form validate_p_comp2.
      select single bukrs
             into   (t001-bukrs)
             from   t001
             where  bukrs eq p_comp2.
      if sy-subrc ne 0.
        message e004 with 'Company Code'(004) p_comp2 'Does not Exists'(003)
      endif.
    endform.                    " validate_p_comp2
    *&      Form  get_vendor_data
          Getting the Vendor Related Docs
    form get_vendor_data.
    select a~rzzlifnr
            b~name1
            a~docnr
            a~refdocnr
            a~rzz_ebeln
            a~hsl
        into corresponding fields of table it_final_vendor
        from zzgeinz9a as a
        inner join lfa1 as b
        on arzzlifnr = blifnr
        where rzzlifnr in s_vendor
        and   rbukrs   eq p_comp1.
        if sy-subrc eq 0.
          v_flag = 'X'.
          p_year = sy-datum+0(4).
          perform get_doc_date using p_comp1
                                     p_year.
          perform move_records.
          sort it_final_vendor by rzzlifnr.
          perform generate_data.
        else.
          v_flag = space.
        endif.
    endform.                    " get_vendor_data
    *&      Form  get_customer_data
          Getting the Customer Related Docs
    form get_customer_data.
    select a~rzzkunnr
            b~name1
            a~docnr
            a~refdocnr
            a~rzz_ebeln
            a~hsl
        into corresponding fields of table it_final_customer
        from zzgeinz9a as a
        inner join kna1 as b
        on arzzkunnr = bkunnr
        where rzzkunnr in s_cust
        and   rbukrs   eq p_comp2.
        if sy-subrc eq 0.
          v_flag = 'X'.
          p_year = sy-datum+0(4).
          perform get_doc_date_cust using p_comp2
                                          p_year.
          perform move_records_cust.
          sort it_final_customer by rzzkunnr.
          perform generate_data_cust.
        else.
          v_flag = space.
        endif.
    endform.                    " get_customer_data
    *&      Form  get_doc_date
          Getting the Document Date and FI Doc No
         -->P_P_COMP1 Company Code
         -->P_P_YEAR  Fiscal Year
    form get_doc_date using    p_p_comp1
                               p_p_year.
      loop at it_final_vendor.
        concatenate it_final_vendor-refdocnr '*' into
    it_final_vendor-doc_date.
        modify it_final_vendor index sy-tabix.
    endloop.
    clear it_final_vendor.
    data: v_doc_date(11) type c,
          v_belnr like bkpf-belnr,
          v_bldat like bkpf-bldat.
          loop at it_final_vendor.
           concatenate it_final_vendor-refdocnr '%' into v_doc_date.
            select single belnr
                          bldat
                   into corresponding fields of it_final_vendor
                   from bkpf
                   where bukrs eq p_p_comp1
                   and   gjahr eq p_p_year
                   and   awkey like v_doc_date.
                   modify it_final_vendor.
           endloop.
        clear:it_final_vendor.
    endform.                    " get_doc_date
    *&      Form  move_records
          Moving records to final internal table
    form move_records.
    *--Checking the existance of belnr in bsik
    clear it_final_vendor.
      select belnr
             zbd1t
             into table it_final_bsik
             from bsik
             for all entries in it_final_vendor
             where belnr eq it_final_vendor-belnr
             and   bukrs eq c_bukrs.
    clear it_final_bsik.
      loop at it_final_vendor.
        read table it_final_bsik with key belnr = it_final_vendor-belnr.
        if sy-subrc eq 0.
          it_final_vendor-zbd1t = it_final_bsik-zbd1t.
          it_final_vendor-due_date = it_final_vendor-bldat +
    it_final_bsik-zbd1t.
          it_final_vendor-found    = 'X'.
          modify it_final_vendor.
        endif.
      endloop.
    endform.                    " move_records
    *&      Form  generate_data
          Segregating the records based on due_date
    form generate_data.
      delete it_final_vendor[] where found ne 'X'.
      sort it_final_vendor by belnr.
      loop at it_final_vendor.
        if it_final_vendor-due_date > p_rundt1.
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-not_due.
        elseif it_final_vendor-due_date < p_rundt1.
          it_final_vendor-due_days = p_rundt1 - it_final_vendor-DUE_DATE.
        endif.
    *--filling 0-30 bucket.
        if it_final_vendor-due_days ge 0 AND it_final_vendor-due_days le 30.
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-buck_0_30.
    *--filling 31-60 bucket.
    elseif it_final_vendor-due_days ge 31 AND it_final_vendor-due_days le 60
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-buck_31_60.
    *--filling 61-90 bucket.
    elseif it_final_vendor-due_days ge 61 AND it_final_vendor-due_days le 90
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-buck_61_90.
    *--filling 91-180 bucket.
        elseif it_final_vendor-due_days ge 91 AND it_final_vendor-due_days
    le 180.
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-buck_91_180.
    *--filling 180 bucket.
        elseif it_final_vendor-due_days gt 180.
          move-corresponding it_final_vendor to it_final_vendor_temp.
          move it_final_vendor-hsl to it_final_vendor_temp-buck_180.
        endif.
         append it_final_vendor_temp.
         clear it_final_vendor_temp.
      endloop.
    endform.                    " generate_data
    *&      Form  DISP_ALV_GRID_VENDOR
          Displaying the output in grid For Vendor
    form DISP_ALV_GRID_VENDOR.
    *--Generating the OUTPUT GRID FOR VENDOR
      call function 'REUSE_ALV_GRID_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           = ' '
        I_CALLBACK_TOP_OF_PAGE            = ' '
        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                         = wa_layout
          IT_FIELDCAT                       = i_fldcat_head
        IT_EXCLUDING                      =
          IT_SPECIAL_GROUPS                 = i_group
          IT_SORT                           = it_sort[]
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
          IT_EVENTS                         = i_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
        IT_ALV_GRAPHICS                   =
        IT_ADD_FIELDCAT                   =
        IT_HYPERLINK                      =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
        IT_EXCEPT_QINFO                   =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = it_final_vendor_temp
       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.                    " DISP_ALV_GRID
    *&      Form  get_doc_date_cust
          text
         -->P_P_COMP2 Company Code
         -->P_P_YEAR  Fiscal Year
    form get_doc_date_cust using    p_p_comp2
                                    p_p_year.
      loop at it_final_customer.
        concatenate it_final_customer-refdocnr '*' into
    it_final_customer-doc_date.
        modify it_final_customer index sy-tabix.
    endloop.
    clear it_final_customer.
    data: v_doc_date(11) type c,
          v_belnr like bkpf-belnr,
          v_bldat like bkpf-bldat.
          loop at it_final_customer.
           concatenate it_final_customer-refdocnr '%' into v_doc_date.
            select single belnr
                          bldat
                   into corresponding fields of it_final_customer
                   from bkpf
                   where bukrs eq p_p_comp2
                   and   gjahr eq p_p_year
                   and   awkey like v_doc_date.
                   modify it_final_customer.
           endloop.
        clear:it_final_customer.
    endform.                    " get_doc_date_cust
    *&      Form  move_records_cust
          Moving Customer Data to Final Internal Table
    form move_records_cust.
    *--Checking the existance of belnr in bsid
      select belnr
             zbd1t
             into table it_final_bsid
             from bsid
             for all entries in it_final_customer
             where belnr eq it_final_customer-belnr
             and   bukrs eq c_bukrs.
    clear it_final_bsid.
      loop at it_final_customer.
        read table it_final_bsid with key belnr = it_final_customer-belnr.
        if sy-subrc eq 0.
          it_final_customer-zbd1t    = it_final_bsid-zbd1t.
          it_final_customer-due_date = it_final_customer-bldat +
    it_final_bsid-zbd1t.
          it_final_customer-found    = 'X'.
          modify it_final_customer.
        endif.
      endloop.
    endform.                    " move_records_cust
    *&      Form  generate_data_cust
          Generating the Customer Output
    form generate_data_cust.
      delete it_final_customer[] where found ne 'X'.
      sort it_final_customer by belnr.
      loop at it_final_customer.
        if it_final_customer-due_date > p_rundt2.
         move-corresponding it_final_customer to it_final_customer_temp.
         move it_final_customer-hsl to it_final_customer_temp-not_due.
        elseif it_final_customer-due_date < p_rundt2.
         it_final_customer-due_days = p_rundt2 - it_final_customer-DUE_DATE.
        endif.
    *--filling 0-30 bucket.
    if it_final_customer-due_days ge 0 AND it_final_customer-due_days le 30
          move-corresponding it_final_customer to it_final_customer_temp.
          move it_final_customer-hsl to it_final_customer_temp-buck_0_30.
    *--filling 31-60 bucket.
    elseif it_final_customer-due_days ge 31 AND it_final_customer-due_days
    le 60
          move-corresponding it_final_customer to it_final_customer_temp.
          move it_final_customer-hsl to it_final_customer_temp-buck_31_60.
    *--filling 61-90 bucket.
    elseif it_final_customer-due_days ge 61 AND it_final_customer-due_days
    le 90
          move-corresponding it_final_customer to it_final_customer_temp.
          move it_final_customer-hsl to it_final_customer_temp-buck_61_90.
    *--filling 91-180 bucket.
        elseif it_final_customer-due_days ge 91 AND
    it_final_customer-due_days
    le 180.
          move-corresponding it_final_customer to it_final_customer_temp.
          move it_final_customer-hsl to it_final_customer_temp-buck_91_180.
    *--filling 180 bucket.
        elseif it_final_customer-due_days gt 180.
          move-corresponding it_final_customer to it_final_customer_temp.
          move it_final_customer-hsl to it_final_customer_temp-buck_180.
        endif.
         append it_final_customer_temp.
         clear it_final_customer_temp.
      endloop.
    endform.                    " generate_data_cust
    *&      Form  generate_field_catalog_vendor
          Generating the Field Catalog for Vendor
    form generate_field_catalog_vendor.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          I_PROGRAM_NAME               = v_repid
          I_INTERNAL_TABNAME           = 'IT_FINAL_VENDOR_TEMP'
        I_STRUCTURE_NAME             =
        I_CLIENT_NEVER_DISPLAY       = 'X'
          I_INCLNAME                   = v_repid
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        changing
          ct_fieldcat                  = i_fldcat_head
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_ERROR                = 2
         OTHERS                       = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      if not i_fldcat_head[] is initial.
        loop at i_fldcat_head into wa_fldcat_head.
        case wa_fldcat_head-fieldname.
         when 'RZZLIFNR'.
            wa_fldcat_head-col_pos = '1'.
            wa_fldcat_head-ref_tabname = ' '.
            wa_fldcat_head-seltext_m  = 'Vendor No'(001).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
         when 'NAME1'.
            wa_fldcat_head-col_pos = '2'.
            wa_fldcat_head-seltext_m  = 'Vendor Name'(007).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '35'.
         when 'BELNR'.
            wa_fldcat_head-col_pos = '3'.
            wa_fldcat_head-seltext_m  = 'Invoice No'(008).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
            wa_fldcat_head-KEY       = ' '.
         when 'BLDAT'.
            wa_fldcat_head-col_pos = '4'.
            wa_fldcat_head-seltext_m  = 'Document Date'(009).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '13'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'RZZ_EBELN'.
            wa_fldcat_head-col_pos = '5'.
            wa_fldcat_head-seltext_m  = 'PO.Ref.No'(010).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '13'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'HSL'.
            wa_fldcat_head-col_pos = '6'.
            wa_fldcat_head-seltext_m  = 'Invoice Amount'(011).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'DUE_DATE'.
            wa_fldcat_head-col_pos = '7'.
            wa_fldcat_head-seltext_m  = 'Due Date'(012).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'DUE_DAYS'.
            wa_fldcat_head-col_pos = '8'.
            wa_fldcat_head-seltext_m  = 'Due Days'(013).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '9'.
         when 'NOT_DUE'.
            wa_fldcat_head-col_pos = '9'.
            wa_fldcat_head-seltext_m  = 'Not Due'(014).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_0_30'.
            wa_fldcat_head-col_pos = '10'.
            wa_fldcat_head-seltext_m  = '0 To 30'(015).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_31_60'.
            wa_fldcat_head-col_pos = '11'.
            wa_fldcat_head-seltext_m  = '31 To 60'(016).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_61_90'.
            wa_fldcat_head-col_pos = '12'.
            wa_fldcat_head-seltext_m  = '61 To 90'(017).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_91_180'.
            wa_fldcat_head-col_pos = '13'.
            wa_fldcat_head-seltext_m  = '91 To 180'(018).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_180'.
            wa_fldcat_head-col_pos = '14'.
            wa_fldcat_head-seltext_m  = 'Beyond 180'(019).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
        when 'DOCNR'.
            wa_fldcat_head-no_out = 'X'.
        when 'REFDOCNR'.
            wa_fldcat_head-no_out = 'X'.
        when 'DOC_DATE'.
            wa_fldcat_head-no_out = 'X'.
        when 'FOUND'.
            wa_fldcat_head-no_out = 'X'.
         endcase.
         modify i_fldcat_head from wa_fldcat_head index sy-tabix.
        endloop.
      endif.
    endform.                    " generate_field_catalog_vendor
    *&      Form  get_events_vendor
          Getting ALV Events
    form get_events_vendor.
        call function 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
       importing
         et_events             = i_events
      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.
      if not i_events[] is initial.
       read table i_events into wa_event with key name = 'TOP_OF_PAGE'(024)
       wa_event-form = 'GENERATE_USERCOMMAND'.
       modify i_events from wa_event index sy-tabix.
       read table i_events into wa_event with key name = 'END_OF_LIST'(025)
       wa_event-form = 'GENERATE_USERCOMMAND_FOOTER'.
       modify i_events from wa_event index sy-tabix.
      endif.
    endform.                    " get_events_vendor
    *&      Form  GENERATE_USERCOMMAND
          Displaying Header-Text and Logo on Grid
    form generate_usercommand .
      clear i_comment[].
      wa_comment-typ = 'H'.
      wa_comment-info = 'Vendor Ageing Report'(026).
      append wa_comment to i_comment.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_comment
          i_logo             = 'ENJOYSAP_LOGO'
        I_END_OF_LIST_GRID       = 'X'
    endform.                    " GENERATE_USERCOMMAND
    *&      Form  GENERATE_USERCOMMAND_FOOTER
          Displaying Footer-Text on Grid
    form generate_usercommand_footer.
      clear i_comment[].
      clear wa_comment.
      wa_comment-typ = 'S'.
      wa_comment-key = 'GE-Betz'(027).
      append wa_comment to i_comment.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary       = i_comment
        I_LOGO                  = ''
          i_end_of_list_grid       = 'X'.
    endform.                    " GENERATE_USERCOMMAND_FOOTER
    *&      Form  generate_layout_vendor
          Generating the ALV Layout
    form generate_layout_vendor.
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.     "OPTIMIZING FIELD WIDTH
      wa_layout-zebra = 'X'.                  "PUTTING ZEBRA COLORS
      wa_layout-confirmation_prompt = 'X'.    "DISPLAYS CONFIRMATION DIALOG
      wa_layout-totals_text = 'Totals'(028).       "DISPLAYS TOTALS TEXT
      wa_layout-subtotals_text = 'Sub Totals'(029)."DISPLAYS SUBTOTALS TEXT
    endform.                    " generate_layout_vendor
    *&      Form  generate_sort_vendor
          Sorting the Internal Table by Vendor
    form generate_sort_vendor.
      it_sort-fieldname = 'RZZLIFNR'.
      it_sort-tabname = 'IT_FINAL_VENDOR_TEMP'.
      it_sort-up = 'X'.
      it_sort-subtot = 'X'.
      append it_sort.
    endform.                    " generate_sort_vendor
    *&      Form  generate_group_vendor
          Grouping the Data
    form generate_group_vendor.
      clear i_group.
      wa_group-sp_group = 'A'.
      wa_group-text  = 'RZZLIFNR'.
      append wa_group to i_group.
    endform.                    " generate_group_vendor
    *&      Form  GENERATE_FIELD_CATALOG_CUST
          Generating Field Catalog for Customer
    form GENERATE_FIELD_CATALOG_CUST.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          I_PROGRAM_NAME               = v_repid
          I_INTERNAL_TABNAME           = 'IT_FINAL_CUSTOMER_TEMP'
        I_STRUCTURE_NAME             =
        I_CLIENT_NEVER_DISPLAY       = 'X'
          I_INCLNAME                   = v_repid
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        changing
          ct_fieldcat                  = i_fldcat_head
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_ERROR                = 2
         OTHERS                       = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      if not i_fldcat_head[] is initial.
        loop at i_fldcat_head into wa_fldcat_head.
        case wa_fldcat_head-fieldname.
         when 'RZZKUNNR'.
            wa_fldcat_head-col_pos = '1'.
            wa_fldcat_head-ref_tabname = ' '.
            wa_fldcat_head-seltext_m  = 'Customer No'(020).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
         when 'NAME1'.
            wa_fldcat_head-col_pos = '2'.
            wa_fldcat_head-seltext_m  = 'Customer Name'(021).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '35'.
         when 'BELNR'.
            wa_fldcat_head-col_pos = '3'.
            wa_fldcat_head-seltext_m  = 'Invoice No'(008).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
            wa_fldcat_head-KEY       = ' '.
         when 'BLDAT'.
            wa_fldcat_head-col_pos = '4'.
            wa_fldcat_head-seltext_m  = 'Document Date'(009).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '13'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'RZZ_EBELN'.
            wa_fldcat_head-col_pos = '5'.
            wa_fldcat_head-seltext_m  = 'PO.Ref.No'(010).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '13'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'HSL'.
            wa_fldcat_head-col_pos = '6'.
            wa_fldcat_head-seltext_m  = 'Invoice Amount'(011).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'DUE_DATE'.
            wa_fldcat_head-col_pos = '7'.
            wa_fldcat_head-seltext_m  = 'Due Date'(012).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '12'.
            wa_fldcat_head-ref_tabname = ' '.
         when 'DUE_DAYS'.
            wa_fldcat_head-col_pos = '8'.
            wa_fldcat_head-seltext_m  = 'Due Days'(013).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '9'.
         when 'NOT_DUE'.
            wa_fldcat_head-col_pos = '9'.
            wa_fldcat_head-seltext_m  = 'Not Due'(014).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_0_30'.
            wa_fldcat_head-col_pos = '10'.
            wa_fldcat_head-seltext_m  = '0 To 30'(015).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_31_60'.
            wa_fldcat_head-col_pos = '11'.
            wa_fldcat_head-seltext_m  = '31 To 60'(016).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_61_90'.
            wa_fldcat_head-col_pos = '12'.
            wa_fldcat_head-seltext_m  = '61 To 90'(017).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_91_180'.
            wa_fldcat_head-col_pos = '13'.
            wa_fldcat_head-seltext_m  = '91 To 180'(018).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
         when 'BUCK_180'.
            wa_fldcat_head-col_pos = '14'.
            wa_fldcat_head-seltext_m  = 'Beyond 180'(019).
            wa_fldcat_head-ddictxt = 'M'.
            wa_fldcat_head-outputlen = '16'.
            wa_fldcat_head-do_sum = 'X'.
        when 'DOCNR'.
            wa_fldcat_head-no_out = 'X'.
        when 'REFDOCNR'.
            wa_fldcat_head-no_out = 'X'.
        when 'DOC_DATE'.
            wa_fldcat_head-no_out = 'X'.
        when 'FOUND'.
            wa_fldcat_head-no_out = 'X'.
         endcase.
         modify i_fldcat_head from wa_fldcat_head index sy-tabix.
        endloop.
      endif.
    endform.                    " GENERATE_FIELD_CATALOG_CUST
    *&      Form  get_events_customer
          Getting ALV Events
    form get_events_customer.
        call function 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
       importing
         et_events             = i_events
      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.
      if not i_events[] is initial.
       read table i_events into wa_event with key name = 'TOP_OF_PAGE'(024)
       wa_event-form = 'GENERATE_USERCOMMAND_CUST'.
       modify i_events from wa_event index sy-tabix.
       read table i_events into wa_event with key na

  • Discoverer Report

    Dear Sir,
    Can i access the report from cyber cafe(Web Enabled) that is generated with oracle 9i Discoverer. If YES then How ?
    If NO then Why
    OR
    any other version from which we can access the report from cyber cafe that created with discoverer

    Is it Correct " If You Don't have Licence copy of oracle S/w then u can use only development not for production for production you must have licence copy of oracle."

  • Discoverer Report Row Total

    We are running Oracle BI Discoverer Viewer version 11.1.1.4.0. When we upgraded to this version we lost some functionality. In the previous version the report displayed the number of rows the query returned. Now the row totals display only under certain conditions. For instance, I have a inventory report name INV-REP-120 and it prompts the user for 6 parameters & displays 6 columns of data. One of the parameters is named ‘Keyword' and I’ll use this one in the problem description. When I set the keyword parameter to ‘HINGE’ The bar at the top of the results sheet it displays:
    ‘Rows 1-25 of 81, Columns 1-6 of 9’
    When I change the keyword to ‘TUBE’ the viewer displays:
    ‘Rows 1-25, Columns 1-6 of 9’
    The total rows are not displayed but the number of pages. It appears that if the total number of rows is less than 200 then the row total is displayed. I changed the rows displayed from 25 to 100 and scrolled down to the last page and now the reports displays:
    ‘451 – 458 of 458, Columns 1-6 of 9’
    When I use the key word TEE I get :
    ‘Rows 1-50, Columns 1-6 of 9’
    There are 596 tees, which would be about 12 pages of 50 rows. I noticed that at the top of table there is a field ‘Page 1 of 5.’ It looks like if there are more than 5 pages it does not display the total number of rows.
    There seems to be some interaction between the total number of rows the number of rows per page and perhaps a setup on the back-end that determines whether or not the row total is displayed. How can I configure the viewer at the front-end and/or back-end to consistently display the row total for a report? Is there a Discoverer preference located in the pref.txt in the apps server that controls this?

    Hi,
    You can inform to your SP to edit the table EUL4_documents
    and ask him to modify the name of the report that is stored in the column DOC_NAME .There is absolutely no necessary to open the work book that is stored in the database and change the work book name
    Regards
    Swamy!

  • Discoverer report not working on R12 !

    We have just migrated to R12 from 11i and some of the discoverer query is not working, but the same is working fine when we ran thru SQL Developer or TOAD.
    Is there any context (mo_global.set_policy_context) needs to be set in Discoverer report to get the data?
    Thanks

    Thanks Srini,
    There is no any specific error message, the strange thing is if I run the Discoverer report is not returning any data, but if I set the mo_global.set_policy_context ('S',111) in SQL Developer or TOAD and then run the discoverer report it return data...
    Any pointers?

  • Discoverer Report parameter based on subquery

    Hi Guys,
    I have following query which i need to convert into discoverer report
    select hpah.EMPLOYEE_NUMBER,hpah.FIRST_NAME,hpah.LAST_NAME,hpah.PERSON_NAME,
    --hpah.JOB_NAME,hpah.ASSIGNMENT_ORGANIZATION_NAME,
    hpah.ASSIGNMENT_TYPE,hpah.USER_ASSIGNMENT_STATUS,
    SUBSTR(pj.name, 1, instr(pj.name, '.', 1, 2) -1) job_code,
    SUBSTR(pj.name, instr(pj.name, '.', 1, 2) + 1) job_title,
    (select haou.ATTRIBUTE1 from hr_all_organization_units haou
    where haou.ORGANIZATION_ID = hpah.ASSIGNMENT_ORGANIZATION_ID ) Function,
    (select haou.ATTRIBUTE2 from hr_all_organization_units haou
    where haou.ORGANIZATION_ID = hpah.ASSIGNMENT_ORGANIZATION_ID ) org_desc,
    SUBSTR(hpah.ASSIGNMENT_ORGANIZATION_NAME, 1, 6) dept_code,
    SUBSTR(hpah.ASSIGNMENT_ORGANIZATION_NAME, 7, LENGTH(hpah.ASSIGNMENT_ORGANIZATION_NAME)) dept_title,
    hpah.GRADE_NAME,hpah.LOCATION_NAME,hpah.SUPERVISOR_NAME,
    hpah.PERSON_START_DATE,hpah.ORIGINAL_DATE_OF_HIRE ,
    hpah.SALARY_BASIS,hpah.BUSINESS_GROUP_ID,hpah.ASSIGNMENT_ID,
    decode( hpah.SALARY_BASIS, 'ANNUAL', ppp.proposed_salary_n,
    'HOURLY', (ppp.proposed_salary_n *2080),
    ppp.proposed_salary_n
    ) salary,
    sysdate run_date
    from
    hrfg_person_assignment_history hpah ,
    per_pay_proposals ppp,
    per_pay_bases ppb,
    per_grades pg,
    per_jobs pj
    where hpah.ASSIGNMENT_ID = ppp.ASSIGNMENT_ID
    and hpah.SALARY_BASIS = ppb.PAY_BASIS
    and hpah.BUSINESS_GROUP_ID = ppb.BUSINESS_GROUP_ID
    and hpah.GRADE_ID = pg.GRADE_ID(+)
    and hpah.JOB_ID = pj.JOB_ID (+)
    --and   hpah.EMPLOYEE_NUMBER = 100779
    and hpah.PERSON_START_DATE IN
    (SELECT MAX(hpah2.PERSON_START_DATE)
    FROM hrfg_person_assignment_history hpah2
    WHERE hpah2.EMPLOYEE_NUMBER = hpah.EMPLOYEE_NUMBER
    AND hpah2.PERSON_START_DATE <= sysdate )
    order by hpah.EMPLOYEE_NUMBER
    i need to have sysdate as parameter in my report. I want data based on the date i provide.
    how can i make this as an parameter?

    Hi Prashant,
    Subqueries are not Supported in Conditions..As of Disco Plus Rel 10.1.2.54.25
    A plausible workaround can be:
    1. Create a View with foll. Query
    create or replace view TEST_VIEW as
    select hpah.EMPLOYEE_NUMBER emp_no,hpah.FIRST_NAME,hpah.LAST_NAME,hpah.PERSON_NAME,
    --hpah.JOB_NAME,hpah.ASSIGNMENT_ORGANIZATION_NAME,
    hpah.ASSIGNMENT_TYPE,hpah.USER_ASSIGNMENT_STATUS,
    SUBSTR(pj.name, 1, instr(pj.name, '.', 1, 2) -1) job_code,
    SUBSTR(pj.name, instr(pj.name, '.', 1, 2) + 1) job_title,
    (select haou.ATTRIBUTE1 from hr_all_organization_units haou
    where haou.ORGANIZATION_ID = hpah.ASSIGNMENT_ORGANIZATION_ID ) Function,
    (select haou.ATTRIBUTE2 from hr_all_organization_units haou
    where haou.ORGANIZATION_ID = hpah.ASSIGNMENT_ORGANIZATION_ID ) org_desc,
    SUBSTR(hpah.ASSIGNMENT_ORGANIZATION_NAME, 1, 6) dept_code,
    SUBSTR(hpah.ASSIGNMENT_ORGANIZATION_NAME, 7, LENGTH(hpah.ASSIGNMENT_ORGANIZATION_NAME)) dept_title,
    hpah.GRADE_NAME,hpah.LOCATION_NAME,hpah.SUPERVISOR_NAME,
    hpah.PERSON_START_DATE,hpah.ORIGINAL_DATE_OF_HIRE ,
    hpah.SALARY_BASIS,hpah.BUSINESS_GROUP_ID,hpah.ASSIGNMENT_ID,
    decode( hpah.SALARY_BASIS, 'ANNUAL', ppp.proposed_salary_n,
    'HOURLY', (ppp.proposed_salary_n *2080),
    ppp.proposed_salary_n
    ) salary,
    sysdate run_date
    from
    hrfg_person_assignment_history hpah ,
    per_pay_proposals ppp,
    per_pay_bases ppb,
    per_grades pg,
    per_jobs pj
    where hpah.ASSIGNMENT_ID = ppp.ASSIGNMENT_ID
    and hpah.SALARY_BASIS = ppb.PAY_BASIS
    and hpah.BUSINESS_GROUP_ID = ppb.BUSINESS_GROUP_ID
    and hpah.GRADE_ID = pg.GRADE_ID(+)
    and hpah.JOB_ID = pj.JOB_ID (+)
    --and hpah.EMPLOYEE_NUMBER = 100779
    order by hpah.EMPLOYEE_NUMBER
    2. Create another table say TEST_TAB
    create table TEST_TAB (emp_no, start_dt) as
    SELECT hpah2.EMPLOYEE_NUMBER , MAX(hpah2.PERSON_START_DATE) PERSON_START_DATE
    FROM hrfg_person_assignment_history hpah2
    GROUP BY hpah2.EMPLOYEE_NUMBER
    3. Add both of them in Disco Admin and create a join between TEST_VIEW.emp_no and TEST_TAB.emp_no
    4. Bring both these Objects in a new report in Disco Plus
    5. Create a New Parameter (Base it on PERSON_START_DATE Col of TEST_TAB)
    6. Choose Option Create Condition with operator <=
    7. Checkmark "Require User to Enter a Value
    8. Execute Report
    I believe this should work. Either ways let me know if it helps or u get another workaround. (This scenario looks quite interesting)
    Thanks,
    Chinmay

Maybe you are looking for

  • VS 2010 app looking for CR Runtime v 11.5.3700

    Someone at my company developed a piece of simple C# console app code (below) to create .rpt files in a folder to be emailed later. They did this work on a machine with Visual Studio 2010 and Crystal Reports v 11.5. The created application will be in

  • Can't set up my HPConnect account

    I'm attempting to set up my new printer, and it was all going so well. Until I had to set up an HPConnect account.  I click on "create account," follow the steps, and then when I try to log in with my new account, I get a message saying that either m

  • Error SP2-0640 when installing Statspack

    Oracle 9.2.0.1.0 . Windows. Trying to install statspack, keep getting the same error in spctab.lis SP2-0640: Not connected I have read this is a connect string issue. I have read I should run the spcreate.sql even as system instead of sys. I have uns

  • Regarding Instance Filter for instance search

    Hi, We are facing one problem during instance search through InstanceFilter code. We have written the following code to find the instance- Fuego.Papi.InstanceFilter instFilter; instFilter.create(processService : ProcessService); instFilter.addAttribu

  • InDesign crashes when i open an Open, Place, Import Export or Save dialog

    When i open a dialog that allow me to navigate folders on your system, such as the Place, Open, Import, Save or Export dialogs, InDesign crashes. I have Yosemite updated, no Version Cue, can you help me? I saw that was an old problem (InDesign crashe