Thursday, May 29, 2008

Using the Import Manager

There are a lot of tutorials on the SDN that describe the process of syndicating records out of MDM. One of which I wrote and can be found at this location. Additionally, there are plenty of web logs and guides that can be found online which discuss the general principals of building an interface from MDM to ECC. However, I haven’t seen a lot of good resources for instructing someone how to build an import map. I’ve also noticed that there are a lot of questions on the SDN forums regarding import maps. For this reason I decided to do a small introduction to building import maps with the MDM Import Manager tool. This is an ideal process for several occasions; initial data loads from a source system, and ongoing interfaces with remote systems such as ECC.

The first order of business is to determine what format your source data is in. In my case, I’m going build a map as if it were an inbound interface of data coming from ECC, so I’ll use the standard delivered IDoc structure in the format of an XML schema. I have downloaded the CREMDM04 IDoc in XML format from ECC using transaction WE60. I’ve also created a sample repository to represent the vendor domain. If you have your XML schema handy, we can go ahead and upload it into your repository by going to the XML Schema part of the Admin section in your repository and then adding your schema.

Now we’re ready to build the map, so load up the repository and open the MDM Import Manager. As the Import Manager starts up you will be prompted to enter the file type (XML), remote system (I created one called ECC_INBOUND_VENDOR), and a file containing the data you wish to load. In my case, I generated a sample XML file by extracting data from ECC using a XML file port. If you are using XI, you could have XI generate the file as well. Once you load the file into the Import Manager we can begin by selecting the source table and the target table. To do this go to View -> Source Table, and select the root segment, in my case it is CREMDM04. To select the destination table, go to View -> Destination Table, and select the main table for your repository, in my case it’s called Vendors.

You will most likely have the E1LFA1M segment of the IDoc in your source data, but depending on your source data you may also have some additional segments. In my case, I have E1PADTEL (telephone address data) and E1LFB1M (company code data). In order to add all three of these segments to the map, you need to find them in the Source Hierarchy and add them by right clicking and selecting Lookup, then choose the fields you want to include in the map. To make things simple, I am going to select all fields, however in a real scenario you would want to include only the fields that are going to be interfaced over from XI to optimize performance of the import server. In my case, as I mentioned earlier, I have two more segments in my source data which are sub-segments of the E1LFA1M node. To include those, drill down into the E1LFA1M segment until you find the other segments, and follow the same procedure to include them in the map.

Next, you can change tabs to the Map Fields / Values tab and begin the mapping process. This is where you select the field from the source and determine where the data will go when it’s imported into your repository. For example, if you are using the CREMDM04 format, then you can simply find the element named LIFNR in your source, and map it to the Vendor Number field in your repository by selecting the element on the source side, selecting the Vendor Number field on the target side, and pressing the map button between them.

Once you have done this you should see a green arrow icon appear next to the fields to indicate that they are mapped.

Performing the mapping can take some time, but to speed the process up SAP has delivered some mapping spreadsheets which tell you what fields in the CREMDM IDoc need to be mapped to each corresponding field in the standard delivered vendor repository. Most customers tend to create their own repository which is optimized for only the enterprise level attributes, so you will probably either need to generate a mapping spreadsheet yourself, or have a functional analyst provide one to you. In any case, once you have performed your mappings, your ready to go to the next step.

Switch tabs to the Match Records tab. This is where you will select what your key is. What this means more specifically is that when records are imported into MDM, you need a way to identify whether the record already exists, or if it’s a new record altogether. In most cases, the vendor number is used as the key, since this will always be unique. I will use the vendor number as the key in my example. Select the vendor number field in the Value Matching section, and press the add button.

Once you have done this, MDM will then a list of the records to import, and give you the number of records that are new creates, and the number of records which already matched the key in the repository. Now you have to select what you want your import action to be. In our case, we want our import action to be “Create”, which will generate a new record for all that didn’t match on the key.

We’re almost done! Switch to the Import Status tab and view the action items. If there is nothing left for you to do, the action item will say “Ready to import”. Many times, you will have to go back to the mapping tab to complete a mapping. The status may say “Map Account Group Values” or something like that, which will indicate that you have source data being mapped to a check table in your repository, so in order to maintain data integrity, you need to select the value in the lookup table for each of the values in the source field. Often times the Automap button will work for this.

When you are ready, press the red exclamation point at the top of the screen that says “Execute Import” and your import will get kicked off! That’s all there is to it! Piece of cake, right?

I hope this was helpful to anyone that’s getting started with the import manager!

No comments: