Skip to Content

Using SAP MDM for number generation

MDM Solution landscape-

MDM is integrated with ECC using XI in a CMDM scenario, Enterprise Portal is used as UI and we have an Approval workflow for new creations as well as edit requests. Requirement is to generate the numbering from SAP MDM for any newly created records. Users are not allowed to create any new record in ECC directly. MDM offers 2 standard ways(A & B) for generating numbers-

A.    Define a calculated field based on Auto ID to match the number ranges defined in ECC

To illustrate in ECC for different material type we have a different number ranges assigned. This can be replicated in MDM by defining a calculated field Material number and the calculation expression will be (Auto ID+100000000-1). This will ensure that Materials created in MDM are matching the ECC number range. The above expression can be changed using conditions (If then else) IF (Mat Type=’PROD’, Auto ID+100000000-1, Auto ID+200000000-1). This can be further nested if we have more material types and they have different numbering ranges in ECC.

Key challenges faced:

•1.    Losing the numbers on performing a match base search from Portal-

Since we are using EP as the user interface JAVA APIs are used for connecting to MDM repository. Requestor logs in portal, does a search for the record based on matching strategy defined in MDM. Duplicates can be found against both records that exist in repository as well records that do not exist in the repository (empty record).There are two API available for executing the matching strategy in MDM and for continuity of numbers driven by MDM we should use the 2nd API.

•a.     ExecuteMatchingStrategyCommand (for records that are present in the repository)-

This inserts a record in MDM with the calculated field on which the matching strategy is run. After getting the duplicate results the inserted record is deleted. In the process we lose a number in MDM.

•b.     ExecuteMatchingStrategyForNewRecordValuesCommand (for new Records that are not present in the repository)-

This API will not insert a record in MDM repository and hence the numbers will not be lost. Limitation for using this API- Will not work if we have any calculated field in the MDM data model which is also part of the Matching strategy


•2.    Initial data loads for already existing data present in ECC to MDM.

Since the numbers have to be matched utmost care is required during data migration. Let me explain this with some examples-

  • a. ECC has materialsin range100000- 199999 and say there are some missing numbers in production. After 100007 we have next material as 100012 in ECC.
  • b. to replicate this in MDM we need to insert 5 dummy records in MDM from 100008 to 100011 so that nubers in MDM matches with ECC

B. Use of Key generation property for the ECC remote system.

This means the numbers will be generated when the records are syndicated to ECC from MDM and it will also update the remote key mapping in data manager. See the following blog for more details.

This has limitations since the number generated are not directly visible in record details but can be seen only via edit key mapping.

Suggested Way: Instead we can define the Material Number field as Text and from EP we do a RFC lookup in ECC to get the number depending upon Material Type which can be assigned to the text field in MDM. This way we don’t lose any numbers because of search (Matching based) conducted from Portal UI and synchronizing the numbers between ECC and MDM for initial data loads can be managed very easily.

You must be Logged on to comment or reply to a post.
  • You can map number generated not only to key mapping, but also to any field. So it avoid limitation and this field can be visible in Portal.
    • Thanks for your suggestion. Option B generates number only after the record has been syndicated and is mapped automatically as remote keys.

      1. For a record which is say not approved and not syndicated the Material number will still be not generated.
      2. Remote key can be mapped to any field in the target structure but mapping this back to any MDM fields requires some more workarounds. Please share if there is any direct way.

      Best regards-

      • 1. Agree. And it doesn't need number.
        2. After creating material in ECC, it generates message with MDM code and material number. After MDM import Server import its.
        • Correct. the numbers will be reflected in MDM after importing back for which we need to configure sending the messages/Idocs from ECC and importing in MDM.

          Thanks again-

  • Hi Ravi,

    With the option no 2, I have got a question. If I have couple of records in my data manager for different remote systems, how can they be identified for the respective systems during syndication. As the remote system & key details are keyed in during the syndication process only.
    I hope you understand my question.


    • We define the key generation based on remote systems. So if the records in MDM are meant for different remote systems they will have different key generated based on the qualified ranges defined .