Message mapping: Insert LineBreak into Element Value

Hi everybody,
we use a mapping for generating the content of an email body.
I have to insert lineBreaks.
How can I do this in message mapping?
Regards Mario

Mario,
Your question is already answered.
Did using \n helped you?
You seem to have marked the thread as answered and didnt award points.
So i feel anyone who has a similar issue and searches for this thread wont know which thing to do to solve the problem.
This is one of the reasons why points system are there.
Regards,
Sumit
ps: i know you are a big time contributor in sdn.  I think doing a little bit extra will help everyone.

Similar Messages

  • BPM Message Mapping: "Cannot produce target element /ns1:BAPI...."

    Hi,
    A scenario File - BPM - BAPI call was developed, as described in blog 'RFC scenario using BPM' cfr. link
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    The Mapping is as follows:
    MT_EDB_MATERIAL_REQ (1:1) --> BAPI_MATERIAL_EXISTENCE_CHECK (1:1)
    MATNR (1:1) -
    > MATERIAL (1:1)
    When executing the scenario, an error appears in the trace of SXMB_MONI, step 'Request Message Mapping'
    Cannot produce target element /ns1:BAPI_MATERIAL_EXISTENCECHECK. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd....
    I tried the following:
    1) import the XML-file into the testmapping: executed successfully
    File:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_EDB_MATERIAL_REQ xmlns:ns0="http://agfa.com/SD_EDB">
    <MATNR>15P6X</MATNR>
    </ns0:MT_EDB_MATERIAL_REQ>
    2) Removed the mapping on node level and left mapping only on element level (material): same error
    3) Activated the message mapping, interface mapping, determinations, etc again...:same error
    4) Removed the Interface Mapping and created it again: same error
    5) Compared the version ID of the Interface Mapping/message mapping in the Monitor trace with the version ID of the IR and saw that there was a difference.
    After the CPA full cache, SXI_CACHE full refresh and object refresh in the IB Administration, the differences remain, and also the error....
    Anybody an idea ?

    Hi
    >>>Cannot produce target element /ns1:BAPI_MATERIAL_EXISTENCECHECK. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd....
    The error clearly says that one of the occurrence value  for the target node mentioned is not coming from the source during mapping. The easiest way to solve the problem is as follows
    <b>
    First Execute the mapping as pointed out by "Raj" and the following steps.
    </b>
    1. Goto the Mapping Editor
    2. Double click on the target node that is causing the problem here BAPI_MATERIAL_EXISTENCECHECK.
    3.  Right click on the same node and select "DisplayQueue".
    4. View the Queue.
    5. YOu will find "Suppress" entries, which means a value is expected but no value is coming in.
    6.Go from right to left and check each node in the mapping and you will be able to trace where the suppress node comes from and take appropriate action
    regards
    krishna

  • Changing datatype, afterwards Message-Mapping cannot produce target element

    Hi,
    we use PI/700.
    I changed a working system by changing a datatype of an existing message (adding a new element). My interface mapping contains two mappings: an XSL-Mapping and afterwards a Message-Mapping.
    My interface mapping looks like this:
    Message-Type A ->
          XSL-Mapping ->
    Message-Type B ->
          Message-Mapping ->
    Message-Type B
    When I test each mapping alone everything works fine (with the new element I added).
    But if I test my interface mapping in IBD with both mappings together, I'll get an error:
    "Cannot produce target element /MT_EDM_OUTBOUND_LASTGANG_TO_SAP/LASTGANG/MASSEINHEIT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd".
    Is it possible that XI has problems in refreshing the XSDs?
    I tried this:
    (1) I changed my Message-Mapping and now all elements are mapped 1:1 -> no success!
    (2) Later I changed my Message-Mapping and build in "exists" with "if" to check whether the element "MASSEINHEIT" is generated by the XSL-Mapping -> It doesn't exists (??? - WHY? - when I test it, everything works fine)
    (2) Afterwards I changed my interface mapping and take only the XSL-Mapping (without the following Message-Mapping) -> the element "MASSEINHEIT" exists now!
    I'm totally confused!
    Any ideas?
    Regards
    Wolfgang Hummel

    Hi,
    If you have made structural changes to the data type..such as number of fields have decreased/increased..or some new fld altogether, then you have to activate the datatype..goto message mapping and then re-do the mapping...but if you have made "typo" changes like names have been changed, etc..then i think it should be alrite..i have sometimes made changes to my datatype, but after activating it, i had to redo the mapping..that was it!...the rest would fall into place:) No changes had to be made in the interface mapping..
    Regards,
    Sushumna

  • Error in message mapping - Cannot produce target element

    As one step in my integration process, I am builing a very simple file to BPM integration (inbound MI async, outbound MI abstract).
    The source type and the target type are completely equal - I am only doing some modifications to some of the content.
    The type for both messages - source & target message - is an imported external definition (DTD), and hence no DT or MT are created.
    As a first step I am trying to fill the target message with the content from the source message (without any modifications to the content). However, when testing this in the message mapping area, I get an error message already when filling the first element, the 'root node'.
    The error message is as follows:
    Start of test
    Compilation of <MM name> successful
    Cannot produce target element <elementname>. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element <elementname>. . Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    End of test
    Any suggestions?
    Thanks,
    C

    Thanks,
    when creating the source message manually in the MM it worked - so nothing wrong with the mapping.
    I saved this file and compared with the "original file" - containing the content which I wanted to upload, and on which the xsd (external definition) was based - and there where some inconsistancies.
    I changed some values in the source XML which made it work, also when uploading the file from a drive.
    So, I will go back to the source system and try to get a better XML.
    Thanks for now!

  • Message-Mapping: nested Loops over Elements

    Hi Experts,
    I have problems with my Message-Mapping in the IR. I have a source and a target structure. In the following I will give you easy examples of these structures:
    <u>source structure:</u>
       <E1EDP01>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
       </E1EDP01>
       <E1EDP01>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
       </E1EDP01>
    <u>target structure:</u>
    <LineItem>
       <IDTNR></IDTNR>
    </LineItem>
    <LineItem>
       <IDTNR></IDTNR>
    </LineItem>
    That means:
    For every <E1EDP01> in the source structure I create one <LineItem> in the target structure. One E1EDP01-Element can contain more than one E1EDP19-Elements. I have to loop over these E1EDP19-Elements, because I have to locate the Element <QUALF> with a given (fixed) value. The Mapping should put the value from the Element <IDTNR> from the source structure - where the QUALF-Element has this given value - in the IDTNR-Element of the target structure.
    I tried it with a UDF, but only the first <IDTNR> in the target structure got filled.
    Thanks for your help
    Christopher

    Thank you,
    but how I can set the Elements IDTNR and QUALF to the context E1EDP01?
    In the splitByValue-Function do I need "each value"?
    best regards
    Christopher

  • Error Message When Inserting Data Into Table

    Hi,
    I am trying to insert the following value into my customer table, however i get the following error on doing so.
    ERROR: date format picture ends before converting entire input string
    STATEMENT:
    insert into phonecall (start_date_time)
    values(10-JAN-2006 11:53:09)
    any ideas as to what might be wrong with my insert statement to bring up this error ??
    start_date_time is a DATE field by the way.

    Or
    SQL> alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS';
    Session altered.
    SQL> create table aa (test date)
      2  /
    Table created.
    SQL> insert into aa values ('11-12-2006 12:11:22')
      2  /
    1 row created.
    SQL> select * from aa ;
    TEST
    11-12-2006 12:11:22
    SQL>

  • Message Mapping - Filter on parent element

    Hi,
    I'm using message mapping for mapping IDoc ORDERS05 to flat file.
    This is the source structure :
    ORDERS05  1..1
    ---- IDOC  1..1
         ---- E1EDKT1  0..99
              ---- TDID  0..1
              ---- TSSPRAS_ISO
              ---- E1EDKT2  0..9999999
                   ---- TDLINE  0..1
    and this is the target structure :
    TCD 1..1
    ---- TCT  1..unbounded
         ---- TDID
         ---- TDSPRAS
         ---- TDLINE
    Can anybody help me about how to do the mapping for having 1 TCT element for each
    E1EDKT2 element with parent (E1EDKT1) having field TDID equals to the constant "ZALO" ?
    For exemple:
    <ORDERS05>
       <IDOC>
          <E1EDKT1>
             <TDID>ZALO</TDID>
             <TSSPRAS_ISO>tdspras1</TSSPRAS_ISO>
             <E1EDKT2>
                <TDLINE>tdline11</TDLINE>
             </E1EDKT2>
             <E1EDKT2>
                <TDLINE>tdline12</TDLINE>
             </E1EDKT2>
          </E1EDKT1>
          <E1EDKT1>
             <TDID>unused</TDID>
             <TSSPRAS_ISO>tdspras2</TSSPRAS_ISO>
             <E1EDKT2>
                <TDLINE>tdline2</TDLINE>
             </E1EDKT2>
          </E1EDKT1>
          <E1EDKT1>
             <TDID>ZALO</TDID>
             <TSSPRAS_ISO>tdspras3</TSSPRAS_ISO>
             <E1EDKT2>
                <TDLINE>tdline3</TDLINE>
             </E1EDKT2>
          </E1EDKT1>
       </IDOC>
    </ORDERS05>
    must result in :
    <?xml version="1.0" encoding="UTF-8"?>
    <TCD>
         <TCT>
              <TDID>ZALO</TDID>
              <TDSPRAS>tdspras1</TDSPRAS>
              <TDLINE>tdline11</TDLINE>
         </TCT>
         <TCT>
              <TDID>ZALO</TDID>
              <TDSPRAS>tdspras1</TDSPRAS>
              <TDLINE>tdline12</TDLINE>
         </TCT>
         <TCT>
              <TDID>ZALO</TDID>
              <TDSPRAS>tdspras3</TDSPRAS>
              <TDLINE>tdline3</TDLINE>
         </TCT>
    </TCD>
    Thanks in advance,
    Laurence

    Hi,
    When implementing your solution, I get only 1 TCT per E1EDKT01 (and no more loop on E1EDKT02) and filter on "ZALO" TDID is not working.
    <TCT>
         <TDID>ZALO</TDID>
         <TDSPRAS>tdspras1</TDSPRAS>
         <TDLINE>tdline11</TDLINE>
    </TCT>
    <TCT>
         <TDID>unused</TDID>
         <TDSPRAS>tdspras2</TDSPRAS>
         <TDLINE>tdline2</TDLINE>
    </TCT>
    <TCT>
         <TDID>ZALO</TDID>
         <TDSPRAS>tdspras3</TDSPRAS>
         <TDLINE>tdline3</TDLINE>
    </TCT>
    I have changed context of TDID to ORDERS05, and context of E1EDKT2 to ORDERS05 too.  Aren't thoses contexts correct?
    Laurence

  • Message Mapping(Display queue and Suppress Value)

    Hi Experts,
    In Message Mapping(graphical mapping), upon checking the properties of the nodes,there's one property display queue, in which suppress is there??
    What does it mean?? Which queue it points and what value is suppressed??
    Thanks & Regards,
    Sushama

    Hi Sushama,
    SUPPRESS means no value.
    suppose we are checking one condition (tdid = "RE" then pass tdline) based on the condition we will send one output. if the condition fails then suppress value goes to the target.
    > What does it mean?? Which queue it points and what value is suppressed??
    es:  if(tdid.equals("WE") ifwithoutelse pass tdline value as output.    [tdid is in E1EDKA1 segment and this segment occurance is multiple]
    In this case if the condition is satisfied once and failed once (means E1EDKT1 segment comes 2 times) then first time it sends the corresponding tdline value and second time it sends the SUPPRESS value.
    Regards
    Ramesh

  • Error in reading XML message and inserting data into another DB using DB link

    Hi Experts,
    I am getting error parsed XML message data while  inserting into another DB table using DB link.
    ORA-22804: remote operations not permitted on object tables or user-defined type columns.
    Please help me.
    Thanks.

    ORA-22804: remote operations not permitted on object tables or user-defined type columns.
    Looking at the error message assuming you might be doing the alter table statement on remote table unit_labels which is throwing the ORA-22804 error which is not permitted on remote tables.

  • Error message when inserting table into JSP

    I am using JDEV 10.1.3.3 and am getting the following error message when I try to create a table in a form on a jsp:
    "Could not complete get pdusage from application because it would result in an invalid document".
    Here is the stack trace:
    oracle.bali.xml.model.XmlReadOnlyException: read-only on commit
         at oracle.bali.xml.model.XmlModel.__precommitTransaction(XmlModel.java:2676)
         at oracle.bali.xml.model.XmlContext.__precommitTransaction(XmlContext.java:1519)
         at oracle.bali.xml.model.XmlContext.__commitTransaction(XmlContext.java:1549)
         at oracle.bali.xml.model.XmlModel.__requestCommitTransaction(XmlModel.java:2717)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:575)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:555)
         at oracle.bali.xml.model.task.StandardTransactionTask.__commitWrapperTransaction(StandardTransactionTask.java:413)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:203)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.fetchUnderTransaction(JDevTransactionManager.java:110)
         at oracle.adfdt.view.common.binding.provider.ADFBaseProvider.<init>(ADFBaseProvider.java:34)
         at oracle.adfdtinternal.view.faces.binding.provider.ADFIteratorModelProvider.<init>(ADFIteratorModelProvider.java:46)
         at oracle.adfdtinternal.view.faces.binding.provider.ADFCustomTableModelProviderFactory.createModelProvider(ADFCustomTableModelProviderFactory.java:64)
         at oracle.adfdtinternal.view.common.binding.datatransfer.ADFBindingsProviderInfo.getData(ADFBindingsProviderInfo.java:40)
         at oracle.adfdtinternal.view.common.binding.datatransfer.BaseADFDataInfo.getData(BaseADFDataInfo.java:35)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.getTransferData(ADFBindingUtils.java:1087)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.getTransferModelProvider(ADFBindingUtils.java:1111)
         at oracle.adfdtinternal.view.common.binding.datatransfer.ADFDocumentFragmentCreatorInfo.createDocumentFragment(ADFDocumentFragmentCreatorInfo.java:63)
         at oracle.adfdtinternal.view.common.binding.operation.CreateOperation.apply(CreateOperation.java:96)
         at oracle.bali.xml.model.datatransfer.operation.PerformOperationAction.actionPerformed(PerformOperationAction.java:39)
         at oracle.bali.xml.share.ActionProxy.actionPerformed(ActionProxy.java:47)
         at oracle.bali.xml.gui.swing.dnd.DropMenuInvoker$CleanupProxy.actionPerformed(DropMenuInvoker.java:235)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Hi,
    obviously you try to drag and drop a component to a place where it breaks the document. Make sure the table is added to the JSP body. Have a look at the page sources for existing syntax problems - e.g. missing close elemenents or misplaced elements
    Frank

  • Message mapping changes

    Hi All.
    I created a message mapping from a custom message type towards MATMAS_BAPI01.
    I disabled the EDI_DC40 field and in the idoc communication channel I disabled "Apply control record values from payload".
    When I check the final idoc message created, I noticed that some EDI_DC40 parameters were wrong.
    <SAP:TABNAM>EDI_DC40</SAP:TABNAM>
      <SAP:MANDT>200</SAP:MANDT>
      <SAP:DOCREL>640</SAP:DOCREL>
      <SAP:DOCNUM>0000000000037246</SAP:DOCNUM>
      <SAP:DIRECT>2</SAP:DIRECT>
      <SAP:IDOCTYP>MATMAS_BAPI01</SAP:IDOCTYP>
      <SAP:CIMTYP />
      <SAP:MESTYP>MATMAS_BAPI</SAP:MESTYP>
      <SAP:MESCOD />
      <SAP:MESFCT />
      <SAP:SNDPOR>SAPCX1</SAP:SNDPOR>
      <SAP:SNDPRN>host01</SAP:SNDPRN>
      <SAP:SNDPRT>LS</SAP:SNDPRT>
      <SAP:SNDPFC />
      <SAP:RCVPOR>CFDCLNT200</SAP:RCVPOR>
      <SAP:RCVPRN>CFDCLNT200</SAP:RCVPRN>
      <SAP:RCVPRT>LS</SAP:RCVPRT>
      <SAP:RCVPFC />
      <SAP:TEST />
      <SAP:SERIAL />
      <SAP:EXPRSS />
      <SAP:STD />
      <SAP:STDVRS />
      <SAP:STATUS>03</SAP:STATUS>
      <SAP:OUTMOD />
      <SAP:SNDSAD />
      <SAP:SNDLAD />
      <SAP:RCVSAD />
      <SAP:RCVLAD />
      <SAP:STDMES />
      <SAP:REFINT />
      <SAP:REFGRP />
      <SAP:REFMES />
      <SAP:CREDAT>2005-09-12</SAP:CREDAT>
      <SAP:CRETIM>23:21:31</SAP:CRETIM>
       <SAP:ARCKEY>2FE85D8023D311DA9BDB000D56B9D8A6</SAP:ARCKEY>   </SAP:IDocOutbound>
    In concrete
    <SAP:SNDPRN>host01</SAP:SNDPRN> had to be changed into <SAP:SNDPRN>hostXX</SAP:SNDPRN>. I thought the value host01 came from the sld (logical system name of the technical system attached to the business system), so I changed that towards hostXX.
    <SAP:RCVPOR>CFDCLNT200</SAP:RCVPOR> had to be changed into <SAP:RCVPOR>SAPCDD</SAP:RCVPOR>. I thought this value came from the rfc destination in the xi sytem, so I created a new one called SAPCDD and configured it into the idoc adapter.
    However, this change in the sld/XI system  did not affect the generated idoc (no, I did not forget to activate ).
    I decided to do some more drastic changes:
      - enable EDI_DC40 field in the message mapping
      - enable "Apply control record values from payload" in the idoc communication channel
    I now hardcode the wanted values.
    After activating the changes, still the same idoc is send towards the R/3 system.
    Can anyone tell me what I am doing wrong.
    Is it a caching problem or am I doing something wrong.
    Kind regards

    hi Geert,
    take a look at my weblog:
    /people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
    it may answer some of your questions:)
    Regards,
    michal

  • Again: RuntimeException in Message-Mapping transformatio~

    Hello Guys,
    again this issue.
    I created the mapping (IDoc to .xsd (external Definition). Testing the mapping is successful. Do I send the IDoc from ERP I get the error message:
    <i>Error while lookup Problem when calling an adapter by using communication channel RFC_Empfaenger. Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:360a7b02b58a30e5b9cc095802b368c5 not available in CPA Cache.</i>
    The mentioned communication channel exits but I cannot find the the channel with the number in CPA Cache. I updated the cache several times. We use this channel as RFC look up to the ERP to read MARA-BISMT of the material number in the IDoc.
    When I copy the payoad of the faulty message and insert it into the test tapstrip field of the message mapping I get the error "java.lang.NullPointerException"
    Do I use another test file (all the same data, except quantity) the test is successful
    I'm already struggling with this problem since a week. Does anybody have an idea
    Rgds.
    Dieter

    Hi,
    Check if the Business System / Service you use in the RFC Lookup code is the same as the one under which the RFC Comm Channel has been created in the Directory?
    You get this error only when either the Business System / Business service is not found or the RFC Comm channel is not found.
    if they both are correct, ensure that the Comm Channel is an RFC Receiver Comm Channel and not a sender or anyother Comm Channel.
    Finally , make some dummy changes and then activate the same and see if it works.
    Regards,
    Bhavesh

  • Message mapping  response error

    Hi..All,
    i am doing RFC-SOAP scenario, in request message mapping i am giving the values at sender side executed, i am getting the fields at target side, in resonse message mapping giving the all fields at sender side,i executed , but in target side not getting any fields, pls suggest me.
    ****for helpful answers i will give points***********
    thanks in advance,
    Pasi

    Hi
    when you do the RFC to SOAP scenario then you have to craete the two message mapping
    one mapping will be b/w both the request messages
    and other mapping will be b/w the response messages.
    in the interface mapping you select the request message mapping in the request tab and response message mapping in the response tab.
    both the message interfaces outbound as well as inbound interface of the synchronous type.
    if u still face the problem please reply me back
    Thanks
    Rinku

  • Manipulate Dates in XI Message Mapping

    Hello all,
    I have a problem in which I need to take a  date from my source file and manipulate this date to help produce my target structure.
    <i><b>This is not my actual XML</b></i>
    <source root>
      <field 1>A</field 1>
      <field 2>Any value</field 2>
      <field 3>Next value</field 3>
      <field 4>20070201</field4>
    </source root>
    Consider the above XML as my source.  I would like to have logic in the message mapping that will check the value of a field (field 1) and based on it's value add or subtract days from the date value provided.
    This would be my output for adding ten (10) days if '<b>field 1</b>' has a value of '<b>A</b>'
    <target root>
      <target 1>A</target 1>
      <target 2>Any Value</target 2>
      <target 3>Next Value</target 3>
      <target 4>20070211</target 4>
    </target root>
    This would be my output for subtracting five (5) days if '<b>field 1</b>' has a value of '<b>B</b>' (Same source file)
    <target root>
      <target 1>B</target 1>
      <target 2>Any Value</target 2>
      <target 3>Next Value</target 3>
      <target 4>20070127</target 4>
    </target root>
    As you can see there is a field in my source system that will tell me what type of logic to perform.  The problem that I am having now is that the message mapping functions that currently exist are not helping me satisfy this requirement.  I have viewed several forums and tried several of the suggestions given but nothing seems to help.  Does anyone know how to solve this problem?  Is there a UDF that anyone has used that would help me in solving this requirement?  The solution should be dynamic to account for leap years as well as for the different days that each month has.
    Answers received will be rewarded with points.
    Thanks in advance for the help that you provide.

    Hi,
    Here i am sending UDF code,which takes date(format:yyyyMMdd) as input and does addition or subtraction operations based on <field 1> value,return the result date(format:yyyyMMdd) as string value.
    public String GenerateDate(String date_input, String field1,Container container){
    //Here "date_input" and "field1" are inputs for this UDF
    int date = Integer.parseInt(date_input);
    Calendar cal;
    int day = date % 100;
    int month = (date/100) % 100 - 1;
    int year = date / 10000;
    cal = Calendar.getInstance();
    cal.set(year, month, day);
    /implement addition or subtraction logic here as your needs/
    if (field1 == "A")          
      cal.add(Calendar.DATE, 10);
    else if(field == "B")
      cal.add(Calendar.DATE, -5);
    day = cal.get(Calendar.DATE);
    month = cal.get(Calendar.MONTH)+ 1;
    year = cal.get(Calendar.YEAR);
    date = year * 10000 + month * 100 + day;
    return (""+date);
    if you need any other details regarding this UDF, plz let me know.
    Cheers,
    Jag

  • Sequence and INSERT ALL INTO with parallelism problem

    I want to use the INSERT ALL INTO style of multiple-inserts (with 10gR2) to normalize a wide table into a skinny table. The large table has a few fk columns and 100 numeric columns. I want to insert them into another table as 100 rows in a single SQL pass.
    CREATE TABLE WIDE_SOURCE(
    FKEY_1 INTEGER,
    FKEY_2 INTEGER,
    FKEY_3 INTEGER,
    AMT001 INTEGER,
    AMT002 INTEGER,
    AMT100 INTEGER);
    CREATE TABLE SKINNY_DEST(
    PKEY INTEGER NOT NULL,
    FKEY_1 INTEGER,
    FKEY_2 INTEGER,
    FKEY_3 INTEGER,
    AMT INTEGER,
    CONSTRAINT PK_SKINNY_DEST PRIMARY KEY(PKEY)
    CREATE SEQUENCE KEY_GEN MINVALUE 1 INCREMENT BY 100 START WITH 1;
    INSERT ALL
    INTO SKINNY_DEST VALUES(KEY_GEN.NEXTVAL+001, FKEY_1, FKEY_2, FKEY_3, AMT001)
    INTO SKINNY_DEST VALUES(KEY_GEN.NEXTVAL+002, FKEY_1, FKEY_2, FKEY_3, AMT002)
    INTO SKINNY_DEST VALUES(KEY_GEN.NEXTVAL+003, FKEY_1, FKEY_2, FKEY_3, AMT003)
    INTO SKINNY_DEST VALUES(KEY_GEN.NEXTVAL+100, FKEY_1, FKEY_2, FKEY_3, AMT100)
    SELECT * FROM WIDE_SOURCE;
    With this query, each row in WIDE_SOURCE will generate 100 rows in SKINNY_DEST. I know that works. Unfortunately, it appears that the sequence isn't working the way I thought it should- with multiple nodes and parallel insert, there's some overlap in the generated key.
    Is there a better way? I've considered 100 separate sequences, but that just seems plain silly. Am I trying to have my cake (the parallelism) and eat it too (by disregarding limitations of Oracle's sequence construct)?

    Have not tested this on a RAC, but it seems to work fine - as expected without any overlaps. (version 10.2.0.1.0)
    SQL> create sequence seq_id start with 1 increment by 10 nomaxvalue nocycle;
    Sequence created.
    SQL> create table skinny ( id number, fk_key1 number );
    Table created.
    SQL> create table wide( fk_key1 number, name varchar2(32) ) parallel( degree 2 );
    Table created.
    SQL> insert into wide select object_id, object_name from all_objects where rownum < 100000;
    51853 rows created.
    SQL> commit;
    Commit complete.
    SQL> exec DBMS_STATS.Gather_Table_Stats( USER, 'WIDE' );
    PL/SQL procedure successfully completed.
    SQL> alter session enable parallel dml;
    Session altered.
    SQL> set autotrace on
    SQL> insert all
    2 into skinny values( seq_id.nextval+0, fk_key1 )
    3 into skinny values( seq_id.nextval+1, fk_key1 )
    4 into skinny values( seq_id.nextval+2, fk_key1 )
    5 into skinny values( seq_id.nextval+3, fk_key1 )
    6 into skinny values( seq_id.nextval+4, fk_key1 )
    7 into skinny values( seq_id.nextval+5, fk_key1 )
    8 into skinny values( seq_id.nextval+6, fk_key1 )
    9 into skinny values( seq_id.nextval+7, fk_key1 )
    10 into skinny values( seq_id.nextval+8, fk_key1 )
    11 into skinny values( seq_id.nextval+9, fk_key1 )
    12 select
    13 /*+ FULL(o) PARALLEL(w,2) */
    14 fk_key1
    15 from wide w
    16 /
    518530 rows created.
    Execution Plan
    Plan hash value: 1585486391
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
    | 0 | INSERT STATEMENT | | 51853 | 253K| 37 (14)| 00:00:01 | | | |
    | 1 | MULTI-TABLE INSERT | | | | | | | | |
    | 2 | INTO | SKINNY | | | | | | | |
    | 3 | INTO | SKINNY | | | | | | | |
    | 4 | INTO | SKINNY | | | | | | | |
    | 5 | INTO | SKINNY | | | | | | | |
    | 6 | INTO | SKINNY | | | | | | | |
    | 7 | INTO | SKINNY | | | | | | | |
    | 8 | INTO | SKINNY | | | | | | | |
    | 9 | INTO | SKINNY | | | | | | | |
    | 10 | INTO | SKINNY | | | | | | | |
    | 11 | INTO | SKINNY | | | | | | | |
    | 12 | SEQUENCE | SEQ_ID | | | | | | | |
    | 13 | PX COORDINATOR | | | | | | | | |
    | 14 | PX SEND QC (RANDOM)| :TQ10000 | 51853 | 253K| 37 (14)| 00:00:01 | Q1,00 | P->S | QC (RAND) |
    | 15 | PX BLOCK ITERATOR | | 51853 | 253K| 37 (14)| 00:00:01 | Q1,00 | PCWC | |
    | 16 | TABLE ACCESS FULL| WIDE | 51853 | 253K| 37 (14)| 00:00:01 | Q1,00 | PCWP | |
    Statistics
    37168 recursive calls
    26542 db block gets
    7610 consistent gets
    0 physical reads
    12696752 redo size
    498 bytes sent via SQL*Net to client
    1084 bytes received via SQL*Net from client
    6 SQL*Net roundtrips to/from client
    3 sorts (memory)
    0 sorts (disk)
    518530 rows processed
    SQL> set autotrace off
    SQL> commit;
    Commit complete.
    SQL> select
    2 id, count(*)
    3 from skinny
    4 group by id
    5 having count(*) > 1
    6 /
    no rows selected
    SQL>
    I checked the PQ V$ views and PQ slaves were used.

Maybe you are looking for