Problem with Persistent Object as Reference Attribute of Persistent Object

Hello All,
I have a problem with a persistent class that contains a reference attribute to another persistent class.  I can write the reference object attribute to the DB but when I read the reference attribute back from the DB the object is null.  Allow me to explain...
I have two tables; one is a data table with one key field of type OS_GUID, the second is a mapping table with several business key fields and two further fields; an instance GUID and a class identifier GUID.  The data table is used to contain all the data for an object.  The mapping table is used to hold a relationship between the GUID assigned in the data table and the business key.  The mapping table has been structured in this way by following the help here:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/df/e785a9e87111d4b2eb0050dadfb92b/frameset.htm
and the field mapping in persistent class for the mapping table has been mapped following the help here:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/06/f23c33638d11d4966d00a0c94260a5/frameset.htm
The code I use to create entries in the data and mapping table is:
<-snip->
  DATA:
    gv_blank_data_guid TYPE REF TO zcl_ps_data,
    gv_data_guid       TYPE        os_guid,
    go_data_ps         TYPE REF TO zcl_ps_data,
    go_data_agent      TYPE REF TO zca_ps_data,
    go_data_map_ps     TYPE REF TO zcl_ps_data_map,
    go_data_map_agent  TYPE REF TO zca_ps_data_map,
    go_exc             TYPE REF TO cx_root.
  go_data_agent = zca_ps_data=>agent.
  go_data_map_agent = zca_ps_data_map=>agent.
  TRY.
Check if there's already data with the business key on the DB
      go_data_map_ps = go_data_map_agent->get_persistent(
                         i_data_ref     = iv_data_ref
                         i_action       = iv_action ).
... if there is then exit.
      EXIT.
    CATCH cx_root INTO go_exc.
  ENDTRY.
  TRY.
Create the data...
      go_data_ps = go_data_agent->create_persistent(
                       i_root_guid = gv_blank_data_guid
                       i_req_date  = iv_req_date ).
      TRY.
... finally, write the new data to the data business key map table
          go_data_map_ps = go_data_map_agent->create_persistent(
                             i_data_ref     = iv_data_ref
                             i_action       = iv_action
                             i_data_guid    = go_data_ps ).    "note1
        CATCH cx_root INTO go_exc.
      ENDTRY.
    CATCH cx_os_object_not_found.
  ENDTRY.
  COMMIT WORK.
