Conditional mapping in Graphical mapping

Hi All,
I have a conditional mapping requirement i.e.I have 2 nodes ( collections/collection/object and  extensions/collection/@name) in the source structres. Both nodes are identical and have unbound occurences. Based on certain condtions I need to map second node in the  source node to target node ( Items ). Below is the condition.
If first node '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/collections/collection/object/@classname' (Occurs Unbounded ) value is not  'contracts.LineItem'  and second node '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/extensions/collection/@name' ( Occurs Unbounded ) value is 'MATGRP_COLLN' then only map source field '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/extensions/collection/row' ( occurs unbounded ) to target node 'Items' ( Occurs unbounded ).
I have done this mapping using If condtions and did some context changes. My second condition is working fine but my first condition is not working as expected. Its only taking value in the first occurences and based on that passing first condition. But I need to check in all occurences whether value 'contracts.LineItem' is not exist  then only I need to pass that condition. Please let me know how to achieve this.
Please help me to achieve my requirement.Thanks.
Regards,
Rajesh

Hi Rajesh,
To reply your query first we have to understand the exact requirement . So I am writing my understanding below and solution for it .Kindly reply if your requirement is different.
you have three source field which is involved in mapping .@classname, @name, and row and target side you have node item .
Now you have to check for all classname and name that if classname is not equal to contracts.LineItem and @name is equal to MATGRP_COLLN ( both the values I have considered as constant) then map row to target node item. i.e if classname and lineitem is occuring 4 time and two time both are satisfying both the codition then generate two target Item node .
Solution.
classname -> (CollapseContext)->equals to ContractLineitem --not -->
                                                                                AND -
IIF WITHOUT ELSE
Name -
>(CollapseContext)-->equals to MATGRP_COLLN--
>
the condition of if without else function will be output of AND and in then map row----.(collpasecontext) finally the output of if without else will be mapped to item
note :all ittalic is Graphical mapping functions .
Regards,
Saurabh

