SQL Report help needed

Hi All,
I am creating a report which is having 2 sql queries ,1 for the main columns that i need to show and 2 from total sum and count.
Report is something as given below
SET TAB OFF;
set linesize 1500;
set pagesize 50;
SET FEEDBACK OFF;
SET WRAP OFF
COLUMN today NEW_VALUE VAR1 NOPRINT;
TTITLE LEFT 'ABC Inc.' SKIP 1 -
LEFT 'Daily Report' SKIP 1 -
LEFT 'As Of ' VAR1 SKIP 2
BTITLE LEFT SKIP 'Page No : ' FORMAT 9999999999 SQL.PNO SKIP 3;
COL SR_NO HEADING 'Seq'               FORMAT 999999;
COL REFNO HEADING 'Ref No'                FORMAT A20;
COL ORIG_NAME HEADING ' Branch Name'      
     FORMAT A50;
SELECT      ROWNUM                SR_NO,
     REF_NO                REFNO,
     ORIGIN_NAME               BRNAME
FROM BANK
WHERE PASS_CD=101
SELECT      ' Failure Count : '|| NVL(COUNT(DECODE(CODE,1,CODE,NULL)),0) ||
     ' Failure Total Amt : '|| NVL(SUM(DECODE(CODE,799,AMT,NULL)),0)
     || CHR(10) ||     
     ' Successful Count : '|| NVL(COUNT(DECODE(CODE,000,CODE,NULL)),0) ||
' Successful Total Amt: '|| NVL(SUM(DECODE(CODE,000,AMT,NULL)),0)
FROM BANK;
CLEAR BREAKS;
CLEAR COLUMN;
TTITLE OFF;
When i am running this second query output is going to secong page and title is repeated again and same as 1rst page is showing page no-1
Kindly help me,i want the output on the same page at bottom.
Thanks

i think its only work in ISQL* PLUS enivironment iam
not sure.It does work in SQL*Plus
is that i can use in the package??http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12048.htm

