Help Required for date display & mutating trigger

Hai all..
I need clarification for 2 problems.
Problem 1
Is there a possibility to display the values with a date range.
I mean if there is no data for a particular date within the given range. it should display some null value.
Eg.
table name : sample
Sno Date1 Name desgn
1 1-may-2004 xyz engr
1 3-may-2004 xyz engr-1
1 4-may-2004 xyz engr-2
The query is
select * from sample where date1 between '01-may-2004' and '04-may-2004'.
The result of query will be
Sno Date1 Name desgn
1 1-may-2004 xyz engr
1 3-may-2004 xyz engr-1
1 4-may-2004 xyz engr-2
But i need the result to be displayed as
Sno Date1 Name desgn
1 1-may-2004 xyz engr
nil 2-may-2004 nil nil
1 3-may-2004 xyz engr-1
1 4-may-2004 xyz engr-2
Pls let me know how to achieve this.
Problem 2:
While i am updating a value using a trigger.
I am getting "mutating" error.
Is there a possibility to avoid the mutation.
The two triggers i am using is
Trigger 1
CREATE OR REPLACE TRIGGER TRIG_DURATION_UPDATED
AFTER UPDATE ON
TIMESHEET_DATA
FOR EACH ROW
DECLARE
ID_COUNT DATE;
A date;
NN NUMBER;
AA NUMBER;
NN1 NUMBER;
BEGIN
b_dur :=0;
IF UPDATING('PROGRESS') THEN
SELECT COUNT(1) INTO AA FROM TIMESHEET_DATA_PAUSE WHERE DATA_sNO = :OLD.DATA_SNO AND EMP_ID = :OLD.EMP_ID AND
ACNUM = :OLD.ACNUM AND DURATION IS NULL;
IF AA > 0 THEN
SELECT to_date(START_TIME,'DD-MON-YYYY HH:MI AM') into a FROM TIMESHEET_dATA_PAUSE WHERE
EMP_ID = :NEW.EMP_ID AND ACNUM = :new.acnum AND DATA_SNO = :new.data_sno AND pause_TIME IS NULL
AND DURATION IS NULL;
select to_date(sysdate,'DD-MON-YYYY HH:MI AM') into id_count from dual;
SELECT A - ID_COUNT INTO NN FROM DUAL;
SELECT round(TRUNC(NN*24),2) INTO NN1 FROM DUAL;
UPDATE TIMESHEET_dATA_PAUSE SET DURATION = NN1,PAUSE_TIME = SYSDATE WHERE
EMP_ID = :NEW.EMP_ID AND ACNUM = :new.acnum
AND DATA_SNO = :new.data_sno AND pause_TIME IS NULL AND DURATION IS NULL;
END IF;
END IF;
END;
Trigger 2
CREATE OR REPLACE TRIGGER TRIG_DURATION_UPDATED_PAUSE
AFTER UPDATE ON
TIMESHEET_DATA_PAUSE
FOR EACH ROW
DECLARE
ID_COUNT DATE;
A_COUNT NUMBER(10);
A date;
NN NUMBER;
AA NUMBER;
NN1 NUMBER(10,2);
BEGIN
IF UPDATING('DURATION') THEN
SELECT COUNT(1) INTO A_COUNT FROM TIMESHEET_DATA WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID
AND ACNUM = 'ACNUM' AND DURATION IS NULL;
IF A_COUNT >0 THEN
SELECT NVL(SUM(DURATION),0) INTO NN1 FROM TIMESHEET_DATA_PAUSE WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID AND ACNUM = :NEW.ACNUM;
UPDATE TIMESHEET_DATA SET DURATION = NN1 WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID AND ACNUM = :NEW.ACNUM AND DURATION IS NULL;
END IF;
END IF;
EXCEPTION WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE ('CANNOT INSERT');
END;
Pls let me know the solutions for the two..
Thanks in Advance
Gaya3

