How to handle a multi-department scenario?

Hello,
     I've used WLI 8.1sp2 in the scenario of one administrator handling all
processes of a company. However, I have a need to use a single
installation to support multiple departments. Each department has its
own set of users/roles, and has its own managers.
I'd love to be able to let each department manager use the WLI console
to configure their department's specific needs. However, there's no way
to restrict them from viewing other processes and users in WLI.
I'm thinking we need to provide a custom application to support this,
where we can filter the processes and users by the department name (such
as prepending the department name to the process name or user names).
Then we'd have a custom application that uses the WLI APIs to filter out
the information for that particular department.
Can anyone comment on this scenario and how it could be achieved with
WLI? Or, does anyone know a product that can handle such a scenario
natively (I haven't seen one).
Thanks

Thank you for your answer.
I didn't realise I could use inputHidden for anything more complex than a single string...
I have added a h:inputHidden for the elements array but it still doesn't work.
How should it be used?
     <h:form>
          <h:inputHidden value="#{myExample.elements}"/>
          <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null.

Similar Messages

  • How to handle this kind of scenario in SBO

    Hello, I am new to SAP Business One. I would like to know how to handle Transporation Company scenario below in SBO.
    QUESTION 1: A transportation company has 30 truck. The company receives orders from the customer and use the trucks to deliver the goods from Point A to Point B everyday. The cost for delivery is $0.50 per-KG.
    The way I handle above:
    1. In ITEM MASTER DATA:
    Create a new item > Item Type: Labor > Description: Delivery from Point A to Point B > and determine the delivery price is $0.50.
    2. Use the item created in no 1 above when creating Sales order/Invoice.
    If the weight is 5000kg then simply put QTY 5000 in Sales Order with the price of $0.50/KG, which has been set in Item Master Data.
    Is the above method correct or there is better way to handle?
    QUESTION 2: TRACKING EACH TRUCK EXPENSES BY ITS LICENSE PLATE:
    Each truck has Spare Parts expense (e.g. bulbs, oil, battery, tires etc) that the company would like to track.
    The company purchased the spare parts from suppliers and keep it in the warehouse. When a truck needs to replace its spare parts, the company will issue the parts and record it under that truck's license number as that truck's expense.
    The goal is SBO must be able to provide detail monthly expense report for each truck when inquired by its license plate. I prefer NOT to manually input "directly" in Journal Entry to prevent error.
    Thanks.

    Hi,
    welcome to sbo forum!
    For your question 1, it will depend if you will only have 1 route for all of your deliveries.If your point of origin is always point a then destination is point B w/ price of $0.50,then you are right with your process... but if you will have to expand and move into different places, i think it will best for you to create a UDT for your pricing.
    in summary:
    1.create UDT pricing(with origin,destination and price)
    2.Create UDF in row level of Sales order(U_origin,_U_destination)
    3.) create FMs for your Sales order Origin and destination based on UDT Pricing table.
    4.) create automatic fms for your price( based on origin and destination selection).
    for question 2, all your repairs and maintenance will pass through AP invoice( either by item or service). in our country we normally use Ap service,since a truck has normally several types of spare parts. This figures will will surely add up to the number of item master data record in your system ,since you will need create a unique item for each and every item available.
    -To monitor all your expenses, you will need to create a UDF in the header of PO, GRPO or AP invoice, place your plate number here. so that when you extract your reports, you will easily identify your expenses per truck.
    in summary:
    1.create UDF for header of PO,GRPO or AP( Udf_Plate number) you can set valid values for you udf or by FMS with default values.
    2.Create Udf for lines of PO,GRPO or ap(UDF_spare part type) --note: if you will use the Item type document for repairs and  maintenance then i guess you dont need to add UDF_spare parts.
    Hope i was able to help you.
    Regards,
    Darius Gragasin

  • Newbie: How to handle a multi-step dialogue with no session?

    I can't see how to handle the following trivial problem:
    1. The user clicks on a button to retrieve values from the database
    2. The values returned are displayed in a table on the same page
    3. The user clicks a button next to the desired element
    4. Some action is performed
    I can achieve steps 1, 2, 3 but fail on step 4: the action is not called.
    One prerequisite is that I don't want to store anything in the session or application scope.
    In the example that follows, when you click on "Show Element" the action is not performed.
    This is myExample.jsp:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Test</TITLE>
    </HEAD>
    <f:view>
         <BODY>
         <h:form>
              <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
              <p/>
              <h:dataTable value="#{myExample.elements}" var="elem" binding="#{myExample.dataTable}">
                   <h:column>
                        <h:outputText value="#{elem}"/>
                   </h:column>
                   <h:column>
                        <h:commandButton type="submit" value="Show Element"     action="#{myExample.doShowElement}"/>
                   </h:column>
              </h:dataTable>
         </h:form>
         </BODY>
    </f:view>
    </HTML>This is myExample.java:
    package example;
    import javax.faces.component.html.HtmlDataTable;
    public class MyExample {
         private HtmlDataTable dataTable;
         private String[] elements;
         public MyExample() {
         private String[] readFromDatabase() {
              return new String[] {"one", "two", "three"};
         public String[] getElements() {
              return elements;
         public void setElements(String[] elements) {
              this.elements = elements;
         public HtmlDataTable getDataTable() {
              return dataTable;
         public void setDataTable(HtmlDataTable dataTable) {
              this.dataTable = dataTable;
         public String doSearch() {
              elements = readFromDatabase();
              return "";
         public String doShowElement() {
              String selected = (String) dataTable.getRowData();
              System.out.println("Selected element: " + selected);
              return "";
    }This is in faces-config.xml
         <managed-bean>
              <managed-bean-name>myExample</managed-bean-name>
              <managed-bean-class>example.MyExample</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>

    Thank you for your answer.
    I didn't realise I could use inputHidden for anything more complex than a single string...
    I have added a h:inputHidden for the elements array but it still doesn't work.
    How should it be used?
         <h:form>
              <h:inputHidden value="#{myExample.elements}"/>
              <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
    ...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null.

  • How to handle classification multi value characterstic

    Hi,
    I searched SDN for multi value characteristic addition in to classificatin data source and found that we need to implement notes: 535370, 350296 sin sequence. But I'm wondering if there is any update on creating the class data source with multple value chars ? Please advice if we have any logic to add the multi value chars without changing the CT04 setting or implementing the notes....Thanks inadvance
    Sam

    We had to extarct multiple values from classification for equipment and Function Location. Created a generic Funcion module based extractor and used below approach to fetch multiple values :
    1. Enhance the extract structure with the Maximum number of required fields.
    2.Fetch Attribute Name, Attribute number and units (used for key figures) from CABN
    3. Fetch Object number for the given equipment from INOB by passing Equipment number and class type
    4. Fetch the attribute values from AUSP using object number (3), attribute number (2), object/class indicator and class type.
    5. Loop over the result set obtained (4) and using the attribute number, move the values to field corresponding to that of the extract structure.)
    Thanks,
    Monika

  • How to Handle Rework Scenario

    Dear Sir,
    We have following scenario :
    We created a Production Order (type PP01) for 1 piece of  Component 'X' . The Order was confirmed using Co11n and subsequently MB31 (GR) was done for the Order .  An Inspection Lot got created after the GR .  During Inspection , it was found that Processed Material need some Rework and Quality Inspector posted the Compopnent under BLOCK Stock during the UD .
    Now we need to start Rework on this Component .  Pl guide us what steps need to be followed for completing the Rework cycle .
    I have gone thru many of posting available in this forum related to REWORK , where it has been suggested to make a PP03 type Order in CO07 .
    But I fail to understand that following issues in this :
    a) How to issue faulty Compponent to Rework Order
    b) How to clear the Stock from earlier BLOCK Stock
    c) How to bring Stock back after Rework Order is confirmed and Inspected .
    I request you to kindly help me pl .
    Rgds
    Sonia Agarwal

    Here is the expalanation..
    THis is how we handle the scenario in our place..
    There are two types.
    1.      Repairing done by external persons or subcontractors..
    2.      Refurbishment done inside the plant.
    The second is done by the production department..
    The Refurbishment process is bit different from other production processes..
    The Defective material is received from different locations to the stores through MIGO.
    Here we will specify from and to locations of the defective Assemblies..
    The TO storage location is RMMS.. Here the valuation tye is SF-DEF..
    The refurbishment order is created in IW81.
    Order type is PM04
    In the Header, Refurbishment tab page is Important..The from to details have to given promptly(from val type defective to val type repaired)..
    Then the other things are like your usual production order..
    The GI is done in MB11,261 movement..(Against the order)
    After the execution is done, in MIGO goods issue is done with movement 531..Receipt of byproduct. the material is now converted from DEF to REP..
    Components issue has to be as followed.In the components tab , the materials to be issued has to given as usual. and the same materials has to be mentioned again as -1.It means you are taking away the defective components and adding the good ones...
    Confirmation is done on IW41..
    Hope the above clarifies..

  • How to handle the control records in case of file to idoc scenario.

    Hi All,
    can you please clarify me how to handle the control records in case of file to idoc scenario.

    Hi,
    In File to Idoc scenario even though you selected apply control record values from payload and you are not getting those correct values which you have provided in the mapping.
    Also check the checkboxes Take sender from payload and Take receiver from payload along with the Apply control record values from payload checkbox
    Regards
    Seshagiri

  • Question on "How to Handle Inv management Scenarios in BW" docuemnt.

    Hi all,
    I read the document "How to Handle inventory management scenarios in BW" and I did not understood what a snapshot scenario is?  Can anyone tell me what is the difference between snapshop and non-cumulative scenario's.
    thanks,
    Sabrina.

    In a non-cumulative scenario the current stock of any day (or month) is not stored physically in the cube. Instead the stock values over time is calculated dynamically at query runtime by the BW OLAP engine, which basically derives the stock by summing up the periodic value changes (cumulative inflow and outflow of the non-cumulative key figure), which are stored in the cube (together with a so called stock marker used as the basis of the calclation).
    In the snapshot scenario the current stock of any month is calculated in a snapshot ODS and then loaded to a cube. This means that the the stock value is physically stored in the cube in an ordinary cumulative key figure.
    Since a non-cumulative cube store value changes and not the actual stock this means that performance might be bad if there are many value changes for each characteristic combination in a month (since the stock is calculated at runtime and many records must be processed to derive the stock). So in this case the snapshot scenario is better since no runtime calculations of the stock need to occur  and since only one record, containing the actual stock value will be stored in each month for each characteristic combination having a stock value.
    I think you would be better of with an example, but with this explanation in mind looking at the scenarios in the How to again might clarify things...
    Regards,
    Christian
    / Christian
    Message was edited by: Christian

  • How to handle inventory management scenario

    Hi All,
    In How to handle inventory management scenario whitepaper, I fail to understand the basic difference between 'Inventory Management with non-cumulative Key Figures' and 'Inventory Management with Snapshots'. Can anyone please explain me the basic difference.
    Thanks
    PB

    Hi Loic
    Can u please see if all the steps listed below are OK.
    While setting up  the IM Scenario
    I have jotted down the steps with valuable inputs from you  and paper 'How to Hanlde IM scenarios'
    Please find the steps below. Kindly review them and let me know in case I have got anything wrong or missed out on anything.
    1. Transfer Business Content Datasources 2LIS_03_BX , 2LIS_03_BF, AND 2LIS_03_UM in RSA5.
    2. Go to Transaction LBWE, Activate Datasources 2LIS_03_BF, AND 2LIS_03_UM.
    3. Go to Transaction MCB_ select SAP BW usage 'Standard' Radio button.
    4. Save it.
    5. Go to Transaction MCNB, enter name of run ‘Stock_init’. Enter Termination date in future. Enter Datasource as 2LIS_03_BX.
    6. Execute the initialisation.
    7. Entries can be found in SETUP Table MC03BFSETUP & MC03BFSETUP.
    8. Run SETUP for 2LIS_03_BF, AND 2LIS_03_UM using TCodes OLI1BW and OLIZBW respectively.
    9. Run the extraction for 2LIS_03_BX in BW.
    10. Compress the request with ‘No Marker Update’ NOT SET i.e. unticked or unchecked.
    11. Run the extraction for 2LIS_03_BF in BW.
    12. Compress the request with ‘No Marker Update’ SET i.e. ticked or checked.
    13. Run the extraction for 2LIS_03_UM in BW.
    14. Compress the request with ‘No Marker Update’ SET i.e. ticked or checked.
    Steps 1 and 2 shall be executed in Development and transported to production and step 3 onward should be carried out in Production itself with Posting Block.
    Thanks in advance.
    Regards
    PB

  • Any How-to handle SRM scenarios in BI 7.0

    Hi,
       BI 7.0 is being implemented for a client.He is trying to use SRM 5.0.Can u provide me some how-to handle SRM scenarios in BW guides or documents please.
    Regards,
    Joy

    Hi ,
    I need to retract data from BW-BPS 7.1 to SRM.I am new to BW
    (4 months experience)
    Can anyone send me documentation , links or steps by steps guide to explain how
    to do the link please?
    Is it more or less the same as with retraction into CO-Pa?Is there a standard retractor?
    If there are no standard retractors, what is the solution?
    This a challenging task for me and I really need to do it at work.
    Thanks in advance for your help.
    I'll surely assign points if one can help me.
    My mail is [email protected]
    Nevil

  • How-to handle SRM scenarios in Bi 7.0---any help ???

    Hi,
    BI 7.0 is being implemented for a client.He is trying to use SRM 5.0.Can u provide me some how-to handle SRM scenarios in BW guides or documents please.
    Regards,
    Joy

    Hi ,
    I need to retract data from BW-BPS 7.1 to SRM.I am new to BW
    (4 months experience)
    Can anyone send me documentation , links or steps by steps guide to explain how
    to do the link please?
    Is it more or less the same as with retraction into CO-Pa?Is there a standard retractor?
    If there are no standard retractors, what is the solution?
    This a challenging task for me and I really need to do it at work.
    Thanks in advance for your help.
    I'll surely assign points if one can help me.
    My mail is [email protected]
    Nevil

  • SQL 2008 Trigger to handle multi rows scenario

    I have created below trigger to start logging the company changes from the table1 into another audit table. It works fine with single row but crashing with identical change with multiple rows. Can you please help me to update the trigger to handle multi-row
    scenario. Thanks.
    GO
    IF
    NOT EXISTS
    (SELECT
    * FROM sys.objects
    WHERE object_id
    = OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
    AND type
    in (N'U'))
    CREATE
    TABLE [dbo].[Company_AuditPeriod](
          [Client] [varchar](25)
    NOT NULL,
          [Period] [varchar](25),
          [Table_Name] [varchar](25),
          [Field_Name] [varchar](25),
          [Old_Value] [varchar](25),
          [New_Value] [varchar](25),
          [User_ID] [varchar](25)
          [Last_Update] [datetime],
            [agrtid] [bigint]
    IDENTITY(1,1)
    NOT NULL,
    ON [PRIMARY]
    GO
    --create trigger
    SET
    QUOTED_IDENTIFIER ON
    GO
    CREATE
    TRIGGER [dbo].[Table1_Update]
    ON [dbo].[Table1]
    FOR
    UPDATE
    NOT
    FOR REPLICATION
    AS
    BEGIN
    DECLARE
          @status          
    varchar(3),
          @user_id   
    varchar(25),
          @period          
    varchar(25),
          @client          
    varchar(25),
          @last_update
    datetime
    DECLARE
          @Old_status      
    varchar(3),
          @Old_user_id     
    varchar(25),
          @Old_period      
    varchar(25),
          @Old_client      
    varchar(25)
    SELECT
          @status    
    = status,
          @user_id   
    = user_id,
          @period          
    = period,
          @client          
    = client,
          @last_update
    = last_update
    FROM Inserted
    SELECT
          @Old_status
    = status,
          @Old_user_id     
    = user_id,
          @Old_period      
    = period,
          @Old_client      
    = client
    FROM Deleted
    If @Old_status <> @status
    INSERT INTO Company_AuditPeriod
    VALUES ( @client, @period,
    'Table1',
    'period',@old_status, @status, @user_id, @last_update)
    END
    GO

    Sorry for the confusion.
    I just made sure the table name is same in sys.objects statement and create table statement (there was a typo)
    IF
    NOT EXISTS
    (SELECT
    * FROM sys.objects
    WHERE object_id
    = OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
    AND type
    in (N'U'))
    CREATE
    TABLE [dbo].[ Company_AuditPeriod](
    Earlier you created Trigger on Company_AuditPeriod but
    We have to create trigger on Table1 please with multi row scenario. Thanks.
    --Company_AuditPeriod DDL
    GO
    IF
    NOT EXISTS
    (SELECT
    * FROM sys.objects
    WHERE object_id
    = OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
    AND type
    in (N'U'))
    CREATE
    TABLE [dbo].[ Company_AuditPeriod](
          [Client] [varchar](25)
    NOT NULL,
          [Period] [varchar](25),
          [Table_Name] [varchar](25),
          [Field_Name] [varchar](25),
          [Old_Value] [varchar](25),
          [New_Value] [varchar](25),
          [User_ID] [varchar](25)
          [Last_Update] [datetime],
            [agrtid] [bigint]
    IDENTITY(1,1)
    NOT NULL,
    ON [PRIMARY]
    GO
    --Table1  DDL
    CREATE TABLE [dbo].[Table1](
    [bflag] [int] NOT NULL,
    [client] [varchar](25) NOT NULL,
    [copies] [int] NOT NULL,
    [cost_bio] [decimal](28, 8) NOT NULL,
    [cost_cpu] [decimal](28, 8) NOT NULL,
    [cost_dio] [decimal](28, 8) NOT NULL,
    [date_ended] [datetime] NOT NULL,
    [date_started] [datetime] NOT NULL,
    [description] [varchar](255) NOT NULL,
    [expire_days] [int] NOT NULL,
    [func_arg] [varchar](255) NOT NULL,
    [func_id] [int] NOT NULL,
    [ing_status] [int] NOT NULL,
    [invoke_time] [datetime] NOT NULL,
    [last_update] [datetime] NOT NULL,
    [mail_flag] [tinyint] NOT NULL,
    [me_mail_flag] [tinyint] NOT NULL,
    [module] [char](3) NOT NULL,
    [order_date] [datetime] NOT NULL,
    [orderno] [int] NOT NULL,
    [output_id] [int] NOT NULL,
    [poll_status] [char](1) NOT NULL,
    [printer] [char](16) NOT NULL,
    [priority] [char](1) NOT NULL,
    [priority_no] [int] NOT NULL,
    [process_id] [int] NOT NULL,
    [report_cols] [int] NOT NULL,
    [report_id] [varchar](255) NOT NULL,
    [report_name] [varchar](25) NOT NULL,
    [report_type] [char](1) NOT NULL,
    [server_queue] [char](12) NOT NULL,
    [status] [char](1) NOT NULL,
    [step_id] [char](8) NOT NULL,
    [system_name] [char](8) NOT NULL,
    [used_bio] [int] NOT NULL,
    [used_cpu] [int] NOT NULL,
    [used_dio] [int] NOT NULL,
    [user_id] [varchar](25) NOT NULL,
    [variant] [int] NOT NULL,
    [agrtid] [bigint] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
     CONSTRAINT [PK_acrrepord001] PRIMARY KEY NONCLUSTERED 
    [agrtid] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [INDEX]
    ) ON [PRIMARY]
    G0<o:p></o:p>
    --create trigger
    SET
    QUOTED_IDENTIFIER ON
    GO
    CREATE
    TRIGGER [dbo].[Table1_Update]
    ON [dbo].[Table1]
    FOR
    UPDATE
    NOT
    FOR REPLICATION
    AS
    BEGIN
    DECLARE
          @status          
    varchar(3),
          @user_id   
    varchar(25),
          @period          
    varchar(25),
          @client          
    varchar(25),
          @last_update
    datetime
    DECLARE
          @Old_status      
    varchar(3),
          @Old_user_id     
    varchar(25),
          @Old_period      
    varchar(25),
          @Old_client      
    varchar(25)
    SELECT
          @status    
    = status,
          @user_id   
    = user_id,
          @period          
    = period,
          @client          
    = client,
          @last_update
    = last_update
    FROM Inserted
    SELECT
          @Old_status
    = status,
          @Old_user_id     
    = user_id,
          @Old_period      
    = period,
          @Old_client      
    = client
    FROM Deleted
    If @Old_status <> @status
    INSERT INTO Company_AuditPeriod
    VALUES ( @client, @period,
    'Table1',
    'period',@old_status, @status, @user_id, @last_update)
    END
    go

  • How To Handle Stale Stats Scenario.

    hi ,
    I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
          My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
          below is my query:
          select /*+gather_plan_statistics*/* from tab1         
          where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
    Plan hash value: 3167980259
    | Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
    |*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
         Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
         So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AM

    930254 wrote:
    hi ,
    I am using Release 10.2.0.1.0 of Oracle. I am having a scenario in which i am getting poor execution plans due to stale stats , and how should i tackle the scenario. below is the part of my main query which deviates the execution path due to wrong cardinality estimation.
          My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
          below is my query:
          select /*+gather_plan_statistics*/* from tab1         
          where c1 BETWEEN 1346300090668 AND 1346325539486    ;     
    Plan hash value: 3167980259
    | Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
    |*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
         Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause.
         So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.Edited by: 930254 on Aug 30, 2012 4:41 AMUm, refresh the stats on a regular basis?
    Oracle 10 and later has a default job to do that. Runs at 2200 daily.
    If you need an 'on demand' refresh, that's easy enough to set up.

  • CRM Service - how to configure multi location multi department customer

    Hi,
    In our CRM system, business wants to identify and manage multi location & multi department customers.
    For example, there might be a council which is our customer. Apart from that, different departments & different council establishment can contact as, and we might create them as individual customers too. But there should be a relationship in the system to denote that all these customers are related.
    I was thinking about relating these business partners using sold-to, ship-to type of relationship, where the main council business partner can be sold-to for all other department & locational business partners.
    I don't think customer hierarchy will be a suitable solution for this. Yet, would appreciate any inputs on this.
    If anyone could comment on this, or suggest a better solution for this scenario, it would be of great help.
    Regards,
    Kaushal

    Turns out that AE was wiping it clean from repository.xml (open Edit dialog on SAP target, then click OK w/o entering password). When I specified password again using Edit dialog, it was saved to repository.xml and connection then worked.

  • How to handle the trigger sequence

    I really do not have any idea for this question.
    the trigger need to implement:      
    An employee can not work on more than 2 projects supervised by any given department.
    DEPARTMENT (dname, dnumber, mgrssn, mgrstartdate) KEY: dnumber.
    PROJECT (pname, pnumber, plocation, dnum)      KEY: pnumber.
    CREATE TABLE WORKS_ON
    ( ESSN VARCHAR2(9) NOT NULL,
      PNO NUMBER NOT NULL,
      HOURS NUMBER(3,1) NOT NULL,
    PRIMARY KEY (ESSN, PNO));
    DESC WORKS_ON;
    INSERT INTO WORKS_ON VALUES
    ('123456789',1,32.5);
    INSERT INTO WORKS_ON VALUES
    ('123456789',2 ,7.5);
    INSERT INTO WORKS_ON VALUES
    ('666884444',3 ,40.0);
    INSERT INTO WORKS_ON VALUES
    ('453453453',1 ,20.0);
    INSERT INTO WORKS_ON VALUES
    ('453453453',2,20.0);
    CREATE TABLE PROJECT
    (PNAME VARCHAR2(15) NOT NULL,
    PNUMBER NUMBER NOT NULL,
    PLOCATION VARCHAR2(15),
    DNUM NUMBER NOT NULL,
    PRIMARY KEY (PNUMBER), UNIQUE(PNAME));
    DESC PROJECT;
    INSERT INTO PROJECT VALUES(
    'ProjectX',1, 'Bellaire',5);
    INSERT INTO PROJECT VALUES(
    'ProjectY',2, 'Sugarland',5);
    INSERT INTO PROJECT VALUES(
    'ProjectZ',3,'Houston',5);
    INSERT INTO PROJECT VALUES(
    'Computerization',10,'Stafford',4);i create package and two trigger like following in order to avoid mutating table.
    PACKAGE                     "HW4AIDB" AS
    TYPE EmploadY IS RECORD(
         Empessn varchar2(9),
         Empprojectcount number,
         Empdepartcount number
    TYPE EmploadarrayY is table of EmploadY
                          index by BINARY_INTEGER;
    Empload EmploadarrayY;
    Emploadsize number;
    END;
    create or replace
    TRIGGER TPROJECTA AFTER INSERT OR UPDATE OR DELETE ON WORKS_ON
    DECLARE
    i number:=0;
    BEGIN
      HW4AIDB.Emploadsize :=0;
      for m in (select w.essn empessn,
      count(w.pno) empprojectcount, count(distinct p.dnum) empdepartcount
      from works_on w, project p
      where w.pno=p.pnumber
      group by w.essn)loop
      i :=i+1;
      HW4AIDB.Empload(i).Empessn := m.empessn;
      HW4AIDB.Empload(i).Empprojectcount := m.empprojectcount;
      HW4AIDB.Empload(i).Empdepartcount := m.empdepartcount;
      dbms_output.PUT_LINE('TPROJECTA '||' '||m.empessn||' '||m.empprojectcount||
                           ' '||m.empdepartcount);
      end loop;
      HW4AIDB.Emploadsize :=i;
      dbms_output.PUT_LINE('==================================');
    END;TRIGGER TSALARYB BEFORE INSERT OR UPDATE OR DELETE ON EMPLOYEE
    FOR EACH ROW
    DECLARE
    w HW4AID.EmploadX;
    i number;
    mypos number;
    BEGIN
    mypos :=-1;
    for i in 1..HW4AID.Emploadsize loop
    if(:new.ssn = HW4AID.Empload(i).Empssn) then
    w.Empmgrsalary := HW4AID.Empload(i).Empmgrsalary;
    w.Empsalary := HW4AID.Empload(i).Empsalary;
    mypos :=i;
    exit;
    end if;
    end loop;
    i :=mypos;
    dbms_output.put_line('NEW '||:new.ssn||'-'||:new.salary);
    if updating then
    dbms_output.put_line('updating......');
    if(:new.salary > w.Empmgrsalary) then
    raise_application_error(-20005,'the salary is higher than that of department manager');
    end if;
    dbms_output.PUT_LINE('update done');
    end if;
    END;
    i defined two trigger for AFTER, trigger run orders are acorrding to. before statement level, before row-level, after row level and after statement level.
    so my trigger actually can not implement requirement. how to handle it. now i try to use this rule: select w.essn, w.pno,p.pnumber, p.dnum from works_on w, project p where w.pno=p.pnumber; in statement level trigger. howerver in row-level trigger i can not get value i need(p.dnum i can not get its count). if you guy have any other ideas, pls give me some advise. my brain is really run out of.
    Thanks for your help!!!

    I would recommend creating a package/procedure that is the only way to insert a user into the works_on table. Then inside this procedure you need to serialize access to the works_on table by using a select for update. Then you can count the number of projects and ensure that the new works on is valid.
    If you try to use triggers then due to Oracle's mutli-versioning, if two users insert the same data at the same time, the data integrity will be violated.
    You will obviously have an employee table. I have created one here as follows:
    create table employee (essn varchar2(9) primary key);
    insert into employee values ('999999999');
    Then you can use this table to serialize access to the works_on table by issuing a select for update against it. If you don't do this then two users executing the procedure at the same time will violate the constraint. It is important that you understand this and try it out with multiple sessions so that you understand it.
    create or replace procedure insert_works_on
    (p_essn varchar2, p_pno number, p_hours number)
    as
    l_essn varchar2(9);
    l_count number;
    begin
    select essn
    into l_essn
    from employee
    where essn = p_essn
    for update;
    select count(*)
    into l_count
    from works_on w
    join project p on p.pnumber = w.pno
    where w.essn = p_essn
    and p.dnum = (select dnum
    from project
    where pnumber = p_pno);
    if l_count < 2
    then
    insert into works_on values (p_essn, p_pno, p_hours);
    else
    dbms_output.put_line('Employee works on more than 1 project for dept');
    end if;
    end;
    Then you can try it out:
    begin
    insert_works_on('999999999',1, 10);
    end;
    commit;
    begin
    insert_works_on('999999999',2, 20);
    end;
    commit;
    begin
    insert_works_on('999999999',3, 30);
    end;
    commit;
    The first two will succeed and the last will fail. Try it out in multiple session as well to ensure it works for a multi-user scenario.

  • How to handle exception CX_SY_REF_IS_INITIAL

    hi experts,
    im working on a test scenario for abap mapping in SAP XI im getting this error
    An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
    i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
    can any one please suggest me how to handle this exception for the following code...
    method IF_MAPPING~EXECUTE.
      break x1149.
    * initialize iXML
      TYPE-POOLS: ixml.
      class cl_ixml definition load.
    ** Instances & Variable declaration =======================
    * instance main factory
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA: l_ixml TYPE REF TO if_ixml,
    * instance input stream factory
       l_streamfactory TYPE REF TO if_ixml_stream_factory,
    * instance input stream
      l_istream  TYPE REF TO if_ixml_istream,
    * instance input document
      l_document TYPE REF TO if_ixml_document,
    * instance parse input document
      l_parser TYPE REF TO if_ixml_parser,
    * instance for elements within the nodes
      node      TYPE REF TO if_ixml_node,
    *instance of nodemap
      nodemap   TYPE REF TO if_ixml_named_node_map,
    * instance for iterator
      iterator  TYPE REF TO if_ixml_node_iterator,
      name      TYPE string,
      value     TYPE string,
    * instance main factory
       o_ixml   TYPE REF TO if_ixml,
    * instance output document
       o_document TYPE REF TO if_ixml_document,
    * instance output stream
      o_istream  TYPE REF TO if_ixml_ostream,
    * instance parse output document
      o_parser  TYPE REF TO if_ixml_parser,
    * instance fot renderer
      renderer type ref to if_ixml_renderer,
      irc type i,
      l_xml_size   TYPE i,
    *ROOT ELEMENT
    l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
    *NEXT CHILD ELEMENT FROM THE ABOVE PARENT
    l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
    *CHILDREN1 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_WHSE  TYPE REF TO if_ixml_element,
    *CHILDREN2 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_DC    TYPE REF TO if_ixml_element,
    *CHILDREN3 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_PLANT    TYPE REF TO if_ixml_element,
    *CHILDREN4 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_QTY    TYPE REF TO if_ixml_element.
    *saving the xml document
      DATA: l_xml_table       TYPE TABLE OF t_xml_line.
      types: begin of t_source,
              whse(5),
              dc(4) ,
              plant(4),
              qty    type i,
             end of t_source.
      types: tt_source TYPE STANDARD TABLE OF t_source.
      data:  wa_source type t_source.
      data: it_source TYPE  tt_source,
            ivalue type string.
    * Procedures and business logic =======================================
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    * how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
    endmethod.
    full reward points for answers.
    Thanks & Regards,
    Uday Kumar.
    Edited by: UDAY on May 6, 2008 9:32 PM

    Hi Uday,
    Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
    " Define a class exception object to get error message......
    DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
    "// Use the statment Try block to catch the error.
    TRY.
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    "   The Statement CATCH define a block that catches the exceptions of the
    "   exception class cx_sy_ref_is_initial
        CATCH cx_sy_ref_is_initial INTO o_exception.
    " If you need to get the error message text do as follow
    DATA errorMsg type string.
    " Get the message text
      errorMsg = o_exception->GET_TEXT( ).
    " Display the error information
      MESSAGE errorMsg TYPE 'I'.
      ENDTRY.
    The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
    Font: SAP Help
    You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
    Best Regards.
    Marcelo Ramos

Maybe you are looking for

  • Cisco 1841 SSL VPN and Anyconnect Help

    I am pretty new to Cisco programming and am trying to get an SSL VPN set up  for remote access using a web browser and using Anyconnect version 3.1.04509. If I try to  connect via a web browser I get an error telling me the security  certificate is n

  • Can I get a newsletter created in pages to open in the body of an email

    I would like to send newletters created in Pages to clients and have them open in the body of the email rather than as an attachment...is this possible?

  • How to write this query ?

    how to write this query ? list the emp name who is working for the highest avg sal department. I can use row_number over to get correct result. If we don't use this row_number function, just plain sql, how to do it ? the row_number version is like th

  • Start Oracle Internet Directory failing... server context is null

    I'm trying to install Oracle Internet Directory on a RHEL5 64 bit for the first time. The database (11.2.0.3), Weblogic (10.3.6), and OID (11.1.1.6) have all installed okay, and I'm running the config.sh script. I specify 'Creating the schema' and en

  • GB   Audiogram 6: multitrack problem

    I have a problem with my audiogram 6. I'm really new in home recording and I've always recorded one track per time (guitar first then the bass then drums then vocals). I read that GB allows you to record in multitrack...this is great to me but...I JU