Similar Messages

  • SQL Server2008 help needed

    Having trouble with SQLServer 2008 (not MySQL) and my database connection in Dreamweaver CS6.  My document type is set as .asp using VBScript.  I can list the table information  but cannot use the insert wizard to add new records.  I don't get any errors after creating the insert form, but no records get inserted.  I'm not a VBScript expert, but do I have to manually write some code to insert records?  How do I attach it to a button?

    Thanks for the quick reply.  I won't be back in the office for a few days, but I'll try to post it when I get back in.  It's pretty much the code generated from the Dreamweaver Insert Record wizard.  I see where the submit button is created and the value is set but the action on the form is set to MM_insert, so I don't see where the submit code is actually called.
    Date: Wed, 3 Oct 2012 12:06:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: SQL Server2008 help needed
        Re: SQL Server2008 help needed
        created by bregent in Dreamweaver General - View the full discussion
    This post should be moved to the app dev forum.  Please post the code from your form and the insert script pages.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4746757#4746757
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4746757#4746757
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4746757#4746757. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver General by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • SQL queries help need-urgent

    Based on your inputs-I studied and created the below objects.I apologise for asking lengthy questions,but i
    need your help very much now to proceed next.
    There is a COMPANY WHICH has many divisions/departments in it.
    These divisions has employees.
    *{color:#0000ff}--Created employee table which employee_id and Salary.*
    **employees (*empid,salary){color}*
    *{color:#0000ff}***DO i need to put the DEPT_ID and Manager_id in the EMPLOYEES table? {color}*
    *{color:#0000ff}--Presently,iCreated a relationship table to have EMPLOYEE"S MANAGER information.a manager is an employee itself.{color}*
    *{color:#0000ff}--Created a table for EMPLOyee and department---RELATIONSHIP ---> empl_id and dept_id{color}*
    The COMPANY has numerous Products(also we can say projects) and these project work is done by the various depts.
    *{color:#0000ff}Projects /Job table*
    *--job_id*
    *--Project_name*
    *--Budget Amount{color}*
    *{color:#0000ff}--Created a table for Project and department---RELATIONSHIP ---> proj_id and dept_id*
    *--Also,Created a table for Project and Employee---RELATIONSHIP ---> proj_id and employee_id{color}*
    Also,here scenario (1)Employees can work or be a part of many or multiple departments and work for multiple projects/products at a time (2)As usual-each Department has a manager.**EVery dept can handle or work only on one project.
    *{color:#0000ff}--Created a table for Project and department---RELATIONSHIP ---> proj_id and dept_id*
    *--Also,Created a table for Project and Employee---RELATIONSHIP ---> proj_id and employee_id*
    *{color}*
    _*{color:#000000}***(1)Are the tables and the relationships defined above enough or have i created too much tables?Please advise me.{color}*_
    Queries:-Need to write SQLs for below items.Please help me.Could you all have a look
    bq. h5. {color:#0000ff} \\ _     (2)SQL for a person see all his manager?***A person can have 2,3 managers._ \\ _     (3)need a person--->manager-->and their manager's MANAGER_ \\ _     (4)How will managers to view all employees reporting to him._ \\ {color} \\ h5. \\ {color:#0000ff}_(5)feasibility (SQL) to support the increase of salaries of employees in a department by percentage or amount wise._ \\ _     (6)SQL to update or change manager of a department/employee._ \\ {color} \\ h5. \\ {color:#0000ff}_(7)If a employee is removed-then all related details should also be removed._ \\ _     (8)to remove person and department,terminate a person from organisation_ \\ _     SHIFTING a person to different department,assign a person to a department_{color} \\ h5. {color:#0000ff}_SQL to collect all info of a person, his managers , departments and project this employee works._ \\ _     find Department which dont have managers._{color} \\ h5. \\ {color:#0000ff}_****find expenditure all projects together in terms of salary_{color}

    Sorry for all the confusion with the questions.So let me clear myself,i am doing this not as assignment or homework,but something
    which interests me and trying to leran.Earlier as I stated that its a part of my school(** well frnakly speaking, it was my plan if i could
    put this as an item of the school as the scope is very huge.
    *(1)one employee can be in many departments(1 TO MANY) and and each department has one manager.(1 to 1)*
    Created a table for EMPLOyee and department-RELATIONSHIP ---> empl_id and dept_id*
    (2)Also,an employee can work in multiple items/projects(1-MANY) at a time. And a project HAS only one department.(1 to 1)
    **Projects table created has codes,the Project name ,Planned budget cost/amount, start_date and end_date AND DEPART_ID
    Also,Created a table for Project and Employee-RELATIONSHIP ---> proj_id and employee_id*
    This is the full scenario has put above.So,i needed help as I am very confused if i have done the correct relationships.
    And,these below items are my plans to allow the schema nd tables support it.
    (2)how will a person see all his manager?***A person can have 2,3 managers.(EMP->MANAGER relationship TABLE)
    (3)SQL to be able to show a person--->manager-->and their manager's MANAGER
    (4)How will managers to view all employees reporting to him.
    (5)SQL to support the increase of salaries of employees in a department by percentage or amount wise.
    (6)SQL to update or change manager of a department/employee.
    (7)If a employee is removed-then all related details should also be removed.
    (8)to remove person and department,terminate a person from organisation
    SHIFTING a person to different department,assign a person to a department
    Projects /Job table EMPLOYEES TABLE-> SALARY info
    --job_id
    --Project_name
    --Budget Amount

  • Purchase order report -help needed.

    Hi guys,
    Can anyone help me create a report for the purchase orders (similar to ME2N) ,my company needs all the info related to a PO like payment history.we need to pull all <b>closed POs</b> during a certain time period.Is ther a way todo this .
    I'd appreciate your help.'
    Thanks
    Cheris T

    Hello,
    You will need to run both ME80N and FBL1N. ME80FN can display PO history and from FBL1N you can get payment history.
    Hope this helps !
    Cheers !

  • SAP PS Module Report, Help needed for the Right Logic.

    Hi,
             I have to develop a  PS module Report . This spec of this  report is when you enter , project # , month , date , proj type it should  display all the projects  and only the billing levels  with  different  fiels  like ITD cost, ITD sales, ytd cost,  sales,  awards  etc etc.
    Right now  Iam getting the O/P : in the  following manner, There are many fields  I am just showing the desired ones which have to be changed.
    Proj,           Title,         award,    ITDsales,         ITD cost ,    ytd sales,   ytd costs,
    14148,       New prj       123        --                   ---                    -
    14148-B01,  bill1          -
                234           -
                       456                -
    14148-B02,  bill2          -
                789          -
                       123                -
    14148.001    wbs1        -
             123                     -
                     456
    14148.001    wbs2        -
              567                    -
                     890
    But   for me  the desired output must be only for  project  and the billing levels. It shouldn’t be for WBS elements  xxxx.001  and xxxx.002.
    Desired  output:
    Proj,           Title,         award,    ITDsales,   ITD cost ,       ytd sales,      ytd costs,
    14148,       New prj       123        --               690                 -
                   1346
    14148-B01,  bill1          -
             234                -
                       456             -
    14148-B02,  bill2          -
             789                -
                      123              -
    The ITD costs  and YTD costs must be added   123 + 567 = 690 and
                                                                                 456+890 = 1346.
    And these values must come   on the project level.
    P.S:  I can restrict the values  for wbs elements  , means I can filter them at PRPS table  by giving prps-stufe LE ‘2’.  Then I wont get the wbs level, But I want the values of these to be added up and then show it on the project level.
    Please  go through  this code and let me  know where exactly I need to put the right logic  to work in the desired manner.
    Thanks   in advance
    Dan
    Code Below************************
    [code]TABLES: PROJ,                "Project Definition
            PRPS,                "WBS Elements
            prhi,
            CEPC,                " Profit Center w/ Group Head info
            BPGE,                "Plans (12, 13, etc.)
            COSP,                "Primary   Cost Element (Bill Sales, DPC)
            COSS,                "Secondary Cost Element (Shrd Sls,Sal,etc)
            COSB,                "Results Analysis Cost Elements (Unbil Sls)
            COOI,                "Commitments management: Line items
            JEST,                "Project Status
            TCJ04,               "Person Responsible for Project
            zpclasses,           "Project classes.
    New Added
            CRCO,            " Assignment of Work Center to Cost Center
            CRHD.            " Work Center Header
    Record Layout of extracted data
    TYPES: BEGIN OF EXDEF,       "Data definition of extract data
           X_BU(2)     TYPE C,   "Business Unit
           X_CNTR(10)  TYPE C,   " Profit Center
           X_PROJ(24)  TYPE C,   "Project def (Prj)
           X_CREP(30)  TYPE C,   "Contract Rep.
           X_BDREP(25) TYPE C,   "BD Rep. name
           X_GRPH(15)  TYPE C,   "Tech Rep employee name
           X_ACTREP(15)  TYPE C,  "Acct Rep employee name
           X_PMGR(15)  TYPE C,   "PM employee name
           X_TTLE(35)  TYPE C,   "Title
           X_CLNT(20)  TYPE C,   "Client
           X_POCN(20)  TYPE C,   "Prime Contract Number
           X_TYPE(13)  TYPE C,   "Order Type Sarnoff
           X_OPEN(10)  TYPE C,   "Open Date
           X_CLOSE(10) TYPE C,   "Close Date
           X_CGT(4)    TYPE C,   "CO, GV, TC
           X_DISTR(2)  TYPE C,   "Distribution Channel
           X_CONTR(6)  TYPE C,   "Percentage contribution
           X_AWRD(14)  TYPE C,   "Award        (Plan 11)
           X_P12R(14)  TYPE C,   "Auth Revenue (Plan 12 @ Rev)
           X_P12C(14)  TYPE C,   "Auth Cost    (Plan 12 @ Cost)
           X_P13R(14)  TYPE C,   "Auth Revenue (Plan 13 @ Rev)
           X_P13C(14)  TYPE C,   "Auth Cost    (Plan 13 @ Cost)
           X_ITDS(14)  TYPE C,   "ITD Sales
           X_ITDC(14)  TYPE C,   "ITD Costs
           X_YTDS(14)  TYPE C,   "YTD Sales
           X_YTDC(14)  TYPE C,   "YTD Costs
           X_MTHS(14)  TYPE C,   "Current Month Sales
           X_MTHC(14)  TYPE C,   "Current Month Costs
           X_ITDB(14)  TYPE C,   "ITD Billed Sales
           X_YTDB(14)  TYPE C,   "YTD Billed Sales
           X_MTHB(14)  TYPE C,   "Current Month Billed Sales
           X_COMM(14)  TYPE C,   "Commitments
           X_STAT(6)   TYPE C,   "Active or Inactive (REL, TECO, or CLSD)
           X_ZPROJCLASS(12),
           X_MTHIC(14) TYPE C,   "Current Month Incremental Costs
           X_YTDIC(14) TYPE C,   "YTD Incremental Costs
           X_ITDIC(14) TYPE C,   "ITD Incremental Costs
           X_ZSCURVE(10) TYPE C, "S-CURVE  Status
    New Added
           X_CM_COST(20) TYPE C,
           X_AM_COST(20) TYPE C,
           X_TL_COST(20) TYPE C,
           X_KP_COST(20) TYPE C,
           X_PM_COST(20) TYPE C,
    END OF EXDEF.
    Data declarations
    FIELD-SYMBOLS <MNT> .
    DATA: ETAB  TYPE  EXDEF   OCCURS 100  WITH  HEADER LINE.
    DATA:  X1_PM_COST(20) TYPE C,
           X1_TL_COST(20) TYPE C,
           X1_AM_COST(20) TYPE C,
           X1_CM_COST(20) TYPE C,
           X1_KP_COST(20) TYPE C.
    DATA: KOKRS_FIXED      LIKE PROJ-VKOKR VALUE 'DSRC',  "Controlling Area
          TOTAL_AWARD      LIKE BPGE-WTGES,
          TOTAL_AUTHR12    LIKE BPGE-WTGES,
          TOTAL_AUTHC12    LIKE BPGE-WTGES,
          TOTAL_AUTHR13    LIKE BPGE-WTGES,
          TOTAL_AUTHC13    LIKE BPGE-WTGES,
          TOTAL_ITDSALES   LIKE BPGE-WTGES,
          TOTAL_ITDCOSTS   LIKE BPGE-WTGES,
          TOTAL_ITDICOSTS  LIKE BPGE-WTGES,
          TOTAL_YTDSALES   LIKE BPGE-WTGES,
          TOTAL_YTDCOSTS   LIKE BPGE-WTGES,
          TOTAL_YTDICOSTS  LIKE BPGE-WTGES,
          TOTAL_MTHSALES   LIKE BPGE-WTGES,
          TOTAL_MTHCOSTS   LIKE BPGE-WTGES,
          TOTAL_MTHICOSTS  LIKE BPGE-WTGES,
          TOTAL_ITDBILLED  LIKE BPGE-WTGES,
          TOTAL_YTDBILLED  LIKE BPGE-WTGES,
          TOTAL_MTHBILLED  LIKE BPGE-WTGES,
          TOTAL_COMMITMENT LIKE COOI-WTGBTR,
          HOLD_PRART       LIKE PRPS-PRART,
          COUNT_PROJECTS   TYPE I,
          MNT_INDX(20)     TYPE C,
          HLD_INDX(3)      TYPE N,
          YYYY_MM(10)      TYPE C,
          TEMP-DATE(8)     TYPE C.
    Selection Screen
    SELECTION-SCREEN SKIP 3.
    SELECTION-SCREEN BEGIN OF BLOCK XEXTRPM WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETERS MONTH(2)  TYPE  N   OBLIGATORY.
    PARAMETERS YEAR(4)   TYPE  N   OBLIGATORY.
    SELECT-OPTIONS: EXTRPRJ  FOR PROJ-PSPID.     " Range of Projects
    SELECT-OPTIONS: EXTRTYP  FOR PRPS-PRART.  "Project Types (CO,GV,etc.*)
    SELECT-OPTIONS: EXTRPCTR FOR PROJ-PRCTR.     " Range of Profit centers
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: OPT1 RADIOBUTTON GROUP OPTN,
                OPT2 RADIOBUTTON GROUP OPTN DEFAULT 'X'.
    select-options : s_pc for proj-zprojclass.   "project class
    SELECTION-SCREEN END OF BLOCK XEXTRPM.
    Select Tables
    START-OF-SELECTION.
    write: / 'Sales data (Unshared) extracted on: ', sy-datum.
    uline.
      CLEAR:  COUNT_PROJECTS,
              TOTAL_AWARD,
              TOTAL_AUTHR12,
              TOTAL_AUTHC12,
              TOTAL_AUTHR13,
              TOTAL_AUTHC13,
              TOTAL_ITDSALES,
              TOTAL_ITDCOSTS,
              TOTAL_YTDSALES,
              TOTAL_YTDCOSTS,
              TOTAL_MTHSALES,
              TOTAL_MTHCOSTS,
              TOTAL_ITDBILLED,
              TOTAL_YTDBILLED,
              TOTAL_MTHBILLED,
              TOTAL_COMMITMENT,
              ETAB.
    PROJ Table                                          Project Definition
      SELECT  * FROM PROJ                   "Project Definition
           WHERE PSPID IN EXTRPRJ AND      " Range of Project Numbers
              PRCTR IN EXTRPCTR and        " Range of Profit center
                zprojclass in s_pc.     "project class
    SELECT * FROM PRPS WHERE           "WBS Elements
                  PRART IN EXTRTYP         " Range of Proj.Types (CO,GV,TC..
                 and PSPHI = PROJ-PSPNR.
        HOLD_PRART   = '  '.               "clears project type
        CLEAR ETAB.
        ETAB-X_PROJ  = PRPS-POSID.
        ETAB-X_BU    = PRPS-PRCTR(2).      "Business Unit
        ETAB-X_PMGR = PROJ-VERNA.          "Project Manager
        IF PRPS-PRCTR(2) = '01'.
         ETAB-X_CNTR  = PRPS-PRCTR.         " Profit Center
         CONCATENATE SPACE PRPS-PRCTR INTO ETAB-X_CNTR SEPARATED BY SPACE.
        ELSE.
          ETAB-X_CNTR  = PRPS-PRCTR.         " Profit Center
        ENDIF.
         ETAB-X_TTLE  = PRPS-POST1.         "Title
        CLEAR  TEMP-DATE.
        TEMP-DATE    = PROJ-PLFAZ.         "Project planned start date
        CONCATENATE  TEMP-DATE4(2)  '/' TEMP-DATE6(2) '/'
                     TEMP-DATE+0(4)  INTO  ETAB-X_OPEN.
        TEMP-DATE    = PROJ-PLSEZ.         "Project planned finish date
        CONCATENATE  TEMP-DATE4(2)  '/' TEMP-DATE6(2) '/'
                     TEMP-DATE+0(4)  INTO  ETAB-X_CLOSE.
    Tech Lead
    will comment below
        SELECT SINGLE VERNA FROM TCJ04     "Tech Lead name from TCJ04
               INTO  (ETAB-X_GRPH) WHERE  VERNR = PROJ-ZGRPHD.
    End Of Tech Lead
    Account Manager
        SELECT SINGLE VERNA FROM TCJ04  "Acct Manager from TCJ04
               INTO  (ETAB-X_BDREP) WHERE  VERNR = PROJ-ZBUSDEV.
    ******End Of Account Manager
    Key Personnel
        SELECT SINGLE VERNA FROM TCJ04     "Account Rep name from TCJ04
               INTO  (ETAB-X_ACTREP) WHERE  VERNR = PROJ-ZRESPDIR.
    ********End of Key Personnel
    **Contract Manager
        SELECT SINGLE VERNA FROM TCJ04     "Contract Rep name from TCJ04
               INTO  (ETAB-X_CREP) WHERE  VERNR = PROJ-ZCNTREP.
    End of Contract Manager
    PRPS Table                            WBS's attached to the Project
       SELECT * FROM PRPS WHERE           "WBS Elements
                 PRART IN EXTRTYP         "Range of Proj.Types (CO,GV,TC..
                 AND PSPHI = PROJ-PSPNR.
                order by posid stufe.    "Sort by WBS & Level (needed?)
    get info from level 1 of the WBS
         IF PRPS-STUFE EQ 1.              "top-level WBS element
            HOLD_PRART  = PRPS-PRART.      "save project type for later
            ETAB-X_STAT = '????'.          "set ? as the default status
    get Status for level 1
            SELECT * FROM JEST             "use JEST to determine Status
               WHERE OBJNR =  PRPS-OBJNR
                 AND INACT EQ SPACE.       "space denotes an active status
               CASE JEST-STAT.             "find the system status (Ixxx)
                    WHEN 'I0001'.
                         ETAB-X_STAT = 'CRTD'.    "Created
                    WHEN 'I0002'.
                         ETAB-X_STAT = 'REL'.     "Released
                    WHEN 'I0045'.
                         ETAB-X_STAT = 'TECO'.    "Technically Complete
                    WHEN 'I0046'.
                         ETAB-X_STAT = 'CLSD'.    "Closed
               ENDCASE.
            ENDSELECT.
    Select only active projects (ie; those not with TECO or CLSD)
            IF  OPT2 EQ 'X'
               AND  ( ETAB-X_STAT EQ  'TECO'
                  OR  ETAB-X_STAT EQ  'CLSD' ).
                   EXIT.
            ENDIF.
    *comment Contract Rep and Proj man because we get them from PROJ now
           etab-x_crep   = prps-zzcont.     "Contract Rep.
           etab-x_pmgr   = prps-verna.      "Program Manager Name
            ETAB-X_CLNT   = PRPS-ZZMANDT.    "Client Name
            ETAB-X_CGT    = PRPS-PRART.      "CO, GV, TC, etc
            ETAB-X_DISTR  = PRPS-ZZVTWEG.    "Distrib Channel (ie; GP, etc.)
            ETAB-X_CONTR  = PRPS-USR04.      "Contribution %
            ETAB-X_POCN   = PRPS-ZZPOCN.     "Contract Number
            ETAB-X_TYPE   = PRPS-ZZORDT.     "Order Type Sarnoff
    Award and Authorization (Revenue & Cost)
            SELECT * FROM BPGE
               WHERE OBJNR   = PRPS-OBJNR
                 AND LEDNR   = '0001'        "Budget / Planning Ledger
                 AND TRGKZ   = 'N'           "Object indicator
                 AND WRTTP   = '01'          "Value Type
                 AND ( VERSN = '011'         "011 = Award
                    OR VERSN = '012'         "012 = Billing Authorization
                    OR VERSN = '013' ).      "013 = RA Authorization
                                             "010 = Funding Authorization
    Award                                                        Plan 11
              IF BPGE-VERSN = '011'.         "Plan 11 = Award
                CASE BPGE-VORGA.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_AWRD = ETAB-X_AWRD + BPGE-WTGES.
                ENDCASE.
              ENDIF.
        IF prps-stufe eq '2'.
    Authorization (Revenue & Cost plan 12)                       Plan 12
              IF BPGE-VERSN = '012'.         "Plan 12 = RA Authorization
                CASE BPGE-VORGA.
                  WHEN 'KSTR'.               "KSTR = Revenue level
                    ETAB-X_P12R = ETAB-X_P12R - BPGE-WTGES.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_P12C = ETAB-X_P12C + BPGE-WTGES.
                ENDCASE.
              ENDIF.
    Authorization (Revenue & Cost plan 13)                       Plan 13
              IF BPGE-VERSN = '013'.         "Plan 13 = RA Authorization
                CASE BPGE-VORGA.
                  WHEN 'KSTR'.               "KSTR = Revenue level
                    ETAB-X_P13R = ETAB-X_P13R - BPGE-WTGES.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_P13C = ETAB-X_P13C + BPGE-WTGES.
                ENDCASE.
              ENDIF.
        endif.
            ENDSELECT.                     "BPGE
      ENDIF.      "end of if prps-stufe eq 1. top-level WBS element
    COSP Table (External Postings)                     Awards
    COSP Table (External Postings)                     Billed Sales
    COSP Table (External Postings)                     DPC's & Legacy Load
            SELECT * FROM COSP
               WHERE OBJNR = PRPS-OBJNR    AND
                     GJAHR LE YEAR
             AND (
                 ( kstar = '0000400999'   and        "old CE for Award $
                   ( KSTAR BETWEEN '0000400990' AND '0000400999' AND
                     VERSN = '011'              AND    "11 = Award
                     WRTTP = '01' )                    "01 = Planned
              OR ( ( KSTAR BETWEEN '0000400001' AND '0000400989' OR
                     KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                     WRTTP = '04' )                    "04 = Actuals
              OR ( ( KSTAR BETWEEN '0000998001' AND '0000998010' OR
                     KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
                     WRTTP = '04' )                    "04 = Actuals
    *------- Awards
           if cosp-kstar = '0000400999' and          "old 400999 = Awards
             IF COSP-KSTAR BETWEEN '0000400990' AND '0000400999' AND
                COSP-VERSN = '011'              AND    "11 = Award
                COSP-WRTTP = '01'.                     "01 = Planned
               IF YEAR       = COSP-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSP-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_AWRD = ETAB-X_AWRD + <MNT>.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSP-GJAHR.
                   ETAB-X_AWRD = ETAB-X_AWRD +
                                 COSP-WKG001 + COSP-WKG002 +
                                 COSP-WKG003 + COSP-WKG004 +
                                 COSP-WKG005 + COSP-WKG006 +
                                 COSP-WKG007 + COSP-WKG008 +
                                 COSP-WKG009 + COSP-WKG010 +
                                 COSP-WKG011 + COSP-WKG012 +
                                 COSP-WKG013 + COSP-WKG014 +
                                 COSP-WKG015 + COSP-WKG016.
               ELSE.
                 EXIT.
               ENDIF.
             ENDIF.
    *------- Billed Sales
             IF ( COSP-KSTAR BETWEEN '0000400001' AND '0000400989' OR
                  COSP-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                  COSP-WRTTP = '04'.
                                     "0000999001 = ITD Sales
                                     "0000999003 = ITD Billed Revenue
                IF YEAR = COSP-GJAHR.
                  DO.
                   IF SY-INDEX LE MONTH.
                      MOVE SY-INDEX TO HLD_INDX.
                      MNT_INDX =  'COSP-WKGXXX'.
                      REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                      ASSIGN  (MNT_INDX) TO <MNT>.
                      ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
                      ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
                      IF SY-INDEX = MONTH.
                         ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
                      ENDIF.
                   ELSE.
                      EXIT.
                   ENDIF.
                  ENDDO.
                ELSEIF YEAR > COSP-GJAHR.
                  ETAB-X_ITDB = ETAB-X_ITDB -
                             COSP-WKG001 - COSP-WKG002 -
                             COSP-WKG003 - COSP-WKG004 -
                             COSP-WKG005 - COSP-WKG006 -
                             COSP-WKG007 - COSP-WKG008 -
                             COSP-WKG009 - COSP-WKG010 -
                             COSP-WKG011 - COSP-WKG012 -
                             COSP-WKG013 - COSP-WKG014 -
                             COSP-WKG015 - COSP-WKG016.
                ELSE.
                  EXIT.
                ENDIF.
             ENDIF.
    *------- DPC's & Legacy Load
             IF ( COSP-KSTAR BETWEEN '0000998001' AND '0000998010' OR
                  COSP-KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
                  COSP-WRTTP = '04'.
               IF YEAR = COSP-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSP-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDC  = ETAB-X_ITDC  + <MNT>.
                        ETAB-X_YTDC  = ETAB-X_YTDC  + <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHC  = ETAB-X_MTHC  + <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSP-GJAHR.
                   ETAB-X_ITDC = ETAB-X_ITDC +
                                 COSP-WKG001 + COSP-WKG002 +
                                 COSP-WKG003 + COSP-WKG004 +
                                 COSP-WKG005 + COSP-WKG006 +
                                 COSP-WKG007 + COSP-WKG008 +
                                 COSP-WKG009 + COSP-WKG010 +
                                 COSP-WKG011 + COSP-WKG012 +
                                 COSP-WKG013 + COSP-WKG014 +
                                 COSP-WKG015 + COSP-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
           ENDSELECT.
    COOI Table (Commitments)              commitments for the WBS elements
           SELECT  * FROM COOI
             WHERE OBJNR =  PRPS-OBJNR.
               ETAB-X_COMM = ETAB-X_COMM + COOI-WTGBTR.
           ENDSELECT.
    COSS Table (External Postings)                    G&A on Commitments
    COSS Table (External Postings)                    Shared Billed Sales
    COSS Table (External Postings)                    Shared DPC's
    COSS Table (External Postings)                    Salary,ESE,OH, & G&A
           SELECT  *   FROM  COSS
             WHERE
              ( OBJNR =  PRPS-OBJNR AND
                WRTTP =  '22' )                         "G&A on Commitments
                    OR
              ( OBJNR =  PRPS-OBJNR AND
                GJAHR LE YEAR       AND
                WRTTP = '04'        AND                 "04 = Actuals
                   (                                   "Shared Billed Sales
                     (   KSTAR BETWEEN '0000400001' AND '0000400989' OR
                         KSTAR BETWEEN '0000999001' AND '0000999003' )
                     OR                                "Shared DPC's
                     (   KSTAR BETWEEN '0000600001' AND '0000601999' )
                     OR                                "Salary,ESE,OH, & G&A
                     ( ( KSTAR BETWEEN '0000001000' AND '0000001999'  OR
                         KSTAR BETWEEN '0000002100' AND '0000002199'  OR
                         KSTAR BETWEEN '0000002500' AND '0000002599'  OR
                         KSTAR BETWEEN '0000002800' AND '0000002899' ) )
                  and  parob not like 'PR%' ) "commented out on 4/19/2000
    *------- G&A on Commitments    (NOTE: data is always as of the RUN date)
             IF  COSS-WRTTP = '22'.
                   ETAB-X_COMM = ETAB-X_COMM +
                                 COSS-WKG001 + COSS-WKG002 +
                                 COSS-WKG003 + COSS-WKG004 +
                                 COSS-WKG005 + COSS-WKG006 +
                                 COSS-WKG007 + COSS-WKG008 +
                                 COSS-WKG009 + COSS-WKG010 +
                                 COSS-WKG011 + COSS-WKG012 +
                                 COSS-WKG013 + COSS-WKG014 +
                                 COSS-WKG015 + COSS-WKG016.
             ENDIF.
    *------- Shared Billed Sales
             IF ( COSS-KSTAR BETWEEN '0000400001' AND '0000400989' OR
                  COSS-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                  COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSS-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
                        ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                 ETAB-X_ITDB = ETAB-X_ITDB -
                               COSS-WKG001 - COSS-WKG002 -
                               COSS-WKG003 - COSS-WKG004 -
                               COSS-WKG005 - COSS-WKG006 -
                               COSS-WKG007 - COSS-WKG008 -
                               COSS-WKG009 - COSS-WKG010 -
                               COSS-WKG011 - COSS-WKG012 -
                               COSS-WKG013 - COSS-WKG014 -
                               COSS-WKG015 - COSS-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
    *------- Shared DPC's
             IF COSS-KSTAR BETWEEN '0000600001' AND '0000601999' AND
                COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSS-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDC  = ETAB-X_ITDC  + <MNT>.
                        ETAB-X_YTDC  = ETAB-X_YTDC  + <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHC  = ETAB-X_MTHC  + <MNT>.
                       ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                   ETAB-X_ITDC = ETAB-X_ITDC +
                                 COSS-WKG001 + COSS-WKG002 +
                                 COSS-WKG003 + COSS-WKG004 +
                                 COSS-WKG005 + COSS-WKG006 +
                                 COSS-WKG007 + COSS-WKG008 +
                                 COSS-WKG009 + COSS-WKG010 +
                                 COSS-WKG011 + COSS-WKG012 +
                                 COSS-WKG013 + COSS-WKG014 +
                                 COSS-WKG015 + COSS-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
    *------- Salary,ESE,OH,& G&A
             IF ( COSS-KSTAR BETWEEN '0000001000' AND '0000001999'  OR
                  COSS-KSTAR BETWEEN '0000002100' AND '0000002199'  OR
                  COSS-KSTAR BETWEEN '0000002500' AND '0000002599'  OR
                  COSS-KSTAR BETWEEN '0000002800' AND '0000002899' ) AND
                  COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                   IF SY-INDEX LE MONTH.
                      MOVE SY-INDEX TO HLD_INDX.
                      MNT_INDX =  'COSS-WKGXXX'.
                      REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                      ASSIGN  (MNT_INDX) TO <MNT>.
                      ETAB-X_ITDC = ETAB-X_ITDC + <MNT>.
                      ETAB-X_YTDC = ETAB-X_YTDC + <MNT>.
                      IF SY-INDEX = MONTH.
                          ETAB-X_MTHC = ETAB-X_MTHC + <MNT>.
                      ENDIF.
                   ELSE.
                      EXIT.
                   ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                 ETAB-X_ITDC = ETAB-X_ITDC +
                               COSS-WKG001 + COSS-WKG002 +
                               COSS-WKG003 + COSS-WKG004 +
                               COSS-WKG005 + COSS-WKG006 +
                               COSS-WKG007 + COSS-WKG008 +
                               COSS-WKG009 + COSS-WKG010 +
                               COSS-WKG011 + COSS-WKG012 +
                               COSS-WKG013 + COSS-WKG014 +
                               COSS-WKG015 + COSS-WKG016.
               ELSE.
                 EXIT.
                ENDIF.
             ENDIF.
            ENDSELECT.
    COSB Table (Results from running RA)                    Unbilled Sales
            SELECT * FROM COSB
               WHERE OBJNR = PRPS-OBJNR
                 AND KSTAR BETWEEN '0000003004' AND '0000003005'
                                   "0000003004 = Unbilled Revenue
                                   "0000003005 = Unearned Revenue
                 AND GJAHR LE YEAR
                 AND WRTTP = '32'.                    "32 = Results Analysis
               IF YEAR = COSB-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSB-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDS = ETAB-X_ITDS - <MNT>.
                        ETAB-X_YTDS = ETAB-X_YTDS - <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHS = ETAB-X_MTHS - <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSB-GJAHR.
                 ETAB-X_ITDS = ETAB-X_ITDS -
                               COSB-WKG001 - COSB-WKG002 -
                               COSB-WKG003 - COSB-WKG004 -
                               COSB-WKG005 - COSB-WKG006 -
                               COSB-WKG007 - COSB-WKG008 -
                               COSB-WKG009 - COSB-WKG010 -
                               COSB-WKG011 - COSB-WKG012 -
                               COSB-WKG013 - COSB-WKG014 -
                               COSB-WKG015 - COSB-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
            ENDSELECT.
      ENDSELECT.               "End of WBS records (from PRPS) for project
    Get Total Sales by adding Billed Sales to Unbilled Sales.
       ETAB-X_ITDS  =  ETAB-X_ITDS  +  ETAB-X_ITDB.
       ETAB-X_YTDS  =  ETAB-X_YTDS  +  ETAB-X_YTDB.
       ETAB-X_MTHS  =  ETAB-X_MTHS  +  ETAB-X_MTHB.
       IF  HOLD_PRART IN EXTRTYP.   "Matches the user requested project type
         IF  OPT1 EQ 'X' OR         "All projects
           ( OPT2 EQ 'X' AND        "Only active projects
             ETAB-X_STAT NE  'TECO' AND
             ETAB-X_STAT NE  'CLSD' ).
               TOTAL_AWARD      = TOTAL_AWARD      + ETAB-X_AWRD.
               TOTAL_AUTHR12    =   TOTAL_AUTHR12    + ETAB-X_P12R .
              TOTAL_AUTHC12    = TOTAL_AUTHC12    + ETAB-X_P12C.
               TOTAL_AUTHR13    = TOTAL_AUTHR13    + ETAB-X_P13R.
               TOTAL_AUTHC13    = TOTAL_AUTHC13    + ETAB-X_P13C.
               TOTAL_ITDSALES   = TOTAL_ITDSALES   + ETAB-X_ITDS.
               TOTAL_ITDCOSTS   = TOTAL_ITDCOSTS   + ETAB-X_ITDC.
               TOTAL_YTDSALES   = TOTAL_YTDSALES   + ETAB-X_YTDS.
               TOTAL_YTDCOSTS   = TOTAL_YTDCOSTS   + ETAB-X_YTDC.
               TOTAL_MTHSALES   = TOTAL_MTHSALES   + ETAB-X_MTHS.
               TOTAL_MTHCOSTS   = TOTAL_MTHCOSTS   + ETAB-X_MTHC.
               TOTAL_ITDBILLED  = TOTAL_ITDBILLED  + ETAB-X_ITDB.
               TOTAL_YTDBILLED  = TOTAL_YTDBILLED  + ETAB-X_YTDB.
               TOTAL_MTHBILLED  = TOTAL_MTHBILLED  + ETAB-X_MTHB.
               TOTAL_COMMITMENT = TOTAL_COMMITMENT + ETAB-X_COMM.
               PERFORM SHIFT_SIGN.
               APPEND  ETAB.              "Write data to internal table
               CLEAR   ETAB.
               COUNT_PROJECTS = COUNT_PROJECTS + 1. "Count # of Projects
         ENDIF.
       ENDIF.
       ENDSELECT.
    ENDSELECT.                          "End of Projects from PROJ table
      PERFORM GRAND_TOTALS.
      SORT  ETAB  BY  X_BU X_PROJ.
      ETAB-X_BU    = 'BU'.
      ETAB-X_CNTR  = 'PrftCntr'.
      ETAB-X_PROJ  = 'Proj'.
      ETAB-X_CREP  = 'Contract Mgr'.
      ETAB-X_BDREP = 'Account Mgr'.
      ETAB-X_GRPH  = 'Technical Lead'.
      ETAB-X_ACTREP = 'Key Person1'.
      ETAB-X_PMGR  = 'Program Mgr'.
      ETAB-X_TTLE  = 'Title'.
      ETAB-X_CLNT  = 'Client'.
      ETAB-X_POCN  = 'Contract #'.
      ETAB-X_TYPE  = 'Type'.
      ETAB-X_OPEN  = 'Open'.
      ETAB-X_CLOSE = 'Close'.
      ETAB-X_CGT   = 'CGT'.
      ETAB-X_DISTR = 'DC'.
      ETAB-X_CONTR = 'Contr%'.
      ETAB-X_AWRD  = 'Award'.
      ETAB-X_P12R  = 'Auth12 Sales'.
      ETAB-X_P12C  = 'Auth12 Cost'.
      ETAB-X_P13R  = 'Auth13 Sales'.
      ETAB-X_P13C  = 'Auth13 Cost'.
      ETAB-X_ITDS  = 'ITD Sales'.
      ETAB-X_ITDC  = 'ITD Costs'.
      ETAB-X_YTDS  = 'YTD Sales'.
      ETAB-X_YTDC  = 'YTD Costs'.
      ETAB-X_MTHS  = 'Mth Sales'.
      ETAB-X_MTHC  = 'Mth Costs'.
      ETAB-X_ITDB  = 'ITD Billed'.
      ETAB-X_YTDB  = 'YTD Billed'.
      ETAB-X_MTHB  = 'Mth Billed'.
      ETAB-X_COMM  = 'Commitments'.
      ETAB-X_STAT  = 'Status'.
      INSERT ETAB  INDEX 1.    "Write a report header line to internal table
      CLEAR  ETAB.
    CALL FUNCTION 'Z_RH_START_EXCEL_DATA_OLE'
        EXPORTING
           data_name = 'C:\WINNT\Profiles\cbraswell\Desktop\TestTemp.xlt'
             DATA_NAME          = 'ZSales.XLS'
             DATA_PATH_FLAG     = 'W'
             DATA_TYPE          = 'DAT'
             DATA_BIN_FILE_SIZE = 'ZSales'
             CHART_TITLE        = 'ZSales'
             CHART_TYPE         = 2
             CATEGORY_TITLE     = 'ZSales'
             VALUE_TITLE        = 'ZSales'
             DATA_XTOP_COR      = 0
             DATA_YTOP_COR      = 0
             DATA_XBOT_COR      = 0
             DATA_YBOT_COR      = 0
             CATEGORY_XTOP_COR  = 0
             CATEGORY_YTOP_COR  = 0
             CATEGORY_XBOT_COR  = 0
             CATEGORY_YBOT_COR  = 0
         TABLES
              DATA_TAB           =    ETAB
         EXCEPTIONS
              NO_BATCH           = 1
              DOWNLOAD_ERROR     = 2
              INVALID_TYPE       = 3
              INTERNAL_ERROR     = 4
              NO_OLE_SUPPORT     = 5
              OLE_FILE_ERROR     = 6
              OLE_ERROR          = 7
              NO_DATA            = 8
              COORDINATE_ERROR   = 9
              OTHERS             = 10.
    Negative # sign in the front of number for downloading to Excel
    FORM  SHIFT_SIGN.
      IF ETAB-X_AWRD CA '-'.    SHIFT ETAB-X_AWRD RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P12R CA '-'.    SHIFT ETAB-X_P12R RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P12C CA '-'.    SHIFT ETAB-X_P12C RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P13R CA '-'.    SHIFT ETAB-X_P13R RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P13C CA '-'.    SHIFT ETAB-X_P13C RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_ITDS CA '-'.    SHIFT ETAB-X_ITDS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_ITDIC CA '-'.   SHIFT ETAB-X_ITDIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_ITDC CA '-'.    SHIFT ETAB-X_ITDC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDS CA '-'.    SHIFT ETAB-X_YTDS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDC CA '-'.    SHIFT ETAB-X_YTDC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDIC CA '-'.   SHIFT ETAB-X_YTDIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_MTHS CA '-'.    SHIFT ETAB-X_MTHS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHC CA '-'.    SHIFT ETAB-X_MTHC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHIC CA '-'.   SHIFT ETAB-X_MTHIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_ITDB CA '-'.    SHIFT ETAB-X_ITDB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDB CA '-'.    SHIFT ETAB-X_YTDB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHB CA '-'.    SHIFT ETAB-X_MTHB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_COMM CA '-'.    SHIFT ETAB-X_COMM RIGHT CIRCULAR.     ENDIF.
    ENDFORM.
    FORM  GRAND_TOTALS.
    SKIP 1.    .
    WRITE: / '----
    WRITE: / 'System ID                  = ', SY-SYSID,
           / 'Client                     = ', SY-MANDT,
           / 'User                       = ', SY-UNAME,
           / 'Date of data extract       = ', SY-DATUM ,
           / 'Number of Projects          =           ',   COUNT_PROJECTS,
           / 'total Award      (Plan 11)  = ', TOTAL_AWARD,
           / 'total Auth Sales

    Hi all,
        Iam really waiting for someone to see and  get the logic right  for this code.Iam completely stuck up.  i need ur help
    Thanks

  • XML Publisher Multi tab Report: Help needed

    Hi,
    I have a requirement like below--
    Need to develop master detail XML Report in R12. O/P will be in excel.
    Excel output having two Work sheet.
    Some columns data must be non editable in excel output ,whereas some columns will be editable.
    User must not be able to add any line manually in the report.
    Can anyone pls help me out to find a way to build this?????????
    Thanks
    Titas

    Hi Titas,
    Any luck with this? Were you able to create a multi-tab report using XML Publisher? Any help on this will be greatly appreciated.
    Thanks.

  • Error while running disco report (Help needed urgent)

    Hello All,
    When i am running a disocoverer report i am getting the following error.
    ORA-01840 input value not long enough for date format
    ORA-02063 preceding line from prod
    The data retrieved by the query is incomplete because it was canclled?
    Kind Regards,
    Kumar.

    Hi Kumar
    It sounds like you could be trying to use the TO_DATE function and are either passing to it a value that is doesn't understand or you have not defined the format mask. Only if the string being converted is already in the database date format you do not need to provide a format mask. In all other cases you do.
    For example, if your database format is DD-MON-YYY then this is valid: TO_DATE('01-OCT-2009')
    However, if your format is something like 10/01/2009 you will have to tell Discoverer how the date is made up. In this particular case the answer would be: TO_DATE('10/01/99','MM/DD/YY')
    You should notice how the format mask is included in single quotes and separated from the date itself by a comma.
    Hope this helps
    Best wishes
    Michael

  • Simple BIP Report help needed

    Hi All ,
    I am bit new to BI Publisher,I have done plenty of Oracle reports 6i and 10g.
    Have read the BIPublisher Guide as well,but could not understand a few points.
    suppose I want to build a very very simple report like
    Sysdate Sysdate Sysdate
    16-Oct-08 16-Oct-08 16-Oct-08
    step 1) I will write the following query in the Data Model and store/save it.
    select sysdate ,sysdate,sysdate from dual.
    Step 2) In the layout model I want to use .rtf layout .So in the MS word .rdf document I create /insert
    a table with 2 rows and 3 columns,where 1st row will have Sysdate in all 3 columns as header.
    Now to fetch date 3times(the data) from the above query,WHAT is going to be my next steps ????
    I am not able to understand the link between the layout(.rtf document) and XML document.
    Please can someone reply to this question and let me know ?
    Regards
    Sunny

    I added a useless parameter just so you could see where parms should go...
    Datatemplate:
    <dataTemplate name="A_SIMPLE_REPORT">
         <properties>
              <property name="xml_tag_case" value="upper"/>
         </properties>
         <parameters>
              <parameter name="P_PARM" dataType="character"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="QUERYNAME">
                   <![CDATA[
    select sysdate SYSDATE1
    , sysdate SYSDATE2
    , sysdate SYSDATE3
    from dual
    where 'XYZ' = nvl(:P_PARM, 'XYZ')
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_UPPERGROUP" dataType="varchar2" source="QUERYNAME">
                   <element name="SYSDATE1" dataType="varchar2" value="SYSDATE1"/>
                   <element name="SYSDATE2" dataType="varchar2" value="SYSDATE2"/>
    <element name="SYSDATE3" dataType="varchar2" value="SYSDATE3"/>
              </group>
         </dataStructure>
         <dataTrigger name="afterReportTrigger" source="A_SIMPLE_REPORT.afterreport()"/>
    </dataTemplate>
    XML OUPUT:
    <?xml version="1.0" encoding="UTF-8" ?>
    <A_SIMPLE_REPORT>
    <LIST_G_UPPERGROUP>
    <G_UPPERGROUP>
    <SYSDATE1>2008-10-16T18:20:19.000-05:00</SYSDATE1>
    <SYSDATE2>2008-10-16T18:20:19.000-05:00</SYSDATE2>
    <SYSDATE3>2008-10-16T18:20:19.000-05:00</SYSDATE3>
    </G_UPPERGROUP>
    </LIST_G_UPPERGROUP>
    </A_SIMPLE_REPORT>
    Hope this helps,
    Scott
    PS If you have been doing reports for as long as you say you prob. know this already...but I NEVER* trust Oracle to convert my dates. I convert them all to char, pass them and convert them on "the other side" (if needed). But, you can change the data type to date if you feel brave, but don't say I didn't warn you. ;-)

  • Report help needed

    Hi All,
    I am struck into a particular problem. Please have the patience to read through the problem.
    I have a report with 2 queries. One query picks ups the invoices from the AR module, and the other query picks up the entries from the GL module because some invoices are not routed thru AR module.
    Now the accounting structure is that we have multiple sets of books. Each book can have different businesses, and all the businesses deal in various currencies.
    So the structure of the 2 queries is as follows
    Invoices: Set_Of_Book -> Business -> Currency -> Invoice Details
    Accruals: Set_Of_Book -> Business -> Currency -> Accrual Details
    Both the queries cannot be merged into a single query because they have different logics.
    Now I have to display the following summaries
    Invoices:
    1. Currency-wise summary of all invoices for all businesses in a Set_Of_Book
    2. Currency-wise summary of all invoices in a set_of_book
    Accruals:
    1. Currency-wise summary of all accruals for all businesses in a Set_Of_Book
    2. Currency-wise summary of all accruals in a set_of_book
    In the end:
    1. Summary of currency-wise total of all invoices + accruals
    Now I'm really struck up at item number 2(currency-wise summary for a set of book) the last item.
    How do i design my report so that I don't have to hard code the currencies anywhere.
    'm not an expert in reports, and the report has become a bit too complex for me.
    Any help shall be highly appreciate
    TIA
    Naveen

    Usman,
    you can do this via SQL. You can use the ROUND-Function, which is able to round to calendar week. See http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/functions121.htm#sthref1648 for details. The correct format to round for you is IW, wich means calendar week by iso standard. So your query should look like:
    select round(hiredate,'IW') week, sum(sal) summary
    from emp
    group by round(hiredate,'IW');
    If "week" differs from "iso-week", you can add or subtract days as workaround to to function (round(hiredate+2,'IW')).
    regards
    Rainer

  • Oracle 11G Install on Win 7 With PL/SQL Developer Help Needed

    Today is my first day with Oracle. I have tried to Install Ora11g from our network drive.I think the installation went fine. I also installated PL/SQL Developer when i try to log in i got the following error see below.
    PL/SQL Developer - (Not logged on)
    Initialization error
    SQL*Net not properly installed
    OracleHomeKey: SOFTWARE\ORACLE
    OracleHomeDir:
    OK
    After i did some research online i found this solution "go to Tools > Preferences > options set manually "Oracle Home" to the folder of ORACLE_HOME and "OCI Library" to the oci.dll file located in ORACLE_HOME/bin/oci.dll"
    C:\app\user\product\11.2.0\client_1\bin.dll <=== I believe this is my Oracle_Home
    C:\app\user\product\11.2.0\client_1\bin\oci.dll <==== Is my OCI Library.
    When i apply thse 2 paths i get the following error.
    Initialization error
    COuld not load " C:\app\user\product\11.2.0\client_1\bin.dll
    OCIDLL forced to C:\app\user\product\11.2.0\client_1\bin.dll
    LoadLibrary(C:\app\user\product\11.2.0\client_1\bin\.dll)returned 0
    Can someone help me with this ???????????????/

    Pl indicate which version of Win 7 - you will need Professional or higher - Home versions are not supported/certified, so things may or may not work as expected.
    http://download.oracle.com/docs/cd/E11882_01/install.112/e16773/reqs.htm#CHDHGGFE
    HTH
    Srini

  • How to optimize this SQL. Help needed.

    Hi All,
    Can you please help with this SQL:
    SELECT /*+ INDEX(zl1 zipcode_lat1) */
    zl2.zipcode as zipcode,l.location_id as location_id,
    sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2)) as distance
    FROM location_atao l, zipcode_atao zl1, client c, zipcode_atao zl2
    WHERE zl1.zipcode = l.zipcode
    AND l.client_id = c.client_id
    AND c.client_id = 306363
    And l.appType = 'HOURLY'
    and c.milessearchzipcode >= sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2))
    I tried to optimize it by adding country column in zipcode_atao table. So that we can limit the search in zipcode_atao table based on country.
    Any other suggestions.
    Thanks

    Welcome to the forum.
    Please follow the instructions given in this thread:
    How to post a SQL statement tuning request
    HOW TO: Post a SQL statement tuning request - template posting
    and add the nessecary details we need to your thread.
    Depending on your database version (the result of: select * from v$version; ):
    Have you tried running the query without the index-hint?
    Are your table (and index) statatistics up-to-date?

  • Sql loader help needed  urgent

    Hi,
    I normally get a csv having data as
    column1 ;columnb;columnc;
    13 ; 12 ; 13 ;
    11 ;13 ;33;
    as the table where it needs to go is say table
    xys( a number, b number , c number).
    so the control file is fairly simple ...
    But from now I need to restrict data entry if the change in format happens in the csv
    say if it is like
    column2;column1;column3,
    12,13;12;
    11;13;14;
    or say the csv like
    column1;column2;column3;column4;
    11;13;14;15;
    111;134;14;12;
    in both cases sql loader should not run and throw the error saying the reason in the log.
    how do i manage it in the control file `???
    any ideas???
    regards
    Message was edited by:
    SHUBH

    Hello,
    do you only need to check the first line of the file if it contains a line like
    column1;column2;column3 ?
    If yes, maybe a small script like this could be a starting point:
    You have to replace "column1;column2;column3" with the header information that's valid and instead of file1 in the CURRENTSTRING=... Line write the name of your input file.
    I hope this helps. (But maybe some of the experts here knows a way to do the verification checks with SQLLDR, so maybe its worth to wait a little bit :)
    #!/bin/ksh
    VALIDSTRING="column1;column2;column3"
    CURRENTSTRING=`head -n 1 file1`
    if [[ $VALIDSTRING == $CURRENTSTRING ]]
    then
    echo "They match."
    else
    echo "They dont match."
    fi
    --

  • Passing Parameters to reports - Help needed

    Dear All,
    I want to send multiple values in a sigle parameters(eg. PSerialNo) to report and use it in report. I have succeded upto constructing the values at form level as:
    '1','3','7','15'
    I want to use these values in reports like:
    Select x,y,z,a,b,c
    From SomeTable
    Where SomeColumn = :PValue
    And SerialNo In (:PSerialNo)
    No output
    SerialNo datatype is number, even i tried this
    Select x,y,z,a,b,c
    From SomeTable
    Where SomeColumn = :PValue
    And To_Char(SerialNo) In (:PSerialNo)
    same result
    guys, plz somebody help me.
    Sumanth

    You can select the values from a collection. Eg.
    SQL> CREATE OR REPLACE TYPE num_tab AS TABLE OF NUMBER;
      2  /
    Type created.
    SQL>
    SQL> CREATE OR REPLACE function num_str_to_tab( p_string in varchar2 ) return num_tab
      2    as
      3        l_string        long default p_string || ',';
      4        l_data          num_tab := num_tab();
      5        n               number;
      6    begin
      7      loop
      8          exit when l_string is null;
      9          n := instr( l_string, ',' );
    10          l_data.extend;
    11          l_data(l_data.count) :=
    12                ltrim( rtrim( substr( l_string, 1, n-1 ) ) );
    13          l_string := substr( l_string, n+1 );
    14     end loop;
    15     return l_data;
    16   end;
    17  /
    Function created.
    SQL>
    SQL>
    SQL> SELECT *
      2  FROM emp
      3  WHERE empno IN(
      4    SELECT column_value
      5    FROM TABLE (CAST(num_str_to_tab('7369,7782,7900') AS num_tab))
      6  )
      7  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30

  • Contract Analysis Report - Help needed pls.

    Hi Gurus,
    I have below requirement.
    To analyze the contracts created in purchasing(in SAP). The report shall help to analyse the Contracts that are due to expire in next 12 months.
    Now I need a suitable datasource and business content ods/cube.
    Required characters are: Contract no, Vendor, Purchasing group, created on,start date,end date etc.
    Report to run for contract end date between today's date and next year. For ex if user is running report on 05-oct-2007, the report should display all the contracts having end date between 05-oct-2007 and 04-oct-2008.
    Please help me.
    Thanks,
    Sasi

    Hi
    Take the <b>VBRK-KNUMV field  and pass it to KONV-KNUMV</b> table field along with all the Condition types (KSCHL) fields to get the amounts (KBETR and KWERT) fields
    Regards
    Anji

  • SQL problem - help needed ASAP!!

    Hey guys,
    Doing a college project... would really appreciate some help. I am trying to use a variable in the where clause of a select cursor in PL/SQL. The code is this:
    procedure results(p_search_entry varchar2, p_search_field varchar2) is
    cursor c_results is
    select * from physics_b where p_search_field = p_search_entry;
    begin
    for cv_results in c_results
    loop
    -- loop through actions
    end loop;
    The problem is that I don't know how to get the where clause to accept the variable passed into the procedure as the field name. Does anyone know the syntax for this?
    Thanks very much!
    Niall

    This isn't the correct forum for this kind of question. The SQL and PL/SQL forum PL/SQL is probably best.
    That said, you can't do what you want that way.
    You can do
    procedure results (p_search_entry in varchar2)
    cursor c_result is
    select * fro physics_b where subject=p_search_entry;(assuming subject is a column in physics_b)
    You can't use a variable to represent a column directly. You need to build the statement as a string and then use execute immediate.
    statement:='select * fro physics_b where '||p_search_field||' = :1';
    -- this bit is probably bad syntax.
    execute immediate statement using p_search_entry;Look up execute immediate and bind variables

Maybe you are looking for

  • USB 6009 and TDMS write

    Dear all! I'm using USB-6009 device to adquire data from a physical channel. In the following vi, the number of samples to be adquired is set to 1000, with a 100Hz rate. Therefore, as I understand, the number of samples that should be read inside the

  • Follow-up question: Moving Root volume to new disk

    When using Disk Utility to do the Restore (complete copy) from old to new, do the Volume Names need to be identical ? e.g. will restoring from volume "bk250" to volume "bk400" screw up the aliases already on bk250 etc? Thanks Message was edited by: W

  • Rotated image at 120% zoom

    Hi Framers, I use Frame 7.1p116 and have some small graphics of arrows in my text. These are imported by reference, Anchored Frame, At Insertion Point. When I display at 100% ot 140% (or other values) the display is just fine. But at 120% one of the

  • Export to Quicktime not working

    I've created a slidehow in Keynote '09, it's a little big with 117 slides, images on every one, music looped throughout and three videos that have their own specific timing on the slide to last as long as the video. I've created it with the intent to

  • Wht r types of structures in ABAP

    Hi,      Wht r types of structures in ABAP. Answer rewarded. Regds. Balakri...