'No assignment of payroll data to BW month for country grouping 99'

hi gurus,
i am getting the error 'No assignment of payroll data to BW month for country grouping 99'
to solve this i went to
SBIW>Settings for Application-Specific DataSources (PI)->Human Resources->Payroll Plug-In>Assignment of Payroll Data to BW Month
i am choosing country 99 and here i get 4 options which should i choose.
1.payment date of for- period
2.end date of in -period
3payment dare of for -period
4payment dare of  in- period
regards
man

Hi,
As per the settings in the SBIW code in R/3 , we can go with a single Time based assignment for a Country at a time.So we can not use both IN Period and FOR period for the same country code.
For more information, refer the below path.
SBIW>Settings for Application-Specific DataSources (PI)->Human Resources->Payroll Plug-In>Assignment of Payroll Data to BW Month
Under human resources.....go to payroll and assignment of payroll data to BW
if you do not get...use Cntl + F and enter payroll..
you will get
in Assignment of payroll data to BW Month, after giving country grouping, what type of period assignment should be given. in R/3 dev side when i have chosen
1.End of For period, extracted 972 records
2. End of In period, extracted 1023 records
3. Payment date of For period, extracted 972 records(just the same as in the first option)
4.Payment date of In period, extracted 0 records
Do u know more about these options??? one more thing to clarify on this. While doing payroll data extraction, do we have consider or say give "Define time frame for transfer", if that is compulsory then i have done that by givigng
Earliest date as 01.01.2005
Latest date as 31.12.2005
but in the info package selection i have given to extract 01.01.2005 to 28.02.2006 and it has extracted successfully even 2006 records which means that though we define time frame, extraction is independent of this time frame, am i correct???
Hareesh

