Map _attributes_ dynamically. How to?

Good day.
I'm struggling with a following problem.
I need to dynamically create and map attributes. I've read the document "Dynamically Creating, Building and Mapping a Context in Web Dynpro", it was a bit helpful but it doesn't fit all my requirements.
What I've done:
1) Created an attribute in my controller:
wdThis.wdGetContext().getNodeInfo().addAttribute("Attr1", "com.sap.dictionary.string");
BTW, I can see, that the method addAttribute is overloaded and we can pass the IDataType, but I couldn't find how to replace "com.sap.dictionary.string" with IDataType. Is it possible?
2) Now, I want to map that attribute with an attribute in my view:
IWDNodeInfo custNodeInfo = wdThis.wdGetInitializationController()
     .wdGetAPI()
     .getContext().getRootNodeInfo();
IWDAttributeInfo localNodeInfo = wdThis.wdGetAPI().getContext()
     .getRootNodeInfo().addMappedAttribute("Attr1", "com.sap.dictionary.string");
BTW, what do the parameters of the addMappedAttribute mean? Am I right?
And there is a question - in the docs said that we should use IWDNodeInfo, but addMappedAttribute return IWDAttributeInfo and I can't get how to link attribute in the controller and in the view. It is the main question, hope for your help.

It's OK.
I tried the way you suggested but it failed:
1) Created an attribute in controller:
     wdContext.getNodeInfo().addAttribute("Attr1", "com.sap.dictionary.string");          
     wdContext.currentContextElement().setAttributeValue("Attr1", "test");
2) Accessed the data in a view:
Iterator iter =
               wdThis
               .wdGetInitializationController()//Initialization - it's mine component
               .wdGetContext()
               .getNodeInfo()
               .iterateAttributes();
