Generate a Report

hi Friends,
i have three table
1-
CREATE TABLE "TRANSACTION_DETAILS"
( "S_NO" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"ITEM_NAME" VARCHAR2(500),
"DESCRIPTION" VARCHAR2(4000),
"QTY" NUMBER,
"RATE" NUMBER,
"AMOUNT" NUMBER,
CONSTRAINT "TRANSACTION_DETAILS_CON" PRIMARY KEY ("S_NO") ENABLE
2-
CREATE TABLE "LAB_WORK_DTL"
( "ID" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"WORK_DETAIL" VARCHAR2(4000),
"LABOUR_AMT" NUMBER,
CONSTRAINT "LAB_WORK_DTL_PK" PRIMARY KEY ("ID") ENABLE
3-
CREATE TABLE "JOB_CARD_DETAILS"
( "ID2" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"AMOUNT" NUMBER,
CONSTRAINT "JOB_CARD_DETAILS_CON" PRIMARY KEY ("ID2") ENABLE
i want to generate a Report with these three table of total amout of bill Like
BILL_NO,BILL_DATE,VEHICLE_NO,SUM(AMOUNT) ,SUM(LABOUR_AMT),SUM(AMOUNT)
I AM USING
select a.BILL_NO,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) from TRANSACTION_DETAILS a,LAB_WORK_DTL b,JOB_CARD_DETAILS c where a.PARTY_NAME =b.PARTY_NAME and a.PARTY_NAME=c.PARTY_NAME and a.PARTY_NAME =:P38_PARTY_NAME group by a.bill_no,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,b.bill_no,b.BILL_DATE,b.PARTY_NAME,b.VEHICLE_NO,c.bill_no,c.BILL_DATE,c.PARTY_NAME,c.VEHICLE_NO
i have two entry corresponding to PARTY_NAME is 'A' in TRANSACTION_DETAILS
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,ITEM_NAME = C ,AMOUNT =12
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,ITEM_NAME = D ,AMOUNT =50
i have two entry corresponding to PARTY_NAME is 'A' in LAB_WORK_DTL
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,WORK_DETAIL = CLUTCH REPAIR ,LABOUR_AMT =250
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,WORK_DETAIL = WHEEL BALANCING,LABOUR_AMT =150
i have two entry corresponding to PARTY_NAME is 'A' in JOB_CARD_DETAILS
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,DESCRIPTION = ENGINE REPAIRING ,AMOUNT =200
BILL_NO =5 BILL_DATE =05-MAR-10 , PARTY_NAME =A , VEHICLE_NO = 112 ,DESCRIPTION = PATROL,AMOUNT =500
when i run my code then Result is
SUM(a.AMOUNT) =248
SUM(b.LABOUR_AMT) =1600
SUM(c.AMOUNT) =2800
But Result Should Be
SUM(a.AMOUNT) =62
SUM(b.LABOUR_AMT) =400
SUM(c.AMOUNT) =700
how can i get correct value .
Manoj Kauhsik

1. I guess there is more data related to PARTY_NAME 'A' then you showed us, because there is no way the numbers you presented could add up to 248... (maybe another billno, date, vehicle?)
2. You can remove ",b.bill_no,b.BILL_DATE,b.PARTY_NAME,b.VEHICLE_NO,c.bill_no,c.BILL_DATE,c.PARTY_NAME,c.VEHICLE_NO" from your GROUP BY
3. You can also rewrite your query in something like :
select a.BILL_NO,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,SUM(a.AMOUNT) suma
, (select sum(b.LABOUR_AMT) from LAB_WORK_DTL b where a.PARTY_NAME =b.PARTY_NAME) sumb
, ...same for the third table...
from TRANSACTION_DETAILS a
where a.PARTY_NAME =:P38_PARTY_NAME
group by a.BILL_NO,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO

Similar Messages

  • APiI for generating Quote report as Pdf  in oracle iStore

    hi,
    Any one help me on which API is used for generating quote report in oracle istore...

    Are u sure about  the report version.
    Please do upgrade  while  even in oracle  they almost stopped for new version -Developer suite

  • Error while generating the report on Test env (for divide condition)

    Hi All,
    I am facing the below error while generating the report in test environment while the same report is working fine on Prod environment.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression. [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression. [nQSError: 16015] SQL statement execution failed. (HY000)
    Actually the error is coming for the below logics:
    COUNT(DISTINCT RMA.RMA)/COUNT(DISTINCT User."User Name")
    "RMA Fact"."Module Backlog"/COUNT(DISTINCT User."User Name")
    Can anyone please tell if I need to make any configuration changes as the same logic works perfectly fine on production but not on test.
    Thanks in advance

    Is anyone having any idea about it...

  • Error while generating earlywatch report.

    Hi Guru's
                  I am having problem in generating earlywatch report.
    In solution manager i find these errors:-
    The data for this session is overdue. Data has not yet been transferred from the associated satellite system.
    Go to the Service Data Control Center (transaction SDCCN) in the satellite system and check why the data has not been sent.
    Typical sources of errors are:
    The RFC connection for the SAP Solution Manager system is not working.
    The 'Task Processor' background job, which collects the session data, has been changed.
    Problems arose while data was being collected (see the detail log for the task that collects the session data).
    A periodic 'SDCC Maintenance Package' task has not been scheduled to check whether your SAP Solution Manager system requests session data.
    Session number: 1000000002286
    In source system tcode sdccn when i try to run Refresh sessions i get following error:-
    31.05.2010     12:24:34      > Task rescheduled for 20100531125533 ( attempt 0001 )     /BDL/SAPLBDL11     0
    31.05.2010     12:24:34     Refresh of session overview failed from destination SM_SMPCLNT100_BACK     /BDL/SAPLBDL11     0
    31.05.2010     12:24:34      > Sessions cannot be refreshed from destination SM_SMPCLNT100_BACK ( SMP , 0020275310 )     /BDL/SAPLBDL11     0
    31.05.2010     12:24:34      > You cannot log on (CUA system assignment missing)     /BDL/SAPLBDL11     0
    31.05.2010     12:24:34      > error reading function module interface DSWP_API_SESSIONLIST_GET from  SM_SMPCLNT100_BACK     /BDL/SAPLBDL11     0
    31.05.2010     12:23:58     Refresh of session overview started from destination SM_SMPCLNT100_BACK     /BDL/SAPLBDL11     0
    I have checked with the rfc's they are working fine.
    Please help.
    Regards
    Akif

    Hi Akif,
    Could you please try deleting the RFC Connection and entering it again in the Managed system.
    1) SDCCN
    2) Goto-> Settings-> Task specific.
    3) RFC Destinations-> Settings click on change mode.
    4) Delete the RFC and then add the RFC Connection again and mark as Master and active.
    Then check it, hope it solves the issue.
    Thanks,
    Raghavendra.

  • Error while generating the report in BI using CRM

    dear experts...   .  / friends  ...
    i have created a query long back called SERVICE REQUEST using Query designer
    using that particular query i have generating the reports from MAY 1 to till date
    in my report i have a characteristics called USER STATUS , for this user status i can restrict the below values i.e
    open
    reopen
    waiting
    in - transfer
    resolved
    new
    completed
    in the above values , i want to get the transaction numbers which are not completed i.e. i need to exclude complete
    and i need to include all the above values
    but after generating the report , am getting completed records too...
    and in the report  i saw for that completed record i have OPEN DOCUMENTS(key figures)  and NO.OF DOCUMENT HEADERS(key figures) is 0
    actually if we see any updated record for the particular report the key figure NO.OF DOCUMENT HEADERS should be 1 right?
    so in my scenario if NO.OF DOCUMENT HEADERS getting 0 so the filter condition for COMPLETED , is not working
    so that the reason  even though i have filtered the COMPLETED value for the USER STATUS field , am getting those
    fields....
    so friends kindly help me in this regard to avoid completed value for the filed USER STATUS..
    thanks in advance...for u r helping
    regards...
    GA

    dear experts,
    for the above issue i have raised the OSS message and i got the below reply as well..
    they told me to create a pre queris can any one help me in this regard?
    =>
    => If you want to ensure that all completed transactions are filtered
    from the report even when keyfigure "open documents" <> 0 then
    you have to adjust your query definitions, e.g. by means of
    pre-queries to create a list of records for which a "completed"
    state-entry exists.

  • Generated a report which gives PR(Purchase Requisition) analysis using ALV.

    hi experts,
    please give me tables and fields for following report, and also exlain me briefly,
    Generated a report which gives PR(Purchase Requisition) analysis using ALV.
    thanks in advance,
    radhakrishna

    Hi
    please find this report which link SO PO PR and Prd Ord and there status.
    >
    REPORT z_so_info.
    TABLES: vbak, vbap, afko, afpo.
    *Field catalog
    TYPE-POOLS: slis.
    DATA: lv_repid TYPE sy-repid VALUE sy-repid,
    xfield TYPE slis_t_fieldcat_alv,
    afield TYPE slis_fieldcat_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(25) text-002.
    SELECT-OPTIONS: so_so FOR vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    PARAMETERS:
    p_kunnr LIKE vbak-kunnr, " sold-to
    p_kunwe LIKE vbak-kunnr. " ship-to
    SELECTION-SCREEN END OF BLOCK b2.
    *Constants
    CONSTANTS: c_zor TYPE vbak-auart VALUE 'ZOR',
    c_we TYPE vbpa-parvw VALUE 'WE',
    c_ag TYPE vbpa-parvw VALUE 'AG'.
    c_space TYPE space.
    *Ranges
    RANGES: ra_parvw FOR vbpa-parvw,
    ra_kunnr FOR vbpa-kunnr.
    *Tables
    DATA: BEGIN OF gt_output OCCURS 0,
    vbeln LIKE vbak-vbeln, " sales order number
    posnr LIKE vbap-posnr, " SO item number
    matnr LIKE vbap-matnr, " material number
    sh LIKE vbpa-kunnr, " Ship-to
    sp LIKE vbpa-kunnr, " Sold-to
    lifnr LIKE ekko-lifnr, " Vendor
    bstnk LIKE vbak-bstnk, " PO number
    banfn LIKE vbep-banfn, " Purchase requi
    po_st TYPE char30, " PO status text
    pstyv TYPE vbap-pstyv, " Item catagory
    aufnr LIKE afpo-aufnr, " Production Order
    prd_stat TYPE string, " Prd order status
    END OF gt_output.
    DATA: wa_output LIKE gt_output.
    FIELD-SYMBOLS: <fs_output> LIKE gt_output.
    *Table for sales order and PO
    TYPES : BEGIN OF gs_data,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    pstyv TYPE vbap-pstyv,
    matnr TYPE vbap-matnr,
    END OF gs_data.
    DATA: gt_data TYPE STANDARD TABLE OF gs_data,
    wa_data TYPE gs_data.
    *Table for Production Orders
    TYPES: BEGIN OF gs_prd,
    aufnr TYPE afpo-aufnr,
    posnr TYPE afpo-posnr,
    kdauf TYPE afpo-kdauf,
    kdpos TYPE afpo-kdpos,
    wepos TYPE afpo-wepos, "Goods Receipt Indicator
    elikz TYPE afpo-elikz, "Delivery Completed Indicator
    objnr TYPE aufk-objnr, "Object number
    getri TYPE afko-getri, "Confirmed Order Finish Date
    gltri TYPE afko-gltri, "Actual finish date
    END OF gs_prd.
    DATA: gt_prd TYPE STANDARD TABLE OF gs_prd,
    wa_prd TYPE gs_prd.
    *Table for partner data
    TYPES: BEGIN OF gs_partner,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    parvw TYPE vbpa-parvw,
    kunnr TYPE vbpa-kunnr,
    END OF gs_partner.
    DATA: gt_partner TYPE STANDARD TABLE OF gs_partner,
    wa_partner TYPE gs_partner.
    TYPES: BEGIN OF gs_po,
    ebeln TYPE ekkn-ebeln,
    ebelp TYPE ekkn-ebelp,
    vbeln TYPE ekkn-vbeln,
    vbelp TYPE ekkn-vbelp,
    END OF gs_po.
    DATA: gt_po TYPE STANDARD TABLE OF gs_po,
    wa_po TYPE gs_po.
    TYPES: BEGIN OF gs_preq,
    vbeln TYPE vbep-vbeln,
    posnr TYPE vbep-posnr,
    banfn TYPE vbep-banfn,
    END OF gs_preq.
    DATA: gt_preq TYPE STANDARD TABLE OF gs_preq,
    wa_preq TYPE gs_preq.
    TYPES: BEGIN OF gs_po_stat,
    ebeln TYPE ekko-ebeln,
    procstat TYPE ekko-procstat,
    lifnr TYPE ekko-lifnr,
    END OF gs_po_stat.
    DATA: gt_po_stat TYPE STANDARD TABLE OF gs_po_stat,
    wa_po_stat TYPE gs_po_stat.
    *Field symbols
    FIELD-SYMBOLS: <fs> TYPE tj02t-txt04,
    <fs_temp> TYPE tj02t-txt04,
    <fs_stat> TYPE char30.
    START-OF-SELECTION.
    PERFORM fr_build_range.
    PERFORM fr_get_data.
    PERFORM fr_build_fc.
    PERFORM fr_output.
    *& Form fr_get_data
    text
    --> p1 text
    <-- p2 text
    FORM fr_get_data.
    *Get SO
    SELECT avbeln aposnr apstyv amatnr
    FROM vbap AS a
    JOIN vbak AS b
    ON avbeln = bvbeln
    JOIN vbpa AS c
    ON bvbeln = cvbeln
    INTO TABLE gt_data
    WHERE b~vbeln IN so_so
    AND b~auart EQ c_zor "Only Sales Orders
    AND c~kunnr IN ra_kunnr. "from selection screen
    DELETE ADJACENT DUPLICATES FROM gt_data COMPARING vbeln posnr.
    *get data of the production order
    IF NOT gt_data[] IS INITIAL.
    SELECT aaufnr aposnr akdauf akdpos awepos aelikz
    b~objnr
    FROM afpo AS a
    JOIN aufk AS b
    ON aaufnr = baufnr
    INTO TABLE gt_prd
    FOR ALL ENTRIES IN gt_data
    WHERE a~kdauf EQ gt_data-vbeln
    AND a~kdpos EQ gt_data-posnr.
    ENDIF.
    *Get partner data
    IF NOT gt_data[] IS INITIAL.
    SELECT vbeln posnr parvw kunnr
    FROM vbpa
    INTO TABLE gt_partner
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln.
    ENDIF.
    *Get Purchase Order
    IF NOT gt_data[] IS INITIAL.
    SELECT ebeln ebelp vbeln vbelp
    FROM ekkn
    INTO TABLE gt_po
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND vbelp EQ gt_data-posnr.
    SELECT vbeln posnr banfn
    FROM vbep
    INTO TABLE gt_preq
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND posnr EQ gt_data-posnr.
    ENDIF.
    IF NOT gt_po[] IS INITIAL.
    SELECT aebeln aprocstat a~lifnr
    FROM ekko AS a
    JOIN ekpo AS b
    ON aebeln = bebeln
    INTO TABLE gt_po_stat
    FOR ALL ENTRIES IN gt_po
    WHERE b~ebeln EQ gt_po-ebeln
    AND b~ebelp EQ gt_po-ebelp.
    ENDIF.
    *Move data to output table
    LOOP AT gt_data INTO wa_data.
    wa_output-vbeln = wa_data-vbeln.
    wa_output-posnr = wa_data-posnr.
    wa_output-pstyv = wa_data-pstyv.
    wa_output-matnr = wa_data-matnr.
    READ TABLE gt_po INTO wa_po WITH KEY vbeln = wa_data-vbeln
    vbelp = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-bstnk = wa_po-ebeln.
    READ TABLE gt_po_stat INTO wa_po_stat WITH KEY ebeln = wa_po-ebeln.
    IF sy-subrc EQ 0.
    wa_output-lifnr = wa_po_stat-lifnr.
    CASE wa_po_stat-procstat.
    WHEN '01'.
    wa_output-po_st = 'Version in process'.
    WHEN '02'.
    wa_output-po_st = 'Active'.
    WHEN '03'.
    wa_output-po_st = 'In release'.
    WHEN '04'.
    wa_output-po_st = 'Partially released'.
    WHEN '05'.
    wa_output-po_st = 'Released Completely'.
    WHEN '08'.
    wa_output-po_st = 'Rejected'.
    ENDCASE.
    ENDIF. "inner read subrc
    ENDIF. "outer read subrc
    READ TABLE gt_preq INTO wa_preq WITH KEY vbeln = wa_data-vbeln
    posnr = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-banfn = wa_preq-banfn.
    ENDIF.
    READ TABLE gt_prd INTO wa_prd WITH KEY kdauf = wa_data-vbeln
    kdpos = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-aufnr = wa_prd-aufnr.
    *get the purchase requisition for production order as well
    SELECT SINGLE banfn
    FROM ebkn
    INTO wa_output-banfn
    WHERE aufnr EQ wa_prd-aufnr.
    *Get the status of the production order
    PERFORM fr_get_prd_stat USING wa_prd-objnr
    CHANGING wa_output-prd_stat.
    ENDIF. " sy-subrc
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_we.
    IF sy-subrc EQ 0.
    wa_output-sh = wa_partner-kunnr.
    ENDIF.
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_ag.
    IF sy-subrc EQ 0.
    wa_output-sp = wa_partner-kunnr.
    ENDIF.
    APPEND wa_output TO gt_output.
    CLEAR: wa_data, wa_prd,wa_partner,wa_output.
    ENDLOOP.
    ENDFORM. " fr_get_data
    *& Form fr_build_range
    text
    --> p1 text
    <-- p2 text
    FORM fr_build_range .
    *Range for partner function
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SH' TO ra_parvw-low. " we
    APPEND ra_parvw.
    CLEAR ra_parvw.
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SP' TO ra_parvw-low. " ag
    APPEND ra_parvw.
    CLEAR ra_parvw.
    *Range for ship-to and sold-to
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunnr TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunwe TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    ENDFORM. " fr_build_range
    *& Form fr_build_fc
    text
    --> p1 text
    <-- p2 text
    FORM fr_build_fc .
    sales order number
    afield-fieldname = 'VBELN'.
    afield-seltext_s = 'Sales #'.
    afield-ref_tabname = 'VBAK'.
    APPEND afield TO xfield. CLEAR afield.
    sales ITEM number
    afield-fieldname = 'POSNR'.
    afield-seltext_s = 'Item #'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    Material Number
    afield-fieldname = 'MATNR'.
    afield-seltext_s = 'Material #'.
    afield-ref_tabname = 'VBAP'.
    afield-outputlen = 10.
    APPEND afield TO xfield. CLEAR afield.
    *Vendor Number
    afield-fieldname = 'LIFNR'.
    afield-seltext_s = 'Vendor Num.'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    ship-to-party
    afield-fieldname = 'SH'.
    afield-seltext_s = 'Ship-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    sold-to-party
    afield-fieldname = 'SP'.
    afield-seltext_s = 'Sold-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    *PO number
    afield-fieldname = 'BSTNK'.
    afield-seltext_s = 'PO NUM'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PO status
    afield-fieldname = 'PO_STAT'.
    afield-seltext_s = 'Step'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    *PO step status
    afield-fieldname = 'PO_ST'.
    afield-seltext_s = 'PO.Status'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    *Purchase requisition
    afield-fieldname = 'BANFN'.
    afield-seltext_s = 'Pur. Req.'.
    afield-ref_tabname = 'VBEP'.
    APPEND afield TO xfield. CLEAR afield.
    *Item catagory
    afield-fieldname = 'PSTYV'.
    afield-seltext_s = 'Itm. Catg'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    *Prodcution Order number
    afield-fieldname = 'AUFNR'.
    afield-seltext_m = 'Prod.Order'.
    afield-ref_tabname = 'AFKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PRODCUTION status
    afield-fieldname = 'PRD_STAT'.
    afield-seltext_s = 'Prd. Step'.
    afield-ref_tabname = 'zbacklog_v2'.
    afield-outputlen = 20.
    APPEND afield TO xfield. CLEAR afield.
    *PRODUCTION step status
    afield-fieldname = 'PRD_ST'.
    afield-seltext_s = 'Prd. Status'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    ENDFORM. " fr_build_fc
    *& Form fr_output
    text
    --> p1 text
    <-- p2 text
    FORM fr_output .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    it_fieldcat = xfield[]
    i_default = 'X'
    i_save = 'A'
    TABLES
    t_outtab = gt_output
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM. " fr_output
    *& Form fr_get_prd_stat
    text
    -->P_WA_PRD_OBJNR text
    FORM fr_get_prd_stat USING p_objnr CHANGING p_prd_stat.
    DATA: lt_status TYPE STANDARD TABLE OF jstat,
    wa_status TYPE jstat,
    lv_status TYPE tj02t-txt04,
    lv_temp2 TYPE char5,
    lv_buff TYPE string.
    CALL FUNCTION 'STATUS_READ'
    EXPORTING
    client = sy-mandt
    objnr = p_objnr
    only_active = 'X'
    TABLES
    status = lt_status
    EXCEPTIONS
    object_not_found = 1
    OTHERS = 2.
    LOOP AT lt_status INTO wa_status.
    IF wa_status-stat(1) EQ 'I'.
    SELECT txt04 FROM tj02t
    INTO lv_status
    WHERE istat EQ wa_status-stat
    AND spras EQ 'E'.
    ENDSELECT.
    lv_temp2 = lv_status.
    CONCATENATE lv_temp2 p_prd_stat INTO p_prd_stat
    SEPARATED BY ','.
    ENDIF.
    CLEAR: wa_status, lv_status, lv_temp2.
    ENDLOOP.
    lv_buff = p_prd_stat.
    *Status of Production Order
    IF lv_buff CS 'CRTD'.
    p_prd_stat = 'Not Active'.
    ENDIF.
    IF lv_buff CS 'REL'.
    IF lv_buff CS 'GMPS'.
    p_prd_stat = 'Printed In Prod'.
    ELSE.
    p_prd_stat = 'Printed'.
    ENDIF.
    ENDIF.
    IF lv_buff CS 'TECO'.
    p_prd_stat = 'Technically Compt.'.
    ENDIF.
    ENDFORM. " fr_get_prd_stat
    >

  • Generating a report based on two analytics(for ex:PO and PR)

    I have a question regarding generating reports on two analytics.
    In our scenarios,
    We need to generate a report based on Purchase order and Purchase request.Is it possible in OBIA?
    if yes,please provide the solution.
    Thanks in advance

    Hi ,
    Thanks for your valuable time.
    We are in designing phase of the project. we need to know ,Is there any inbuilt dashboards or reports built using both PO and PR repositories?
    I would like to explain with ex:
    Let's say we need a report or dashboard containing few fields from PO and few fields from PR.Let's assume both PO and PR data available at same granularity.
    Do we have any such inbuilt reports or dashboard?
    If not,could we customize the report generation using both PO and PS tables?
    Please provide the solution.
    Thanks in advance.
    Edited by: user3561029 on Aug 31, 2008 9:03 PM

  • How to generate a report for all Analyses which conatins a specific column

    Hello Experts
    I am trying to generate a report of all Analyses which contains a specific column. We are currently using OBIEE 11.1.1.7.0.
    I have tried to use the command line options using ./runcat.sh, but did not find any arguments that can filter the analyses by a specific column used.
    Any help is much appreciated.
    Regards
    Rakesh 

    Hi Rakesh,
    SampleApp has your answer: everything is available for free, just copy/paste and run on your own instance.
    http://slc02ojw.oracle.com:7780/analytics/saw.dll?Dashboard&PortalPath=%2Fshared%2F10.%20Lifecycle%20and%20Admin%2F_port…
    (as long as this instance will be up...)
    In the dashboard named "10.31 Webcat Analysis" you have a columns to analysis report where you select the presentation column and you get all the reports using it.
    This dashboard require a script to be run on your catalog, it will parse it and extract all the column info (and many other interesting things) and load it in a database. The scripts are simple and well documented, so you can easily adapt them to your own environment.
    If you want the script there is no miracle solution: download SampleApp and extract it (it's not small, but with all the great content it has we can't complain about that ...).

  • How to generate jasper report in pdf format using swing

    hi all,
    im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
    1)delegate:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
    return generateReportDto;
    2)sessionBean:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    //Map parameters = new HashMap();
    ReportManager reportManager = new ReportManager();
    3)ReportManager()
    public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
              Connection conn = null;
              try {
                   conn = dataSource.getConnection();
                   //Generate the report to bytes
                   File reportFile = new File(fileName);               
                   byte[] bytes =
                        JasperRunManager.runReportToPdf(
                             reportFile.getPath(),
                             parameters,
                             conn
              //conn.close();
              //Write the bytes to a file
              ByteBuffer buf = ByteBuffer.wrap(bytes);
              File file = new File(outputFileName);
              // (if the file exists)
              boolean append = false;
              // Create a writable file channel
              FileChannel wChannel = new FileOutputStream(file, append).getChannel();
              // Write the ByteBuffer contents; the bytes between the ByteBuffer's
              // position and the limit is written to the file
              wChannel.write(buf);
              // Close the file
              wChannel.close();
              } finally {
                   if (conn != null) {
    conn.close();
    Any help would be highly appreciated. Thanks in advance

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

  • Command to open a PDF generated Oracle Report in New browser window

    I know this is probably something for the Oracle Forums but I'll ask anyway because I can't find any info out there on this, without some extra work.
    I am generating a PDF file from 10g Oracle reports on Linux RHEL 5 and storing the PDF file to the server. I can send that PDF file directly to a printer with the "lpr" command and that part works fine.
    What I'm wanting to do now is "View" the PDF from within the server in a new window. We are using RHEL 5 (Linux) platform and I'm trying to see if there is a way to open the file with a "command line" command that will open it in a new browser window or new window period (opening it with Adobe Acrobat).
    Does anyone have a command that will do this? Otherwise, how has everyone else been handling this. The idea of just viewing the previously generated PDF Report file will save us overhead on our database servers because they won't have to re-run some of the same reports over and over.
    Any help and assistance is appreciated.
    Chris

    Several options:
    - If you only want to show the pdf to the client without printing, use destype=cache and use WEB.SHOW_DOCUMENT after the RUN_REPORT_OBJECT (for examples search the forms-forum, there are lots)
    -If you have to generate the pdf to a file to get it printed, you could
    +use WEBUTIL_FILETRANSFER.AS_TO_CLIENT after the printing to transfer the file to the client, then use CLIENT_HOST to view it.
    +map the appserver-directory you generate the report to as a virtual directory in the application-server then use WEB.SHOW_DOCUMENT to directly access the generated file via url.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Generating a report from RTF template using WSDL from ADF

    Hi,
    I am a newbie to ADF-BIP integration.
    I am using the wsdl http://<<ip>>:<<port>>/xmlpserver/services/PublicReportService?WSDL for generating a report from RTF Template in ADF.
    We are using Oracle Business Intelligence Publisher Release 11g (11.1.1) and JDeveloper 11g (11.1.1.5.0).
    I have a couple of merge variables in my RTF template and I am passing these variable using Report Request parameters.
    below is code I added for creating the report request.
    First I created publicReportService using webservice proxy.
        public static ReportRequest getReportRequestFromBIPWithTemplate(String reportFolderOnBIP,
                                                            String reportName,
                                                            String outputFileFormat,
                                                            String template,
                                                            HashMap params) {
          String reportAbsolutePath = reportFolderOnBIP + "/" + reportName + ".xdo";
          ReportRequest repRequest = new ReportRequest();
          System.out.println("report path:  " + reportAbsolutePath);
          repRequest.setReportAbsolutePath(reportAbsolutePath);
          repRequest.setAttributeTemplate(template);
          repRequest.setAttributeFormat(outputFileFormat);
          repRequest.setAttributeLocale("en-US");
          repRequest.setSizeOfDataChunkDownload(-1);
          System.out.println(params.size());
          ParamNameValue[] paramNameValue = new ParamNameValue[params.size()];
          ArrayOfParamNameValue arrayOfparamNameValue = new ArrayOfParamNameValue();
          Set set = params.entrySet();
          Iterator iter = set.iterator();
          int i = 0;
          while (iter.hasNext()) {
            Map.Entry me = (Map.Entry)iter.next();
            System.out.println(i + "--->>>" + me.getKey() + " : " + me.getValue());
            paramNameValue[i] = new ParamNameValue();
            paramNameValue.setMultiValuesAllowed(false);
    ArrayOfString values = new ArrayOfString();
    if (me.getValue() == null) {
    values.getItem().add("");
    } else {
    values.getItem().add((me.getValue()).toString());
    paramNameValue[i].setValues(values);
    paramNameValue[i].setName((me.getKey()).toString());
    arrayOfparamNameValue.getItem().add(paramNameValue[i]);
    i++;
    repRequest.setParameterNameValues(arrayOfparamNameValue);
    return repRequest;
    I generated report response bytes using below code
    {code:java}
    repRes = publicReportService.runReport(repReq,userID,password);
    reportStream = repRes.getReportBytes();I could see the generated PDF but the supplied variables are NOT reflected in place of merge variables.
    Ex: In template
    Welcome, <<merge variable, userName>>
    {code}
    Generated PDF should have
    {code:java}
    Welcome, Hello World
    {code}
    Instead of the above I am getting
    {code:java}
    Welcome,
    {code}
    I am looking for a suggestion, Please help me in this regard.
    Thanks,
    Satya
    Edited by: 921138 on May 30, 2012 11:11 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Please let me know if any one has update for this.
    Thanks in advance,
    Satya

  • Generating hourly report from oracle database using sql developer .Help

    I am working on SQL Developer 1.5.1, i need to prepare hourly record of the activity on the database, for that i have a sql query that gives me the report as per selected columns on hourly basis.I need to prepare 24 reports a day.
    Each time i have to go to the query , change the date as per hours like form 22:06:2011 10:00:00 to 22:06:2011 11:00:00 and get the report and export it in excel.
    I want to automate the script so that whenever i run the script , it just asks me the date and runs the script 24 times and fetch me the hourly report of whole day.
    the query syntax is something like this
    Select
    from
    where
    And.......................
    And...................
    And......................
    And req date between to-date( 22:06:2011 10:00:00) And to-date(22:06:2011 11:00:00)
    Order by 7,1,2,3,4,5
    Is there any possibility that i can automate the script to automatically change the hour itself and generate a report in excel 24 times?please share if you have any idea on this.
    Looking forward for a response.

    This gives you data for the whole day and the first column tells you which hour data it is,
    SELECT 'HOUR' || TO_CHAR ( req_date, 'HH24') AS hour_num,
           col1,
           col2,
           col3
      FROM table_name
    WHERE TRUNC (req_date) = TO_DATE ( '22/06/2011', 'DD/MM/YYYY')G.

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • Problem Generating a Report by passing a Resultset as a datasource

    I am having troubles generating a report using CR for Eclipse 2.0.
    I used the example that shows how do a simple select SQL query to the database and pass the resultset from the query to the report to generate a report from here: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201084dc-be66-2b10-64bf-dde4970c9b90
    I used a simple rpt file that simply shows the content of two columns from a table: TXN_TYPE_CD and TXN_STATUS_CD from a POLICY_TXN table.
    Using the code above, and just modifying it a bit to include my jdbc connection details as well as my select query, I was able to view the report which populated data from my database (Oracle 10g) at runtime of the application.  This test proved positive.
    However, the problem I am having is that I am trying to make this code into a Servlet for use in a Java EE application running on Websphere 6.1.0.17 using JVM 1.5.0_15  64-bit.  Instead of using the DHTML thick client, I export to PDF.  When I do this, the crystal report shows as a PDF, but the data is missing for some reason.  Only the headers for the two db columns are shown.  I don't see any startling differences between the code and am 100% positive that my resultset is being returned with data (I output the data returned in the result set as shown in the code).
    Here is the code I am using:
    public class CrystalReportGeneratorServlet_WOW extends Servlet {
         private static final long serialVersionUID = 768970549082466125L;
         protected HttpSession session;
         private final String EXPORT_FILE = "myExportedReport.pdf";
         private final String CUSTOM_PATH = "/custom/resource/crystalReport/";
         private String REPORT_NAME;
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException {
              Properties loParms = new Properties();
              ResultSet resultSet = null;
              //Obtain current JDBC Connection
              Connection loConn = AppEnvironment.getJDBCConnection();
              Statement statement = null;
              try {
                   REPORT_NAME = "Test.rpt";
                   //Open report
                   ReportClientDocument reportClientDoc = new ReportClientDocument();
                   reportClientDoc.open(SystemConfig.getAppHome() + CUSTOM_PATH + REPORT_NAME, 0);
                   //Create SQL query.    
                   String query = "SELECT \"POLICY_TXN\".\"TXN_TYPE_CD\", \"POLICY_TXN\".\"TXN_STATUS_CD\"" + "FROM   \"POLICY_TXN\"";
                   //Query database and obtain the Resultset that will be pushed into the report.  
                   statement = loConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                   //Execute query and return result set.
                   resultSet = statement.executeQuery(query);
                   //Look up existing table in the report to set the datasource for and obtain its alias.  This table must
                   //have the same schema as the Resultset that is being pushed in at runtime.  The table could be created
                   //from a Field Definition File, a Command Object, or regular database table.  As long the Resultset
                   //schema has the same field names and types, then the Resultset can be used as the datasource for the table.
                   String tableAlias = reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();
                   /////TESTING: OUTPUT contents of resultSet
                   while (resultSet.next()) {
                        System.out.println("TXN_STATUS_CD = " + resultSet.getString("TXN_STATUS_CD"));
                        System.out.println("TXN_TYPE_CD = " + resultSet.getString("TXN_TYPE_CD"));
                   //Push the Java ResultSet into the report.  This will then be the datasource of the report.
                   DatabaseController dbc = reportClientDoc.getDatabaseController();
                   dbc.setDataSource(resultSet, tableAlias , "resultsetTable");
                   //Export to PDF
                   ExportToPDF(reportClientDoc, response);
              catch(ReportSDKException ex) {     
                   System.out.println(ex);
              catch(Exception ex) {
                   System.out.println(ex);               
              } finally {
                   try {
                        resultSet.close();
                   } catch (SQLException e) {
                             e.printStackTrace();
                        } finally {
                             AppEnvironment.returnStatement(statement);
                             AppEnvironment.returnConnection ( loConn ) ;
         private void ExportToPDF(ReportClientDocument rcd, HttpServletResponse response)
              try {
                   ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)rcd.getPrintOutputController().export(ReportExportFormat.PDF);
                   rcd.close();
                   writeToBrowser(byteArrayInputStream, response, "application/pdf", EXPORT_FILE);
              catch(ReportSDKException ex) {
                   System.out.println(ex);
              catch(Exception ex) {
                   System.out.println(ex);
         * Utility method that demonstrates how to write an input stream to the server's local file system.
         private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse response, String mimetype, String exportFile) throws Exception {
              //Create a byte[] the same size as the exported ByteArrayInputStream.
              byte[] buffer = new byte[byteArrayInputStream.available()];
              int bytesRead = 0;
              try{
                   //Set response headers to indicate mime type and inline file.
                   response.setHeader("Content-disposition", "inline;filename=" + exportFile);
                   response.setContentType(mimetype);
                   //Stream the byte array to the client.
                   while((bytesRead = byteArrayInputStream.read(buffer)) != -1) {
                   response.getOutputStream().write(buffer, 0, bytesRead);
                   //Flush and close the output stream.
                   response.getOutputStream().flush();
                   response.getOutputStream().close();
              } catch (Exception e){
                        e.printStackTrace();
         public static Servlet getInstance()
            return new CrystalReportGeneratorServlet_WOW();
    Any help would greatly be appreciated.

    Actually Uzair I came across this thread in trying to find a resolution to my problem.  I was wondering if you were able to resolve this issue as it appears as though I may have the same problem.
    Thanks.

  • Weird behavior: PLSQL-generated SQL Report Region

    I am trying to tune my PLSQL-generated SQL Report Region. I put in some code to write the resulting query to a table. I turn it on, run the page, and then turn it off and look at the SQL. Instead of getting one query for each time I load the page, I get five. Trying to find out a bit more about why, I concatenate :APP_USER and to_char(sysdate, 'hh:mi:ss') to the resulting SQL. What I find is that four of the entries in the table have my ApEx dev username, and all of these writes are 3 seconds before the SQL generated under the app username is written!
    It probably goes without saying, but in all of the writes under my dev username, there are no session values and so any PLSQL if statements that depend on a session value act as if the session values are null. Also, any place I have :APP_ID show up as 4000 in those writes instead of the app number that shows up under my app username.
    Do you follow this?
    Well, on a hunch I copied the whole region back on to the page and disabled the original. This time, no writes with the dev username, only one select statement as originally expected.
    Is that wierd or what?
    Bill

    Scott, Your last comment - that was it. I should've paid more attention to the time. The minutes must have been off. I made sure to log out of the dev environment before I ran the page, but the writes under my dev login were occurring when I saved the region. I still don't see why that process causes four identical writes, but it's not that important.
    Thanks! Now I can to working on the real problem - improving my SQL.
    Bill

  • Can we generate one report tab for each of the prompt values selected in the bobj 4.0 webi report.

    can we generate one report tab which filters
    with each prompt value selected in bobj 4.0 webi report.

    Hi Shrinidhi ,
    It can be achievable with static tabs created for each LOV .But this is not recommended because , object values can change dynamically .
    It is good idea to use section on prompt object in the report .With sections great feature available is in larger report it’s easy to navigate using map. It displays the section tree.You can select the particular LOV to navigate.

Maybe you are looking for

  • HOW CAN I GET THE PURCHASE ORDER RELEASE DATE

    Dear All, HOW CAN I GET THE PURCHASE ORDER RELEASE DATE - any reprot is there? Thank you Ahmad

  • Is there a way to change the order of the list that appears when i right click on a link?

    In previous versions of firefox, when i right clicked on a link the list that appeareded was in order: first Open Link in New Window second Open Link in New Tab In firefox 4 this is reversed. Is there a way to change it back?

  • How to change admin account name?

    My parents started up my MacBook Pro and gave it a stupid admin account name. I though I knew how to change it, but I still see it in the User list and in the terminal. I read about logging in as root user to change it, but just thought of doing a fa

  • Crop to specific size

    Since Leopard / Photoshop CS3 is currently broken, I'm using Fireworks, but having trouble doing the simplest things. I need to crop a portion of an image to a specific pixel dimension. It's easy in Photoshop, but I'm just not getting it Fireworks. A

  • Adobe Reader embedded in 64 bit web browser

    Hi I'm to develop an application in which PDF files are displayed in an embedded webbrowser on a Windows Form. It is a requirement that no external applications open when a PDF is displayed, and that the application is a 64 bit Windows application. W