MessageMapping CounterPart of CopyValue

Hello,
There is one standard node function copyvalue available in XI, what I need now is the counterpart of copyvalue, actually the source structure has more than one elements which should be mapped to one repeated structure.
One example as in help.sap.com documented, just anotherway around.
source
customer (0..unbounded)
   name 1
   street 1
   city 1
  zipcode 1
target
partner (0..unbounded)
  name 1
  addrDate ( 0..unbounded)
street, city, zipcode, should generate in this case 3 addrDate in partner under one partner Element.
Is there some standard way to do it in message mapping or should I write UDF for this ? Thanks for help !
regards,
Hai

Hi,
In the message mapping in the target structure just do duplicate subtree on the field addrDate to get it 3 times.
after that just map
street-->addrdate
city-->addrdate[1]
zipcode-->addrDate[2]
Hope this will help you.
**Reward points if helpful.
--Sankar Choudhury

Similar Messages

  • Using CopyValue function with error

    Hi All,
    I have a requirement to send the three values coming in the one source field to three different target fields.
    E.g: Source field is "src1" and having the values 1,2 ,3 These values should be sent to the target fields such as
    first target field "Trg1" should get the value as "1" and the second target field "Trg2" should get the value as "2".
    third target field should getv value as "3"
    I have used copyvalue function. it is working fine but if any value from "src 1" is blank.
    I will have the runtime error as follow
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_WORKORDER_TO_ORDCHG_ORDERSO5_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:MT_WORKORDER/StatementName2/TEST/acc
    Will appreciate your advise on how to resolve this.
    Regards,
    FNG

    I have mapped as follows
    sourc1 ->  mapWithDefault [NIL}  ->  copyvalue [0]  -> targt 1
    sourc1 ->  mapWithDefault [NIL}  ->  copyvalue [1]  -> targt 2
    sourc1 ->  mapWithDefault [NIL}  ->  copyvalue [2]  -> targt 2
    No substring function used.
    But still having error
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_WORKORDER_TO_ORDCHG_ORDERSO5_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:MT_WORKORDER/StatementName2/TEST/acc
    I noticed from the source xml structure in the inbound payload, when sourc1 is blank, the tag is not created.
    so question is how to create sourc1 tag if the sourc1 is come as blank ?

  • How to read file name in JavaMapping (not in MessageMapping)

    Hi,
    We all know that we can read a filename using dynamic configuration code in Message Mapping.
    Now my question is how to acheive the same in pure Java Mapping.
    Plz dont give me answers for Dynamic Configuration in MessageMapping.
    Thanks,
    Avis.

    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import java.util.HashMap;
    import com.sap.aii.mapping.api. AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    public class JavaMapping implements StreamTransformation {
       private Map           param = null;
       private AbstractTrace  trace = null;
       public void setParameter (Map param) {
          this.param = param;
          if (param == null) {
             this.param = new HashMap();
       public void execute(InputStream in, OutputStream out) {
    try {
             trace = (AbstractTrace)param.get(
            StreamTransformationConstants.MAPPING_TRACE );
            DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key =
    DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
             trace.addInfo(ourSourceFileName);

  • Message Split and CopyValue issue

    Hello,
    I am having a problem with a message mapping.
    I am trying to split an idoc into multiple idocs based on the content of the idoc.  My idoc is CREMAS and I need to create a separate idoc for each company code which is in the segment E1LFB1M-BUKRS.  I am able to split the idoc based on the company code successfully. 
    However, my issue is with copying the other segments underneath the segment E1LFB1M that have 0..9999 occurrences in each idoc. 
    For example, I use copyvalue for segments EDI_DC40 and E1FLA1M which worked great for all the idocs created since they have a single occurrence, however the copyvalue does not work for segment E1FLM1M (purchase orgs) which has 0..9999 occurrences.  The copyvalue for E1FLM1M only copies 1 segment per idoc message instead of the 6 E1FLM1M segments for each idoc that I have in my example. 
    Any suggestions on how this can be solved?
    Thank you.
    Rhonda

    Rhonda
    You can use CopyValue() to copy the value of a position in the source structure and assign it to a target field for a frequently occurring source structure element. The value is copied each time the target field occurs in the target structure.
    It will work for the segments which are occuring once in seource, Not for the multiple segments.
    Regards
    Raj

  • No payload in Request messagemapping in MONI

    Hi ,
      I did a file to proxy scenario to update R/3 table. it is showing everything successful in PI sxmb_moni. In R/3 moni, i found application error occured (used fault message type).
    i observed in PI sxmb_moni, pipeline step of Request messagemapping doesnt have the target payload(data).
    it is showing only
    <?xml version="1.0" encoding="UTF-8" ?>
      <ns0:f2ps_p_mt xmlns:ns0="http://xyz.com/f2ps" />
    i tested messagemapping in IR, and is working fine and generating the output structure.
    why is it not showing the message payload in PI moni?
    can anybody help me?....
    thanks ,
         kumar

    Hi ,
    this is my source structure (source message):
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:f2ps_f_mt xmlns:ns0="http://xyz.com/f2ps">
       <recset>
          <rec>
             <eno>123</eno>
             <ename>name1</ename>
             <dept>prod</dept>
             <sal>20000</sal>
          </rec>
          <rec>
             <eno>456</eno>
             <ename>name2</ename>
             <dept>it</dept>
             <sal>30000</sal>
          </rec>
       </recset>
    </ns0:f2ps_f_mt>
    this is the target structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:f2ps_p_mt xmlns:ns0="http://hcl.com/f2ps">
       <record>
          <empcode>123</empcode>
          <ename>name1</ename>
          <sal>20000</sal>
          <dept>prod</dept>
       </record>
       <record>
          <empcode>456</empcode>
          <ename>name2</ename>
          <sal>30000</sal>
          <dept>it</dept>
       </record>
    </ns0:f2ps_p_mt>
    thanks,
    kumar

  • PR counterparts of PO structure/tables

    Hi gurus,
    Do you know what are the PR counterparts of these PO structure/tables?
    mepoheader
    purchase_order_items
    Thanks!

    EBAN is the table where PR gets saved (BANFN - PR no , BNFPO - Item no )
    EKKO , EKPO ...are the PO tables and PR number also will be updated in these tables for cross reference.
    Mathews

  • Problem creating schema source while using WebService in MessageMapping

    Hi, scenario is RFC2WS.
    Problem that occurs is that when i want to use a method from WebService in MessageMapping XI won't import the structure. I am getting following error. The WSDL is from an external portal on which a WebService is ready to invoke.
    <b>What might be the problem?! </b>
    <i>
    Problem when creating schema source:
    Details
    java.lang.NullPointerException
    STACKTRACE:
    com.sap.aii.utilxi.misc.api.BaseException: java.lang.NullPointerException
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdSchemaTextable.setSchema(XsdSchemaTextable.java:86)
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdContainerTextView.setSchema(XsdContainerTextView.java:46)
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdContainerTextView.<init>(XsdContainerTextView.java:36)
        at com.sap.aii.ib.gui.xmleditor.docview.MultiViewEditor.makeFromTreeDoc(MultiViewEditor.java:216)
        at com.sap.aii.ib.gui.xmleditor.docview.MultiViewEditor.<init>(MultiViewEditor.java:64)
        at com.sap.aii.mappingtool.mf.TransformationPanel.createTargetView(TransformationPanel.java:264)
        at com.sap.aii.mappingtool.mf.TransformationPanel.<init>(TransformationPanel.java:100)
        at com.sap.aii.mappingtool.mf.MappingTool.<init>(MappingTool.java:32)
        at com.sap.aii.mappingtool.api.MappingToolFactory.getInstance(MappingToolFactory.java:96)
        at com.sap.aii.mappingtool.fwutil.util.ToolUtil.restartTool(ToolUtil.java:315)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiTransformationView.loadIfrSchema(XiTransformationView.java:274)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiMappingView$LinkDataTarget.setData(XiMappingView.java:378)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiTransformationView$MessageDataTarget.setData(XiTransformationView.java:973)
        at com.sap.aii.utilxi.swing.toolkit.dnd.DataTarget.setData(DataTarget.java:514)
        at com.sap.aii.utilxi.swing.toolkit.dnd.DataTarget.drop(DataTarget.java:462)
        at java.awt.dnd.DropTarget.drop(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer.access$800(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown Source)
        at sun.awt.dnd.SunDropTargetEvent.dispatch(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processDropTargetEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
    STACKTRACE:
    java.lang.NullPointerException
        at com.sap.aii.utilxi.xsd.api.XsdHandler.saveSchemaToDocument(XsdHandler.java:61)
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdSchemaTextable.setSchema(XsdSchemaTextable.java:82)
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdContainerTextView.setSchema(XsdContainerTextView.java:46)
        at com.sap.aii.ib.gui.xmleditor.docview.views.XsdContainerTextView.<init>(XsdContainerTextView.java:36)
        at com.sap.aii.ib.gui.xmleditor.docview.MultiViewEditor.makeFromTreeDoc(MultiViewEditor.java:216)
        at com.sap.aii.ib.gui.xmleditor.docview.MultiViewEditor.<init>(MultiViewEditor.java:64)
        at com.sap.aii.mappingtool.mf.TransformationPanel.createTargetView(TransformationPanel.java:264)
        at com.sap.aii.mappingtool.mf.TransformationPanel.<init>(TransformationPanel.java:100)
        at com.sap.aii.mappingtool.mf.MappingTool.<init>(MappingTool.java:32)
        at com.sap.aii.mappingtool.api.MappingToolFactory.getInstance(MappingToolFactory.java:96)
        at com.sap.aii.mappingtool.fwutil.util.ToolUtil.restartTool(ToolUtil.java:315)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiTransformationView.loadIfrSchema(XiTransformationView.java:274)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiMappingView$LinkDataTarget.setData(XiMappingView.java:378)
        at com.sap.aii.ibrep.gui.mapping.xitrafo.XiTransformationView$MessageDataTarget.setData(XiTransformationView.java:973)
        at com.sap.aii.utilxi.swing.toolkit.dnd.DataTarget.setData(DataTarget.java:514)
        at com.sap.aii.utilxi.swing.toolkit.dnd.DataTarget.drop(DataTarget.java:462)
        at java.awt.dnd.DropTarget.drop(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer.access$800(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown Source)
        at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown Source)
        at sun.awt.dnd.SunDropTargetEvent.dispatch(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processDropTargetEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
    </i>

    Hi ,
    Can you please cross check these steps carefully.
    1. After importing the WSDL using external definition, did you checked msges Tab for for the included msg to see what msges you have added.
    and be careful that the namespaces of the messages are part of the WSDL description and can differ from the namespace of the external definition object.
    2.Did you created message Interface corresponding to the message types from the external definition? it is needed to route the message to webService. Here select message types of the external definition object. Assign input and output messages.
    3. Creating a SOAP Receiver Channel
    To call the Web service, you create a communication channel with type SOAP and
    direction receiver in the Integration Directory. The obligatory parameters in the
    configuration are Target URL and SOAP action. You get the values you have to enter
    here from the WSDL file.
    Creating a SOAP Sender Channel
    When you create a SOAP sender channel you have to define the namespace and the
    name of a message interface. Since no input help is provided, you copy and paste the
    values from your Integration Repository.
    Select the Quality of Service according to your interface type. If you are using a
    synchronous interface, select Best Effort. Otherwise, select Exactly Once or EOIO.
    Hope this will help you to figure out.
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Oracle.jms.AQjmsException when inserting large MessageMap message via JMS

    Is there a limit on the number of items/size of message that can be placed on the AQ using the MessageMap message format?
    Ive attempted to place 100 elements, each a small string of approximately 20 characters, into the AQ but I get the following error.
    ---> nested oracle.jms.AQjmsException: JMS-204: An error occurred in the AQ JNI layer
    If I reduce the number of elements to about 70 the message is successfully queued.

    As long as the byte array obtained by serializing the JMSMapMessage
    java object instance fits in a BLOB (max size 4 Gig) you should be able to
    enqueue your message (providing the OS and/or the JVM can handle it).
    Smaller map messages are stored inline in the table itself. Larger messages
    are stored in a BLOB. It is likely that you do not have permissions to
    write to the BLOB field of the OJMS MapMessage ADT.
    To figure out the exact SQL exception turn tracing on by putting the following
    lines of code in your OJMS client and recompiling.
    AQjmsOracleDebug.setDebug(true);
    AQjmsOracleDebug.setTraceLevel(5);
    This will give you the exact SQL exception that is thrown.
    -Vivek

  • HT203180 it didn't sync an sd counterpart. what do I do?

    When I downloaded a video from the iTunes store, there was no SD counterpart. what happened?

    Does the rest of the store work ok?
    Presumably you can browse internet ok?
    Apple servers seem to be having some issues currently (appleTV) so things may be more widespread.
    Give it some time and re-try or in itunes go to the iTunes store home page (house icon) and choose Purchased from Quicklinks on the right and see if you canreinitiate the download from there,
    You can raise a support ticket at:
    https://expresslane.apple.com/GetproductgroupList.action

  • Copyvalue from context -- check number of entries

    Experts,
    Iam facing an issue where i need to copy values from the first entry only if there are no more entries in the context
    Sometimes i see multiple entries in the context. each entry in the context is sent to the new record as a field value.so i  would want to pass the right values if entries exist else i would want to copy the first occurence.
    This is how my sample structure is
    if then -> Remove Context - SplitByValue - Target,
    Copyvalue doesn't work for the case when there are multiple entries in the queue.
    Thanks much,
    Pavan

    Pavan,
    Can you give an example of what you want and what you are seeing now?
    raj.

  • Change messagename(external msg) without losing the messagemapping

    HI all,
    I´m using an external message "externalmsg1" with messagename(root) "test".
    I´ve created a messagemapping by using "test"(external msg) as source and 2 RFC messages(multimapping) as target.
    Now the messagename(inside the external message) was changed from "test" to "test_new".
    Did you know how to change the external message from "test" to "test_new" WITHOUT losing the mapping ?
    note: only the messagename was changed. The structure is the same!
    Thanks for your help,
    Gordon

    Hi Gordon,
    You can consider using mapping templates in PI:
    http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50171256-1ee2-2a10-3f84-ddecf098f724?quicklink=index&overridelayout=true

  • PC Counterpart to Front Row

    Hello,
    Not much else to say .... I have a couple of friends who have seen my FR set up, playing media through the TV and would like to do the same with their PC's. I would tell 'em to get a Mac but they are tired of hearing it.
    Does Windows have a counterpart to Front Row?
    Message was edited by: buz

    Yeaaahhhh - I know, I know .... these individuals just aren't real savvy, they are good at email and Facebook. I'm just trying to help them out and I have all of 45 mins logged at a Windows machine (so I guess I'm not real savvy either - ).
    Google has led me to Plex which I'm just now reading up on - seems to be a cross platform media server, just not sure of 'ease of use' and 'stability' yet.

  • Counterpart to the InterlockedExchange

    Hi,
    I would like to know that is there any counterpart to the InterlockedExchange routine available with win api
    The InterlockedExchange function atomically exchanges a pair of values. The function prevents more than one thread from using the same variable
    LONG InterlockedExchange(
    LPLONG Target, // value to exchange
    LONG Value // new value
    );

    im sorry about the square thingy. what i was thinking awhile ago was my old cellphone the nokia n78. and that square thingy one was kind of look like a "simcard" and located on the side of the battery bar on the upper right hand side of the screen.
    and from what i remember when i used to have that phone even if i wasnt using the WLAN, that square thingy was just stay there.
    sorry guys for my ignorance, i was just curious.
    plz reply....

  • Pages counterpart for PC

    I own a PC and am looking for a pages counterpart for school. I'm looking for the best counterpart for PC. Is there any? And if so, what are they?

    For DTP use Serif PagePlus.
    The only equivalent that combines DTP, WP, Spreadsheets, Charts, Drawing etc is Word but with less polish than Pages.
    Peter

  • Context Function : copyValue() USE

    Hi
    I have to use the context function in my scenario but before that I was trying the functions with different data values & conditions. Now when I am using <b>copyValue</b> using same example given in <a href="http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm">copyValue Help document</a> with source structure as
    <i>partner     0 to Unbounded
      Name      1  to 1
      addDat    3  to 3</i>
    & Target Structure as
    <i>Customer   0 to Unbounded
      Name     1 to 1
      City     1 to 1   =CopyValue([nnumber=0]addData)
      Street   1 to 1   =CopyValue([nnumber=1]addData)
      Zip      1 to 1   =CopyValue([nnumber=2]addData)</i>
    Now when I am sending single record, I am getting the desired results but when I am sending 2 records the value of city, street & zip are of the first record. E.g
    <b><Partner>
          <Name>lalit</Name>
          <addData>Noida</addData>
          <addData>Raj Road</addData>
          <addData>201001</addData>
       </Partner>
       <Partner>
          <Name>lalit1234</Name>
          <addData>Noida123</addData>
          <addData>Raj Road678</addData>
          <addData>20100190</addData>
       </Partner>
    <Customer><Name>lalit</Name><City>Noida</City><Street>Raj Road</Street><Zip>201001</Zip></Customer><Customer><Name>lalit1234</Name><City>Noida</City><Street>Raj Road</Street><Zip>201001</Zip></Customer></b>
    Also when I am giving only one value of addData in Source the same value is getting copied in city, street & zip, it should give the exception over here.
    Pls. suggest that these are the limitations of copyValue function or I am doing something wrong.
    I am testing my mapping in Integration Builder only.
    Regards
    - Lalit -

    Hi,
    >><i>CopyValue() function is used to copy the value of a tag whose context is occuring multiple times to n number of occurances of the tags in the target.</i>
    Yes. CopyValue is used when there are multiple occurances of a field in the source, and we need to map only the value of the first occurance of this field to the target.
    Since you have used this function between the source addData and the target tags city, state and zip, the value of the tags will be filled with the value of the addData field.
    If there are multiple occurances of target tags(city,state,zip)and only one occurance of the addData in the source, the same value will be copied to the targets occuring multiple times.
    If there are multiple addData(source)tags, correspondingly, the targets will have different values.
    Regards,
    Smitha.

Maybe you are looking for