while (iter.hasNext())
                    IWDAttributeInfo attrInfo = (IWDAttributeInfo) iter.next();
                    if (attrInfo.getName().equalsIgnoreCase("Attr1"))
                    {                                                  IWDInputField tv =
                              (IWDInputField) view.createElement(
                         IWDInputField.class, null);
                         tv.bindValue(attrInfo); // Here is an exeption, that the attribute "Attr1" doesn't exist.
                                    transCont.addChild(tv);
As you can see I got an exception. And it was expected, because there is not any maooing between Attr1 in the controller and view.

Similar Messages

  • Value Mapping and Dynamic Value Mapping

    Hi Experts,
    Could you please give a example for Value Mapping and Dynamic Value Mapping?
    Regards
    Sara

    Sara,
    I am assuming that you are going to use the Receiver JDBC adapter to select the data from the database.
    In this case, take a look at this blog of mine to understand how te dataypes should be created for the request and response JDBC Select Query.
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    The only difference would be that in the mapping when you create the Request Message for the JDBC adapter, the columns you create would be determined from the Source,
    i.e, if value = 1 , only the required Columns should be mapped as Blank constants,
    likewise for the other requirement.
    the columns you do not want to select you should not create them in theoutput of your request mapping.
    Regards
    Bhavesh

  • Header mapping ...how it is done step by step

    Hi Masters,
                       Actually i have lot of confusion in header mapping .... so can u please help me that what is header mapping ... how and where it is implemented .. if it is step by step with example then it will be very much helpful for me............
    Thanks in advance,
    jp

    Hi,
    The header mapping is made available in the receiver agreement. It is required in the IDoc adapter, for example, because the IDoc adapter does not know any communication parties.
    After header mapping, the adapter must also convert the address to an external protocol.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b2/1f17419b24f06fe10000000a1550b0/content.htm
    Adapter-Specific Message Attributes in the Message Header Use -
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/content.htm
    Header info - Access of XI Message Header Information
    Regards
    Khanna

  • Map in photobook; how to copy

    When I make a photobook, I would like to use a geografical map twice. How can I copy a map.

    Just add another map page to the book via the Layout pane.  That will duplicate what's in the first map page.
    OT

  • Word 2013 mailmerge wants MAPI client. How to set up tbird?

    Trying to do email merge in Word 2013. Nothing happens. Word help says something about needing a MAPI client, so how do I do that so that email merge in Word gets send by Tbird?
    Thx.

    I do have tbird set as default client, yet doesn't seem to work. Although I'd like to get it to work from Word, I can use the mailmerge addon for Tbird as a workaround. So, still looking for how to get word emailmerge to work.
    Also, FWIW, I have many email accounts in tbird.

  • MY phone is using large amounts of data, when i then go to system services, it s my mapping services thats causing it. what are mapping services and how do i swithch them off. i really need help.

    MY phone is using large amounts of data, when i then go to system services, it s my mapping services thats causing it. what are mapping services and how do i swithch them off. i really need help.

    I Have the same problem, I switched off location services, maps in data, whatever else maps could be involved in nd then just last nite it chewed 100mb... I'm also on vodacom so I'm seeing a pattern here somehow. Siri was switched on however so I switched it off now nd will see what happens. but I'm gonna go into both apple and vodacom this afternoon because this must be sorted out its a serious issue we have on our hands and some uproar needs to be made against those responsible!

  • HT4865 I need help findin my sons iPod n I set up with different iCloud account n never installed find my device n location map is off how do I locate device

    I need help findin my sons iPod n I set up with different iCloud account n never installed find my device n location map is off how do I locate device

    Jenniferp27.jp wrote:
    ...n never installed find my device n location map is off how do I locate device
    Then you cannot locate it electronically.
    What to do if your iOS device is lost or stolen
    http://support.apple.com/kb/HT5668

  • XSLT Mapping with Dynamic Configuration for Mail Adapter

    Hi Guys,
    I am wondering if somebody can help me please.
    I have a requirement in which I need to pick up the file from FTP and email it to the user as an attachment with the same file name and content.
    I know it is possible via 3 method either by deploying adapter module or via XSLT or JAVA Mapping.
    I preferred XSLT Mapping because it is easier to use and we don't need to compile the code like JAVA Mapping.
    I have done the XSLT Mapping but the only problem I am facing is that how to copy the file name which we get it from Dynamic Configuration to the Mail ContentDisposition.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
        <!-- copy payload -->
    I tried many option but unfortunately none of them worked.
    <Content_Disposition>attachment;filename="$inputparam"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-conf"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-key"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-value"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dummy"</Content_Disposition>
             <Content_Disposition>
                attachment;filename=
                <xsl:value-of select="dynamic-key"/>
             </Content_Disposition>
    I really appreciate if someone can please provide some guidance.
    Thanks,

    Hi,
    Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
    It will throw Exception..
    The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
    If u r doing for file to file means no UDF required,, just check ASMA on both sides....
    Babu

  • File-name not being fetched in a multi-message mapping by Dynamic Conf

    In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration.....
    the problem is ...the same BPM contains another transformation step which contains a message mapping (which is not multi mapping), and here the code (UDF) works to fetch the file name...
    the code is all correct....and it looks like
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    if (sourceFileName == null ){
    sourceFileName = "ErrorFile.xml";}
    return sourceFileName;

    Hi,
    The scenario I am trying to test is a multi mapping scenario where I am trying to split one source message and create two target messages by using two different receiver interfaces, one for each message.
    I am on PI 7.1 and when I test message mapping and operation mapping using the payload from SXMB_MONI, it is successful. Whereas when I test the scenario end to end I am getting the following error messages:
    Operation Mapping
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Name
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Namespace
    http://accenture.com/1:N_multi-mapping
    Runtime error
    Split mapping created no messages
    Start tag ns0:Messages Add raw attribute xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" Start tag ns0:Message1 Close tag ns0:Message1 Start tag ns0:Message2 Close tag ns0:Message2 Close tag ns0:Messages
    Could someone please help
    Cheers,
    S

  • Mapping in dynamic structures

    Hi all,
    in a scenario I'm working on at the moment, I get a flat file in and have to send a XML. Up to this point there is no problem, but the second line of the file conains the field list with a delimiter and the other lines the data with the same delimiter and every field of the field list has to become a tag within the target structure. So I have to create the output XML dynamically.
    In the first step I use the file content conversion to convert the file into a simple structure like this:
    <file>
    <recordset>
    <data>
    <row>...the data...</row>
    </data>
    </recordset>
    </file>
    The target structure is similar, but within the row tag I must have the data of the row structured as described in the second row of the flat file.
    I have created a mapping with a user-defined, that creates a String with the content for each row element (concatenation of the xml tags and the content), but this doesn't work, because after the mapping the < and > are replaces with the replace strings.
    Perhaps anyone has an idea?
    Thanks in advanced
    Regards
    Olli

    hi,
    >>>>Perhaps anyone has an idea?
    you have 2 possible choices:
    1. do it with message mapping and convert the replace
    strings in the adapter (adapter module)
    2. do the mapping in java mapping or abap mapping
    when you can define dynamic structures
    I'd propose the second way but in both you have to write
    some code in order to do those dynamic structures
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • I have problem in libya map for n78 how can i upda...

    please in last version of nokia map i have libya map and more setails for road (all road in it) but now libya map is only big road but the small road not in it how can i update it

    Hi anaalmnse
    Presumably you have updated from Nokia Maps v1.0 to v2.0 and now have Navteq mapping in place of former TeleAtlas. It depends whether you updated application yourself from:http://europe.nokia.com/A4984199 or upgraded device firmware to latest which then included Maps v2.0.
    If it is the former scenario, you could have re-formatted the device to take it back to "out of the box" condition with the earlier version of Nokia Maps pre-installed, but if the latter applies you are stuck with it unfortunately.  
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • Mapping in BPM: how to merge results of receive steps into send steps

    Hello,
    we need the following BP:
    1. async. Receive Step: receive an IDoc
    2. sync. Send Step: WebService request using the content of an IDoc field.
    The WebService returns some data we need for the destination structure.
    3. Transformation???
    4. async. Send Step: we have to <b>merge</b> and map the Idoc fields and the
    resulting fields of the WebService into the destination structure.
    What are the basic steps and objects therefore?
    IDoc-message            X  --> |
    WebService-message Y  --> |   -->  Z dest-message
    Out problem is, how an where to get access to both Source Messages to merge them for the destiniation message?
    Regards
    Gunnar

    <i>1. async. Receive Step: receive an IDoc
    2. sync. Send Step: WebService request using the content of an IDoc field.
    The WebService returns some data we need for the destination structure.
    3. Transformation???
    4. async. Send Step: we have to merge and map the Idoc fields and the
    resulting fields of the WebService into the destination structure.</i>
    >>>>
    1. async. Receive Step: receive an IDoc - OK
    2. sync. Send Step: WebService request using the content of an IDoc field.
    The WebService returns some data we need for the destination structure. - OK
    3. Transformation - this transformation step will have 2:1 mapping. source would be IDOC and response of WS mapped to result.
    4. async. Send Step: Send the result

  • Message mapping with dynamic node

    Hi,
    I am doing message mapping where my source structure is
    <root>
         <EmpCount>2</EmpCount>
         <Emp>
              <item>
                   <code>1</code>
                   <name>ABC</name>
              </item>
                                     <item>
                   <code>2</code>
                   <name>PQR</name>
              </item>
         </Emp>
    <root>
    If EmpCount is having value 2 then Emp node will have only 2 items
    Target structure is flat structure like (something like fix file format)
    <root>
         <EmpData>EmpDetails</EmpData>      occurrences 0...unbounded
    </root>
    With above sources data following is expected target sturcure…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>3PQR</EmpData>
    </root>
    Here my query is how I can create more than one node to target structure with employee details.
    I already tried with following Re: how to create target node a constant number of times
    This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>2ABC</EmpData>
    </root>

    Sunil,
    Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for
    I/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">
       <EmpCount>2</EmpCount>
       <Emp>
          <Item>
             <Code>1</Code>
             <Name>A</Name>
          </Item>
          <Item>
             <Code>1</Code>
             <Name>B</Name>
          </Item>
       </Emp>
    </ns0:MT_Check>
    O/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">
       <Root>
          <EmpData>2A</EmpData>
          <EmpData>2B</EmpData>
       </Root>
    </ns0:MT_Check_Out>
    Best regards,
    raj.

  • Java mapping for Dynamic File name: stuctures?

    Hi,
    Scenario:  Sender AS2 adapter --> PI --> Receiver File (NFS) Adapter. Just a file pass through, no mapping
    Requirement: Want to have the receiver file name as C1.yymmdd.C2 where C1 and C2 are contants and yymmdd is current date.
    I was told in sdn forum that I have to write java mapping and provided the sample code also. However, I am not sure how and where to use that sample code. Could you please help on following questions:
    1) What is the source and target data type structures for mapping?
    2) Where do I develop java mapping? How do I import to PI?
    3) How do I get access to SAP Netweaver Developer Studio? Can I download it to my laptop? or if I dont have access, can I use any other tool to develop? ( NetBeans, Eclipse ??) and how?
    4) what are the files and libraries that we need to import to java mapping? (e.g.,  Import aii_map_api.jar library)
    5) How to generate .jar file?
    If someone has already developed java mapping (.jar file) ready to import into PI, please provide the same.
    Thanks in advance
    - Riya Patil

    Hi Sarvesh,
    Is this UDF work if I dont select ASMP on sender side? (We tested selecting ASMP on both sender & receiver file adapters, it works fine and it works without UDF also).
    In my requirement I have to use sender AS2 adpter, please confirm if I can use this UDF without selecting ASMP on sender side.
    I have done the following tests:
    Test-1) Select ASMP with 'File Name' on both sender and receiver file adapters without any mapping (UDF)
    It works great. No UDF or mapping required. It is just pass through of file having the receiver file name same as in sender channel.
    Test-2) Select ASMP with 'File Name', only on receiver file adapter without any mapping (UDF)
    It is obvious, it doesn't work. I am getting the following error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Test-3) Select ASMP with 'File Name', only on receiver file adapter with mapping (using DynamicConfiguratio UDF)
    We are getting the following error message in SXMB_MONI:
    Fatal Error: com.sap.engine.lib.xml.parser.Parser~
    <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
    Here is the code we have in UDF:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = "C1." + a + ".C2";
    conf.put(key, SourceFileName);
    return " ";
    So looks like UDF is not working and it is failing in mapping. If I could make it work, I think there is good chance that I can see DynamicConfiguration under SOAP Header, which what required for the error we see in out test-2.
    Can someone please help me to straighten this UDF and make it work.
    Thanks in advance.
    - Riya Patil

  • Multi-Mapping and Dynamic Configuration

    Hello,
    Is it possible to use dynamic configuration in mulltip-mapping? (message split?)
    in a  proxy-mail scenario I am using a multi-mapping. The message gets splited by a specif field.
    (Field of source message-SplitByValue(Value Change)-CollapseCOntext->Target Message(1..N)
    WIthin the graphical mapping I have a dynamic configuration for the "Mail Subject"
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey keySubj = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail", "THeaderSUBJECT");
    conf.put(keySubj,  pSubject);
    return pSubject ;
    I have mapped this field to a field in the target message.
    The messages are being splitted as expected and the value of pSubject is also correct.
    BUT when receiving emails the subject field has the same value for all splitted messages.
    My Question is "conf.put(keySubj,  pSubject);" overwitting all splitted outgoing messages?
    Thanks for the Help
    EMW

    As stated in http://help.sap.com/saphelp_nw70/helpdata/EN/43/09b16006526e72e10000000a422035/frameset.htm
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    ●     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    ●     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    ●     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    Regards,
    Henrique.

Maybe you are looking for