2 Replies Latest reply on Jun 8, 2004 1:11 PM by cr*420723*ns

    Error in data format

    26374
      Hi

      We got a problem with date formats i InterConnect. We are transforming a IDOC fra SAP in interconnect, in IDOC the date is 20040401 ( yyyymmdd ). The interConnect transform is a CopyField an the result type is date. How can we control the format mask ?

      We get the error :

      oracle.oai.agent.common.AgentRuntimeException: Could not convert 20040514 to a date. Please make sure your dates are in the correct format.
           at oracle.oai.agent.common.OAIDate.getMillis(OAIDate.java:75)
           at oracle.oai.agent.common.OAIDate.<init>(OAIDate.java:50)
           at oracle.oai.agent.common.AttributeObjectImpl.convertToCorrectType(AttributeObjectImpl.java:376)
           at oracle.oai.agent.common.AttributeObjectImpl.set(AttributeObjectImpl.java:107)
           at oracle.oai.agent.common.AttributeObjectImpl.set(AttributeObjectImpl.java:92)
           at oracle.oai.agent.server.transform.MessageTransformer.copyObject(MessageTransformer.java:1400)
           at oracle.oai.agent.server.transform.MessageTransformer.processStackFrame(MessageTransformer.java:1006)
           at oracle.oai.agent.server.transform.MessageTransformer.processTransformMetadatalet(MessageTransformer.java:467)
           at oracle.oai.agent.server.transform.MessageTransformer.transformMessage(MessageTransformer.java:261)
           at oracle.oai.agent.server.OutMessageTransformer.processObject(OutMessageTransformer.java:64)
           at oracle.oai.agent.common.QueueAgentComponent.run(QueueAgentComponent.java:110)
           at java.lang.Thread.run(Thread.java:484)


      Henning
        • 1. Re: Error in data format
          422369
          I have also struck the same DATE issue.
          I am pushing XML into RAW payload onto an AQ adapter (HP) and am subscribing with a DB Adapter (Solaris).
          When the DATE transformation (CopyField) happens in the DB Adapter, it fails with the same sort of error message as Henning has above:
          -------------------------------------------------------
          Tue Jun 08 14:32:05 EST 2004: Inbound Transform Engine: performing transform.
          Transform: CopyFields
          Source Fields: [PO_UPDATE2_CO:OAI/V1.PO_Update.last_updated]
          Destination Fields: [Purchase_Order_PO_UPDATE2_OAI_V1_S:OAI/V1.LAST_UPDATED]
          Source values: [08-jun-2004 10:37:16]
          Params: [[]
          Tue Jun 08 14:32:05 EST 2004: Inbound Transform Engine: done performing transform CopyFields.
          Results: [08-jun-2004 10:37:16]

          Tue Jun 08 14:32:05 EST 2004: There was a problem transforming the message.
          Purchase_Order.PO_UPDATE2:OAI/V1,OAI/V1,false,0
          PO_Update
          id: 2
          action: U
          item: Hot Stereo
          amount: $1499.00
          quantity: 8
          last_updated: 08-jun-2004 10:37:16

          oracle.oai.agent.common.AgentRuntimeException: Could not convert 08-jun-2004 10:37:16 to a date. Please make sure your dates are in the correct format.
               at oracle.oai.agent.common.OAIDate.getMillis(OAIDate.java:75)
               at oracle.oai.agent.common.OAIDate.<init>(OAIDate.java:50)
               at oracle.oai.agent.common.AttributeObjectImpl.convertToCorrectType(AttributeObjectImpl.java:376)
               at oracle.oai.agent.common.AttributeObjectImpl.set(AttributeObjectImpl.java:107)
               at oracle.oai.agent.common.AttributeObjectImpl.set(AttributeObjectImpl.java:92)
               at oracle.oai.agent.server.transform.MessageTransformer.copyObject(MessageTransformer.java:1400)
               at oracle.oai.agent.server.transform.MessageTransformer.processStackFrame(MessageTransformer.java:1006)
               at oracle.oai.agent.server.transform.MessageTransformer.processTransformMetadatalet(MessageTransformer.java:467)
               at oracle.oai.agent.server.transform.MessageTransformer.transformMessage(MessageTransformer.java:261)
               at oracle.oai.agent.server.InMessageTransformer.processObject(InMessageTransformer.java:87)
               at oracle.oai.agent.common.QueueAgentComponent.run(QueueAgentComponent.java:110)
               at java.lang.Thread.run(Thread.java:484)
          Tue Jun 08 14:32:05 EST 2004: Inbound Transform Engine: ** Error ** message could not be transformed and will be dropped.
          Purchase_Order.PO_UPDATE2:OAI/V1,OAI/V1,false,0
          PO_Update
          id: 2
          action: U
          item: Hot Stereo
          amount: $1499.00
          quantity: 8
          last_updated: 08-jun-2004 10:37:16
          -------------------------------------------------------

          I tried setting the HUB DB and the "target" DB Adapter DB nls_date_formats the same, but this did not help.
          • 2. Re: Error in data format
            cr*420723*ns
            Hi,
            I had a similar problem and as a workaround I ended up defining each field as a string and formatting the date at each end of the integration, not ideal I know.

            I also have a note from Oracle stating that:
            "Oracle 9iAS Interconnect by default uses a java date format when sending fields of datatype ‘date’ to subscribing applications. This would not be in most cases acceptable to the publishing or subscribing applications, which expect dates in a specific format".
            To help deal with this, two custom transformations have been defined which carry out date and date format transformations. These are :

            DatetoString – convert a date into a string in an arbitrary format

            StringtoDate – convert a string, representing a date in some specified format, into a ‘true’ Interconnect date.

            When applying the transformation from string to date, the format of the date as supplied in the string field is provided as a parameter to the transformation to convert it to a date.

            One possible use of these applications is to transfer dates reliably between applications. To do this, the following approach should be adopted :

            •     Define the date(s) as String fields in the Application views.
            •     Define the value(s) as date datatypes in the Common view.

            Then, the StringtoDate transform can be used in the publishing application to transform the string containing the date in one Application view to a date object in the common view, and the DatetoString transform can be used to transform this date to a string object with a different format in the subscribing Application view. This allows dates to be transformed between the various formats required by applications without resorting to elaborate and error prone manipulations (eg translating ‘Jan’ to ‘01’ , subtracting 12 from 24 hour times if needed and so on)

            The date in the common view will be of date type and will be in the default java date type. The date can be then transformed to a string with any valid format, which is provided as a parameter."

            Hope this helps.