<-snip->
The fact that it is possible to pass the object GO_DATA_PS in the call to GO_DATA_MAP_AGENT (the line that I've put the comment "note1" on) indicates to me that the reference to the data persistent object can be written to the DB by the mapping persistent object.  After executing the above code the mapping table object and class identifier fields are populated.  Also, if multiple entries are written to the tables then the class identifier field in the mapping table is always the same and the object ID is different as expected.
However, the problem I have is if I read an object from the DB using the business key with the following code:
<-snip->
  DATA:
    gv_req_date        type        datum,
    gv_data_guid       TYPE        os_guid,
    go_data_ps         TYPE REF TO zcl_ps_data,
    go_data_agent      TYPE REF TO zca_ps_data,
    go_data_map_ps     TYPE REF TO zcl_ps_data_map,
    go_data_map_agent  TYPE REF TO zca_ps_data_map,
    go_exc             TYPE REF TO cx_root.
  go_data_agent = zca_ps_data=>agent.
  go_data_map_agent = zca_ps_data_map=>agent.
  TRY.
Read data mapping with the business key
      go_data_map_ps = go_data_map_agent->get_persistent(
                         i_data_ref     = iv_data_ref
                         i_action       = iv_action ).
... then read the data.
      TRY.
          CALL METHOD go_data_map_ps->get_data_guid
            RECEIVING
              result = go_data_ps.
        CATCH cx_os_object_not_found.
      ENDTRY.
    CATCH cx_root INTO go_exc.
  ENDTRY.
<-snip->
At no point during this code are the attributes of the object of the persistent class for the data table populated with the contents of the fields of the data table referenced as the attribute of the mapping table.  To clarify, when viewing the object in the debugger all the attributes of the mapping object that are simple table fields are populated with the values of the fields of in the mapping table, however, the attributes of the object that represents the persistent class for the data table are not populated with the fields of the data table.  I had hoped that by reading the mapping table object the data object would automatically be populated.  Is there another step I need to perform to populate the data object?
I'm sorry if the above is hard to follow.  Without being able to provide screenshots it's difficult to explain.
If someone has managed to store references to persistent objects in a table and then read the references back could you list the steps you went through to create the persistent classes and include the code that reads the objects please?  The code I have almost works, I must be just missing some subtle point...
Thanks in advance,
Steve.

Hi Andrea,
The iObject being replicated at item level for Service Complaints is the SAP standard behaviour.
Generally we raise complaint refering to some sales or service issues. In your scenario you are trying to create a complaint based on an iObject, then you have to mention the corresponding product details. I dont see any business requirement not to copy the iObject product at the item level.
If you want it then I think only you have to write a Z program for it.
Hope this helps!
Regards,
Chethan

Similar Messages

  • Problem with JavaScript code in Page Attributes, modal popup...

    Hello all!
    I'm encountering a problem with a modal popup I wrote in JavaScript.
    h3.
    The situation*
    A user sees an interactive report with rows that are clickable, so these rows are links. Upon clicking the name of something in a row, some items get a certain value and a modal popup shows on the screen. In this modal popup, there are details regarding that particular row the user has clicked, but the problem_ here is...
    The modal popup closes itself only seconds after it has been opened.
    This must be because I've probably made a mistake somewhere in my code, but I just can't figure out where... It also appears that when I click on a row link, the popup shows, but the progress bar of my toolbar seems to show a loading bar (as if I refreshed the page).
    h3.
    My code*
    This code is located in the _"Function and Global Variable Declaration"_ part, under the _"JavaScript"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    function showhide(x){
    $x('REGION1').style.display = ( x == 'REGION1') ? 'block' : 'none';
    $x('REGION2').style.display = ( x == 'REGION2') ? 'block' : 'none';
    $x('REGION3').style.display = ( x == 'REGION3') ? 'block' : 'none';
    $( function(){
      $('#ModalForm').dialog(
         modal: true,
         autoOpen: false,
         width: 500,
         height: 350,
         buttons:{ Close: function(){closeForm();}        
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        $('#ModalForm').dialog('close');
        $(document).ready(function() {
            $('a.temppop').click(function() {
                openForm();
        });This code is located in the _"Header Text"_ part, under the _"Header"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>This code is located in the _"Column Link"_ part, you get there by going to the _"Report Attributes"_ of the region called _"Template overview"_ on page 24. This region is an interactive report.
    Link Text: #FOODTEMPLATENAME#
    Link Attributes: class="temppop"
    Target: Page in this Application
    Page: 24
    Item 1, name: P24_MEALID; item 1, value: #MEALTYPEID#
    Item 2, name: P24_TEMPLATEID; item 2, value: #FOODTEMPLATEID#So basically I call the function to open the modal popup by the class name. When a link with that class name in it is clicked, it opens the popup.
    To remind you of the problem, the modal popup closes seconds after it has been opened. How do I fix this?
    Thanks in advance.
    (APEX version 4.1.1.00.23)

    Come on guys... I really need to know this. :(

  • Object and reference accessing for primitives, objects and collections

    Hi,
    I have questions re objects, primitives and collection accessing and references
    I made a simple class
    public class SampleClass {
         private String attribute = "default";
         public SampleClass()
         public SampleClass(SampleClass psampleClass)
              this.setAttribute(psampleClass.getAttribute());
              if (this.getAttribute() == psampleClass.getAttribute())
                   System.out.println("INSIDE CONSTRUCTOR : same object");
              if (this.getAttribute().equals(psampleClass.getAttribute()))
                   System.out.println("INSIDE CONSTRUCTOR : equal values");
         public void setAttribute(String pattribute)
              this.attribute = pattribute;
              if (this.attribute == pattribute)
                   System.out.println("INSIDE SETTER : same object");
              if (this.attribute.equals(pattribute))
                   System.out.println("INSIDE SETTER : equal values");
         public String getAttribute()
              return this.attribute;
         public static void main(String[] args) {
    ...and another...
    public class SampleClassUser {
         public static void main(String[] args) {
              SampleClass sc1 = new SampleClass();
              String test = "test";
              sc1.setAttribute(new String(test));
              if (sc1.getAttribute() == test)
                   System.out.println("SampleClassUser MAIN : same object");
              if (sc1.getAttribute().equals(test))
                   System.out.println("SampleClassUser MAIN : equal values");
              SampleClass sc2 = new SampleClass(sc1);
              sc1.setAttribute("test");
              if (sc2.getAttribute() == sc1.getAttribute())
                   System.out.println("sc1 and sc2 : same object");
              if (sc2.getAttribute().equals(sc1.getAttribute()))
                   System.out.println("sc1 and sc2 : equal values");
    }the second class uses the first class. running the second class outputs the following...
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    SampleClassUser MAIN : equal values
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    INSIDE CONSTRUCTOR : same object
    INSIDE CONSTRUCTOR : equal values
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    sc1 and sc2 : equal values
    ...i'm just curios why the last 3 lines are the way they are.
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    sc1 and sc2 : equal values
    how come while inside the setter method, the objects are the same object, and after leaving the setter method are not the same objects?
    Can anyone point a good book that shows in detail how objects, primitives and collections are referenced, especially when passed to methods. Online reference is preferred since the availability of books can be a problem for me.
    Thanks very much

    You are confusing references with objects.
    This compares two object references:
    if( obj1 == obj2 ) { // ...Whereas this compares two objects:
    if( obj1.equals(obj2) ) { // ...A reference is a special value which indicates where in memory two objects happen to be. If you create two strings with the same value they won't be in the same place in memory:
    String s1 = new String("MATCHING");
    String s2 = new String("MATCHING");
    System.out.println( s1 == s2 ); // false.But they do match:
    System.out.println( s1.equals(s2) ); // trueIf you're using a primitive then you're comparing the value that you're interested in. E.g.
    int x = 42;
    int y = 42;
    System.out.println(x == y); // trueBut if you're comparing references you're usually more interested in the objects that they represent that the references themselves.
    Does that clarify matters?
    Dave.

  • Problem with local class, static private attribute and public method

    Hello SDN,
    Consider the following situation:
    1) I have defined a LOCAL class airplane.
    2) This class has a private static attribute "type table of ref to" airplane (array of airplanes)
    3) A public method should return the private static table attribute
    Problems:
    a) The table cannot be given as an EXPORTING parameter in the method because TYPE TABLE OF... is not supported and I get syntax errors. I also cannot define a dictionary table type because it is a local class.
    b) The table cannot be given as a TABLES parameter in the method because TABLES is not supported in the OO context.
    c) The table cannot be given as an EXPORTING parameter in the method defined as LIKE myStaticAttribute because my method is PUBLIC and my attribute is PRIVATE. ABAP syntax requires that all PUBLIC statements are defined before PRIVATE ones, therefore it cannot find the attribute to reference to with LIKE.
    I see only 2 solutions:
    a) Never ever use local classes and always use global classes so that I might define a dictionary table type of my class which I can then use in my class.
    b) Make the attribute public, but this goes against OO principles, and isn't really an option.
    Am I missing anything here, or is this simply overlooked so far?

    Hello Niels
    Since your class is local and, thus, only know to the "surrounding" application is does not really make sense to make it public to any other application.
    However, if you require to store instances of your local classes in internal tables simply use the most generic reference type possible, i.e. <b>OBJECT</b>.
    The following sample report shows how to do that. Furthermore, I believe it also shows that there are <u><b>no </b></u>serious inconsistency in the ABAP language.
    *& Report  ZUS_SDN_LOCAL_CLASS
    REPORT  zus_sdn_local_class.
    " NOTE: SWF_UTL_OBJECT_TAB is a table type having reference type OBJECT
    *       CLASS lcl_airplane DEFINITION
    CLASS lcl_airplane DEFINITION.
      PUBLIC SECTION.
        DATA:    md_counter(3)             TYPE n.
        METHODS: constructor,
                 get_instances
                   RETURNING
                     value(rt_instances)   TYPE swf_utl_object_tab.
      PRIVATE SECTION.
        CLASS-DATA: mt_instances    TYPE swf_utl_object_tab.
    ENDCLASS.                    "lcl_airplane DEFINITION
    *       CLASS lcl_airplane IMPLEMENTATION
    CLASS lcl_airplane IMPLEMENTATION.
      METHOD constructor.
        APPEND me TO mt_instances.
        DESCRIBE TABLE mt_instances.
        md_counter = syst-tfill.
      ENDMETHOD.                    "constructor
      METHOD get_instances.
        rt_instances = mt_instances.
      ENDMETHOD.                    "get_instance
    ENDCLASS.                    "lcl_airplane IMPLEMENTATION
    DATA:
      gt_instances      TYPE swf_utl_object_tab,
      go_object         TYPE REF TO object,
      go_airplane       TYPE REF TO lcl_airplane.
    START-OF-SELECTION.
      " Create a few airplane instance
      DO 5 TIMES.
        CREATE OBJECT go_airplane.
      ENDDO.
      gt_instances = go_airplane->get_instances( ).
      CLEAR: go_airplane.
      LOOP AT gt_instances INTO go_object.
        go_airplane ?= go_object.
        WRITE: / 'Airplane =', go_airplane->md_counter.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe<u></u>

  • Problem with jax-ws and optional attributes

    Hello,
    I'm developing some web services, starting by defining the object model in schemas, then doing WSDL first to define the services.
    I've come across a problem that appears to be caused by jax-ws not properly handling optional attributes. I've tried this with both 2.0 and 2.1ea3 and both fail the same way.
    I created a simplified test case to repeatably demonstrate the problem.
    The type definition for the object looks like this :
    <xsd:complexType name="TestObject" >
    <xsd:attribute name="name" type="xsd:string" use="required"/>
    <xsd:attribute name="subId" type="xsd:integer" use="optional" />
    </xsd:complexType>
    And in the wsdl:
    <wsdl:message name="testRequest">
    <wsdl:part name="testrequest" type="mf:TestObject"/>
    </wsdl:message>
    <wsdl:operation name="testAction">
    <wsdl:input name="testRequest" message="mf:testRequest"/>
    <wsdl:output name="successResponse" message="mf:successResponse"/>
    </wsdl:operation>
    and the test code:
    public void testOptionalAttrs()
    TestObject testObj = new TestObject();
    testObj.setName("testName");
    //testObj.setSubId(2);
    MDSProvisioningResourcePortType resourceManager = factory.getGatewayResourceManager();
    boolean success = resourceManager.testAction(testObj);
    Running the test code with the 'setSubId' uncommented works.
    With the 'setSubId' call commented out out results in this error:
    javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
         at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:301)
         at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:124)
         at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:91)
         at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:225)
         at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:121)
         at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:69)
         at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:541)
         at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:497)
         at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:392)
         at com.sun.xml.ws.client.Stub.process(Stub.java:213)
         at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:120)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:238)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:212)
         at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
         at $Proxy58.testAction(Unknown Source)
         at com.qualcomm.mf.prov.ProvisioningGatewayClientFactoryTest.testOptionalAttrs(ProvisioningGatewayClientFactoryTest.java:118)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
         at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
         at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
         at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
         at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
         at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:255)
         at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:64)
         at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:105)
         at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:292)
         ... 35 more
    Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
         at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:224)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:239)
         at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:302)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:661)
         at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:111)
         at com.sun.xml.bind.v2.runtime.CompositeStructureBeanInfo.serializeBody(CompositeStructureBeanInfo.java:71)
         at com.sun.xml.bind.v2.runtime.CompositeStructureBeanInfo.serializeBody(CompositeStructureBeanInfo.java:19)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:663)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:250)
         ... 38 more
    Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
         at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:33)
         at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.print(TransducedAccessor.java:199)
         at com.sun.xml.bind.v2.runtime.property.AttributeProperty.serializeAttributes(AttributeProperty.java:61)
         at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:295)
         ... 44 more
    Caused by: java.lang.NullPointerException
         at org.w3._2001.xmlschema.Adapter3.marshal(Adapter3.java:23)
         at org.w3._2001.xmlschema.Adapter3.marshal(Adapter3.java:1)
         at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:31)
         ... 47 more
    So am I missing something or is jax-ws not handling optional attributes correctly?
    Thanks,
    Hank

    Hi,
    This is not a direct answer to your question. But if you want to build restful web services with Weblogic 10.3, why not use Jersey . It is the implementation of the new JAX-RS spec. In my experience, although Jersey is part of the Java EE 6 spec, it appears to work ok with Java EE 5 container like Weblogic 10.3.1. The [JAX-RS section of Java EE tutorial|http://java.sun.com/javaee/6/docs/tutorial/doc/giepu.html] is another good source of example code.
    Edited by: vamsee2 on Sep 25, 2009 12:38 PM

  • Problem with undesired rounding of entity attributes of type Number

    Hello,
    We have an entity object based on an oracle database table. Some of the columns of the table are of type NUMBER ( without specified precision and scale) and are mapped to attributes of type oracle.jbo.domain.Number as is the oracle recommendation and default behaviour. We have a view object based on this entity. We are using JSF <af:table> component to show and edit the contents of the view object.
    In the database table we have values in the NUMBER columns like:
    -.0000000000000696421833421346
    8029.19708029197
    -364.9641231232332
    The problems is that these values get rounded to the 3th digit after the decimal point, without to have specified any formatting. The numbers shown in the <af:table> look like:
    -0
    8029.197
    -364.964
    We tested the ViewObject with the Business Component Browsers and there the values looked fine. In the JSF page we tried to comment out the <af:converter> but the result is the same.
    The problem is where these values are rounded to the 3th digit after the decimal point. Is that an ADF configuration?
    Please reply ASAP, the case is urgent, we are waiting on that to move our system to production.

    Hi
    I have a similar problem.
    I want to load xml data into a table using the OracleXmlSave class.
    There are long numbers to import (7638286488771946140)
    When the destination field is of type NUMBER(38), everything is alright. But when there is no precision specified (just NUMBER) the numbers are rounded to 14 digits
    7638286488771946140 -> 7638286488771950000
    When i insert numbers with TOAD, everything's alright, even with "just-NUMBERs".
    Any ideas?
    Daniel
    Message was edited by:
    user548995
    Message was edited by:
    user548995

  • Problem with adjusting both transparency and color of an object

    I am writing a program where when an object is picked, both it's transparency and color will be altered (the object will become opaque, and its color will turn to a predefined "selected" color), while the previously selected object will return to its original transparency and color. I am able to get this to work, except that objects that were picked two or more picks ago will remain in the selected color, albeit in their original transparency. This problem only seems to occur when transparency is factored in. The picking/color & transparency altering code is as follows.
    public class PickingListener extends MouseAdapter {
         private PickCanvas pickCanvas;
         private TextDisplay overlay;
         private Primitive p;
         private Primitive lastP;
         private ColoringAttributes origColor;
         private TransparencyAttributes origTransparency;
         public PickingListener(PickCanvas pickCanvasArg, TextDisplay overlayArg) {
              pickCanvas = pickCanvasArg;
              overlay = overlayArg;
         public void mouseClicked(MouseEvent e) {
              pickCanvas.setShapeLocation(e);
              PickResult result = pickCanvas.pickClosest();
              if (result == null) {
                   System.out.println("Nothing picked");
              } else {
                   p = (Primitive) result.getNode(PickResult.PRIMITIVE);
                   if (p != null) {
                        setSelectedColor();
                        overlay.setPickedBarInfo((BarInformation) p.getUserData());
                   else
                        System.out.println("null");
         private void setSelectedColor() {
              ColoringAttributes barCA = new ColoringAttributes();
              TransparencyAttributes barTransp = new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f);
              barCA.setColor(ColorConstants.SELECTED);
              if (lastP != null) {
                   lastP.getAppearance().setColoringAttributes(origColor);
                   lastP.getAppearance().setTransparencyAttributes(origTransparency);
              origColor = p.getAppearance().getColoringAttributes();
              origTransparency = p.getAppearance().getTransparencyAttributes();
              p.getAppearance().setColoringAttributes(barCA);
              p.getAppearance().setTransparencyAttributes(barTransp);
              lastP = p;
    }Capabilities to alter the primitive's color and transparency are all set.
         barAppearance.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
              barAppearance.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
              barAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_WRITE);          barAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
    ColoringAttributes barCA = new ColoringAttributes();
    barCA.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
    barCA.setCapability(ColoringAttributes.ALLOW_COLOR_READ);)
    Any insight as to why this would occur would be greatly appreciated.
    -Adrian Benton

    A Behavior is the preferred way to make changes in a scenegraph. Here is an example from a previous post that changes the appearance of a shape when it collides with another shape.
    The javadoc for javax.media.j3d.Behavior appears to refer to the issue you have.
    Transparencies are confusing, different display adapters deal with them differently. Suggest you search the forum at
    http://forums.java.net/jive/forum.jspa?forumID=70
    for more detailed information.
    regards
    class CollisionDetector extends Behavior {
      private static final Color3f highlightColor = new Color3f(0.0f, 1.0f, 0.0f);
      private static final ColoringAttributes highlight = new ColoringAttributes(
          highlightColor, ColoringAttributes.SHADE_GOURAUD);
      private boolean inCollision = false;
      private Shape3D shape;
      private ColoringAttributes shapeColoring;
      private Appearance shapeAppearance;
      private WakeupOnCollisionEntry wEnter;
      private WakeupOnCollisionExit wExit;
      public CollisionDetector(Shape3D s) {
        shape = s;
        shapeAppearance = shape.getAppearance();
        shapeColoring = shapeAppearance.getColoringAttributes();
        inCollision = false;
      public void initialize() {
        wEnter = new WakeupOnCollisionEntry(shape);
        wExit = new WakeupOnCollisionExit(shape);
        wakeupOn(wEnter);
      public void processStimulus(Enumeration criteria) {
        inCollision = !inCollision;
        if (inCollision) {
          shapeAppearance.setColoringAttributes(highlight);
          wakeupOn(wExit);
        } else {
          shapeAppearance.setColoringAttributes(shapeColoring);
          wakeupOn(wEnter);
    }

  • Problems with sub-items and header attributes in complains

    Hello Gurus!
    I am relatively new to the enterprise services and I have a requirement to create a complain with one product and a child product (items 1000 and 1010) but I tried several ways the service and no matter what I do I always get 2 items without relationship between them. I have tried specifying the parent item ID during create (did not expect to work as parent has also not been created yet) and also tried the BusinessTransactionDocumentReference, but also did not work or did not use the content correctly, in the ES Workplace there is not much info about the possible values for this data segment and it's not returned when I read an existing complain (so I think it is not the way to go)
    Finally, the question is... can I create a complain using the enterprise service CustomerComplaintCRMCreateRequ and with the header, item and subitem in the same step or must I create first and then update? (Like the manual process would be)
    Thanks!

    Hi Milos,
    If nothing at all has synchronized, I would first double check your connection settings and passwords.
    If the synch appears to to be connecting correctly, you will need to look at the data that it is failing on.
    The synch queue is the prx_transaction_queue table in the Business One database.  The object_type column refers to a Business One object.  2 for business partner and 4 for items.  The list_of_cols_val_tab_del is the key in the associated table.  For business partners that is OCRD.CardCode and items OITM.ItemCode.
    First determine that there is no bad data in the queue.  Bad data is typically defined as null or empty strings in the list_of_cols_val_tab_del column.
    Try running the following for business partners:
    select *
    from prx_transaction_queue
    where object_type = 2 and (list_of_cols_val_tab_del is null or list_of_cols_val_tab_del = '')
    And this for Items.
    select *
    from prx_transaction_queue
    where object_type = 4 and (list_of_cols_val_tab_del is null or list_of_cols_val_tab_del = '')
    If there are nulls or empty strings in the list_of_cols_val_tab_del column, delete them.
    If not, take a look at the first records in the queue.
    select top 1 *
    from prx_transaction_queue
    where object_type = 2
    order by tmstmp
    and for items:
    select top 1 *
    from prx_transaction_queue
    where object_type = 4
    order by tmstmp
    Change the transaction_type to "X" (remember what is was, because you will need to change it back).  Changing this value will remove the item from the synch.
    Rerun the synch. 
    If it runs at this point, there is probably data in the records that the synch was not expecting.  The business partner data will need to be examined.  Tics in key values (CardCode, Address Name, contact name, itemcode) may cause problems.
    If this is the case, you might want to contact support to try to track the problem down.
    Another source of problems may be database collation.  We can talk about that if none of the above works.

  • Problem with h:dataTable and binding attribute

    I am new to JSF and I have a problem using the binding attribute of h:dataTable.
    I can successfully use the value attribute to display rows of data fetched from an Oracle database into h:dataTable, but I do know how to bind a h:dataTable to a server object which I would use to update the changes made in the h:dataTable.
    Can some body show me an example how to do so ?
    Thanks in advance.

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Problem with ora:output and xmlns attribute

    Using lastest XDK.
    I am using the built in extension ora:output in a stylesheet running via XSQL called from a small java prg.
    I am using this to generate several html fragments that will get processed later on not by xsql or xml/xsl but by another java prg.
    I have specifed the output as html BUT when I look at the output some of the elements have an xmlns attribute added i.e. xmlns:ora="http://www.oracle.com/XSL/Transform/java"....
    Strange thing its not on all elements, "a", "tr", "td" tags are ok but "b", "br" and "table" have this attribute added.... HELP!!
    How do I stop this attribute getting added...
    Many thanks
    Rob
    PS I know if I use an "html" tag to wrap the output then only that element ends up with the xmlns attribute but I cant/dont want to do this as the prg running later will combine many of these fragments to create a single "real" html page.

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Problem with decimal data visualization in a circular graphic object type

    When we are design a report using Crystal Reports 2008 we found the following problem. When we insert an object of type circle graphic selecting the option in the graphics wizard for view in the legend data both in value and percentage (u2018bothu2019 design) we cant show them in a two decimals format at the same time.
    Using the option u2018number formatu2019 and indicating two decimals only affects the value but not the percentage.
    Show both the value and the percentage with two decimals at same time itu2019s a necessary requirement for our report design.
    Is there any way to show both the value and the percentage in a circle graphic object with two decimals at the same time?
    Thanks.

    hello Jose,
    i am not sure what you mean by "circular graphic object type".
    there's nothing in the standard cr 2008 build that has this that i've ever found that creates a circle other than inserting a box and changing the rounding on the corners. if you're using a 3rd party product or add-on you'll need to contact whoever built it.
    cheers,
    jamie

  • *Very challenging problem with Firefox involving 'table-layout' attribute and cell padding

    I've been trying to figure this out for days and I just feel
    like my head is going to explode. I don't even think words could
    describe the relief if someone could solve this problem for me.
    I described the problem here to make things easier:
    http://morthian.googlepages.com/Untitled-2.html

    .oO(AngryCloud)
    >I came up with a solution. If I use a div inside of the
    cells instead of
    >assigning them a class, the problem goes away.
    This doesn't sound right. You should put the page up again,
    describe
    what you're trying to do and what the problem is in more
    detail.
    >This is going to take me hours
    >to monotonous work, but I will do what I have to do.
    Search & replace comes to mind, but this shouldn't be
    necessary at all.
    A 'div' inside a table cell just for the sake of "fixing"
    some obscure
    problem is not really a solution, as it doesn't really fix
    anything.
    Micha

  • Problem with f:validator and f:attribute

    Here is part of my code:
    <h:dataTable value="#{getQuestionsBean.answers}"
                                       var="question">
                                       <h:column>
                                       <h:panelGrid columns="1">
                                                 <h:inputText id="inputAnswer" value="#{question.answer}"
                                                      rendered="#{question.isInputText}" required="true">
                                                      <f:attribute name="pattern" value="#{question.validatePattern}"/>
                                                      <f:attribute name="errorMessage" value="error text" />
                                                      <f:validator validatorId="custom" />
                                                 </h:inputText>
                                                 <h:message for="inputAnswer" errorClass="errorMessage"/>
    </h:dataTable>
    "custom" is a custom validator witch need a dynamic pattern and error message text. When I send this values like in my code(in pattern atribute), in validator I have only null's. When I put into value just text (like in errorMessage attribute)everything is ok. Any ideas? It's very importent and I can't solve it. Please help.

    Hi,
    I'm stuck in the same problem...did u get any solution for this problem.
    Thanks
    ved

  • Problem with Configurator - Cannot Update Item Attributes for a Config item

    Hi!
    We configured an item to reproduce the following feature of Oracle Configurator in our business case (Oracle Configurator Modeling Guide - 115czmod.pdf): «For example, if you have raw materials that are ordered by lengths, do not create an item for each length. Instead, define a single item for each raw material with an attribute: Length. Then capture the needed length from the end user by a numeric input or from a List of Options, and associate that input with the attribute.»
    However, after we run the AutoCreate Configuration Items program the item was created in the Item Master but no Attribute was updated with the user defined values (within OConfigurator).
    We associated Item Attributes to Propoerties and these are associated to Feature Options.
    we wish to have the Item Descriptive Element Values (Item Catalog)
    transferred from the Configurator run time, after we configure any item.
    This is because we are working with item dimensions, such as length and width.
    We need to define these dimensions during the Configurator run time and have them transferred into the final configuration so that we can use them later on manufacturing. We wish to display these dimensions on a job.
    Support said that "The descriptive element value for the configuration item is copied from the model. This process will not look at the properties in the configurator.
    You may consider using the custom hook for catalog descriptions to get the selected attributes from CZ to the descriptive elements for the config item. Please see Custom CTO Packages under Setup page 2-63 in CTO Process Guide for more details."
    I'm trying to implement the suggested solution.
    I've customized user_catalog_desc procedure on CTO_CUSTOM_CATALOG_DESC package to populate the item catalog values.
    I'm failing to find the descriptive element values defined on configuratior for a specific inventory item id.
    I have managed to found a relation between "p_params.p_item_id" given in procedure user_catalog_desc and
    the configurated item_id in order to update the catalog data on the CTO_CUSTOM_CATALOG_DESC package.
    This is what I've done:
    procedure user_catalog_desc (
    p_params IN CTO_CUSTOM_CATALOG_DESC.inparams,
    p_catalog_dtls IN OUT NOCOPY CTO_CUSTOM_CATALOG_DESC.catalog_dtls_tbl_type,
    x_return_status OUT NOCOPY VARCHAR2)
    is
    begin
    declare
    counter number;
    i number;
    l_value varchar2(30);
    begin
    -- Put your logic here in such a way that you populate p_catalog_dtls
    -- parameter. p_catalog_dtls is a array of records. The attributes of
    -- this record are cat_element_name and cat_element_value.
    -- viz. record (
    -- cat_element_name varchar2(30),
    -- cat_element_value varchar2(30)
    -- Example : p_catalog_dtls(1).cat_element_value := 'XYZ';
    -- IMPORTANT : DO NOT ALTER THE VALUE OF cat_element_name . Doing so will
    -- result in incorrect or inconsistent behaviour.
    -- Make sure you set the x_return_status variable to one of the following:
    -- FND_API.G_RET_STS_SUCCESS to indicate success
    -- FND_API.FND_API.G_RET_STS_ERROR to indicate failure with expected status
    -- FND_API.FND_API.G_RET_STS_UNEXP_ERROR to indicate failure with unexpected status
    select count(*) into counter from MTL_DESCR_ELEMENT_VALUES
    where inventory_item_id = p_params.p_item_id;
    for i in 1 .. counter loop
    select
    distinct to_char(nvl(cz.input_num_val,cz.item_num_val)) into l_value
    from OE_ORDER_LINES_V oe
    , oe_order_headers_all oeh
    , CZ_CONFIG_CONTENTS_V cz
    where oe.header_id = oeh.header_id
    and oeh.order_number in (
    select distinct oeh.order_number
    from OE_ORDER_LINES_V oe
    , oe_order_headers_v oeh
    where oe.header_id = oeh.header_id
    and oe.inventory_item_id = p_params.p_item_id)
    and cz.ps_node_name = p_catalog_dtls(i).cat_element_name
    and oe.config_header_id = cz.config_hdr_id
    and oe.config_header_id in (select distinct cz.config_hdr_id from CZ_CONFIG_CONTENTS_V cz)
    and cz.ps_node_name in (select element_name from MTL_DESCR_ELEMENT_VALUES where inventory_item_id = p_params.p_item_
    id);
    p_catalog_dtls(i).cat_element_value := l_value;
    end loop;
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    end user_catalog_desc;
    end;
    Although the customization seam correct the AutoCreate Configuration Items process
    terminates with warning, and the catalog info is not updated as expected.
    Can anyone help me on this?
    Many thanks in advance.
    Paulo Santos

    How did you solve this issue? During my testing I found there to be no link to the order lines when I was within this program. Therefore I am having issues getting the configuration information to populate the catalog. Is there a link and I just was doing it wrong? Thanks for any help!
    Thanks,
    Angela

  • MVC Problem with getter method of table attribute in model class

    Hi,
    I am on 620 SP34. I am writing a bsp application with mvc. One of the model classes has an attribute of type table. I use this attribute in a htmlb-tableview and '//MODEL/ZMY_TAB' for data binding. If I try to activate a getter method for this attribute, the application dumps with exception <i>BSP exception: Structure component with name "ZMY_TAB" does not exist</i>. I find the SAP source, that raising this exception (see below). The source code looks like: <i>"I don't support getter methods for tables in attribute path"</i>! The setter method works fine, so I am at a loss. Has anyone of you wrote a getter method for an table attribute in bsp-mvc? Have I to consider anything special?
    Thanks,
    Carsten
    Main Program CL_BSP_MODEL==================CP
    Source code of CL_BSP_MODEL==================CM00Z
    METHOD IF_BSP_MODEL_BINDING~GET_ATTRIBUTE_DATA_REF
           * check if attribute exists for binding!                                   
             if exists_attribute( l_name ) is initial.                                
               return.                                                                
             endif.                                                                               
    * setter or getter defined? Not supported for DATA REF requests            
             if get_getter( attribute_name = l_name ) is not initial.                 
               raise exception type cx_bsp_inv_component                              
                 exporting name = l_name.                                             
             endif.                                                   

    You have two options:
    1. Make your attributes public. It should work fine.
    2. If you need to process the attribute values before it is used, you can make the attribute private but will need three methods
    GET_T_ZMY_TAB that returns the table
    SET_T_ZMY_TAB that sets the values
    GET_M_T_ZMY_TAB that returns DDIC information about the attribute. The same holds good for structures(Change to GET_S_ and GET_M_S_ ) and simple attributes(Change to GET_ and GET_M_).
    The set and get methods are kind of documented at http://help.sap.com/saphelp_nw04/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/content.htm but there is no mention of the GET_M_ methods. I could not find one single document on the Model part MVC.
    Once I added the GET_M_XYZ methods to my attributes, my BSPs started to work fine.
    Cheers
    Sreekanth

Maybe you are looking for