There are basically three types of icons being used:
As a general rule of thumb, we do not have to map a target structure field ONLY if minimum and maximum occurences of the target structure field are the same. This means, you will need a mapping to generate the target structure fields whose minimum and maximum occurences do not match unless you do NOT want to generate the target structure as well as the fields and sub-structures sit underneath. If you do not want to generate a target structure, please bear in mind this is ONLY allowed if the target structure carries the minimum occurence of zero, or the mapping would fail with Java exceptions thrown.
This is a mapping from CIDX (a chemical industry standard) interface to IDoc (SAP proprietary) interface. The two interfaces use two different ways to store partner information. On the left-hand side, the source CIDX interface has different partner roles, such as, Bill To, Ship To, Supplier, Sold To, etc. While on the right-hand side the target IDoc interface utilize E1EDKA1 segment with its PARVW field to distinguish among different partners. But, there is only one E1EDKA1 segment displayed on the target structure overview. I can apply mapping from "Bill To" Partner to the E1EDKA1 segment, but I need more E1EDKA1 segments to apply the mappings from "Ship To", "Supplier" adn so on... How am I gonna do this??? Well, the solution is just simple...
The createIf function can help us on this sort of scenarios. In general, the createIf function can be applied to a mapping logic generating the target segment node based on a condition. Let's take a look at the following example using createIf function. The E1EDKA1 segment, whose PARVW is 'AG', carries the partner information of the buyer's role. Therefore, this whole E1EDKA1 segment on the source side needs to be mapped to the Buyer/PartnerInformation segment of the Buyer's role on the target side.
The solution to this problem is shown as above.
To set context of field PARVW to two levels upper, i.e., IDOC level in this case,
Here, on the target side, we have an optional structure, telephoneNumber (0...1), and its mandatory child field CommunicationsNumber (1...1). The whole segment is optional; however, if there is a parent structure, the child field is mandatory. Therefore, if there exists a corresponding source field in the IDoc side, which needs to be mapped to the child field, then the whole segment, parent and the child, must be created in the output document. And if there is no such field in the source side, then the whole segment should not be generated at all. The TELEPHONE1 field of IDoc E1ADRM1 segment is the only source field to both of the parent and child target fields. Moreover, we also need generate the grandparent node -- ContactInformation (0...1) based on the condition, which is PARTNER_Q from E1ADRM1 segment should equal to 'AG'. To have our mapping work, we need make sure that not only the output queues of the parent and child nodes synchronized, but also the queues of the grandparent and the parent should be synchronized as well. We can use the following mapping technique to achieve this:
