ABAP mapping split messages and dynamic filename

Hello,
i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
Regards,
Andreas
Edited by: Andreas on Feb 26, 2009 9:09 AM

you cannot do dynamic configuration for message splits. The below is from SAP help.
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:
u25CF     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.
u25CF     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.
u25CF     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.
What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

Similar Messages

  • Multi-Message-split with ABAP mapping and adapter specific attributes

    Hi all,
    With <b>ABAP-Mapping I split 1 message to n messages</b>.
    So many files are generated in <b>file-Adapter</b>.
    Everything fine.
    But now I want the file names different using adapter specific attributes.
    It is not possible to use variable substitution and write the file name in payload because of receiver restrictions.
    I tried this with following similar coding in ABAP-Mapping:
    data: lt_records TYPE MPP_DYNAMIC_TAB.
          Loop.
          l_file_name = "payload-Inbound"-information
          ls_record-namespace = 'http://sap.com/xi/XI/System/File'.
          ls_record-name = 'FileName'.
          ls_record-value = l_file_name.  "l_file_name comes from inbound-payload
          append ls_record to lt_records.
         Endloop.
      CALL METHOD dynamic_configuration->set_all_records
        EXPORTING
          records = lt_records.
    If I start the interface I see in the monitoring the dynamic configuration with many entries for file-name in the the SOAP-Header mapping of the request message (following extract):
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Mapping der Request-Message
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPAADDRESS.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPABROKERROLE.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPACOMPANYSEGMENT.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPACUSTOMERROLE.XML</SAP:Record>
    The result is that <b>all files have the same file name</b> (last entry in dynamic configuration).
    Is it possible to write the adapter specific configuration in ABAP-mapping <u>for every single result message</u>??
    Thank you for your help,
    Florian

    Hi Florian,
    I've a different idea...I dont think its a "right solution" but just another work around..it involves a BPM...
    In your ABAP mapping..set the dynamic config with as many variables as number of different messages...i.e. use the variables like 'FileName1', 'FileName2'...'FileName6' instead of 'FileName'. But use the same namespace 'http://sap.com/xi/XI/System/File'
    Call the above mapping in a BPM and capture the individual messages and set the attribute 'FileName' from the values of 'FileName1' to 'FileName6' accordingly using Message Mapping and then send the message using the 'Send' step.
    before you try this, try using the variable names 'FileName1' ...'FileName6' in the receiver adapters...enable the ASMS. <b>I know we need to select which variables from the dynamic config to be used by the adapter by specifically selecting 'FileName', 'Directory' etc...but just give it a try and see if it works..</b>
    Or..instead of using a BPM..you can combine Henrique's idea...use Adapter module to set the value for 'FileName' from variables 'FileName1'...'FileName6' accordingly.
    hope I'm clear..lemme know if you have any questions..
    cheers
    praveen

  • Dynamic configuration in integration process using abap mapping

    Hi everybody,
    i have the following scenario:
    file adapter -> integration process -> file adapter
    The integration process uses an ABAP mapping and sets the filename in dynamic configuration as follows:
    *-- Set Parameter
        clear ls_dyn_record.
        ls_dyn_record-name      = gc_dyn_config_name.
        ls_dyn_record-namespace = gc_dyn_config_ns.
        ls_dyn_record-value     = <new_file_name>
    *-- Write configuration
        ir_dyn_config->add_record( ls_dyn_record ).
    But now the new filename is not reflected in the file adapter (receiver). In the integration monitor (SXMB_MONI) i still find the old filename.
    Whats wrong?
    Elko

    The ABAP mapping is more complex, setting filename in Dyn. Conf. is just one step in mapping.
    If I check the Workflow protocol of the Integration Process, I find the following in the Trace of the ABAP-Mapping:
    The filename has been set to 3233340.SWNF00HW.P10I. The Suffix P10I has been added in the ABAP mapping.
    When I check the subsequent message in SXMB_MONI I find:
    The added suffix is missing in the filename !!
    Elko

  • Java Maping and ABAP Mapping

    Hello,
    Pls let me know about Java Maping and ABAP Mapping
    Also pls provide good simple scenario blogs for Java Maping and ABAP Mapping.
    Regards

    Hi Ranchit,
    Check these links for Mappings
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    https://websmp102.sap-ag.de/~sapdownload/011000358700003604872004E/MappingXI30.pdf  (Need Service Makrket place ID)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    JAVA Mapping BLOGS
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    ABAP Mapping Blogs
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    Sachin
    Message was edited by:
            Sachin Dhingra

  • ABAP Mapping Questions

    Hi,
    I am trying to get my head around ABAP mappings and have a few questions.
    In the below code sample which I find in every example and blog it talks about specific steps -
    *initialize iXML, * create iXML factory object, * create streamfactory object, * create input stream object, * initialize the input xml document, * parse the input xml document
    In these steps the code is always exactly the same so my question is are these just standard steps that are implemented every single time an abap mapping is used and hence only standard lines that never have to be changed or will they be different depending on the mapping.
    I am trying to work out where I will begin my coding.
    So would somebody be so kind as to give me a brief explanation of the above mentioned steps.
    Thank you
    METHOD if_mapping~execute.
    * initialize iXML
      TYPE-POOLS: ixml.
      CLASS cl_ixml DEFINITION LOAD.
    * create iXML factory object
      DATA: ixmlfactory TYPE REF TO if_ixml.
      ixmlfactory = cl_ixml=>create( ).
    * create streamfactory object
      DATA: streamfactory TYPE REF TO
      if_ixml_stream_factory.
      streamfactory = ixmlfactory->create_stream_factory( ).
    * create input stream object
      DATA: istream TYPE REF TO if_ixml_istream.
      istream = streamfactory->create_istream_xstring( source ).
    * initialize the input xml document
      DATA: idocument TYPE REF TO if_ixml_document.
      idocument = ixmlfactory->create_document( ).
    * parse the input xml document
      DATA: iparser TYPE REF TO if_ixml_parser.
      iparser = ixmlfactory->create_parser(
      stream_factory = streamfactory
      istream = istream
      document = idocument ).
      iparser->parse( ).

    Hi,
         The above lines you mentioned deal with initialization of the iXML parser for parsing through the XML payload, so they would remain the same for all mapping where you are parsing the input payload.
    The coding for you specific mapping will begin after this, something like :
    * Implements the DOM generating interface to the parser
      iparser->parse( ).
      emp_node_collection = idocument->get_elements_by_tag_name_ns( name = 'Order' ).
      emp_node_length = emp_node_collection->get_length( ).
      emp_node_iterator = emp_node_collection->create_iterator( ).
    where you start reading the xml node values.
    Hope this helps.
    Regards

  • Splitting, Staging and Sending

    HI,
    I am trying to create a solution where I am looking to Split one xml into three xmls using Multimapping. The three xmls are like the staging tables. These three xmls then will be transformed into three output xmls and send to three different locations in File Directory.
    Scenario:
                                          -----> Staging xml    -------> Output Message (xml)
    Third party sysytem (xml) ---> SAP PI -----> Staging xml    -------> Output Message (xml)
                                           -----> Staging xml    -------> Output Message (xml)
    I am looking for a solution without BPM.
    Regards,
    Rahul

    Hi Rahul,
    refer the below link which gives info about how to split messages and creating separate files in their respective target file folders.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0b6bb9d-7689-2c10-52a7-c3bd341d4e5f?quicklink=index&overridelayout=true
    Thanks

  • Messaging and remoting through coherence

    Hi all
    I'm really coherence noob...
    But I want to implement subj by coherence...
    How to implement reliable delivery to queue and/or topic (just done what jms can do) ?
    (now I'm listen a map with messages, and remove received messages from the map.. damn... it's to messy)
    How to allow client call service in any available node once? (i do it by the same way but with blocking queue in client)
    I think it would be great to describe such common "EA patterns" implementations in coherence wiki... isn't it?

    Hi,
    first of all, Coherence might not be the best option to do messaging and remoting, as it is not the purpose of Coherence to solve these problems.
    However, the listener for a map with messages is not a bad start. Backing map listeners are also something you might want to look at.
    Compared to the cache listener they give you a balancing of the load across storage enabled nodes at the price of the backing map listener being able to listen only for events for keys it owns.
    You could also look at InvocationService. That is most similar to remoting and messaging, however InvocationService is not fire&forget, if the invoked node goes down, nothing guarantees the execution of the invocable instance, so you would have to implement failover (retry, redelivery and duplication detection).
    Best regards,
    Robert

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Acces dynamic configuration variable (e.g. filename) in ABAP mapping class

    Hi experts
    I am searching for a possibility to acces a dynamic configuration variable (DCV) in an ABAP mapping class. Since I could not find a solution in SDN and other sources, I hope somebody in this forum can help me.
    What I already found is the following code which can be used to set a DCV, but what I would be interested in is how to read a DCV.
    Any help is appreciated.
    Markus
    METHOD if_mapping~execute.
    DATA l_record type mpp_dynamic.
    * copy payload
    result = source.
    * add an adapter specific attribute
    l_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_record-name = 'FileName'.
    l_record-value = 'test.xml'.
    dynamic_configuration->add_record( l_record ).
    ENDMETHOD.

    Hi Markus,
    you can find everything in my blogs
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    Regards,
    michal

  • Message split ABAP mapping

    Hello everybody,
    for a special mappging I use ABAP mapping -everything fine.
    But I need to split the message with ABAP mapping.
    Does anybody know if this is possible ?
    In the ABAP-class I use the interface IF_MAPPING. This has as a result parameter the parameter RESULT Type XSTRING (no table).
    It only works to add to XMLs in 1 XML string, but my result have to be 2 XML files.
    Alternatively would it be an idea to use multi message mapping (graphical first) AND then ABAP-mapping for special mappings?
    Thanks a lot,
    Florian

    Florian,
    for multimappings in coded mappings (xslt, java and abap mappings) you'll also create a single stream, but in this case, the stream may have the following format:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
        <b><enter your first message here></b>
    </ns0:Message1>
    <ns0:Message2>
        <b><enter your second message here></b>
    </ns0:Message2>
    </ns0:Messages>
    where <ns0:MessageX> tags refer to each different target message type.
    In the case you have a 1:n split, you'll have only 1 message type, but may have several messages within it.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
        <b><My_message id=1></b>
        <b></My_message></b>
        <b><My_message id=2></b>
        <b></My_message></b>
    </ns0:Message1>
    </ns0:Messages>
    Also, remember that, when you define an interface mapping as multimapping (meaning, you set either source, target or both interfaces to multiple messages, your input stream will also contain the <ns0:Messages> and <ns0:MessageX> tags, so you need to treat them in your mapping program.
    Regards,
    Henrique.

  • Message Splitting in ABAP Mapping

    Hi Everybody,
    I have Implemented ABAP mapping in  my Scenario and have used message splitting. That is for each header node of source corresponding number of target nodes should be created.I have a source node under which i have 5 subnodes and when this source node repeats again i need to generate two target nodes with 5 subnodes in each of the target header node.
    I have tested the scenario in SXI_MAPPING_TEST by making the following changes in IR and ID.
    1. Changed the cardinality to 0 to unbounded in Interface mapping.
    2. Have kept the Interface determination type to Enchanced.
    I am getting the ERROR" split mapping created no messages" in sxi_mapping_test.
    Can anyone help me out on this.Good answers will be rewarded.
    Thanks all,
    Zabiulla

    Prabhu,
    what needs to rely on Java stack is the adapter, not the mapping.
    Mohammed,
    make sure you create Messages/MessageX tags (with proper namespace) in your multimapping. Also, expect these tags in your input mapping.
    You can get the exact Messages/Message1 tags (with the namespace) in a message mapping with multiple input or output messages. Create it and go to test tab, just to check the tags you should read/create in your abap mapping.
    Regards,
    Henrique.

  • Help on message split ABAP MAPPING

    Hi friends
    I need to split a message by abap mapping , I am having problem while creating the tag Messages and Message1.
    the mapping is going into error Comparison error during the execution of a simple
    it is turned up to be the issue of <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1> not being created correct
    I am using this code
    CALL METHOD l_document->create_simple_element_ns
          EXPORTING
            name   = 'Messages'
            parent = l_document
    *u2022PREFIX = ''
    *u2022URI = ''
    *u2022VALUE = ''
          RECEIVING
            rval   = Messagesnode.
    CALL METHOD l_document->create_simple_element_ns
          EXPORTING
            name   = 'Message1'
            parent = MESSAGESNODE
    *u2022PREFIX = ''
    *u2022URI = ''
    *u2022VALUE = ''
          RECEIVING
            rval   = Message1node.
    any help wil do
    Thanks

    No answer
    Thanks

  • ABAP Mapping  and Message Mapping

    Hello
    I want to do the followig mapping
    File - > IDOC
    field1  ->field_idoc1
    field2  ->field_idoc2
    field3  ->field_idoc3
    field4  -> (based on an dictionary table in the R/3)
    For the first 3 fields I will use message-mapping.
    For field4 I heard about ABAP Mapping. Select with the value of field4 in an ABAP Table and response the new value to the mapping back.
    Would both mappings in one Interface-Mapping work?
    Regards
    Christoph

    Christoph, There was an article previously available in articles section, now i dont find the link.
    I have given a sample code below. You can find lot of sample JCO code provided along with the JCO library that can be downloaded from service.sap.com.
    JCO.Repository mRepository;
    JCO.Client mConnection = JCO.createClient(
                   sapClient,
                   userName,
                   password,
                   language,
                   hostName,
                   systemNumber );
    // connect to SAP
    mConnection.connect();
    // create repository
    mRepository = new JCO.Repository( "sample", mConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("Z_TEST");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( param1_value , "P_PARM1");
    input.setValue( param2_value , "P_PARM2");
    JCO.ParameterList tabInput = function.getTableParameterList();
    JCO.Table inputTable = tabInput.getTable("T_PARM3");
    inputTable.appendRow();
    inputTable.setValue("test" , "IDOC");
    mConnection.execute( function );
    String ret = function.getExportParameterList().getString( "P_GEN_NUM" );
    mConnection.disconnect();
    return ret ;
    Regds
    Saravana

  • Get Message ID and namespace from ABAP Mapping

    Hi XI Expert,
    Please advise how to get the message ID and namespace from ABAP Mapping.
    Thank You and best Regards
    Fernand

    Hi,
    To access the message ID, use the method GET_MESSAGE_ID of the controller object:
           1.      Fetch a protocol instance for the protocol IF_WSPROTOCOL_MESSAGE_ID.
           2.      To have the system return the message ID after the sender has sent a request message or the receiver has received a request message, use the method GET_MESSAGE_ID of this instance. This returns the ID by using the parameter MESSAGE_ID of type SXMSGUID.
    Also you could do the same by this way also:
    IF_WSPROTOCOL_XI_HEADER
    has attributes messageid and interface namespace.
    using this  you can read the XI message header

  • Hi , friends pls explain abap mapping and message mapping

    1) pls explain abap mapping and message mapping
       send me screen shorts also.

    Hi
    Mapping Techniques
    XI provides 3 standard ways of interface mapping between source and target.
    Graphical mapping
    Java Mapping
    XSLT Mapping
    Two more additional mapping types can be activated in XI by making changes to the exchange profile. Those two mappings are
    ABAP mapping
    XSLT mapping with ABAP Extensions
    Graphical Mapping
    Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception - User defined functions). But sometimes with graphical mapping it is difficult to produce required output. For example ... text/html output, namespace change, sorting or grouping of records etc.
    ABAP Mapping
    A person comfortable with Object Oriented ABAP can go for ABAP mapping instead.
    Java Mapping
    Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
    SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exaclty easy to develop either.
    XSLT Mapping
    One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.
    A few example cases in which an XSLT mapping can be used:-
    When the required output is other than XML like Text, Html or XHTML (html displayed as XML)
    When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    When data is to be filtered based on certain fields (considering File as source)
    When data is to be sorted based on certain field (considering File as source)
    When data is to be grouped based on certain field (considering File as source)\
    Advantages of using XSLT mapping
    XSLT program itself defines its own target structure.
    XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    File content conversion at receiver side can be avoided in case of text or html output.
    Multiple occurrences of node within tree (source XML) can be handled easily.
    XSLT can be used in combination with graphical mapping.
    Multi-mapping is also possible using xslt.
    XSLT can be used with ABAP and JAVA Extensions.
    Disadvantages of using XSLT mapping
    Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    XSLT mapping requires more memory than mapping classes generated in Java.
    XSLT program become lengthier as source structure fields grows in numbers.
    XSLT program sometimes become complex to meet desired functionality.
    Some XSL functions are dependent on version of browser.
    Different types of Mappings
    MAPPING SUPPORTED BY XI
    Message Mapping -> Graphical Design and testing environment. Default Provided By XI. Queue based modelling allow handling or large documents. Extensible via user defined functions
    XSLT Mapping - > Based on openstandard, Portable across application platform, Extensible using user defined functions kewl but disadvantage is Memory overload while handling large documents.
    SAX -> Simple Api For XML. -> Allows you to parse through a XML document. Doesn't consume any memory. But the message can be parsed only once from top to bottom. It Has evolved by contributions made by group of ppl itz a open architecture.
    DOM -> Document Object Model -> Itz designed by W3C. Consumes Memory as the message will be loaded. Allows parsing of document in both way top down and bottom up.
    Send me your email id.Shall send you very good docs for both ABAP Mapping and message mapping.
    Thanks

Maybe you are looking for

  • How to create profile for apple tv

    How do i create profile file for Apple Tv?

  • Vmware Server 1.0.3 and kernel 2.6.22

    Maybe this will be of help to anyone... The modules for vmware server 1.0.3 don't compile under 2.6.22-ARCH kernel from testing, and as far as I know there is no patch to fix that automatically yet.  I was able to to compile them successfully using t

  • HT204587 Do I still need to swipe to open with Touch ID security?

    Do I still need to swipe my iPhone to open it with Touch ID security? It seems like when I first activated my phone this morning, I didn't need to swipe, but now one of my settings must have been changed inadvertantly and even after I utilize the Tou

  • CiscoView 5.4 cann't open device view

    hi, I have CiscoWorks 2000 LAN manage 2.1 , with CiscoView 5.4 the problem is I'm not able to see the Cat2950 and Cat6509 at all , when I ask for a view, it gives me [Ciscoview Error] "Incompatibility may exist among device package", I checked the pa

  • Can't play dvd's in quicktime

    I'm trying to convert movies to MP4 to get them on my I-pod video. I get how to do that, but I'm trying to simply open a DVD on quicktime, and i can't! I open finder, double click on the DVD name and all that comes up is VIDEO_TS, and all i can get f