In future please start two threads when you have two questions to ask. Othewise it makes things difficult to follow and may well lead to some of your questions not getting an answer. Unlike some other sites there is no limit to the number of posts we can have :)
To answer your first question:
If you have Oracle9i you can do this using a PIPELINED function to act as a pivot table (in earlier versions you will have to have a table of some description - ALL_OBJECTS will do in a pinch).
CREATE OR REPLACE TYPE t_dates AS TABLE OF DATE
CREATE OR REPLACE FUNCTION f_dates
  (st IN DATE, cnt IN INTEGER) RETURN t_dates
  PIPELINED
AS
  dd date;
BEGIN
  FOR a IN 1..cnt LOOP
    SELECT  st + (a-1)
      INTO  dd
      FROM  dual;
    PIPE ROW (dd);
  END LOOP;
  RETURN;
END f_dates;
/So, given this data...
SQL> select * from t57
  2  /
      COL1 COL2
         3 05-MAY-04
         4 06-MAY-04
         5 07-MAY-04
         6 12-MAY-04
         8 15-MAY-04
5 rows selected.
SQL>...we can run this query...
SQL> SELECT nvl(to_char(t.col1), 'Nil'), dd.ndate
  2  FROM   t57 t
  3         , ( select column_value AS ndate from table(cast(f_dates(trunc(SYSDATE), 11) AS t_dates))) dd
  4  WHERE trunc(dd.ndate) = trunc(t.col2(+))
  5  /
NVL(TO_CHAR(T.COL1),'NIL')               NDATE
3                                        05-MAY-04
4                                        06-MAY-04
5                                        07-MAY-04
Nil                                      08-MAY-04
Nil                                      09-MAY-04
Nil                                      10-MAY-04
Nil                                      11-MAY-04
6                                        12-MAY-04
Nil                                      13-MAY-04
Nil                                      14-MAY-04
8                                        15-MAY-04
11 rows selected.
SQL> Obviously, you will want to tidy up the function to suit your needs.
Cheers, APC

