Skip to Content

I have a simple requirement for transforming the source interface format to the destination interface format. I don’t like to use Java or XSLT or ABAP mapping for such a simple requirement. I can use the graphical mapping editor but don’t prefer to, as it is not very friendly with me.
Let me explain before I confuse! Let me show the sample source XSD and destination XSD.
Sample Mapping

Let me explain the transformation logic. All the elements of node (source) should be mapped to the text field (destination) separated by comma. I can do it using the “concat” function or write my own advanced user defined function in the message-mapping editor. It looks very easy.

The problem is that “concat” function takes two parameters and we have to explicitly map all the elements of source node to the destination text field. I have mapped for just 4 fields and have a look at the maze formed. Imagine it when I map all fields.
Concat
User-Defined function simplifies maze to an extent but it can accept only 9 parameters. Imagine the mapping exercise for 9 parameters if the advanced function looks like as shown below:
Advanced User-Defined Function
What if source node has 40 elements and there are 10 such nodes which has to be mapped? Can you imagine the complex maze and pain using the mapping editor for this? This kind of scenarios is very frequent when we need to transform idoc structures to flat files or send the idocs in mails!
Why cannot we have facility to pass the node to some complex functions (May be one more type of functions that can be provided by SAP) and provide the data structure for manipulating the children of the source node, which can be mapped to the target node? And also if we have the facility to generate the target xml for an intermediate node of the source interface and target interface that will be helpful for XI developers.
Let me explain the expectations.
Complex Function
Complex Function 1:It takes the node “Order” as an input and provides a data structure, which can access the children of the “Order” and XI developer writes a small code for comma separation and generate the target element. Does it not make XI developers life easier? This complex functions should be provided global access if we need to reuse it any other message mapping.

One more recommendation is to provide the re-name option for design objects. Once the object is re-named all the dependent objects have to be reflected with the same. Let me come to the context of message mapping and explain the difficulty that is faced due to the lack of that feature. I have one sample user defined function, which is used for mapping idoc to target structure. It is used on every field of the source idoc structure. After development is over and tested there are few changes in the business for which for some fields I need to add one more parameter as input and modify the logic of the user-defined function. It provides me an option to edit the logic but cannot change the definition part of it due to which I have to write a new user defined function and re-do the whole mapping exercise. It would have been better if we a have option of specifying the optional parameters and required parameters and also provision of changing the definition after the user defined function is created.
Edit Definition

“I like working with XI but if some small things like this are taken into consideration it can turn out to be much more powerful tool”-XI developers. I listed just few of the common mapping problems that are encountered. More Ideas can be contributed for enhancing the editor.Does every one agree with me?

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Anonymous
    HI sravya,

    Having gone through a lot of pain while message mapping usign the graphical editor, at times i wondered if we could jsut skip and write user defined functions and achive the same with ease.

    But taking the userdefined approach, i realized that we are making our lives more complicated for enhancement/support/maintenace. The idea of graphical editor is to be a no brainer for others to catch up or support. Source controlling and versioning of user defined code was a big problem especially if written in JAVA. we explored a lot using ABAP mapping bcause of the strong robust transport mechanism on the ABAP stack.

    Bottom line, decision to put custom logic into userdefined functions should be limited to simple no brainer activites. Even though as a develper i would love to jsut pump out some code and get the scenario done, cost of maintenance and support are going to catch up in no time.

    cheers,
    Naveen

    (0) 
    1. Sravya Talanki Post author
      Naveen ,

      I do appreciate your view.
      Donot you think giving source code control version to java user defined function would be a better option than doing a custom coding for mapping the fields.
      Either they need to provide us with the editors where simple mapping can be done using direct mapping and complex using custom code.
      And also doing an ABAP mapping for such interfaces will also definetly increase support/enhancement activity as the kind of code involved is going to be definetly time-consuming and error-prone.
      I hope you understand developers head ache..:)

      (0) 
      1. Anonymous
        Sravya,

        >>I hope you understand developers head ache..:)
        Believe me I hear you, I know the pain, and have gone through a ton too my self.

        I will tell you want I would love as a new feature in XI. I would love to see them enhance the iDE of message mapping where the custom development is integrated with NWDI, also to be able to use these custom code sniflets in many other places sort of global mapping functions.

        Some would say XI as a enterprise repository means less of development and more of configuration, drag and drops (which i am not a fan of :)).

        Again, i agree with you, but this approach shouldn’t be preached, its more a case by case basis and I feel the architect should be wise in choosing when to use and when not to use.

        But again being a developer my self, with  the messaging mapping tools which get missed between SPs, too mcuh of mouse job , no short keys ……
        i wish the mapping editor should be given more thought by SAP going forward..

        cheers,
        Naveen

        (0) 
  2. Anonymous
    I sort of agree with Naveen’s point. As a developer it is always nice to have small and powerful code snippets instead of a mapping spaghetti. But again, a visual mapping is always better than coded mapping for a business/new user.

    I happened to work in Biztalk Server and they have an interesting feature of using XSLT as a part of advanced function. The whole map doesn’t have to be XSLT rather it could be a combination of graphical, XSLT and .NET components.

    You happen to say that you don’t want to use XSLT. I wonder why would that be an issue keeping in mind XSLT mapping is the best way to have software/package independent mappings.

    Let me know what you think.
    KK

    (0) 
  3. Bernd Eckenfels
    Hello Sravya,

    i dont know if there is a fold funcion available (which supports delimiters), however the queue structure of the mappings allow a graphical mapping where you select the childs and you need to draw only a single line to send a dynamic amount of events to a single function.

    In functional programming this is called folding, you map a list to a single element.

    Gruss
    Bernd

    (0) 
        1. Sravya Talanki Post author
          Hi Bernd.

          It is the way to do java mapping in message mapping.
          But what I exactly need is some thing different.
          There should be a standard function available which will node and give me the childs.For a simple mapping I donot want to complicate things by passing java mapping as payload.

          (0) 
          1. Anonymous
            Sravya,

            No! he is not talking about
            >> java mapping as payload

            He is talking only about the getParameter() function in the blog, which is just 3 to 4 lines of code. Anyway.. I agree with ur blog that it would be better if there is a default function since it will be often used.

            Regards,
            Felix

            (0) 
            1. Sravya Talanki Post author
              Iam not talking about a requirement where we need to pass the input and it has to seperate by space.Iam talking abou passing and XML node and accessing the children in MM without using any java or ABAP mapping.
              Your getParameter() takes 4 arguments and sepearte it by ‘,’.That is not what I want.I pass the parent node and it should access the children and pass the output.please read the blog if am not clear.
              (0) 
                1. Sravya Talanki Post author
                  Bernd,

                  It is not problem about the repeating children(Number of occurences.

                  NODE X-COMPLEX FUNCTION-TEXT.

                  NODE X HAS CHILDREN ELEMENTS Y,Z,K,L,M.COMPLEX FUNCTION SHOULD BE ABLE TO ACCESS Y,Z,K,L,M.
                  Iam not going to pass Y,Z,K,L,M to the queue.
                  We cant do that with queues.I donot thing mapping editor supports that.

                  (0) 
  4. Anonymous
    I’ve run into similar issues few times and would be nice if SAP can provide access to Node elements in a simple way.
    (0) 

Leave a Reply