Similar Messages

  • 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.

  • Can we use XSLT mapping after graphical Mapping

    Hi,
    Can we use XSLT mapping after graphical mapping?
    My requirement is to generate two namespace attributes in the target output.
    So first I want to generate a structure using graphical mapping and then want to use XSLT mapping only to generate the second namespace XSI (leaving the rest of the structure as it is). Is it possible?
    <ns1:Test xmlns:ns1="wmdata.dwbi.interface" xsi:schemaLocation="wmdata.dwbi.interface w_interface_1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    Please post some solution. (I will reward points)
    Br,
    Madan Agrawal

    Hi Madan,
    Can we use XSLT mapping after graphical mapping?
    To me it seems feasible...
    But to using the two mappings one after another you will have to use BPM .
    Use transformation step for this to use the mapping and change in structure.
    Regards,

  • 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.

  • Value Mapping and graphical mapping

    Hi all
    I am learning value mapping and
    all function used in graphical mapping ..
    can anybody send me inforamtion regarding tht.
    Any link  appericiated.

    Hi Nagsen,
    Mapping is basically done to convert one form of xml into another form. This can be done using either of them mentioned below.
    -  Graphical mapping
    -  XSLT mapping
    -  JAVA mapping
    -  ABAP mapping
    To know more about each of them please go thru the following links. And if you ask me your which is better, it depends basically on the scenario you implementing and the complexity involved. Anyways please go thru the following links:
    Graphical mapping
    /people/bhanu.thirumala/blog/2006/02/02/graphical-message-mapping-150-text-preview
    http://www.sapgenie.com/netweaver/xi/mapping1.htm
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    XSLT mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    JAVA mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    ABAP mapping
    /people/r.eijpe/blog
    To know more about the value mapping tools for the SAP Exchange Infrastructure (XI), please go thru the following link:
    http://www.applicon.dk/fileadmin/filer/XI_Tools/ValueMappingTool.pdf
    To get an idea as to what value mapping is, please go thru the following links:
    http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/dfae3d47afd652e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
    most of  the links that I have provided also helps you get the step by step procedure of doing the same. And also involves the procedure to implement certain advanced features.
    Hope this clears your doubt fully.
    Regards,
    Abhy
    PS: AWARD POINTS FOR HELPUL ANSWERS.

  • 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

  • How can I get the output of graphical mapping as an input to java mapping?

    Hi Experts,
    I am using graphical mapping in my scenario to get an xml at the end, now after this i want to use java mapping and then do encryption on this input. I am using both the mappings in the same interface
    Here the thing is, the input to the java mapping should be the output of the first graphical mapping.
    How can I link the java mapping and graphical mapping so that Ill get the output of the graphical mapping as the input to the java mapping?
    Some pointers to similar kind of implementations is highly appreciated.
    Thanks in advance,
    Thomas
    Edited by: Thomas Varghese on Jan 22, 2009 11:35 AM

    hi,
    the input to the jave mapping will be exaclty the same as if you don't have
    any mapping before that
    the only different is that the input will be XML of the output of the message mapping
    have a look at my blog to see how to combine two mappings:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    that's all
    Regards,
    Michal Krawczyk

  • Calling graphical mapping from XSLT mapping Prog

    hi guys;
    can anyone tell me that weather we can call graphical mapping  from XSLT mapping prog.If this is possible then can anyone guide me through the steps

    Mudit
    Can you go through the links which might be useful to you:
    Use of XSLT mapping?
    Re: Java Mapping  and Graphical Mapping
    ---Mohan

  • 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

  • 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

  • Issue with a graphical mapping -

    Hi folks,
    I have an issue with a graphical mapping.
    We are replicating the Material Master, with an interface of ECC -> PI -> JDBC.
    The idoc we are using is the MATMAS.MATMAS05, and in the database we created 5 tables, simulating the structure of the source idoc. The tables are: MARA, MARC, MARD, MBEW, MAKT.
    The fact is that we need some data of some segments (tables) in another ones.
    In this case we I need to take a value of the segment E1MARCM (MARC) to the MBEW table. The value is: SERNP.
    The condition to copy that value is the centre (WERKS). So, the condition will be:
    If  MBEW-WERKS == MARC-WERKS,
      then  MBEW-SERNP = MARC-SERNP.
    The problem I'm having is that I have to lookup in many different E1MARCM segments, and the relation is not 1...1, nor, E1MBEWM is a child of it (they are in the same level.)
    For example there could come:
    - E1MARCM_1  (WERKS = 0001)
    - E1MARCM_2  (WERKS = 0002)
    - E1MARCM_3  (WERKS = 0003)
    - E1MBEWM_1 (WERKS = 0001)
    - E1MBEWM_2 (WERKS = 0002)
    - E1MBEWM_3 (WERKS = 0002)
    - E1MBEWM_4 (WERKS = 0003)
    - E1MBEWM_5 (WERKS = 0003)
    Am I clear with the requirement?
    Any answer will be greatly appreciated.
    Thanks in advance.
    .Juan.

    Hey folks, any advice or input about this?
    Thanks again.
       Juan

  • Graphical mapping qsn

    Hi All,
    I have a requirement in graphical mapping that i have a two nodes in source side both are identical. Each node has corresponding sub elements. Target side i have node with subelements. Based on certain conditions like if one condition satisfies i need to map first node and its corresponding sub elements in source side to target side node and its subelemts. If second condition satisfies then i need to map second node in source and its subelements to the target node and its sub elements. If both conditions not satisfy then target node should not be populated.
    Please let me know how to acheive this in graphical mapping.
    Thanks in advance.
    Regards,
    Rajesh

    otherwise go for udf which takes the input as your values and checks the condition in the udf and based on that value map the result to target node
    string empty=;
    if ( NODEAelement.equals("A"))
       return A;
    else if (NODEBelement.equals("B"))
       return B
    else
         return empty;
    I just provided the logic, you can procced with this...
    HTH
    Rajesh

  • How to send alert email notification through graphical mapping ?

    Hi,
    I want to send an email notification whenever there is an exception raised while doing graphical mapping.
    However my requirements are as follows :
    1. We want to use email adpater sending emails
    2. We don't want to go for BPM approach, to achieve the above requirement
    3. We don't want to connect to any alert framewok.
    I appreciate your early reply.
    Thanks
    Ganesh

    Hey
    >>whenever there is an exception raised while doing graphical mapping.
    as said earlier this is not possible without configuring alerts.
    yeah,if u know the reasons beforehand that why exceptions can be be triggered in mapping,then u can use conditional receiver determination,for e.g suppose u know that you will get a mapping exception if value of tag <OrdersID>=000,then u can use this condition in conditional receiver determination and send a mail to concerned party,but this won't work if u don't know beforehand as to under what conditions the exception will be  triggered in mapping.
    i would vote for configuring alerts as its the most suited way to handle this
    thanx
    Aamir

  • 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

Maybe you are looking for

  • Delivery based on qty specified in delivery schedule in Scheduling Agreemnt

    Hi, We have a scenario where we need to create delivery based on the quantities entered in the delivery schedule in Scheduling Agreement, eg. on 10.11.2011 qty to be delivered is 10 on 15.11.2011 qty to be delivered is 20 We have sufficient stock and

  • How do i transfer my money from one account to another?

    How do i transfer my money from one account to another?

  • How to connect to a tv?

    I have a laptop and want to connect it to a tv.  I have an external microphone connected to the laptop also.  I want to hear my voice in my tv speakers when I speak.  How can I make that happen? 

  • An error occured in communication with the BW server.--urgent

    Hi all, Can anybody help me. i got 1 issue like ,when iam trying to executing query, iam getting the error pop up screen like 'An error occured in communication with BW server' 'Due to this ,the Connection Has To be Closed'. Detailed Description:   1

  • Special prices query

    Hi All, Hope you someone can help me on a query. I have a price list "sales standard price list" having increased it by 5% from january it has affected / updated  all the Special prices associated with the 5% increase having auto update flagged. The