REG: Graphical Mapping

Hi All,
            I have scenario where i need to split 1 input file( xml ) to n files based on one of the i/p values and post those n files in the  target directory. Is it possible in the graphical mapping and if not which mapping is preferable?
Thanks in advance,
Siva

Hi Sivarama krishna,
               we can use any mapping for splitting, basically we can do Splitting & Merging for the BPM Scenarios.
We need to prefer Graphical mapping ,it is very easy for splitting the message. we need to design BPM
BPM Steps are required for Splitting
1) RECEIVE Step: it can receive the message from sender.
2) TRANSFORMATION Step: it can split the message Or it can merge the messages.
3) FORK Step: it can dispacthes the multiple senders and multiple receivers.
4)RECEIVER DETERMINATION Step: Association of Outbound message interfaces and it can processed by single or multiple receivers.
Note: Here we can take two Receiver Determination steps.One for Sender1 and antother for Sender2
5) SEND Step: Take the two SENDER steps one for Send1 and Send2.
Regards,
Sateesh N.

Similar Messages

  • Bug in exists() function of XI Graphical Mapping Tool?

    Hi!
    If I connect a source field with the exists() function in XI Graphical Mapping Tool and the tag exists it returns TRUE, otherwise it returns FALSE, so everything works as expected.
    But I have to connect a user-defined function with exists(). The user-defined function will either calculate a value or set Resultset.SUPPRESS.
    If there is a value the exits() function returns TRUE, however if Resultset.SUPPRESS is set it does also return TRUE! This looks to me like a bug in exists() function. Shouldn't it always return FALSE if the input is Resultset.SUPPRESS?
    Regards, Tanja

    Hi Stefan!
    > The exists() function checks, if a queue is empty.
    > An empty queue is <b>not</b> represented by the
    > SUPPRESS value.
    > If inside a queue there is a SUPPRESS value, the
    > queue is <b>not</b> empty.
    Ok, so it's not a bug and the exists() function is working as expected.
    > If you want the exist() function after a UDF, provide
    > an empty queue, or easier: return the values "true"
    > or "false" directly from the UDF.
    Yes, that's how I actually solved the problem. The UDF was used at several places where the ResultList.SUPPRESS output was needed. So I copied the UDF and changed it so that the output was TRUE or FALSE instead.
    Regards, Tanja

  • Graphical Mapping Vs XSLT mapping Vs Java Mapping Vs ABAP Mapping

    Hi Experts,
              I have a question regarding different message mapping options available in XI namely
    Graphical Mapping
    XSLT mapping
    Java Mapping
    ABAP Mapping
    Q1: Which amoung the above mappings is the best and why?
    Q2: On what cases Graphical, XSLT, Java and ABAP Mapping should be used?
    Q3: Is it true that graphical and XSLT mappings are converted into Java class internally?
    Kindly help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi,
    There is no hard and fast rule for using the mapping techniques.
    Graphical Mapping is used for simple mapping cases. When, the logic for your mapping is simple and straight forward and it does not involve mult hiearchical mapping requirement. and context handling.
    Java and XSLT mapping are used when graphical mapping cannot help you.
    When the choice is between Java And XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks.  XSLT can lead to a bad perfrormance if the Source XML is huge.
    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.
    For further info on each of the mapping, refer to these links,
    Graphical Mapping,
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    XSLT Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    http://www.w3.org/TR/xslt20/
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    Also, check this thread for more info,
    Different types of Mapping in XI
    Am not sure about XSLT , but , yes graphical mapping is converted into java classes internally and these classes use SAX parsing as well.
    Regards,
    Bhavesh

  • How to use  Advance java function in graphical mapping in XI 2.0?

    Hi,
    currently I am using a simple java function to make an RFC call to R3 system.
    I want to avoid making connection for each lookup. Instead I want to make a single connection for whole message queue and get the corresponding values in some array or container object.
    please suggest a solution.
    I think this is possible using Advance java function, but I am not able to find any example on using Advance java function at help.sap.com.
    thaks in advance.

    Hi!!!
    I'm not sure if I understood you well.
    Do you want to preload some data into your structures in the memory and keep them there so you don't need to make a new connection during processing the whole message or every message?
    In my opinion you can cache some data during processing a message, but it's impossible to cache some data between processing messages.
    If you write your java mapping or you use graphical mapping (even with user-defined function), then you have a java class. The problem is that XI 2.0 reloads this class during processing every message, so even if you load some data from your data source into your structures in the memory, this data will be lost after reloading your mapping class.
    Regards,
    Andrzej Filusz

  • Is it possible to replace  XSLT mapping in place of Graphical mapping

    Is it possible to do XSLT mapping in place of Graphical mapping, in any normal scenario?
    Means the fuctionality we do by using Graphical mapping(like the operations by using node functions etc...) could possible to do with XSLT Mapping?

    HI
    yes it is possible to replace the graphical mapping with the XSLT mapping.
    But using XSLTs degrade the performance of the interface and moreover they are not easily maintainable.
    Refer the below links for assistance on XSLT Mapping:
    XSLT MAPPING:
    Generic XSLT Mapping for SAP XI,Part I
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    Generic XSLT Mapping for SAP XI,Part II
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    XSLT: Recursive Templates
    XSLT: Recursive Templates
    Easy RFC lookup from XSLT mappings using a Java helper class
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14
    Step u2013 By u2013 Step Simple Approach for XSLT Mapping
    Step – By – Step Simple Approach for XSLT Mapping
    http://www.devguru.com/Technologies/xslt/quickref/xslt_element_applytemplates.html
    XSLT Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
    xpath functions in xslt mapping
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=xslt+mapping&adv=false&sortby=cm_rnd_rankvalue#
    Using XSLT mapping in a ccBPM scenario
    File to Multiple IDocs (XSLT Mapping)
    Comparsion of Different mappings:
    Comparing Performance of Mapping Programs
    Complete mapping guide url:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    cheers

  • How to debug global values in UDF in a graphical mapping

    Hi Every one,
    I  got a situation in PI where i have to use global values in graphical mapping UDF.
    I can't able to get the values in "Display Queue " option.
    Can you please tell me what is the best way of debugging global variable in graphical mapping UDF.
    1. I declare one array list in the global values
    2. store some values using another UDF to the arraylist.
    3. I am traversing the values in the arraylist, but the values are not showing in "Display Queue".
    What is the solution to this.

    Did you try with trace.addInfo?
    https://help.sap.com/javadocs/NW04/current/pi/com/sap/aii/mapping/api/AbstractTrace.html
    Sample code for the setMail UDF (Carrier B2B) - Business Process Expert - SCN Wiki

  • Should we avoid Graphical mapping and stick with Java mapping?

    After developing mappings in XI for a month, I just don't see any good reasons to use Graphical mappings over Java mappings. Maybe some experienced users here can give me some valid reasons why we should choose Graphical mappings. Here is what I think:
    Disadvantages of Graphical mappings:
    1. No way to perform automated unit testings. This is probably the biggest reason I hate it. You can do some tests manually when you work in Integration Builder. But there is no way you can write some unit testing utilities to automate the task.
    2. Complexity. Even for some simple requirements, your Graphical mappings can become complicated and hard to understand. A lot of times, I find myself staring at several dozens of graphical nodes and try to understand what it does.
    3. Impossible to reuse. This is totally against the DRY (Don't repeat yourself) principle. For example, to generate messages for JDBC adapter, it is common to have two identical fields for primary keys: one in the access node and another in the key node. If you change the mapping logic in one, you have to remember to change the other.
    Advantage with Java mappings:
    1. Fully automated unit testing. You can create JUnit tests along with your Java mapping classes and use Maven or other build tools to perform automated unit testing.
    2. Your choice of XML parsing and binding. With Java mapping, you can choose any open source framework for XML parsing and binding. For example, with XMLBeans, I can convert XML input message to a Java object, transform to another Java object and write to output message. And each Java object is generated from its corresponding XML schema.
    3. Highly reusable. We can use fundamental object-oriented designs to create highly reusable mapping components.
    4. Better version control. Since the mappings are just Java classes, we can use CVS or SVN to track code changes.
    5. Better build tools. We can fully utilize build tools like Ant and Maven to automate the build, unit tests, or even generate documents and mapping web sites.
    So do you guys agree? Maybe I am still new to XI or I am missing some important things. But at this point, I just don't see why I should use Graphical mappings. Is there anyone developing XI interfaces completely with Java mappings?
    Thanks in advance for any comments!
    Kenny Cheang

    Hi Suraj,
    > Since its graphical the blocks will take space, but
    > there is always an adavntage of processing time.
    > Ebven though it may appear bigger, it will take less
    > time as compared with Java code (for the same
    > mapping).
    Could you explain more why the graphical mapping has better performance? I thought the graphical mapping is compiled into a Java class in the runtime anyway.
    > Yes thats there, but same goes with Java mapping too
    > right (if you haven't mentioned it as constants)
    I mainly think about inheritance. If I have to build 10 interfaces and they all have some common behavior, I can create a base interface class to encapsulate the common logic. But with graphical mapping, you have to duplicate them in each interface.
    > Disadvantages of Java mapping:
    > 1. Performance
    Same as above. I just don't see why Java has worse performance. I actually think Java should have better performance. You can optimize the code anyway you want. In some cases, you have to use queue functions in graphical mapping but it's not necessary in Java.
    > 2. All might not be well versed with Java Code(though
    > everyone may know basic java) .
    I am not asking everyone to abandon graphical mapping. I am just wondering which one is better when you have skills for both.
    > 3. Lot of standard functions are available in GM
    > which you can choose, but you have to remember the
    > exact code for those in Java mapping.
    You can create functions in Java too. All you have to do is to remember the function name.
    Kenny

  • Graphical mapping issue with useOneAsMany if segment does not exist

    Hi all
    I have an issue with graphical mapping in an IDoc to file scenario. I need to have header level fields mapped to line item fields. Whether or not and how many source header segments of the same type exist depends on a qualifier (QUALF). This is generally working if I use the following graphical mapping:
    if QUALF = 001 then <source>  ->  removeContext  ->  useOneAsMany  ->  splitByValue  ->  <target>
    ... with setting QUALF, <source>, and the second input for the useOneAsMany to the highest possible context node.
    Nevertheless, if the segment with the qualifier 001 does not exist in the source then the mapping throws the error "Too few values in first queue in fuction useOneAsMany". Whatever I've tried, the mapping wants to execute the useOneAsMany statement anyway and I haven't found a way to omit this. Whether the target would be created with an empty value or not created at all would be secondary. Would eventually somebody have a solution to this problem?
    Thanks in advance,
    Daniel

    Daniel,
    try using mapWithDefault function before useAsmany
    if QUALF = 001 then <source> -> removeContext -> <b>MapwithDefault</b>->useOneAsMany -> splitByValue -> <target>
    I think it takes care even if the value occur in the contaxt or.
    Babu

  • Graphic Mapping:IDOC to File-Avoid Error in Adapter Engine

    Hi all,
    I'm using Graphic Mapping in my IDOC to File scenario in which each segment in source IDOC will generate a ROW in target File with the condition: DATBI >= currentdate (and some other conditions)
    I have a UDF and use the mapping function CREATEIF for this purpose:
                                 DATBI -> UDF -> CREATEIF -> ROW
    Problem scenario: In the source IDOC if all the segments have DATBI < currentdate then there is no ROW created, and I get the error in Adapter Engine
    Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure ...
    How can I avoid this?
    I've tried to put this condition using XPATH in Interface Determination and got the error.
    There is a way to use function current-date() in XPATH condition?
    Thanks for your help,
    Elaine

    Hi all,
    How can I "suppress the row node if condition fails"? I'm new in PI, so please give more details.
    My FCC as follows:
    Record Structure: Record, Row
    Row.addHeaderLine 0
    Row.fieldSeparator ,
    Record.fieldSeparator 'nl'
    Row.endSeparator ; 'nl'
    It works fine if the condition satisfied.
    In Message Mapping, I've use Test to double check my mapping, and in the scenario that conditions fails, there is no Row in the target message.
    Please advise.
    Thanks,
    Elaine

  • Non-XML payload in graphical mapping

    Experts,
    I have a scenario where I need to trigger a graphical map which eventually populates an IDoc (custom) structure but the Idoc is not being populated with any of the source field.
    My source data is a flat file.
    1. I dont want the src file content to be transformed to XML.
    2. But need to trigger the map (graphical map) to populate the constant values in IDoc.
    However, even with a src message type with a single String type element (no sub-element), the mapping is failing giving XML parsing error.
    Question is:
    1. If it is possible to call a Graphical map without the XML conversion of the source? if yes.. how?
    2. Otherwise can I use Java / ABAP mapping? because since the input parameter for IF_MAPPING~EXECUTE - source is XSTRING type. So can I pass a flat file instead?
    - Shibaji

    HI Shibaji
    1. I dont want the src file content to be transformed to XML.
    2. But need to trigger the map (graphical map) to populate the constant values in IDoc.
    XI expects some XML if it is empty also it will work but you need to send dummy XML for triggering the mapping. You can pass just a blank field as source to trigger this.
    . If it is possible to call a Graphical map without the XML conversion of the source? if yes.. how?
    IE expects XML to process so you need to send some data to execute mapping. I don't think you can avoid XML conversion.
    Otherwise can I use Java / ABAP mapping? because since the input parameter for IF_MAPPING~EXECUTE - source is XSTRING type. So can I pass a flat file instead?
    Java or ABAP mapping also require some source and target to be formed and when you can meet the requirement for triggering the mapping from Graphical. It will complicate using Java/ABAP mapping
    I think if you have a source dummy message with single field with 0..1 occurrence then it should trigger your mapping without any error
    Thanks
    Gaurav

  • Create Attachment within Graphical Mapping using UDF

    Hi!
    We want to create an attachment witihn a graphical mapping using an UDF function.
    I use that function:
    public String addAttachment(String filename, String mimeType, String content, Container container) throws StreamTransformationException{
         BASE64Decoder decoder=new BASE64Decoder();
         try {
              GlobalContainer globalContainer = container.getGlobalContainer();
              OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
              Attachment attachments = outputAttachments.create(filename, mimeType,decoder.decodeBuffer(content));
              outputAttachments.setAttachment(attachments);
              return "Adde1: "+filename;
         } catch (Exception e) {
              return e.toString();
    (SDN helped me much in creating that
    This function has no compiling errors, anything workes fine:
    It takes 3 input-parameters, see also: http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html
    filename (ok, more or less contentID)
    mimeType (more or less contentType)
    content: Base64-encoded String which should be set as content
    In my sample I use the following constants for that function:
    filename = "fn1.txt"
    mimeType="application/xml"
    content = "UG9seWZvbiB6d2l0c2NoZXJuZCBhw59lbiBNw6R4Y2hlbnMgVsO2Z2VsIFLDvGJlbiwgSm9naHVydCB1bmQgUXVhcms=" --> cames directly from http://de.wikipedia.org/wiki/Base64
    When using the message, I got this error within SXMB_MONI:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive for
    message 0022642d-b106-02df-8e8c-f41c243bd112(INBOUND). Reason: java.lang.NullPointerException: while trying to
    invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of an object returned from
    com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()</SAP:AdditionalText>
    This looks pretty much the same as Add Attachment from ABAP Mapping but this tread is also not answered.
    Adding attachment from PI level looks also in that direction, again, no answer.
    So, I was wondering if someone has solved such problem?

    Hi Divyesh!
    We did it that way:
    1. Choosing the XML-Mailstructure as Destination as described in Configuring the Receiver Mail Adapter - Advanced Adapter Engine - SAP Library -  Example (XI payload with mail package)
    2. now we have created a UDF for creating the "content"
    public void getContent(String[] text, String[] attFname, String[] attType, String[] attContent, ResultList result, Container container) throws StreamTransformationException{
    // vergleich ob alle att-Arrays selbe anzahl haben
    if (attFname.length!=attType.length || attFname.length!=attContent.length) {
        result.addValue(Integer.parseInt("Fehler: alle Attachment-Eingänge müssen die selbe Anzahl an Elementen haben!"));
        String CRLF = "\r\n";
        String output="This is a multi-part message in MIME format."+CRLF+CRLF+
        "--"+getBoundary(container)+CRLF+
        "Content-Type: text/plain; charset=UTF-8"+CRLF+
        "Content-Disposition: inline" + CRLF + CRLF +
        text[0]+CRLF;
    for (int i=0;i<attFname.length;i++) {
        output+="--"+getBoundary(container)+CRLF+
        "Content-Type: "+attType[i]+"; name="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Disposition: attachment; filename="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Transfer-Encoding: Base64"+CRLF+CRLF+attContent[i]+CRLF;
    output+="--"+getBoundary(container)+CRLF;
    result.addValue(output);
    This UDF is configured as "QUEUE"
    We have configured this input-structure
    The Content itself is allready base64.
    So we can call this mapping and it creates a Multipart-Mail for us.

  • Graphical mapping is Java Mapping??

    Someone told me that ABAP mapping is faster than Java mapping cause it runs on ABAP stack straight away, where as Java mapping runs on Java stack and then transfers the result to ABAP stack whic reduces effieciency. Does that mean me should prefer ABAP mapping over Graphical mapping as that is also java mapping in the background??
    Regards,
    Ashish

    according to SAP, the graphical mapping (which generates java code) is the fastest mapping and hence the first choice. Personally I prefer XSLT even though it is said to be the slowest because of the way XSLT runs the mapping. However, I never experienced any problems but found it much easier to handle than the graphical mapping especially when the mapping gets a bit tricky and you have to work with many queues.
    I doubt that the Abap is necessarily faster because it depends how you write your source code, whereas the graphical mapping is already optimized
    Cornelius
    null

  • ABAP mapping Vs Graphical mapping

    Hi
    I have an inbound scenario to R/3 where the purchase requisition has 300 line items. I was wondering if it is easier to do ABAP mapping for such scenarios instead of Graphical mapping as it would be better performace as ABAP mapping is executed on ABAP engine?
    I would appreciate valuable inputs.
    Thanks,
    Arjun.

    Hi Arjun
    As mentioned above in the comparison Blog between 2 mappings, i dont think it gives clear picture, if you have some specific work which getting Dynamic Configuration stuff for example, then you will have to Look for ABAP mapping Class, my thinking is that it depends completely on the requirment.
    For ABAP mapping you can go to
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    Let me know if you want any further clarifications
    Piyush
    Pl:reward points if found helpful.

  • Java Mapping  and Graphical Mapping

    Hi All,
    Could any one clarifies the situation where we need to write in a same interface ,
    Both Java mapping and Graphical mapping.
    Regards,
    venu.

    Hi,
       Here is a scenario where you might need to use both graphical and user defined functions.
    source: <fname> <lname> <filename>
    target: <name> <filetype>
    Suppose, you need to concatenate fname and lname into the target <name> tag, you could use the normal graphical mapping using the concat function.
    <fname>\
    concat <name>
    <lname>/
    next, if we need to extract only the filetype from the filename, for example, if we have filename.txt... and we want only the value .txt, we need to write a user defined function which would achieve this for u, since there are no inbuilt function which can solve this for you in graphical mapping.
    Further XSLT mapping comes into picture when we need to create the entire target xml structure. Again, graphical mapping would not be useful here.
    Regards,
    Smitha.

  • Graphical-mapping

    Hi,
       plz tell me about graphical-mapping.
    with warm regards.
    vikash

    Hi
    MAPPINGS STANDARD NODE FUNCTIONS:
    Remove Contexts:     We use it to remove Header Contexts from source side. If we donu2019t want header context to repeat in target structure, use this. It removes repeated header contexts and all the items come under the same contexts.
    Split by Value:     This is counter part of remove context. Use this to add the header context at the target side. Suppose if we wan to separate header contexts for every value of item at source use this.
    Copy Value: We can use this to copy the value of a position in the source structure and assign it to a target field for  frequently occurring source structure element. The value is copied each time the target field occurs in the target structure.
    Createif ():     Use it to create a tag in the target structure depending on the condition. Use it, if the nodes at the target side have to be created only after certain condition is true. If value type is u2018INTENALu2019 Internal request node is created and if value type is u2018EXTERNALu2019 external request node is created.
    Collapse Context:     We use it, if we have to create empty tags in target for every context change in the source.
    Exists: While mapping idoc structure to file structure, Lot of times we come across a scenario where the fields (occurrence=0) are not mandatory in the idoc. They are not populated in the source xml and they are required in the target xml (occurrence=1) which gives runtime exception that target element canu2019t be created.
    u can also refer the below links for further assitance
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Different Node Functions in Graphical Mapping.
    : /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
    cheers
    reward points if found useful

Maybe you are looking for