Help needed in the logic

i hav select query like this:-
SELECT COUNT(*) INTO NO_OF_WORKERS FROM PA0000
WHERE ENDDA = '99991231' AND STAT2 = '3'.
with this select query , i can get the no. of workers .
How can i get the no. of workers in the recording period <u><b>excluding</b></u> those persons who were absent from work on paid/unpaid leave for the entire period?

Hi Hari,
I got the solution for you.use the following sql query.
SELECT COUNT(*) INTO NO_OF_WORKERS
FROM PA0000 AS a inner join PA2001 as b on apernr = bpernr
WHERE aENDDA = '99991231' AND aSTAT2 = '3'
and ( bawart = '0100' or bawart = '0727' ).
Now onething, in my comapany, in PA2001, field awart = '0100' means paid leave and 0727 means unpaid leave.
this things r configured in SPRO. so must replace the values of awart in sql qurey as per the values of paid/unpaid leave in your company.
you can do one thing, go to infotype pa30..then put 2001 in the infotype field in that screen, put cursor in STy field , hit F4 , it will show you the value for paid unpaid leave.
Note the value , modify the value of awart field inthe sql query, thats it.
cheers, and hey dont forget to give reward points.

Similar Messages

  • Help needed on the logic used to display ERP Sales order in CRM WEB UI

    Hi,
    I have a requirement where i need to trigger an activity/workflow in CRM for orders that are created through ERP Salesorder functionality. In the workflow list, we need to give the order description and provide an hyperlink to the order number. on selection of order number, it should display the ERP sales order. To achive this in workflow, i am trying to understand the as-is standard functionality which is available in Agent Inbox search on ERP sales order.This search is getting the ERP orders and on selecting the order it is opening the ERO sales order page. I tried debugging the method GET_MAINCATAEGORY available in the component iccmp_inbox and in the view Inboxsearch.But couldnt really able to crack the logic how it is retrieving the ERP sales order from inbox search. Any pointers on how this is achieved will be of great help.
    Thanks,
    Udaya

    Hi Denis,
    very good idea. I thougt myself about that workaround, but it is not really that for what I searched.
    I mean the "SAP Query" is a really good standard tool, that are used by many customers. That is why think there must be a standard way to display the SAP Query in the Web UI without using Transaction Launcher.
    But it seems that there is no way, except of the transaction launcher or by using an additional analyse system like SAP BI.
    By the way do you know a Web UI compoment which enable the user to start reports like SE38?
    Regards
    Fabian

  • 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

  • Help Needed in Relational logic

    Hi
    Working in 2008 R2 version.
    Below is the sample data to play with.
    declare @users table (IDUser int primary key identity(100,1),name varchar(20),CompanyId int, ClientID int);
    declare @Cards table (IdCard int primary key identity(1000,1),cardName varchar(50),cardURL varchar(50));
    declare @usercards table (IdUserCard int primary key identity(1,1), IDUser int,IdCard int,userCardNumber bigint);
    Declare @company table (CompanyID int primary key identity(1,1),name varchar(50),ClientID int);
    Declare @client table (ClientID int primary key identity(1,1),name varchar(50));
    Declare @company_cards table (IdcompanyCard int primary key identity(1,1),CompanyId int,IdCard int)
    Declare @Client_cards table (IdclientCard int primary key identity(1,1),ClientID int,IdCard int)
    insert into @users(name,CompanyId,ClientID)
    select 'john',1,1 union all
    select 'sam',1,1 union all
    select 'peter',2,1 union all
    select 'james',3,2
    Insert into @usercards (IdUser,IdCard,userCardNumber)
    select 100,1000,11234556 union all
    select 100,1000,11234557 union all
    select 100,1001,123222112 union all
    select 200,1000,2222222 union all
    select 200,1001,2222221 union all
    select 200,1001,2222223 union all
    select 200,1002,23454323 union all
    select 300,1000,23454345 union all
    select 300,1003,34543456;
    insert into @Cards(cardName,cardURL)
    select 'BOA','BOA.com' union all
    select 'DCU','DCU.com' union all
    select 'Citizen','Citizen.com' union all
    select 'Citi','Citi.com' union all
    select 'Americal Express','AME.com';
    insert into @Client(name)
    select 'AMC1' union all
    select 'AMC2'
    insert into @company(name,ClientId)
    select 'Microsoft',1 union all
    select 'Facebook',1 union all
    select 'Google',2;
    insert into @company_cards(CompanyId,IdCard)
    select 1,1000 union all
    select 1,1001 union all
    select 1,1002 union all
    select 1,1003 union all
    select 2,1000 union all
    select 2,1001 union all
    select 2,1002;
    Requirement : 
    1. Get the distict Users card details. the reason for using distinct is, user can have same card multiple with different UserCardNumber.
    Ex : user can have more than BOA card in the @usercards table with different UserCardNumber. But though he has two BOA card, my query should take one row.
    2. After the 1st step, i need to check if any details on @company_cards based on Users companyId.If yes then selct the details from @company_cards. if not select it from @client_cards
    In this case we need to make sure that we shouln't have repeated data on @FinalData table. 
    My Logic:
    Declare @FinalData table (IDCard int,CardName varchar(50),CardURL varchar(50))
    declare @IdUser int = 100, @ClientID int,@companyID int;
    select @ClientID = ClientID,@companyID = CompanyId from @users where IDUser = @IdUser;
    insert into @FinalData (IDCard,CardName,CardURL)
    Select distinct c.IdCard,c.cardName,c.cardURL from @usercards UC join @Cards C on(uc.IdCard = c.IdCard)
    where IDUser=@IdUser;
    if exists(select 1 from @company_cards where @companyID = @companyID)
    BEGIN
    insert into @FinalData(IDCard,CardName,CardURL)
    select c.IdCard,c.cardName,c.cardURL from @company_cards cc join @Cards c on(cc.IdCard = c.IdCard) where CompanyId = @companyID
    and cc.IdCard not in(select IDCard from @FinalData);
    END
    ELSE
    BEGIN
    insert into @FinalData(IDCard,CardName,CardURL)
    select c.IdCard,c.cardName,c.cardURL from @client_cards cc join @Cards c on(cc.IdCard = c.IdCard) where ClientID = @ClientID
    and cc.IdCard not in(select IDCard from @FinalData);
    END
    select * from @FinalData;
    the logic produces the valid result. Is there any alternative way to achieve this logic. I feel there might be some proper way to query this kind of logic. any suggestion please.
    [the sample schema and data i provided just to test. i didn't include the index and etc.]
    loving dotnet

    You can simply merge the statements like below
    Declare @FinalData table (IDCard int,CardName varchar(50),CardURL varchar(50))
    declare @IdUser int = 100
    ;With CTE
    AS
    Select IdCard, cardName, cardURL,
    ROW_NUMBER() OVER (PARTITION BY IdCard ORDER BY Ord) AS Seq
    FROM
    Select c.IdCard,c.cardName,c.cardURL,1 AS Ord
    from @usercards UC join @Cards C on(uc.IdCard = c.IdCard)
    where IDUser=@IdUser
    union all
    select c.IdCard,c.cardName,c.cardURL,2
    from @company_cards cc join @Cards c on(cc.IdCard = c.IdCard)
    join @users u on u.CompanyId = cc.CompanyId
    where u.IDUser = @IdUser
    union all
    select c.IdCard,c.cardName,c.cardURL,3
    from @client_cards cc join @Cards c on(cc.IdCard = c.IdCard)
    join @users u on u.ClientID= cc.ClientID
    where u.IDUser = @IdUser
    )t
    insert into @FinalData (IDCard,CardName,CardURL)
    SELECT IdCard, cardName, cardURL
    FROM CTE
    WHERE Seq = 1
    select * from @FinalData;
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Help in understanding the logic!

    Can anyone help me with the following?
    Can anyone explain how the below logic works if it has the following Input values:
    Input values:
    GLOBAL1_CURR_CODE ='LOC'
    DOC_CURR_CODE ='USD'
    LOC_CURR_CODE ='USD'
    IIF(ISNULL(GLOBAL1_CURR_CODE), NULL,
    IIF(GLOBAL1_CURR_CODE = DOC_CURR_CODE, 1.0,
    IIF(DOC_CURR_CODE = 'STAT', 1.0,
    IIF(GLOBAL1_CURR_CODE = LOC_CURR_CODE, DOC_TO_LOC_EXCH_RATE_VAR,
    :LKP.LKP_W_EXCH_RATE(DOC_CURR_CODE, GLOBAL1_CURR_CODE, EXCH_DT,GLOBAL1_RATE_TYPE, DATASOURCE_NUM_ID)))))
    I am not able to find the :LKP.LKP_W_EXCH_RATE in either SDE or SIL transformations.
    Thanks in advance.
    Nikki.

    Hi again Nikki, I see you have two Oracle.com user accounts!
    This appears to relate to several issues you are having in understanding how global currencies work with the BI Applications. For the benefit of others, related threads are:-
    Informatica Logic for Balance_Global1_Amt column in W_GL_BALANCE_F table
    Informatica Logic for Balance_Global1_Amt column in W_GL_BALANCE_F table.
    Insert records into W_EXCH_RATE_G table
    Re: Insert records into W_EXCH_RATE_G table.
    Modify SIL_GLBalanceFact to populate Balance_Global1_Amt column
    Modify SIL_GLBalanceFact to populate Balance_Global1_Amt column.
    With regards to your latest question, I recognise that the SQL you have populated below has been taken from the MPLT_CURCY_CONVERSION_RATES1 mapplet in the SIL_GLBalanceFact mapping.
    To understand the logic, you need to understand the SQL used by Informatica, as well as Informatica lookup notation. Going through your example line by line:-
    GLOBAL1_CURR_CODE ='LOC'
    DOC_CURR_CODE ='USD'
    LOC_CURR_CODE ='USD'
    IIF(ISNULL(GLOBAL1_CURR_CODE), NULL,
    -- So if the GLOBAL1_CURR_CODE is null, then return NULL else...
    IIF(GLOBAL1_CURR_CODE = DOC_CURR_CODE, 1.0,
    -- if the GLOBAL1_CURR_CODE is equal to the DOC_CURR_CODE then return 1.0 else...
    IIF(DOC_CURR_CODE = 'STAT', 1.0,
    -- if the DOC_CURR_CODE is equal to 'STAT' (for statistical journals) then return 1.0 else...
    IIF(GLOBAL1_CURR_CODE = LOC_CURR_CODE, DOC_TO_LOC_EXCH_RATE_VAR,
    -- if the GLOBAL1_CURR_CODE is equal to the LOC_CURR_CODE then return the column DOC_TO_LOC_EXCH_RATE_VAR else...
    :LKP.LKP_W_EXCH_RATE(DOC_CURR_CODE, GLOBAL1_CURR_CODE, EXCH_DT,GLOBAL1_RATE_TYPE, DATASOURCE_NUM_ID)))))
    -- perform a lookup using the LKP_W_EXCH_RATE transformation (you will see this lookup on it's own in the mapplet; the colon notation above is another way to reference a lookup transformation, instead of using connectors). The five columns in the brackets are used as inputs for the lookup, if a matching record is found in the lookup table then the EXCH_RATE column is returned (check out the LKP_W_EXCH_RATE transformation for the port marked as Output).
    Please mark if helpful / correct,
    Andy
    www.project.eu.com

  • Help needed from the GB experts! I've just installed Native instruments Session Strings PRO!

    Hello, I wasn't paying much attentionI've accidentally installed the VST and RTAS together with the AU format :-( Just wondering if this mistake has just caused me 3 x times the amount of hard disk space! I don't think I'd be using Protools (VST) or any of Steinberg's DAW (RTAS) anytime soon, I'm still new to all this different types of plugins, could someone tell me if I should leave these formats (VST and RTAS) in my hard drive?
    Thank you for reading

    lyndonfromcooks hill wrote:
    Thanks so much for the reply! I did manage to locate the VST and Digidesign folders as per your previous instructions, however both have empty files in them, I then clicked each and "get info" from the menu bar, just to make sure, but both do not have any files, nor taking any hard disk space, which is strange, maybe your correct by saying the samples that was loaded initialy AU (at 30+ gig size) are only referenced for use by the other two formats when needed...anyways I'm only using the Kontakt Player for this library so NI doesn't provide any support for any related issues, all good
    You're welcome!
    A few thoughts:
    First, make sure you check your plugin folders in both your hard drive library and home library. Perhaps it's in the other one (hard disk > library > plug-ins > etc. AND user name > library > plug-ins > etc.)
    However, because installing libraries in different formats isn't unheard of, I would guess that it doesn't install the big honking sound files more than once, for the very thing you're concerned about. Just a guess though. 
    As for NI... yeah... they're not exactly known for good tech support!
    lyndonfromcooks hill wrote:
    Matt, just on the side note I'm a long time lurker from this forum and I've read and learned a lot from your postings, glad to say with your help, I'd leave this topic solved for now.
    Thank you once again.
    Thanks for the kind words!
    (Finally, if after checking all the plug in folders, you still had questions about this, you could always post in the Logic forum since I know some of those people use both Logic and ProTools. I only use / and have installed AU's so haven't dealt with this one myself. I'm just kind of educated-guessing this!).

  • Could you please help me understand the logic behind certain things in OSX?

    Ok, so I try to be an open-minded guy, and I bear no particular allegiance to either OS. I own a Sony TZ and a Mac mini, and my wife has a MacBook Pro. I use both Oses.
    There are certain things I have trouble understanding in th Mac OS, so what I'd really like to understand the logic behind certain design decisions in the OS, and why these might be better ways of accomplishing things. I know how to get around all of the things I mention, so I'm not looking for instructions; rather I'm looking for well-thought out explanations for why these features are the way they are.
    *1. Programs don't quit when you close the window.*
    - This totally puzzles me. Why design it so that program windows are independent are from the running program itself? There must be a reason, cold someone explain how this is more efficient? To me, it's simpler to click an X on the window you are working on to completely shut down a program, rather than to either mouse through menus to select quit, or be obligated to using Command Q keyboard shortcut.
    *2. Menu bars are on the desktop.*
    - Related to the first point, why make the main thing framing your desktop be something which is always changing depending on the program? Why have file menus outside the main window of the program. Having the menu bar on the desktop then necessitates an additional area, the dock, which has to be used as a launch bar and to tell you what programs are currently running. That obligates you to having 3 different areas of screen: 1 for program menus, 1 for running programs, and the program window itself. This seems very inefficient to me. Not to mention all the messy-looking floating palettes all over the place, again because everything is separated and not nicely contained in a single program window.
    - Really, having a changing menu bar that frames the desktop isn't even consistent wth the whole desktop metaphor, which is that you place things on a desktop, like programs, files, etc. Are you changing the whole desk everytime you load a new program, yet the wallpaper stays the same? Doesn't seem to be logically consistent to me.
    *3. No delete key.*
    - This one really gets me. Why make such a commonly used key be a function key (Fn + Backspace)? Why make the user press a secondary key for a major function?
    *4. No Cut command.*
    - I read something about how Cut doesn't actually make sense when moving files around, but I obviously didn't fully understand it. Why make the user command drag, when you can just do Ctrl X??.
    *5. Launching Apps from the Finder.*
    - This seems weird to me, that you find and launch applications from the same thing you use to view files. Program icons in the finder are placeholders for the entire program, not files, yet they are found in the file viewer. Again, to me this seems logically mixed. I really dislike scrolling through Finder to look for apps. I know there is Spotlight and the dock (used as a quicklauncher), but these are really just workarounds for a setup which seems inherently illogical. To me at least, a menu of applications make more sense, ie, the start menu.
    Anyway, those are all I can think of now, although there are other things aout OSX that don't make sense to me.
    Thanks in advance! If I can understand Apple's reasoning and it is convincingly better, that will go a long way towards making me more comfortable with this OS.

    1. Programs don't quit when you close the window.
    That's really more a matter of what you're used to. It comes down to a programming decision as to what Apple and Microsoft considered to make sense. MS thinks that if there are no open windows, you're done using the app. Apple thinks you aren't necessarily done yet, as others have mentioned. I certainly wouldn't want Photoshop to quit every time I closed the last open image I was working on. Would be nice though if Safari would quit when I close the last open browser window. It's quick to relaunch if you really weren't done with it, so wouldn't be much of a bother to have it shut down with the last window.
    2. Menu bars are on the desktop.
    Makes way more sense the Microsoft's approach of repeating the same file menu on every open document in a program. How many places do you need to see File, Options and other common menu headings?
    2. Menu bars are on the desktop.
    Related to number two. The forward app is the only one you can directly work in, so why not have the menu bar change to reflect the choices for that application? When you go back to the previous app you were in, the menu bar changes back. So what loss of functionality is there? It comes back to not having menu bars on every single open window. There's no need or purpose for it.
    3. No delete key.
    Backspace does the same thing.
    4. No Cut command.
    Command+X, not Ctrl+X. This is Mac, not Windows. There's also very little need to ever do this from the keyboard. If you're moving files that are on the same drive/partition, then just drag and drop from the target folder window to the source. It's automatically a move. If going from one physical drive or partition to another, it's automatically a copy. Press and hold the Command key during the drag to make it a move.
    Besides, you don't really think Windows cuts the entire folder or file contents into RAM, do you? If your computer has 4 GB of RAM, and you cut 12 GB of data, it of course can't possibly fit in the clipboard. All Windows does when you do a cut is visually remove the files and folders from the screen. If the items are going to a location on the same drive/partition, it does the same thing as if you did a drag and drop move. The file table is simply updated to reflect the new file or folder locations. If it's to a different drive/partition, it then performs a copy then delete action, same as OS X.
    5. Launching Apps from the Finder.
    A program is just as much a file as any other file. It takes up space on the drive. The OS of course knows what to do with it when you double click an app. Same as it knows what to do when you double click a document related to an app. Windows is no different. An .exe file is also just as much a file as a .doc file. The .exe extension tells Windows to try and treat it as a program to load into RAM. It's not just a simple placeholder. The program has to be made up of something.

  • Help needed for THE decision

    Hi everyone ☺
    I’m finally planning to start recording what I play, and after some hours of wandering on the web I found some interesting possibilities. Now what I need is to decide which one is more suitable for my needs, and here comes the moment for apple discussions
    Basically, I will record my own music one track/instrument at a time (I’m still not able to play more than one…and I dont’ want to spend 2.000$ to buy a 24-ins device just to record drum tracks), I’d like to have a software with built-in effects for guitar/bass/voice, integrated soundtrack possibilities (to play with video recordings), mixing options for both stereo and surround mixing, and I don’t want any card to be placed into my mac. Well, and obviously the sound quality must be pro-like…as anyone probably wants.
    So, here’s what I came up with:
    a) getting logic pro studio 8 and apogee duet
    b) getting pro tools m-powered and mbox 2
    c) getting one of the two softwares and a Monster iStudioLink Instrument cable and plug instruments directly into the mac
    Now, the questions are:
    if I can plug an instrument directly into my mac and control all parameters via one of the two softwares, what do tools like duet and mbox2 serve for?
    In the case this tools are useful [ ☺ ], why ☺ … and which is the couple software/hardware that can best suit my needs?
    I assume that every software has a proprietary file extension in which audio tracks are saved, so that it should be impossible to record an audio track with one software and edit it with another that has different functions/plugins (ex. from logic to pro tools, from pro tools to cakewalk sonar which I have on a pc etc.). Am I right, or is there any “standard”, non compressed high quality file type in which track can be saved and exported to be edited with different softwares?
    I know that from this post it may easily seem that I’m a hopeless digital idiot, but I swear the situation is not really that bad so no need for the kind of explanations with drawings like the ones you find in the “for dummies” guides lol so every experts’ advice will be greatly appreciated
    Neptune

    Thank you Bee Jay and Pancenter for the lighting-fast and useful answers
    now I am aware that an interface IS NEEDED lol (that means they are not produced without a reasons, are they?). I know Pro Tools is the industry standard but I don't like anyone/anything to tie me to their choices/interests (so that's why I was asking about Pro Tools, knowing that there's some sort of "hardware threat"). What I look for is just quality and if I understood what you both mean, as far as this aspect is concerned, Logic and Pro Tools are substantially comparable...isn't it? On the interfaces side, I already checked the Saffire ones (they seem quite good, and cross-platform use is definitely a plus), I will check the others mentioned and will let you know In fact, I didn't consider the "platform problem" but, as I wrote, I also own a PC with an Audigy 2 soundcard (midi/analog/optical/digital inputs/outputs and firewire port...not Madonna's private studio, but not as sad as Mac's little hole) and Sonar 6 Producer Edition, so that has been a really good point to ponder. And now, in the middle of this software/hardware battle...any personal suggestions based on tests/personal experience?

  • Help needed regarding the updation of "Relationships" in BP

    Hello Guys,
    This is to request you to kindly help me regarding the following.
    We have a scenario where all the employees assigned to an Organizational unit (in PPOMA_CRM) are not showing in the "Relationships" ("Has Employee")in the BP transaction of that Organizational Unit.
    Could anyone let me know whether there is any update program that updates the "Relationships" from the Organizational asssignment. Or we need to enter the employees manually in BP "Relationships". Please help. Thanks in anticipation.
    Regards,
    Kishore.

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Please help me on the logic.

    Hi,
      Please help me the logic below my requirement.I found one function module to calculate the age
    HR_RU_AGE_YEARS.But iam not able to implement the logic.Please help me.
    If the value in table P0021-SUBTY = 1 send 'SP'
    If the value in table P0021-SUBTY = 2 send 'CH'
    Also use Condition Logic to check the age of Child in IT0021-FGBDT. If FGBDT =21 years or greater then Check the Student indicator on IT0021 if it is checked then set 'ST' on full file else set 'CH'.
    For Disabled Dependent check to see if the indicator in P0106-DISAB is set to X i.e. yes. If its Yes then set 'DD' on full file.
    DD takes precendence over 'CH'.  Send termination record for students on their 26th Birthday.
    Regards,
    Sujan

    Hi,
    You can use function module HR_HK_DIFF_BT_2_DATES with date1 as sy-datum and date2 as DOB from pa0002 to calculate age.
    Regards,
    Kanupriya

  • Help needed in the query.

    I have a table say T1 with a column of unique sequential numbers that begin at 1. When one inserts a new row, one muse use a sequence number that is not currently in the column. that is Fill the gaps. If there are no gaps, then and only then one can use the next highest integer in the sequence.
    create table T1
    ( seq_nbr INTEGER NOT NULL PRIMARY KEY
    CHECK (seq > 0);
    junk CHAR(5) NOT NULL);
    INSERT INTO T1
    VALUES (1,'Tom'), (2,'Dick'), (4,'Harry'), (5,'Moe');
    Here is the INSERT statement,i came across, where i am not able to understand how logic is working?
    INSERT INTO T1 (seq_nbr,junk)
    VALUES (CASE WHEN EXISTS -- no gaps
    ( SELECT 'no gaps'
    FROM T1
    HAVING COUNT(*) = MAX(seq_nbr))
    THEN ( SELECT MAX(seq_nbr) FROM T1 ) + 1
    ELSE ( SELECT MIN(seq_nbr) -- gaps
    FROM T1
    WHERE (seq_nbr -1)
    NOT IN (SELECT seq_nbr FROM T1)
    AND seq_nbr > 0) - 1, 'Jen');
    the thing is i am not able to understand how this query is executing and the logic.. Can someone please explain this to me?

    Hi,
    this works because the first part of the CASE statement assumes there are no gaps if the number of records in the table = the max(seq_nbr) and inserts the next one up. If there are gaps then it looks for the lowest missing seq_nbr. (without testing this code I wouldn't assume it works)
    Overall though this is not good practice because with high volume systems it will most likely lead to all sorts of concurrency problems. Instead you should just use a straight oracle sequence. Every time I've seen someone try to specify the requirement that a PK must be contiguous set of numbers with no gaps I've found it to be based on an individuals perverse sense of completeness or a left over from an old manual system. Usually the sequence numbers where generated from a ledger and the only way they could easily count throughput was by subtracting yesterdays closing sequence from todays. Once you point out that the database can count these things in fractions of seconds, the requirement disappears.
    Andre

  • Help needed on Mapping logic

    Hi guys,
    I have logic like,
    pernr>logic>pernr.
    Pernr is the first field.
    Whenever the logic fails, it should not process rest of the below fields.
    it should directly go to next record.
    Any ideas.......
    santosh.

    You can achieve this using gloval variable.
    1. right click on the parent node  of pernr. -
    >Add Variable (say ifPernrTrue)
    2. Map this variable with the same logic and give value "true" if logic successful and "false" if logic fails
    Whenever the logic fails, it should not process rest of the below fields.
    3.Map rest of fields as :
    ifPernrTrue (the variable u created) \
    >   if  (without else )  -
    > fields...
                   source filed     /

  • Need help in understanding the logic

    i've been told to develop the mail application for sending the messages.the clients should automatically receive the mail.since the clients have the browser to handle all mails,do u think there is no need to code on the receiving end.Also give me an idea as to how i should retrieve the client details from the huge database

    hai Shanu my job is i'm not worried about the receiving side.i'm just sending the message.all that is left for me is to figure out the clients to whom i hav to send mail.middleware in the sense i don't exactly understand it.so can u plz give me a detailed picture about it
    regards
    coded

  • Help Needed in Date Logic

    Hi I am working in sqlserver 2008 R2 and below is my sample research query
    i am trying to get previous 6 months data.
    WITH CutomMonths
    AS (
    SELECT UPPER(convert(VARCHAR(3), datename(month, DATEADD(MM, DATEDIFF(MM, 0, GETDATE()) - N, 0)))) Month
    ,DATEADD(MM, DATEDIFF(MM, 0, GETDATE()) - N, 0) startdate
    ,DATEADD(MM, DATEDIFF(MM, 0, GETDATE()) - N + 1, 0) enddate
    FROM (
    VALUES (1)
    ,(2)
    ,(3)
    ,(4)
    ,(5)
    ,(6)
    ) x(N)
    WHERE N <= 6
    SELECT month
    ,SUM(isnull(perks.amount,0)) AS PerkAmount
    FROM CutomMonths
    LEFT JOIN (
    select 10.00 as amount,'2014-04-03' as StartDate,'2015-04-03' as EndDate union all
    select 10.00 as amount,'2014-04-03' as StartDate,'2015-04-03' as EndDate
    ) perks ON
    CutomMonths.startdate >= perks.StartDate
    AND CutomMonths.startdate < perks.EndDate
    GROUP BY CutomMonths.Month
    ,CutomMonths.startdate
    ORDER BY CutomMonths.startdate ASC
    current output what i am getting:
    Expected Output:
    I found why the April month i din't get the $20 because the startdate of my perks CTE '2014-04-03'. If it is '2014-04-01' then i will get the expected output.
    But i should not change the the date on perks. How to neglect this date issue and consider the month instead to get the expected output. please help me on this as i am struggling on my logic 
    loving dotnet

    I'm just going to focus on the JOIN criteria in this reply since my answer above and your 2nd response are essentially the same except for the JOIN.
    What your are describing and what you are doing in code is conflicting. 
    You are saying this:
    "I just need to check whether the perks start date falls in between month start date and month end date"
    ..., which translated directly to code would be this:
     ON perks.StartDate >= CustomMonths.StartDate
    AND perks.StartDate <= CustomMonths.EndDate
    What I believe you are getting after is this:
    "I just need to check whether the dates within the perks start and end date range fall in between month start date and month end date"
    ..., which translated directly to code would be this, which is also my answer proposed above:
    ON CustomMonths.StartDate >= DATEADD(DAY, -(DAY(perks.StartDate) - 1), perks.StartDate)
    AND CustomMonths.StartDate <= perks.EndDate
    However, if you really want to use the code solution you proposed, then you would actually be saying this:
    "I just need to check whether the dates within the perks start and end date range fall in between month start date and month end date, but if perk end date happens to be the first day of the month, then ignore it and use the previous day."
    ..., in which case then your code, as follows, would be the solution:
     ON CutomMonths.startdate >= DATEADD(mm, DATEDIFF(mm, 0, perks.StartDate), 0)AND CutomMonths.startdate < DATE
    ADD(mm, DATEDIFF(mm, 0, perks.EndDate), 0)
    NOTE: The alternate JOIN I had commented out in my proposed answer above will do the exact same thing as your latest proposed solution
     ON CustomMonths.StartDate >= DATEADD(DAY, -(DAY(perks.StartDate) - 1), perks.StartDate)
    AND CustomMonths.StartDate < perks.EndDate
    BTW, I see how you are getting to the first day of the month by subtracting all the months from the given date to 01/01/1901, and then turning around and adding them all back to 01/01/1901.  While that is one way to get to the first day of the month, it
    seems excessive from a calculation stand point, although I haven't performed any performance tests to know for certain.
    SELECT DATEADD(mm, DATEDIFF(mm, 0, '2014-04-03'), 0)
    I prefer simply subtracting one less than the current day number from the given date to get to the same first day of the month value.
    SELECT DATEADD(DAY, -(DAY('2014-04-03') - 1), '2014-04-03')

  • Please urgent help needed for the following

    Hi Everybody!
    I desperately need help as soon as possible.
    Following is the partial code for the driver program which will use the Employee class Objects(Employee is declared abstract). If you want to see whole code you can take a look at my last two or three posts in this forum.
    1-     Now data input by the user in the specific field( name, rate ) should be displayed in the �List� at the top of the frame after pressing �Enter� key. Can anyone help me to achieve this functionality. While doing this keep in mind the capacity of Array
    2-     I also need �rate� textfield to enabled initially & become disable when �raise� (for trigerring calculating raise in weekly pay) is checked. On this �increased� textbox will become �enabled� which was disabled initially.
    3-     The stuff which may have the problems is followed by �*******************�.
    // here is how I declared handlers
    ActionEventHandler handler = new ActionEventHandler();
    ItemEventHandler listener = new ItemEventHandler();
    // here is the declaration of awt components which are going to be placed on Frame.
    public class ActionEventHandler implements ActionListener
    public void actionPerformed(ActionEvent event)
    //if(event.getSource() == enterButton)
    for (int i = 0 ; i < empArray.length; i++)
    if(event.getSource() == enterButton)
    empData.add(nameField.getText());
    /*else if(event.getSource() == hoursField)
    calcWeeklyPay();
    if(event.getSource() == clearButton)
    nameField.setText("");
    hoursField.setText("");
    rateField.setText("");
    increaseField.setText("");
    }//else if
    }//ActionEventHandler
    public class ItemEventHandler implements ItemListener
    public void itemStateChanged(ItemEvent event)
    //if(event.getSource() == enterButton)
    if(hEmployee.getState())
    createHourly();
    }//if
    /*else
    sEmployee.setState(true);
    createSalaried();
    }//else*/
    else if(raiseSal.getState())
    increaseField.setEnabled(true);
    rateField.setEnabled(false);
    }//itemStateChanged
    }//ItemEventHandler
    public void createHourly()
    nameField.requestFocus();
    //String name = nameField.getText();
    double payRate = Double.parseDouble(rateField.getText());
    double hours = Double.parseDouble(hoursField.getText());
    empArray[empCreated] = new HourlyEmployee(nameField.getText(), payRate, hours);
    currentEmp = empCreated;
    empCreated++;
    //empData.add(emp.toString());
    enterButton.setLabel("add");
    }//createHourly
    /* public void createSalaried()
    nameField.requestFocus();
    //String name = nameField.getText();
    double payRate = Double.parseDouble(rateField.getText());
    double hours = Double.parseDouble(hoursField.getText());
    empArray[empCreated] = new HourlyEmployee(nameField.getText(), payRate, hours);
    currentEmp = empCreated;
    empCreated++;
    enterButton = new Button("add");
    }//createSalaried*/
    looking forward your kindness

    Visit YAT-Yet Another Thread this is a discussion using the Sun book Core Java 2
    and one part in that book uses an example with Employee class of which I assume you are stealing your class-name from. Anyway, that thread is in the Java forums.

Maybe you are looking for