Similar Messages

  • Dump in Value-Help Component for date

    I created a Value-Help-Component for date fields. (I cannot use the standard value help, because I need the help to start in the month, the user is working on).
    I am using the Date Navigator to select a date.
    If I first change the month with an arrow of the date navigator and then select a date I get a dump in the method IF_WD_CONTEXT_ELEMENT~GET_ATTRIBUTE_REF in line
        attr_info = me->node_info->if_wd_context_node_info~get_attribute( name_only ).
    , because the element does not have a node_info.
    If I just choose a date in the preselected month (without using the arrows of the date navigator) everything is fine.
    Does anybody have an idea??
    Many thanks in advance.

    I found the "solution" to the problem myself.
    I used the method bind_structure in the component containing the date navigator.
    After I replaced it by set_static_attributes it worked without producing dumps.
    Very strange!

  • Help - formula for date automatically displayed as per given frequency period

    Details of report received date and delayed no of days  in submission
    S/No
    Details of Report
    Frequency
    Date as per Frequency (Target Date)
    Received up to as on
    lapse of days
    Fin per Day
    Fine Amount
    24.07.2014
    (Rs.)
    1
    Cash book
    Daily
    24.07.2014
    30.06.2014
    24
    10
    240
    2
    DSR
    Previous Day
    23.07.2014
    31.05.2014
    53
    10
    530
    3
    Day book hard copy
    Thursday & Monday
    Formula Required latest date for Thursday or Monday and date with in cell E4
    10
    0
    4
    Asset stock
    Fortnight
    Formula Required latest date for 15 th day  or last date of month and date with in  cell E4
    10
    0
    5
    Labour approval 
    1st Day of Month
    Formula Required 1st day date of month with in cell E4
    10
    0
    6
    Qty as per drawing
    Every Quarter
    Formula Required last day date of quarter of the year with in cell E4
    10
    0
    Note: I want simply enter the date in  E4 and the formula calculated the date in column D 

    do you want to calculate the date format directly? see the sample:
     =DATEVALUE(TEXT(date,"d/m/yy"))
    KR

  • Mapping conversion help needed for date

    Hi Experts,
    I need help in message mapping convesion for date field
    The source date field can have value '2010-06-04T02:09:59.610-07:00' or 2010-06-04T02:09:60.610-07:00
    I have to change it to '2010-06-04T02:09:59.000-07:00'. ie, if the seconds are 59.XXX, or 60.XXX, then change to 59.000.
    Please let me know the best way to do this
    Thanks
    Mike

    Again, to make it more clear
    The source date field can have any date value such as
      2010-06-04T02:09:59.610-07:00 -
    This needs to be changed to 2010-06-04T02:09:59.000-07:00
      2010-06-04T02:09:60.610-07:00 -- This needs to be changed to 2010-06-04T02:09:59.000-07:00
    2010-06-04T02:09:60.000-07:00 -- This needs to be changed to 2010-06-04T02:09:59.000-07:00
    2010-06-04T02:09:59.000-07:00  - This need not be changed
    2010-06-04T02:09:58.610-07:00 -- This need not be changed
    2010-06-04T02:09:57.610-07:00  etc etc - These need not be changed.
    The only change using date function is for the first two dates, in which 59.XXX and 60.XXX need to be replaced with  59.000
    Using the above date function, all the seconds 59.XXX, 58.XXX, 60.XXX, etc etc,,, are converted to 59.000, 58.000 and 60.000
    I dont need this as per the requirement. So looks like the UDF needs to be altered a little to accomodate my requirement.
    Please help me.
    Thanks
    Mike

  • Help required for FI Extraction

    Hi All,
    Currently i am working in FI Extraction (0FI_GL_4). In ECC, Document Posting is done using the TCODE FB01. After posting the document, i have checked table BKPF and BSEG and found data is available. But i have checked in delta Queue (RSA7). But data is not available.
    I have already done INIT load and delta queue is created in RSA7.Can u pls help me why the data is not available in RSA7.
    I have checked the table BWOM2_TIMEST and found some enteries over there.
    DataSrce___Currnt Date__Time______Update Mode Time (GMT)___Time _______Last time stap int___Time_Zone_diff 0FI_AP_4_____19.08.2009__10:41:51____S__315.162.000.000__________6.194.681.990.000_______X__________________19800
    0FI_AR_4_____19.08.2009__11:41:09____F_____0__________________________0______________0__________________0
    0FI_GL_4_____18.08.2009__15:23:36____F_____0__________________________0______________0__________________0
    0FI_GL_4_____19.08.2009__10:17:56____S__315.162.000.000__________6.194.681.990.000_______X__________________19800
    I have already run delta for 0FI_GL_4. But in this table, the Update Mode is showing "S" instead of "D". Do i need to do settings for this.
    Can u pls help on this issue.
    Thanks,
    Jelina.

    Dear Diogo,
    Thanks a lot for ur replies.. Now i can able to get data in BW.
    Before extracting the data into BW, I have checked in RSA7 -> Display Queue. There is no entry displayed. But executing the delta load Info Package, i am getting data in BW.
    Can u pls help how the data flows into BW.
    I have checked for 0FI_AP_4 and 0FI_AR_4 data sources.After the document posting, immediately the entries are available in RSA7.
    But for 0FI_GL_4 datasource, i dont find any entry in RSA7.
    Pls help on this ..
    Thanks,
    Jelina.

  • Variable Required For Date Difference In Ac Create Date

    Respected All;
    I am stuck in a variable for couple of weeks.
    Please help me to get the difference in dates coming under the Ac Create Date Column for respective Request Id's.
    I want the result in the Delay Column (Variable Required for the result of delay).
    For eg:-
    A
    B
    C
    D
    E
    F
    G
    Request Id
    Ac Create Date
    Act Role Proper Name
    Delay Simplified(Variable Required
    Result In Delay
    Act Activity Name
    1
    000000000560492
    7/9/2014
    Debt Recovery - Archive
    =Ac Create Date C2 - Ac Create Date C1
    5
    Resolved
    2
    7/14/2014
    Call Centre - Back Office
    =Ac Create Date C3 - Ac Create Date C2
    1
    Forward
    3
    7/15/2014
    OWN Shop - AL Rayyan
    =Ac Create Date C4 - Ac Create Date C3
    7
    Resolved
    4
    7/22/2014
    Call Centre - Back Office
    = Ac Create Date C5 - Ac Create Date C4
    0
    Customer Feedback
    5
    7/22/2014
    Call Centre - Back Office
    "NA"
    NA
    Closed FC
    6
    000000000561010
    7/1/2014
    Call Centre - Back Office
    =Ac Create Date C7 - Ac Create Date C6
    1
    Forward
    7
    7/2/2014
    FOLLOW UP TEAM
    =Ac Create Date C8 - Ac Create Date C7
    0
    Resolved
    8
    7/2/2014
    Call Centre - Back Office
    =Ac Create Date C9 - Ac Create Date C8
    1
    Forward
    9
    7/3/2014
    R_RO
    =Ac Create Date C10 - Ac Create Date C9
    12
    Return - Wrong Assignment
    10
    7/15/2014
    Call Centre - Back Office
    =Ac Create Date C11 - Ac Create Date C10
    1
    Forward
    11
    7/16/2014
    IT CRM & Provisioning
    =Ac Create Date C12 - Ac Create Date C11
    0
    Reassignment
    12
    7/16/2014
    IT CRM & Provisioning
    =Ac Create Date C13 - Ac Create Date C12
    1
    Follow Up
    13
    7/17/2014
    IT CRM & Provisioning
    =Ac Create Date C14 - Ac Create Date C13
    0
    Reassignment
    14
    7/17/2014
    IT_Comptel
    =Ac Create Date C15 - Ac Create Date C14
    3
    Resolved
    15
    7/20/2014
    Call Centre - Back Office
    =Ac Create Date C16 - Ac Create Date C15
    0
    Recategorization
    16
    7/20/2014
    Fiber Call Center-Back Office
    =Ac Create Date C17 - Ac Create Date C16
    0
    Forward
    17
    7/20/2014
    IT CRM & Provisioning
    =Ac Create Date C18 - Ac Create Date C17
    1
    Resolved
    18
    7/21/2014
    Fiber Call Center-Back Office
    =Ac Create Date C19 - Ac Create Date C18
    0
    Resolved
    19
    7/21/2014
    Fiber Call Center-Back Office
    =Ac Create Date C20 - Ac Create Date C19
    0
    Customer Feedback
    20
    7/21/2014
    Fiber Call Center-Back Office
    "NA"
    NA
    Closed
    I have used Delay =DaysBetween([Ac Create Date];Previous([Ac Create Date]))
    but however I'm not getting the results required..
    Can someone please help me out with the variable.. For better understanding of the question kindly copy paste the table in excel and check it out, but please please help me out !!!
    Thanks In Advance

    Hi Fahad,
    Try Below-
    Create variable-
    V_NextDate=If RelativeValue([Request Id];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1)=[Request Id] Then ToDate((RelativeValue([Ac Create Date];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1));"MM/dd/yyyy")
    In Delays column put below
    =If IsNull(DaysBetween([Ac Create Date];[V_NextDate])) Then "NA" Else DaysBetween([Ac Create Date];[V_NextDate])
    See sceenshot

  • PCUI 4.0, Search Help Required for New field

    Hi everyone
    I am working in CRM 4.0 Sales Order application
    We created a new field in CRM sales Order in Header level in SAP GUI through EEWB.
    The search help for the new field is working fine in SAP GUI. We want to add the same field with F4 help functionaliity in PCUI as well.
    The field has been added in structure CRMT_BSP_SLS_OD1_General. It also shows domain value for the field however Origin of input field ie empty
    The field has been added in PCUI and is successfully showing data inputted in SAPGUI
    However we need search help functionality for the field
    i tried these two steps
    1) i checked on domain value checkbox and changed the field from input to dropdown. However the dropdown is empty in PCUI. Whenever i check box domain values for some field then all the possible values in SPA GUI are displayed in PCUI, however this is not working here.
    2) I put Value_table in F4 of the field
    This is also throwing up empty values
    Am i missing something in this case
    Please let me know how to go about it
    TIA
    Asad

    Hi Frederic
    Thanks for your response
    I am not sure what is meant by regenerating the field group in this case
    I added the entries for my view in the field group and generated the layout of the field group (If this is what you mean)
    The field is working fine. I am able to save values to the field and able to see values saved in GUI.
    I haven't linked search help of the field in PCUI
    I am not sure how to go about it.
    I used the data element in the structure for the field.
    The data element has Domain entry in <b>Entry Help/Check</b> of the structure
    If i check the Domain Value checkbox in my field group then the domain values should be available in dropdown if the field is dropdown
    However i am not able to see the possible values of the field (It is present in SAP GUI)
    Does something else needs to be done in this case
    TIA
    Asad

  • Help required for unicode compatibilty

    Dear All,
    We are in a process of analyzing the impact of unicode compatibility for our environment.
    Following is our scenario:
    - ECC6.0 is non unicode systsem
    - Need to buid unicode CRM 7, SCM 7, PI 7.1 and BI7
    - Need to integrate the above systems to non unicode ECC system.
    Our questions are :
    1. Is there any performance consideration when using communication between an Unicode and non-Unicode system?
       Is Unicode - Unicode faster than Unicode - non-Unicode communication performance wise?
    2. Do we face any  technical or functinal problems while trying to integrate
       unicode BI/ NW Java Stack  to non unicode systems.
    3. Do we need to review our sizing estimations due to unicode implemenation?
    5. what will be the storage consumption increase for unicode systems compared to non unicode?
    It would be greatly helpful for me if you can clarify these doubts.
    Thanks and Regards

    Hi,
    1. I think no one has really measured this. I expect a slightly higher requirement for Unicode <--> Non-Unicode interfaces.
    2. Please have a look at SAP Notes 838402, 73606, 975768 and 1358929 for restrictions in Non-Unicode systems. SAP highly recommends to go for Unicode in the whole landscape.
    3. and 5.  If you use the SAP quicksizer (http://service.sap.com/quicksizing), then Unicode is integrated.
    " Please note that the Quick Sizer results include Unicode requirements. For more
    information on additional requirements caused by Unicode, see
    http://service.sap.com/unicode -> Unicode Media Library -> Unicode information on
    specific topics: SAP Business Suite Unicode Hardware Requirements"
    Best regards,
    Nils Buerckel
    SAP AG

  • OEM Capacity Planner - location of help definitions for data items

    Does anyone know the location of the help definitions for the OEM Capacity Planner data items? In the GUI, these definitions are accessible individually from Help > Selected Item. The definition provides a description, source, and user action.
    I would like to consolidate these into a glossary for our users of OEM C.P., as well as in a planning document.

    perhaps that information can be here:
    Enterprise Manager Administrator's Guide Contents / Search / Index / PDF
    Enterprise Manager Concepts Guide Contents / Search / Index / PDF
    Enterprise Manager Configuration Guide Contents / Search / Index / PDF
    Enterprise Manager Event Test Reference Manual Contents / Search / / PDF
    Enterprise Manager Messages Manual Contents / Search / Index / PDF
    http://otn.oracle.com/pls/db92/db92.docindex?remark=homepage
    Joel P�rez

  • Coding Required for Data Load...

    Hi All,
    I am stuck up in an issue where I know the logic but unable to write a code. I have the requirement as follows :-
    I have the records in Excel as given below:-
    Fiscal Year          2004
    Key                     004
    Capitalization       A
    Norm Debts         B=0.7*A
    Rate of Interest    C
    Repayment          D=B/10
    Op. Balance         D=B/10
    Cl. Balance          E = B-D
    Total Interest        G=E+F/2*C
    The above records are the data which I am loading first time and only one record. The cube shud be populated with the data till Closing Balance becomes zero.
    So my logic will be
    First record by excel and second onwards is :-
    Fiscal Year         2004 +1 (It shud add 1 to every record till closing balance becomes zero)
    Key                    004 (Constant till Closing balance becomes Zero)
    Capitalization      A (Constant till Closing balance becomes Zero)
    Norm Debts        B (Constant till Closing balance becomes Zero)
    Rate of Interest    C (Constant till Closing balance becomes Zero)
    Repayment         D (Constant till Closing balance becomes Zero)
    Opening Balance   (Closing Balance will become Opening Balance here) = B-D
    Closing Balance     (Closing balance will now again will be debited by repayment that is B-2D)
    Total interest        = (Opening Balance + Closing Balance)/ 2 * Rate of Interest
    So next record will be opening balance = B-2D and Closing Balance will be B-3D and the record shud be automatically fetched till Closing Balance becomes zero.
    Any help will be assigned with points.
    Thanks and Regards,
    Sangini Mathur.

    Hi Sangini,
    I think in ur case u have to LOOP aginst source_package
    in the start routine only then you can get ur requirement.
    Data: w_temp1 like source_package-cl.balance.
    while w_temp1 eq 0.
    Put all your calculations here
    endwhile.
    Hope it helps
    Bhaskar
    Edited by: shanthi bhaskar on Jun 3, 2008 2:34 PM

  • Seeburger help required for 810 and Dispatch Advice (IDOC type DESADV).

    Hi All,
    1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
    --- Seeburger Workbench
    --- Seeburger Mapping Designer (BIC)
    --- Seeburger Counter and Varaibles
    --- Seeburger AS2 Spoke
    --- Any other Seeburger Component setting required
    I have understand blog for 850 -- /people/rajeshkumar.pasupula/blog/2009/08/05/wanna-implement-seeburger-for-edi-find-the-booster
    2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
    3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
    Regards

    Hi Rickkk,
    1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
    --- Seeburger Workbench
    --- Seeburger Mapping Designer (BIC)
    --- Seeburger Counter and Varaibles
    --- Seeburger AS2 Spoke
    --- Any other Seeburger Component setting required
    For SEEBURGER workbench please go through this blog and navigate the enbebbed links furthur to know about Seeburger workbench too.
    /people/prateek.srivastava3/blog/2009/08/01/seeburger--part-1--the-basics
    2
    2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
    For 810 i think the procedure would be the same but themseeburger mapping program that validates the ANSX 810 would be different.As far as 997is concerned 997 is a functional acknowledgement.Its a genric format that is used to send acknowledgement for any EDI transaction set that has been sent.
    3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
      The logic will be based on the trading partner guidelines which will contain the description of all the semantic and syntactiic description about the segments ,its feilds.we need to consider the guidelines and target side specifications too while mapping.
    Thanks,
    Ram.

  • CAT2 - Help required for changing data

    The requirement I have is, if the data is entered for a particular activity type in CAT2, and if it exceeds the default hours alloted for that week, the extra hours need to be split into different activity types.
    Say, this is the data entered: (Max of 35 Hrs per week as per IT0007) (Click on the link below to see sample data!)
    [http://img32.picoodle.com/img/img32/5/12/21/f_datam_9dfadb2.jpg]
    (The value for Thu is 5 and not 6 in the initial entry.)
    The data has to remain exact until it reaches 35 hours and then the extra hours need to be split and entered in a different activity type. (BU is also counted as regular working hours and value for BU is to remain same)
    I tried using the user-exit CATS0002 but since the user exit gets only the value of a single cell at a time, I am not able to process the data for my requirement. and this user exit is triggered only for the cells where the value is changed... if the data is already entered and the user changes some cell, I don't get the whole data entered and hence, I can't modify the already existing data on the timesheet.
    Has anyone coded for a similar scenario? Your help will be really appreciated.
    P.S: I am working on ECC 6.0

    Hi Nazim,
    There is an user-exit for validating the whole time sheet (I think it is  nr. 6, but I am not sure), in this one you could check all the hours, but I am not sure if it will suffice for your requirement.
    Regards,
    Martin

  • Complex requirement for Date/Time Period related - Please help!!

    Hi,
    This is a complex requirement by my client.
    There is a Patients table with the patient's eligbility for the insurance, on monthly wise. I have to find the Inactive patients and also when they are Inactive in the past as well as as of now. 
    Few points about the table and logic:
    1.Data is from Jan 2012 and it is on monthly basis. For Eg: if he enrolls on Jan 2012 and he is active till last month(Jan 31,2015), then From Jan 2012 to Jan 2015, one record per each month is available.  ie total of 37 records for him. If he is Inactive
    for a period then that period record will  be missing.
    2.I need to consider from the day they enrolled to till Jan 31st,2015, to find out whether they are Inactive for any months between their enrolled date to till Jan 31st,2015.
    3. In the below image, PatientID 1000 - No issue with him. he enroled on Aug 2014 and has records till Jan 2015 - No issues. He will not be counted for Inacive members.
    4.patientID 1001 - He is active till now as he hsa records till Jan 2015. But he was Inactive from 2014-06-06 to till  2014-06-30. So,he has to be counted as 'less than 1 month Inactive member for 2014'
    5.PatientID 1002 - He is active till now as he haa records till Jan 2015. But he was Inactive from 2014-09-01 to till  2014-09-30. So,he has to be counted as ' 1 month Inactive member for 2014'
    6.PatientID 1003 - He was Inactive for 09th &10th months for 2014. and also he has record only till Dec 2014. So,he has to be counted as '2 month Inactive member for 2014' and '1 month Inactive for 2015'
    7.PatientID 1004 - He is active from jan 2012 to Apr 2012 only. So,he has to be counted as '8 month Inactive member for 2012','12 month Inactive member for 2013','12 month Inactive member for 2014'  and '1 month Inactive for 2015'
    Please help me to find this as this is very complex for me - Finally they want a table like the second image below
    In the table X=0 means Count of all Members who are NOT inactive ).
    Thanks much in advance for your valuable inputs!

    Create something like a calendar table with a column with dates from enough years that will cover your patient history. For example dates from Jan 1, 2012 to some future date like Dec 31, 2020. Then it will be an OUTER join with this calendar table and get
    DISTINCT months when the patient was inactive.
    The calendar table can have just Month and Year too instead of dates. But usually dates can be useful in many other scenarios too.
    An example -
    create table patient (id int, effective_date date, end_date date)
    create table calendar (id int identity, calendar_date date)
    insert into patient (id, effective_date, end_date) values
    (1000, '1/1/2014', '1/31/2014'), -- patient 1
    (1000, '2/1/2014', '2/28/2014'),
    (1000, '3/1/2014', '3/31/2014'),
    (1001, '1/1/2014', '1/31/2014') -- patient 2
    declare @date date = '1/1/2014'
    while @date <= '12/31/2014' -- 1 year
    begin
    insert into calendar (calendar_date)
    values(@date)
    set @date = DATEADD(dd, 1, @date)
    end
    select distinct p.id as patient, MONTH(c.calendar_date) AllMonths, YEAR(calendar_date) Allyears
    from patient as p right outer join calendar as c
    on c.calendar_date between p.effective_date and p.end_date
    ;with
    AllMonthYears as (select MONTH(calendar_date) Months, YEAR(calendar_date) Years from calendar)
    , AllPatients as (select distinct id as PatientId from patient)
    , AllPatientsWithMonthsYears as (select distinct * from AllMonthYears cross join AllPatients)
    select *
    from AllPatientsWithMonthsYears as apmy
    left outer join patient as p
    on apmy.Months = month(p.effective_date)
    and apmy.Years = year(p.effective_date)
    and apmy.PatientId = p.id
    order by apmy.PatientId, apmy.Years, apmy.Months

  • Help required for importing a repository data file in the B2B console

    I am trying to import a repository data file with the delivery-channel element
    and attributes as below.
    <delivery-channel
    name="GM_DC"
    syncReplyMode="none"
    nonrepudiation-of-origin="false"
    nonrepudiation-of-receipt="false"
    secure-transport="true"
    confidentiality="false"
    routing-proxy="false"
    document-exchange-name="GM_DE"
    transport-name="GM"/>
    I have modified the WLC.dtd present in the lib\dtd subdirectory of the WebLogic
    Integration installation directory to add the syncReplyMode attribute.
    When i import the xml file,i get the following error
    com.bea.b2b.B2BException: ERROR: Invalid document, file 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\B2B_COV_Export.xml'.
         at com.bea.b2b.bulkloader.BulkLoader.processDataFile(Unknown Source)
         at com.bea.b2b.bulkloader.BulkLoader.processDataFile(Unknown Source)
         at com.bea.b2b.bulkloader.BulkLoader.load(Unknown Source)
    Please advise,
    Aruna

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • Input help required for parameter on the selection screen

    hi all,
    i have created two parameters on the selection screen.
    1. deptno
    2.empname
    so my requirement is if i input any deptno then i should get all
    the empname corresponding to that deptno in the parameter empname
    ie for deptno 10 there should be f4 help for empname.
    here i am pasting my code plz check where i am doing wrong--
    *& Report  ZTEST10
    *& Developer
    *& Date:   &DATE
    REPORT  ZTEST10.
    tables: zemployee1.
    parameters: p_deptno like zemployee1-deptno,
                p_empnam like zemployee1-empname.
    Data: begin of itab occurs 0,
           deptno like zemployee1-deptno,
           empname like zemployee1-empname,
           empno like zemployee1-empno,
           end of itab.
    At selection-screen on value-request for p_empnam.
    select empname
            from zemployee1
            into corresponding fields of table itab
            where deptno = p_deptno.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
          DDIC_STRUCTURE         = ' '
            retfield               = 'empname'
          PVALKEY                = ' '
           DYNPPROG               = sy-repid
           DYNPNR                 = sy-dynnr
          DYNPROFIELD            = 'p_empnam'
          STEPL                  = 0
          WINDOW_TITLE           =
          VALUE                  = ' '
          VALUE_ORG              = 'C'
          MULTIPLE_CHOICE        = ' '
          DISPLAY                = ' '
          CALLBACK_PROGRAM       = ' '
          CALLBACK_FORM          = ' '
          MARK_TAB               =
        IMPORTING
          USER_RESET             =
          tables
            value_tab              = itab
          FIELD_TAB              =
          RETURN_TAB             =
          DYNPFLD_MAPPING        =
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 2
          OTHERS                 = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    I will award ur efforts.
    Thanks
    sanjeev

    Hi Sanjeev,
    If you input any deptno and you should get all the empname corresponding then first you need to use CALL FUNCTION 'DYNP_VALUES_READ'.
    EXPORTING
        DYNAME                         = sy-repid
        DYNUMB                         = sy-dynnr
      TRANSLATE_TO_UPPER             = ' '
       REQUEST                        = 'A'
      PERFORM_CONVERSION_EXITS       = ' '
      PERFORM_INPUT_CONVERSION       = ' '
      DETERMINE_LOOP_INDEX           = ' '
      TABLES
        DYNPFIELDS                     = gt_dynp
    declare: DATA : gt_dynp LIKE dynpread OCCURS 0.
    loop at gt_dynp into wt_dynp where fieldname = 'P_SUPRID-LOW'.
      lv_low = wt_dynp-fieldvalue.
      endloop.
    Then while selecting use this p_superid-low instead of p_deptno.
    Then :
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    After this funtion module:
    write:
      IF sy-subrc = 0.
        READ TABLE itab
    INDEX 1.
        'p_empnam' = return_tab-fieldval.
    Declare return_tab as:
        DATA: return_tab   LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    Thanks,
    Shweta
      ENDIF.

Maybe you are looking for

  • JSplitPane problem with JTextArea

    The following piece of code has the problem in it. When you resize the splitpane you won't be able to decrease the size because of the setLineWrap(true). I am also wondering why the button in the bottom moves (and how do I stop it from moving) when t

  • Dynamic JDBC Credentials

    Hi, I read this document http://otn.oracle.com/products/jdev/howtos/bc4j/howto_dynamic_jdbc.html and find that this decsribes solution of my needs. If I do everything exactly as it is described in this paper and as a forward page (from LoginForm.jsp)

  • ME22N - Refresh Delivery Date as a result of PO Transit Table Update?

    The SAP PO Transit Table is being updated to be more accurate. Weu2019ve been asked to develop a Winshuttle script to u2018refreshu2019 each affected open PO/Line to force an update of the POu2019s Delivery Date (the field is not directly accessible

  • Photoshop Elements 11 Photo Editor won't open, trial info keeps popping up

    Okay, I own Photoshop Elements 11 but the Photo Editor refuses to open. When I click it, a pop up shows up for the trial version of PSE 11 saying I should buy it. I already have the lisence for PSE11 so i don't know what the problem is. (Also Organiz

  • Setting for 5ghz n only - Possible?

    Using TIme Capsule. Settings right now of n 2.4 and 5ghz Name st under Wirelss options. I have no need for the 2.4 side any longer, but do not see the ability for just a setting of N 5Ghz only. Not possible? Thanks