Calculate Start and End date in Connect By -- When Hirerchy Changes

/* Formatted on 5/20/2013 9:53:00 AM (QP5 v5.115.810.9015) */
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
Hello , Can some one Please help me or Guide me in calculating Start and End dates for the below logic
I want to calculate the Manager Hirerchy for the given Agent.
Then Below Query is working fine and its giving me the desired results
But when there is a change in the Manager Hirerchy or Manager gets Promoted
Then i need to calculate the start date and end date.
CREATE TABLE PERSON_DTL
  SID                 VARCHAR2(10 BYTE),
  EMP_MGRS_ID         VARCHAR2(10 BYTE),
  START_EFFECTIVE_DT  DATE,
  END_EFFECTIVE_DT    DATE
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M100', 'M107', TO_DATE('05/20/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M101', 'M102', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('A100', 'M100', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M100', 'M101', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M107', 'M102', TO_DATE('05/20/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M102', 'M103', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M103', 'M104', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('A101', 'M105', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
   (SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
   ('M105', 'M106', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
SELECT   CONNECT_BY_ROOT (b.sid) agent_sid,
             TRIM (
                LEADING ',' FROM    SYS_CONNECT_BY_PATH (b.sid, ',')
                                 || ','
                                 || b.emp_mgrs_id
                PATH,
             START_EFFECTIVE_DT Start_dt,
             END_EFFECTIVE_DT End_dt
      FROM   PERSON_DTL b
     WHERE   CONNECT_BY_ISLEAF = 1
START WITH   sid IN ('A101', 'A100')
CONNECT BY   PRIOR b.emp_mgrs_id = b.sid
This is the results that i am getting now.
AGENT_SID    PATH                       START_DT    END_DT
A100    A100,M100,M101,M102,M103,M104    1/1/2010    12/31/9999
A100    A100,M100,M107,M102,M103,M104    1/1/2010    12/31/9999
A101    A101,M105,M106                   1/1/2010    12/31/9999
Results Required
A100    A100,M100,M101,M102,M103,M104    1/1/2010    5/18/2013
A100    A100,M100,M107,M102,M103,M104    5/20/2013   12/31/9999
A101    A101,M105,M106                   1/1/2010    12/31/9999

May be this..
SQL> select agent_sid,max(path) path,max(start_dt) start_dt,
  2         min(end_dt) end_dt
  3  from
  4  (
  5    select agent_sid,path,start_dt,end_dt,
  6           sum(flg) over(order by rn) sm
  7    from
  8    (
  9      select agent_sid,
10             path,
11             start_dt,
12             end_dt,rn,
13             case when path like lag(path) over(order by rn)||'%' then 0 else 1 end flg
14      from
15      (
16        SELECT   CONNECT_BY_ROOT (b.sid) agent_sid,
17                 TRIM (
18                    LEADING ',' FROM    SYS_CONNECT_BY_PATH (b.sid, ',')
19                                     || ','
20                                     || b.emp_mgrs_id
21                 )
22                  PATH,
23                 START_EFFECTIVE_DT Start_dt,
24                 END_EFFECTIVE_DT End_dt,rownum rn
25        FROM   PERSON_DTL b
26        START WITH   sid IN ('A101', 'A100')
27        CONNECT BY   PRIOR b.emp_mgrs_id = b.sid
28      )
29    )
30  )
31  group by agent_sid,sm
32  order by agent_sid;
AGENT_SID  PATH                                     START_DT  END_DT
A100       A100,M100,M101,M102,M103,M104            01-JAN-10 18-MAY-13
A100       A100,M100,M107,M102,M103,M104            20-MAY-13 31-DEC-99
A101       A101,M105,M106                           01-JAN-10 31-DEC-99Edited by: jeneesh on May 20, 2013 7:54 PM
Not thoroughly tested.And not sure whether an easy way exists..

Similar Messages

  • To calculate start and end date

    Hi everybody,
    I wanna substract qmel-strur (start time )
       FROM           qmel-ltrur(end time)
    Please let me know the query for the above.
    Sadik.

    Please refer the code below which solves different requirements and reward points if found helpful
    <b>REPORT  Z_DIFF_DATES                            .
    DATA: DIFF TYPE P, TIME TYPE P.
    DATA: D TYPE I, M TYPE I, Y TYPE I.
    DATA: D1 TYPE I, M1 TYPE I, Y1 TYPE I.
    DATA: DUR TYPE TABLE OF RKE_DAT WITH HEADER LINE.
    DATA: WORK_DAYS TYPE I.
    PARAMETERS: DATE1 TYPE SY-DATUM OBLIGATORY,
                DATE2 TYPE SY-DATUM OBLIGATORY.
    START-OF-SELECTION.
    **** Date & time difference*****
    CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
        EXPORTING
          DATE1                  = DATE1
          TIME1                  = SY-UZEIT
          DATE2                  = DATE2
          TIME2                  = SY-UZEIT
       IMPORTING
         DATEDIFF               = DIFF
         TIMEDIFF               = TIME
    *   EARLIEST               =
    * EXCEPTIONS
    *   INVALID_DATETIME       = 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.
    **** Days Months years between two days
      CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
        EXPORTING
          I_DATE_FROM          = DATE1
    *     I_KEY_DAY_FROM       =
          I_DATE_TO            = DATE2
    *     I_KEY_DAY_TO         =
    *     I_FLG_SEPARATE       = ' '
       IMPORTING
         E_DAYS               = D
         E_MONTHS             = M
         E_YEARS              = Y
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    **** Number of working days
    CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
      EXPORTING
        I_DATAB                     = DATE1
        I_DATBI                     = DATE2
        I_FACTID                    = 'P2'
      TABLES
        ETH_DATS                    = DUR
    * EXCEPTIONS
    *   DATE_CONVERSION_ERROR       = 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.
    DESCRIBE TABLE DUR LINES WORK_DAYS.
    END-OF-SELECTION.
      WRITE:/ D,M,Y.
      SKIP 30.
      WRITE:/ WORK_DAYS.</b>

  • Calculate the working days having the start and end dates only

    Hi,
    Can BIP be able to calculate the working days having the start and end dates only? It is like the NETWORKDAYS function in Excel. (i.e. excluding weekends and holidays).
    Thanks.

    Not out of the box.
    But You could extend your BIP functions
    Look at here:
    http://blogs.oracle.com/xmlpublisher/2009/05/bip_by_extension.html
    Based on that what you need is similar to the following Java code:
    http://objectlabkit.sourceforge.net/
    regards
    Jorge A.

  • Make Quarters from Start and End date

    Hi,
    I have a requirement to make the quarters for fiscal year from the given start and end date.
    For example if I have
    start date : 01-Jan-09
    end date : 31-Dec-09
    I have to split it into 4 quarters as bellow:
    QTR1 : 01-Jan-09 - 31-Mar-09
    QTR2 : 01-Apr-09 - 30-Jun-09
    QTR3 : 01-Jul-09 - 30-Sept-09
    QTR4 : 01-Oct-09 - 31-Dec-09
    plz help.
    Regards,
    Fahim

    Hi,
    SQL&gt; SELECT ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),(ROWNUM-1)*3) start_dt,(ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),ROWNUM*3))-1 End_Date
      2  FROM DUAL
      3  CONNECT BY ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),(LEVEL-1)*3) &lt;=to_date('30-SEP-2009','DD-MON-YYYY');
    START_DT  END_DATE
    01-JAN-08 31-MAR-08
    01-APR-08 30-JUN-08
    01-JUL-08 30-SEP-08
    01-OCT-08 31-DEC-08
    01-JAN-09 31-MAR-09
    01-APR-09 30-JUN-09
    01-JUL-09 30-SEP-09
    7 rows selected.
    SQL&gt;Cheers,

  • Hyperion Planning dynamic forms based on start and end date across years

    Hi All,
    I have a requirement where i need to be able to view a form showing periods across years that are dynamically built depending on the start and end dates. If i have a start date of 01/11/2009 and an end date of 31/7/2013 i want to be able to view a form that shows all of the periods (Jan,Feb etc) in a form that is driven by these dates, in addition it will need to show the actual scenario up to the current month and the forecast from the current month to the end date. So basically if a user inputs the start and end dates the form will display the relevant periods driven by these dates.
    Any tips very much appreciated!

    Hello,
    This is difficult to realize, but you can get quite far with a workaround. The first question is, where do you want to input your selection of time periods? Assuming you have a webform with the complete timeline in months and years and you type in the start period and end period.
    Webforms have the option to suppress rows and columns.
    This can be extended with option of empty cells or not empty cells.
    You will need to apply your creativity on this.
    Put every month-year combination in a column and add the suppression.
    Calculate the timeline between start period and end period with a dummy member, so data exists for these and columns will show.
    Maybe you will need to copy the required timeline into a separate version for this, to avoid having periods which were outside the selection and still have data.
    I hope these hints help a bit in this challenge.
    Regards,
    Philip Hulsebosch
    www.trexco.nl

  • Reduce Working Days by Emp Start and End Dates

    I'm banging my head trying to get this working. The set-up:
    DimResources table with various employee information including a Start and End Date.
    A Calendar table with FullDate, Year, Quarter....WorkingDays (1 for working and 0 for non-working) and WorkingDayNumber (working days increased by 1, weekends are not).
    Page View report with page view filters for Business, Role, Month, Week, Year.
    In the calculation the denominator is total working days for the period * 8. Works great. Further reduced by any submitted time off. Again, so far so good. The part I'm having trouble with is trying to further reduce total working days by
    the number of days the person wasn't available in a month, defined by the person's start or end date.
    The calculated field works great when only 1 person is selected. As soon as more than 1 person is selected or the slicer is cleared, an error is thrown.
    Any ideas on what is wrong or better ways to accomplish what's needed?
    TotalWorkingDays2CF=CALCULATE
     SUM(Calendar[WorkingDays]),
                    FILTER(Calendar,Calendar[WorkingDays]=1),
                    Calendar, DATESBETWEEN(Calendar[FullDate],SUM(DimResources[Start Date]),SUM(DimResources[End Date]))
    Error:
    <detail>
      <ErrorCode>rsErrorExecutingCommand</ErrorCode>
      <Message>Query couldn't run for dataset 'Tablix41DataSet'.</Message>
      <ProductName>Power View</ProductName>
      <ProductVersion>11.0.2150.3</ProductVersion>
      <MoreInfo>MdxScript(Model) (10, 27) Calculation error in measure 'Calendar'[TotalWorkingDays2CF]: An invalid numeric representation of a date value was encountered.</MoreInfo>
    </detail>
    Dennis DeRobertis

    ok, but this is not a running total but just a sub-total/grand-total
    so what you can do is the following:
    create two measures - first calculate the workdays per ressourcen and second use SUMX() to get the sub-/grand-total if multiple employees are selected (e.g. subgroups, groups,division, etc)
    WorkdaysRessource:=CALCULATE(
    COUNTROWS('Date'),
    FILTER('Date',
    'Date'[Date] >= CALCULATE(MIN('DimResources'[Start Date]))
    && 'Date'[Date] <= CALCULATE(MIN('DimResources'[End Date])))
    Workdays:=CALCULATE:=SUMX(
    'DimResources',
    [WorkdaysRessource]
    hth,
    gerhard
    Gerhard Brueckl
    blogging @ http://blog.gbrueckl.at
    working @ http://www.pmOne.com

  • FM to find week start and end date on the basis of a given date

    Hi Everyone,
    I have a requirement in which I require the week start and end date  of any given date.
    For eg: The given date is Wednesday 24.03.2010, I need a function module to calculate the week start date ie. Monday 22.03.2010 and week end date ie. Sunday 28.03.2010 on the basis of that date.
    Any input to this query would be helpful.
    Thanks,
    Nimisha Agarwal
    Edited by: Nimisha Agarwal on Jul 7, 2010 7:47 AM

    HI nimisha,
    many posts r there for this .
    Kindly check  before posting
    anyways this FM will serve u  r purpose.
    GET_WEEK_INFO_BASED_ON_DATE

  • Report for Validity Start and End Date in PO

    Dear All
    Is there any report where I can get PO validity start and end date which user input in addtional data header tab of PO?
    Regards
    Satish Kumar

    Hi,
    Yes, It is available standard report using T-code ME2N - Purchasing Document (PO) Per Document Number, enter the T-code and provide the following input data's are as follows.
    Scope of List                 :  ALV ( for Ms-Excel format report)
    Plant                               :   __________ to __________ (if required)
    Document Date              : ____________ to ___________ (if Required)
    Execute the report shown by default in excel format and if required PO validity start and end data, you have to select Change Layout button and open new window options screen right side field option as Validity Per.Start, Validity Period End, Commutative number field data's are selected and click <--- arrow button and then click bottom tick marked button. Now, the report shown your requirement.
    Hope, it is useful for you,
    Regards,
    K.Rajendran

  • SNP Planned order start and end dates are not calculated correctly

    Hello SNP Guru's
    The SNP planned orders generated after the Heuristics run, have a start and end date based on the Activity Duration (Fixed), while the resource consumption is based on the Bucket Consumption (Variable), which is correct.
    The Activity Duration (Fixed) is based on the BOM Base Quantity. So if the Activity Duration = 1 day, and if the order quantity is more than a day, the start and end dates, still shows as 1 day. So no matter what is the order quantity, the start and end dates is always = 1 day.
    Does anyone have any experience in implementing any code to change the start and end dates on SNP Planned Order?
    Seems like it should work as standard.
    Am i missing something?
    Thanks,
    Mangesh

    Dear Mangesh,
    SNP is a infinite planning tool. If you have defined fixed duration to be 1 DAY in the activity, no matter how many quantity you input for your planned order, the order will last for one day. If the resourced is overloaded, you then run capacity levelling to
    banlance the capacity. What your expected beahavior happens in PPDS planning.
    Claire

  • Contract Start and End Dates in Sales Order

    Hi
    I have a situation where a service item is bundled with a deliverable item. The order is as follows
    Line Item    Mat                                                                 Qty            Higher Level Item               
    10              Item No.1 (Physical Item)                                  1             
    20              Item No.2 (Service Item)                                    1               10
    For the deliverable item 10 , Revenue is recognized immediately. For the Service item no.20 , revenue needs to be recognized over a period of 1 Year (It is a 1 year service contract).
    The whole order is created via BAPI from an external 3rd party order capture system.
    In order to do revenue recognition properly for service items , SAP I believe has 2 options
    1. Based on Billing plan dates
    2. Based on contract start dates
    Since order with both the line items need to produce 1 invoice, I cannot use billing plan . The only other option is to use contract start and end dates. I have enabled contract data at the sales order level. So when I enter the contract start and end dates manually at the line item level and set the item category to recognize revenue based on contract start and end dates based on time-based revenue recognition it is working fine.
    But I need a way to automate the population of contract start and end dates at the line item level. My ABAP guy is not able to find a user exit that can change the XVEDA or any VEDA structure in any of the user exits.
    I guess the SAP SD gurus out there would have definitely dealt with a situation of product bundling (Service and non-service items in the same sales order with one billing document , but seperate revenue recognition for service and non-service items)
    Please help.
    Thnx
    Siva

    Hi Siva,
    Kindly let me know what criteria you want to give for automatic population of start date of contract...
    Standard SAP comes with a few baseline dates for contract start date and we can control this from customization itself. 
    01     Today's date
    02     Contract start date
    04     Acceptance date
    05     Installation date
    06     Date contract signed
    07     Billing date/Invoice date
    08     CntrctStDate+contract duration
    09     Contract end date
    If you have some criteria which is not covered here, then let me know and i will try to provide some help then.
    Thanks
    Kapil Sharma

  • URGENT REPORT START AND END DATE

    GUYZ help me how to generate a report with start date and end date, two text item or calendar rpresent start and end date, it will generate only the start to end date... plzz put the code guyss..
    this is my code when i call my report in runtime only in client server .. i want to generate it wit start and end date but dunno newbie ..
    Declare
    v_Rep varchar2 (30);
    repid report_Object;
    begin
    repid:=find_report_object('dept');
    v_rep:=run_report_object(repid);
    end;

    Check this sample Code..
    DECLARE
    pl_id ParamList;
    pl_name VARCHAR2(10) := 'repdata';
    BEGIN
    pl_id := Get_Parameter_List(pl_name);
    IF Id_Null(pl_id) THEN
    pl_id := Create_Parameter_List(pl_name);
    Add_Parameter(pl_id, 'P_STARTDATE', TEXT_PARAMETER,:BLK_CTRL.P_TODATE);
    Add_Parameter(pl_id, 'P_ENDDATE', TEXT_PARAMETER, :BLK_CTRL.P_CURRENCY);
    Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    ELSE
    Destroy_Parameter_List( pl_id );
    END IF
    RUN_PRODUCT(REPORTS, 'D:\MMRROLDL.RDF' ,SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id ,NULL);
    END;

  • BT Broadband Contract Start and End Date

    Where can I find my contract start and end date online ?

    conrad wrote:
    You can, by starting a new order for BB and entering phone no + post code - no need for email address - you then go to choose a package page which shows your current package  details at the top of the page
    Obviously you don't need to go any further than that page
    Conrad, thank you for your suggestion. I gave your suggestion a try but initially got a technical error and then appeared to be getting closer and closer to completing an order without the required information coming up so I chickened out. This also was fraught with difficulty as the cancel button seemed ineffective.
    I think I may have to use imjolly suggestions.

  • Report execution start and end date/time

    Hi All,
    How can one find execution start and end date/times for all reports? Basically I am looking to see what reports were run on a day, when and how long it took for each to complete.
    Thank you.
    Denis

    Hi,
    The "eul5_batch_reports" holds the data about the scheduled report and if you don't have any so you will not have any data.
    Take a look at "EUL5_QPP_STATS"
    for example:
    select
    qpp.qs_doc_name,
    qpp.qs_doc_details,
    fu.user_name Ran_by,
    qpp.qs_created_date Start_run,
    qpp.qs_doc_owner Doc_owner,
    qpp.qs_num_rows rows_fetch,
    qpp.qs_est_elap_time estimated_time,
    qpp.qs_act_elap_time Run_time,
    qpp.qs_act_cpu_time Cpu_time
    from eul_us.EUL5_QPP_STATS qpp,
    fnd_user fu
    where substr(qpp.qs_created_by,2,10)=fu.user_id
    order by qs_created_date

  • Schedule type LineChart with clients and unavailable start and end dates

    I have been working on trying to get something in flex which will display a list of clients and their unavailability start and end dates.   I have attempted the line chart and the HLOC chart but have not seen success.  I do have the H or V grids working fine.  But getting the data to display in a line graph based upon start date and end date has been my challenge.  any suggestions
    Current Code:
        <s:Label x="0" y="5" text="Min Date" height="24" fontFamily="Times New Roman" verticalAlign="middle"/>
        <mx:DateField id="minDateField"
                      x="50" y="5"
                      formatString="MM-DD-YYYY"
                      selectedDate="{minDate}"
                      change="minDatefield_changeHandler(event)"/>
        <s:Label x="150"  y="5" text="Max Date" height="24" fontFamily="Times New Roman" verticalAlign="middle"/>
        <mx:DateField id="maxDateField"
                      x="200" y="5"
                      formatString="MM-DD-YYYY"
                      selectedDate="{maxDate}"
                      change="maxDatefield_changeHandler(event)"/>
        <mx:LineChart id="nonAvailsLC" x="0" y="40"
                      showDataTips="true"
                      dataProvider="{getNonAvailsResult.lastResult}"
                      creationComplete="nonAvailsLC_creationCompleteHandler(event)"
                      width="890" height="550">
            <mx:backgroundElements>
                <mx:GridLines gridDirection="both"/>
            </mx:backgroundElements>
            <mx:horizontalAxis>
                <mx:DateTimeAxis dataUnits="days" minimum="{minDate}" maximum="{maxDate}"
                                 labelUnits="days"/>
            </mx:horizontalAxis>       
            <mx:verticalAxis>
                <mx:CategoryAxis categoryField="user" labelFunction="getName"/>
            </mx:verticalAxis>       
            <mx:series>
                <mx:LineSeries xField="startDate" yField="user"
                               form="horizontal"/>
            </mx:series>
        </mx:LineChart>

    I guess I still have lots to learn about Flex and Renderers. I downloaded a Gantt chart with Code and they used the AdvancedDataGrid with renderers and such.  I modified the code to work for me. but if I had to create it myself right now, I would be in trouble.  Lots more to learn.

  • How to determine current period start and end dates

    Hi All,
    If given previous period start date and end date, how to determine current period start date and end date?
    Suppose if given previous period start and end dates are 12/28/08 - 01/30/09, then current period start date and end date will be 01/30/09 - 02/27/09. (where 12 is the previous period, 28 is the day, 08 is the year......)
    Can you please suggest an FM to determine the current period dates?
    Thanks & Regards
    Gowthami

    >
    gowthami karunya wrote:
    > If given previous period start date and end date, how to determine current period start date and end date?
    > Suppose if given previous period start and end dates are 12/28/08 - 01/30/09, then current period start date and end date will be 01/30/09 - 02/27/09. (where 12 is the previous period, 28 is the day, 08 is the year......)
    Hello,
    I am assuming you have the Company Code with you & proposing this solution.
    TABLES: bkpf.
    PARAMETERS:
    p_bukrs TYPE bukrs.
    SELECT-OPTIONS:
    s_date FOR bkpf-budat.
    DATA :
    l_perio LIKE bkpf-monat,
    l_poper TYPE poper,
    l_year  LIKE bkpf-gjahr,
    l_spmon TYPE spmon,
    l_periv TYPE periv,
    l_date1 TYPE datum,
    l_date2 TYPE datum.
    CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
      EXPORTING
        companycodeid = p_bukrs
        posting_date  = s_date-high
      IMPORTING
        fiscal_year   = l_year
        fiscal_period = l_perio.
    CONCATENATE l_year l_perio INTO l_spmon.
    * Get the next period
    IF l_perio < 12.
      l_perio = l_perio + 1.
    ELSE.
      l_perio = '01'.
      l_year = l_year + 1.
    ENDIF.
    MOVE l_perio TO l_poper.
    SELECT SINGLE periv INTO l_periv
    FROM t001
    WHERE bukrs = p_bukrs.
    IF sy-subrc = 0.
      CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
        EXPORTING
          i_gjahr        = l_year
          i_periv        = l_periv
          i_poper        = l_poper
        IMPORTING
          e_date         = l_date1
        EXCEPTIONS
          input_false    = 1
          t009_notfound  = 2
          t009b_notfound = 3
          OTHERS         = 4.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
        EXPORTING
          i_gjahr        = l_year
          i_periv        = l_periv
          i_poper        = l_poper
        IMPORTING
          e_date         = l_date2
        EXCEPTIONS
          input_false    = 1
          t009_notfound  = 2
          t009b_notfound = 3
          OTHERS         = 4.
      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: / l_date1, l_date2.
    ENDIF.

Maybe you are looking for

  • Outbound FAX is not working

    Outbound FAX is not working. Below is the Call Flow FAX ServeràH.323àCUCMàMGCPàGatewayàE1 PRIàPSTN The CUCM version is 8.0.3 while the gateway IOS version is 12.4(24)T5. Collected the following Packet Captures between FAX server and CUCM CUCM traces

  • How do i connect my HP touch smart 610 to TV ?

    I have an HDMI on my TV. I also have an RGB pc input pin on my TV. What is the best way to vconnect my pc to my 32'' HD READY DIGITAL LCTV TV. My model of TV is a  Goodmans LD3265D. pc is Touchsmart 610

  • MOVED: How to use onboard VGA on 945GM2 with RX1300Pro graphics card plugged in?

    This topic has been moved to Intel P4 & Celeron P4 based board. https://forum-en.msi.com/index.php?topic=97199.0

  • Great Service, Microsoft

    I am a paying customer. Paying - that means I pay MY money for a service. MY money which pays for things like non-existant client support. The service I pay for is phone accesss. So how come I am forced to download updates, all of which since Skype 3

  • Fire itemrenderer in datagrid

    Hi All, I am adding a row in my datagrid dynamically using an external button but couple columns contain a combo box as itemrenderer. The first item (index 0) in my comboBox have option "---select---". How can I set this first index for both comboBox