Similar Messages

  • No Assignment of Payroll Data to BW Month for Country Grouping 10 and 13

    Hi Gurus,
    I get the error "No Assignment of Payroll Data to BW Month for Country Grouping 10 and 13" when extracting data for 0PY_C02. I then added the "End Date of For Period" in the SBIW in the Payroll systen activity "Assignment of Payroll Data to BW Month". I am still getting the same error???
    Also I do have data in the cube from that extraction, but when I run a query I get no data?? Is this due to the above error?
    Thanks,
    Garth

    Hi,
    The extractor runs without errors in RSA3 in the source system. The error is red with the test of "No Assignment of Payroll Data to BW Month for Country Grouping 10 and 13". I completed the SBIW task to set this in the source system but I still get the same error?
    Any other ideas?
    Thanks,
    Garth

  • Assignment of Payroll Data to BW Month- 0HR_PY_1

    We wish to extract data from R/3 payroll for both the IN Period and FOR period  for the same country code.. Does anybody currently do this and what are the options available
    thanks
    Rodd

    Hi,
    As per the settings in the SBIW code in R/3 , we can go with a single Time based assignment for a Country at a time.So we can not use both IN Period and FOR period for the same country code.
    For more information, refer the below path.
    SBIW>Settings for Application-Specific DataSources (PI)->Human Resources->Payroll Plug-In>Assignment of Payroll Data to BW Month
    With rgds,
    Anil Kumar Sharma .P

  • Personal Data and Address for Country Grouping 99 - error on ESS

    Hello All,
    I have configured personal data and address infotypes in ESS for the country grouping 99.
    I have done the following config
    1. Assign Screen Structure to Infotype Versions
    2. Define Active Subtypes and Use Case
    3. Define Country-Specific Applications
    4. Created a Z service and then assigned this service to subarea.
    I made use of US service and copied to z.
    after the config when i log on to the portal and check the personal data or address links am getting the error:
    An exception occurred that was not caught., error key: RFC_ERROR_SYSTEM_FAILURE
    the st22 dump is
    Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED_NO
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
    caught in
    procedure "HRXSS_PER_CLEANUP" "(FUNCTION)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    You attempted to use a 'NULL' object reference (points to 'nothing')
    access a component.
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    Either the reference was never set or it was set to 'NULL' using the
    CLEAR statement.
    I searched in the forum but still am unable to figure it out where i am wrong or missing any config or any other technical error.
    Can any one pls help me

    http://wiki.sdn.sap.com/wiki/display/ERPHCM/HowtoReuseCountryspecificapplicationsforMolga99
    check the steps in above link
    and also please check with some standard country like india 40 or usa 10 what use cases and time constraints have been set
    INFTY - Now specifies the infotype.
    USECASE - Corresponds to the value in the table V_T7XSSPERSUBTYP.
    ZEITB - Corresponds to the value in the table V_T591A (V_T582A).
    Page 2
    SUBTYPE_TAB - Here, you will find a list of the subtypes that have
    already been checked and that are correct.
    You then find the subtype in METADATA-SUBTY. However, you must move up
    one subroutine in the call hierarchy in advance to do this.
    This data makes it easy for you to identify the infotype and the subtype
    and correct the inconsistency by making entries in the tables mentioned.
    ie
    T_cd:SE24 >>CL_HRPA_PERNR_INFTY_XSS >> CHECK_USECASE_WITH_CONSTRAINT >>
    for
    usecase = A1, A4, B1, B4 (table V_T7XSSPERSUBTYP)
    you need to have
    zeitb = '1' OR zeitb = '2' (table V_T591A)
    for
    usecase = A2, A3, A5, B2, B3, B5
    you need to have
    zeitb = '2'
    for
    usecase = A6, B3
    you need to have
    Zeitb = '3'

  • How to get min date of every month for six months?

    Hi, i have data like this.
    Process_date SEQ_No
    16-MAR-13     733
    09-MAR-13     732
    02-MAR-13     731
    24-FEB-13     730
    16-FEB-13     728
    09-FEB-13     727
    02-FEB-13     726
    26-JAN-13     725
    21-JAN-13     724
    12-JAN-13     723
    05-JAN-13     722
    29-DEC-12     721
    24-DEC-12     720
    15-DEC-12     719
    08-DEC-12     718
    03-DEC-12     717
    22-NOV-12     716
    17-NOV-12     715
    10-NOV-12     714
    03-NOV-12     713
    29-OCT-12     712
    23-OCT-12     711
    13-OCT-12     710
    05-OCT-12     709
    28-SEP-12     708
    22-SEP-12     707
    15-SEP-12     706
    08-SEP-12     705
    01-SEP-12     704
    everymonth admin will refresh actual data table and automatically this above table will update with unique seq_no and process_date.
    I need to extarct min date of everymonth(First refresh of last 6 months - excluding currrent month) and also seq_no related to that month so using joins(using seq_no - that is available in main table) i can combine actual data.
    I need result like:
    02-MAR-13     731 ( I don't need MAR as it should not take current month data)
    so i need final result like below:
    02-FEB-13     726
    05-JAN-13     722
    08-DEC-12     718
    03-NOV-12     713
    05-OCT-12     709
    01-SEP-12     704

    995263 wrote:
    Hi, i have data like this.
    Process_date SEQ_No
    16-MAR-13     733
    09-MAR-13     732
    02-MAR-13     731
    24-FEB-13     730
    16-FEB-13     728
    09-FEB-13     727
    02-FEB-13     726
    26-JAN-13     725
    21-JAN-13     724
    12-JAN-13     723
    05-JAN-13     722
    29-DEC-12     721
    24-DEC-12     720
    15-DEC-12     719
    08-DEC-12     718
    03-DEC-12     717
    22-NOV-12     716
    17-NOV-12     715
    10-NOV-12     714
    03-NOV-12     713
    29-OCT-12     712
    23-OCT-12     711
    13-OCT-12     710
    05-OCT-12     709
    28-SEP-12     708
    22-SEP-12     707
    15-SEP-12     706
    08-SEP-12     705
    01-SEP-12     704
    everymonth admin will refresh actual data table and automatically this above table will update with unique seq_no and process_date.
    I need to extarct min date of everymonth(First refresh of last 6 months - excluding currrent month) and also seq_no related to that month so using joins(using seq_no - that is available in main table) i can combine actual data.
    I need result like:
    02-MAR-13     731 ( I don't need MAR as it should not take current month data)
    so i need final result like below:
    02-FEB-13     726
    05-JAN-13     722
    *08-DEC-12     718 (why??? if we have 03-DEC-12     717)*
    03-NOV-12     713
    05-OCT-12     709
    01-SEP-12     704i think you want something like this:
    WITH T(d,s) AS
    select to_date('16-MAR-13','dd-MON-yy'),733 from dual union all
    select to_date('09-MAR-13','dd-MON-yy'),732 from dual union all
    select to_date('02-MAR-13','dd-MON-yy'),731 from dual union all
    select to_date('24-FEB-13','dd-MON-yy'),730 from dual union all
    select to_date('16-FEB-13','dd-MON-yy'),728 from dual union all
    select to_date('09-FEB-13','dd-MON-yy'),727 from dual union all
    select to_date('02-FEB-13','dd-MON-yy'),726 from dual union all
    select to_date('26-JAN-13','dd-MON-yy'),725 from dual union all
    select to_date('21-JAN-13','dd-MON-yy'),724 from dual union all
    select to_date('12-JAN-13','dd-MON-yy'),723 from dual union all
    select to_date('05-JAN-13','dd-MON-yy'),722 from dual union all
    select to_date('29-DEC-12','dd-MON-yy'),721 from dual union all
    select to_date('24-DEC-12','dd-MON-yy'),720 from dual union all
    select to_date('15-DEC-12','dd-MON-yy'),719 from dual union all
    select to_date('08-DEC-12','dd-MON-yy'),718 from dual union all
    select to_date('03-DEC-12','dd-MON-yy'),717 from dual union all
    select to_date('22-NOV-12','dd-MON-yy'),716 from dual union all
    select to_date('17-NOV-12','dd-MON-yy'),715 from dual union all
    select to_date('10-NOV-12','dd-MON-yy'),714 from dual union all
    select to_date('03-NOV-12','dd-MON-yy'),713 from dual union all
    select to_date('29-OCT-12','dd-MON-yy'),712 from dual union all
    select to_date('23-OCT-12','dd-MON-yy'),711 from dual union all
    select to_date('13-OCT-12','dd-MON-yy'),710 from dual union all
    select to_date('05-OCT-12','dd-MON-yy'),709 from dual union all
    select to_date('28-SEP-12','dd-MON-yy'),708 from dual union all
    select to_date('22-SEP-12','dd-MON-yy'),707 from dual union all
    select to_date('15-SEP-12','dd-MON-yy'),706 from dual union all
    select to_date('08-SEP-12','dd-MON-yy'),705 from dual union all
    select to_date('01-SEP-12','dd-MON-yy'),704 from dual
    SELECT MIN(D),
           MIN(S) KEEP(DENSE_RANK FIRST ORDER BY D)
      FROM (SELECT D,
                   S,
                   TO_CHAR(D, 'mm') M,
                   TO_CHAR(D, 'yy') Y,
                   DENSE_RANK() OVER(ORDER BY TO_CHAR(D, 'yy') || TO_CHAR(D, 'mm') DESC) RN
              FROM T)
    WHERE RN BETWEEN 2 AND 7
    GROUP BY M, Y
    ORDER BY 1 DESC

  • Block payroll data from cost center for all users except HR team

    Hello Expect,
    Could any body please advise me  how can I restrict some HR data  in cost center view from FICO,CRM,SRM and other team,
    Now when other team see cost centers it display all data booked there but my client want to restrict some HR data from them
    In my project there are 151 roles that can display cost center dat including HR data,
    Now my requirment is how can I restrict only HR data belongs to a cost center
    I mean to say they should be able to see all cost center data exept a cost center containing HR data.
    Please advise how to get solution
    Thanks and Regards

    Hi,
    in  T.code PFCG do to the role of the appropriate usr to whom u want restrict cost center.
    Hope this helps.
    Reagrds
    S.Ravi

  • SBIW: Assigment of Payroll Data to BW

    Hi BW experts,
    I need the steps to go to "Assigment of Payroll Data to BW" in R3 server.
    I've gone only up to Human Resources, not able to find the Assignment of Payroll data to BW.
    my steps: tcode sbiw>Settings for Application-Specific DataSources>Human Resources
    pls help. thanks.
    cheers.

    Hi Srikanth,
    in Assignment of payroll data to BW Month, after giving country grouping, what type of period assignment should be given. in R/3 dev side when i have chosen
    1.End of For period, extracted 972 records
    2. End of In period, extracted 1023 records
    3. Payment date of For period, extracted 972 records(just the same as in the first option)
    4.Payment date of In period, extracted 0 records
    Do u know more about these options??? one more thing to clarify on this. While doing payroll data extraction, do we have consider or say give "Define time frame for transfer", if that is compulsory then i have done that by givigng
    Earliest date as 01.01.2005
    Latest date as 31.12.2005
    but in the info package selection i have given to extract 01.01.2005 to 28.02.2006 and it has extracted successfully even 2006 records which means that though we define time frame, extraction is independent of this time frame, am i correct???
    if i am correct then why do we have go for define time frame for data transfer when it is no where acting??
    Please repond as soon as possible, points will be assigned.

  • Last date of the month

    Hi All,
    Can anyone tell me the logic to get the last date of the month for vbrk-fkdat. The date format is dd/mm/yyyy. i need the output on the same format.
    for ex: if vbrk-fkdat = 17/12/2007 the output should be 31/12/2007.
    Thanks,
    Madhu

    actually the FM only takes date like sy-datum. but my variable is
    i had made the changes like -
    data: gv_date(10) TYPE c,
            gv_date1(10) TYPE c.
    CONCATENATE wa_vbrk-fkdat6(2) wa_vbrk-fkdat4(2) wa_vbrk-fkdat+0(4) INTO gv_date SEPARATED BY '/'.
      REPLACE ALL OCCURRENCES OF '/' IN gv_date WITH '.'.
          CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
            EXPORTING
              day_in            = gv_date
            IMPORTING
              last_day_of_month = gv_date1.
    REPLACE ALL OCCURRENCES OF '.' IN gv_date1 WITH '/'.
    but its showing the error as the variable declaration is different as it is in FM, i.e FM contains date type sy-datum.
    please reply ASAP.
    Thanks,
    madhu

  • Last date of a month

    Dear ALL,
    How to find out the last date of a month for a paticular date field.
    Regards,
    Nikhil.

    Hi,
    sample code for calculating ..last day of month
    zdate like sy-datum.
    zl_date like sy-datum.
    WHEN 'Var1'. ' month variable for last date of month
    IF I_STEP = 2.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'Var0'. 'current date or any date of month
    CLEAR L_S_RANGE.
    IF sy-subrc eq 0.
    zdate = LOC_VAR_RANGE-low.
    CALL FUNCTION SLS_MISC_GET_LAST_DAY_OF_MONTH.
          EXPORTING
                DAY_IN  = zdate
          IMPORTING
                LAST_DAY_OF_MONTH = zl_date
          EXCEPTIONS
                  DAY_IN_NOT_VALID.
    if sy-subrc eq 0.
    L_S_RANGE-LOW = zl_date.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    endif.
    ENDLOOP.
    i hope you have how to document for creating Customer exit variable. if not post your mail id.
    Regards,
    San!
    Message was edited by: San!

  • ABAP code to derive last date of the month from month input.

    Hi ,
    how to derive the last date of of month for the for user exit variable
    Hussain Reddy

    Hi,
    See the following code.. .
    WHEN 'ZLDAY'.    " Customer Exit variable on 0CALDAY
      IF i_step = 2.
         data: fd type sy-datum,
               ld type sy-datum.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDAY'.   " User entry date on 0CALDAY
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              fd =  loc_var_range-low.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
                  EXPORTING
                    day_in                  = fd
                 IMPORTING
                   last_day_of_month       = 
    *             EXCEPTIONS
    *               DAY_IN_NOT_VALID        = 1
    *               OTHERS                  = 2
                IF sy-subrc <> 0.
    *             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                ENDIF.
             l_s_range-low = ld.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
                APPEND l_s_range TO e_t_range.
           ENDIF.
      ENDIF.
    Simple Program.
    Just copy past in SE38 and test and use the logic for your requiremet
    REPORT  ztest1.
    data: fd type sy-datum,
             ld type sy-datum.
          fd = sy-datum.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
            EXPORTING
              day_in                  = fd
           IMPORTING
             LAST_DAY_OF_MONTH       =  ld
    *       EXCEPTIONS
    *         DAY_IN_NOT_VALID        = 1
    *         OTHERS                  = 2
          IF sy-subrc <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    write:/ ld.
    further help on exitc you ca see the articles.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    Reddy
    Edited by: Surendra Reddy on Dec 15, 2009 11:38 AM

  • PCP - How to simulate upcoming months payroll data

    Hi,
    I'm try to get plan personnel cost for the year 2008 using the payroll data of 2007. We only have the Jan-Jul 2007 payroll data in the system. I used the program RPCIPE00 with "Cost planning data" checked and "Name of payroll program" as "HTRCALC0" with a variant. But it only works till Jul 2007 which is the latest calculated payroll date.
    Any help?
    Regards,

    Hello,
    Run a Payroll simulation for a future pay period with the Document type 'T' - Test Run and then select the Cost Planning checkbox using the program RPCIPE00. It stores the cost planning data in the PCL5 cluster tables. This data will them be used in the data collection for the forecasting.
    Thanks,
    Archie
    Note - Please let me know how your project is coming along

  • ALE error while posting payroll data

    Hi all,
    We are trying to set up payroll posting via ALE interface. We have done the following settings
    1. Distribution model setup with filters on for standard bapi's
    2. Partner profile setup
    3. RFC destination setup
    When we try to post payroll data,it was returned with the following errors
           RFC destination is not maintained for object BUS6001 and method PRECHECKPAYROLLACCOUNTASSIGN
           The account assignment objects could not be checked
           RFC destination is not maintained for object BUS6004 and method CHECK
           The G/L account could not be checked
    We verified RFC destination and it is working fine. I have searched all possible links in SCN, but unable to get the solution.
    Can someone help in this issue?

    Hi,
    Using tcode pc_payresult please check whether the off-cycle payroll is executed again in period 06-2010. If yes then try to post off-cycle payroll separately (PC00_M99_CIPE - Create Posting Run) by entering "Off-Cycle Payroll Run" parameters. May be you will get an error while posting this off-cycle payroll because this payroll is already posted. In this case you will have to reverse the existing off-cycle posting and then post off-cycle payroll again.
    Once off-cycle payroll is posted, then you try to post normal monthly payroll.
    I hope your problem will be solved by doing the above work out.
    Regards,
    Waqas Rashid

  • Payroll Data Extraction - 0HR_PY_1 and BIWMONTH

    Hi, I'm hoping someone can provide some clarification on an issue with a payroll data extractor please. I've searched the forums, and looked at the Business Content documentation, but I'm still not clear on one point.
    The extractor 0HR_PY_1 (Payroll data) has two selection fields in our version of the DataSource, and these are PERNR and BIWMONTH. It is the BIWMONTH parameter for which I am seeking clarification. Does this allow data to be extracted based upon the calendar month/year that the data was posted into SAP, or does it relate specifically to the calendar year/month of the actual payroll result data. So, if a retrospective payroll change is done in Oct 2010, to an April payroll result, will BIWMONTH contain 10.2010 or 04.2010?
    Any help on this would be greatly appreciated.
    Best wishes,
    Jeff.

    Month of the Posting date. in your example 10/2010

  • Count days in a month for a date range

    i am trying to find no. of days between 2 Date Ranges for a list of Ids. i used the logic in the below link:
    count days of the month
    My query is giving duplicates since, I have list of Ids.
    Doctor_ID     Patient_ID     ARRIVE_DT_TM     DISCH_DT_TM
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45
    763305     42972232     1/7/2013 20:27     3/15/2013 19:15
    25391509     42972298     2/4/2013 22:45     3/8/2013 22:03
    746779     42972331     1/4/2013 23:00     3/26/2013 21:50
    763305     42972338     3/4/2013 22:19     3/6/2013 19:35
    763305     42972411     11/4/2013 22:32     3/29/2013 17:30
    I am looking for query to give me for Patient_ID = 42972229
    MONTH     COUNT_DAYS
    201210     14
    201211     30
    201212     31
    201301     31
    201302     28
    201303     14
    I am running the following code and it loops through the months and gives duplicates when I remove where Patient_id IN (42972229)
    select
    Doctor_ID
    , Patient_ID
    , AR_DTTM
    , DSC_DTTM
    , TO_CHAR(ADD_MONTHS(TRUNC(date1, 'MONTH'), LEVEL - 1), 'YYYY MM') MONTHS_BET
    , (LEAST(date2, ADD_MONTHS(TRUNC(date1, 'MONTH') - 1, LEVEL)) - GREATEST(date1, ADD_MONTHS(TRUNC(date1, 'MONTH'), LEVEL - 1)))+ 1 AS DAYSCOUNT
    from (select
    Doctor_ID
    , Patient_ID
    , ARRIVE_DT_TM AR_DTTM
    , DISCH_DT_TM DSC_DTTM
    ,TRUNC(ARRIVE_DT_TM,'DDD') AS date1
    ,TRUNC(DISCH_DT_TM,'DDD') AS date2
    from temp where Patient_id IN (42972229)
    CONNECT BY LEVEL <= MONTHS_BETWEEN(TRUNC(date2, 'MONTH'), TRUNC(date1, 'MONTH')) + 1
    Please help!

    Hi,
    ASTRA_007 wrote:
    Results I would like to see are:
    Doctor_ID     Patient_ID     ARRIVE_DT_TM     DISCH_DT_TM     Month     CountofDays
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2012 10     14
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2012 11     30
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2012 12     31
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2013 01     31
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2013 02     28
    755722     42972229     10/18/2012 7:50     3/14/2013 20:45     2013 03     14
    763305     42972232     1/7/2013 20:27     3/15/2013 19:15     2013 01     25
    763305     42972232     1/7/2013 20:27     3/15/2013 19:15     2013 02     28
    763305     42972232     1/7/2013 20:27     3/15/2013 19:15     2013 03     15
    and so on...So each row represents a patient-month, and you want to display several columns from the temp table on each output row. In that case, include all those columns in both the SELECT and GROUP BY clauses, like this:
    WITH     universe     AS
         SELECT     *
         FROM     temp
    --     WHERE     patient_id     IN (42972229)
    ,     date_range     AS
         SELECT     TRUNC (MIN (arrive_dt_tm))     AS first_date
         ,     TRUNC (MAX (disch_dt_tm))     AS last_date
         FROM     universe
    ,     all_dates     AS
         SELECT     first_date + LEVEL - 1     AS a_date
         FROM     date_range
         CONNECT BY     LEVEL     <= (last_date + 1) - first_date
    SELECT    u.doctor_id
    ,       u.patient_id
    ,       u.arrive_dt_tm
    ,       u.disch_dt_tm
    ,       TO_CHAR ( TRUNC (a.a_date, 'MONTH')
                  , 'YYYY MM'
                )          AS month
    ,       COUNT (*)          AS count_days
    FROM       all_dates  a
    JOIN       universe   u  ON  a.a_date  BETWEEN  TRUNC (u.arrive_dt_tm)
                                         AND      u.disch_dt_tm
    GROUP BY  u.doctor_id
    ,       u.patient_id
    ,       u.arrive_dt_tm
    ,       u.disch_dt_tm
    ,         TRUNC (a.a_date, 'MONTH')
    ORDER BY  u.patient_id
    ,       TRUNC (a.a_date, 'MONTH')
    ;Output from your sample data (with no filtering):
    `DOCTOR_ID PATIENT_ID ARRIVE_DT_TM     DISCH_DT_TM      MONTH   COUNT_DAYS
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2012 10         14
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2012 11         30
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2012 12         31
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2013 01         31
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2013 02         28
        755722   42972229 10/18/2012 7:50  3/14/2013 20:45  2013 03         14
        763305   42972232 1/7/2013 20:27   3/15/2013 19:15  2013 01         25
        763305   42972232 1/7/2013 20:27   3/15/2013 19:15  2013 02         28
        763305   42972232 1/7/2013 20:27   3/15/2013 19:15  2013 03         15
      25391509   42972298 2/4/2013 22:45   3/8/2013 22:3    2013 02         25
      25391509   42972298 2/4/2013 22:45   3/8/2013 22:3    2013 03          8
        746779   42972331 1/4/2013 23:0    3/26/2013 21:50  2013 01         28
        746779   42972331 1/4/2013 23:0    3/26/2013 21:50  2013 02         28
        746779   42972331 1/4/2013 23:0    3/26/2013 21:50  2013 03         26
        763305   42972338 3/4/2013 22:19   3/6/2013 19:35   2013 03          3
    In the end the objective is to count the no. of days in each month between the arrival and discharge dates by Physician and for his/her patients.Then is the output above really what you want? Say you're interested in physician 763305. That physician had 18-patient days in March, 2013, but the output doesn't make it clear.
    I ran your query, it works great but I have a long list of patients for whom I have to run these counts.the query above includes all patient_ids.
    That's a separate problem, to be solved in the first sub-query, universe. The rest of the query will be unchanged.
    How will you know which patients to include? If you can derive the list from temp itself, just use a WHERE clause in universe. If you need to look at other tables, join them in universe, or use them in sub-queries in universe, or both.
    For exmple, if you decide that the list of patient_ids has no pattern, and that you'll need to store their ids in a separate table (perhaps a global temporary table), then universe might be:
    WITH     universe     AS
         SELECT     t.*     -- or list columns needed
         FROM     temp                        t
         JOIN     patient_ids_to_include  p 
                      ON  p.patient_id = t.patient_id
    ) ...The rest of the query can be the same as above.
    If a same patient is admitted again then Patient_ID will be different no matter when readmitted.Are you saying that patient_id identifies a visit, not a patient, and that the same person is assigned a different patient_id every time that person is admitted?
    For
    INSERT INTO temp (doctor_id, patient_id, arrive_dt_tm, disch_dt_tm)
    VALUES ( 755722
    , 42972229
    , TO_DATE ('03/14/2013 23:00', 'MM/DD/YYYY HH24:MI')
    , TO_DATE ('04/01/2013 12:00', 'MM/DD/YYYY HH24:MI')
    First the Patient ID will be different from the earlier admission. Second the results will show like:
    Doctor_ID     Patient_ID     ARRIVE_DT_TM     DISCH_DT_TM     Month     CountofDays
    755722     42972229     3/14/2013 23:00     4/1/2013 12:00     2012 03     14
    755722     42972229     3/14/2013 23:00     4/1/2013 12:00     2012 04     1Are you saying that temp.patient_id is unique, and so the situation is impossible?
    Edited by: Frank Kulash on May 7, 2013 10:23 AM

  • Terms of Payment to determine due date as last date of the month

    Hi Experts,
    Does any one know how to configure a Terms of Payment to determine due date as last date of the month ?
    I tried by puting fixed date as 31 in the Terms of Payment in FI but when I am creating in FI-CA it gives me an error "_Term of payment Z003 is inconsistent/not planned_"
    Please advice.
    Thanks & Regards
    Satyajeet

    Hi Satyajeet,
    It seems the settings that you have maintained in FI are correct.
    When you are assigning the payment terms in FI-CA, you need to assign a factory calendar as well to the payment terms in the following config-
    IMG->Financial Accounting ->Contract Accounts Receivable and Payable->Postings and Documents->Document->Maintain Payment Terms
    If you have already assigned the factory calendar and still the problem persists, can you give the message ID and the message number of the error that you are getting?
    Thanks,
    Amlan

Maybe you are looking for

  • How to change the posting date in UD stock posting for a HU managed item?

    Hi, We are using Handling Unit managed items with QM activation. For a specific HU managed material, we wanted to post the stock on a previous date. We have created PO on a back date and made GR also on a back date. Now the problem is, the system has

  • Unable to access my other macs in the airport network

    Since I have installed Leopard 10.5.1 I am unable to access my other MACs in my airpot network for file sharing. Interesting that I can accesss my older IMAC which has TIGER 10.4.11 installed. This bug is new since I updated to 10.5.1. Its funny but

  • Asignment of  New  Characteristics via Categories in CCM 2.0

    Hi guys, Im using 5 new characterisitics in a Vendor catalog. Z_COMPANY       /CCM/ID Z_DOC_TYPE      /CCM/ID Z_DATE               DATE Z_SUPPLIER_ID   /CCM/ID Z_MARCA            /CCM/DESCRIPTION I managed to upload these new characteristicas in the

  • Oracle Web Service Manager Login failed

    Hi , I had installed advance version of SOA 10.1.3.1 on windows xp. I abel to login to all component other than web service manager.I am using the oc4jadmin user id and its password to login.Please let me know what i have to do to fix it. Regards, Pa

  • Error 90% of the time trying to play a movie

    I get the following error almost every time I try to play a quicktime movie and it forces me not only to close the quicktime window, but also all my open browser windows as well. AppName: iexplore.exe AppVer: 6.0.2900.2180 ModName: quicktimeessential