Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Predefined master data models delivered by standard

  • Material — MM
  • Customer — BP
  • Supplier — BP
  • Financials — 0G
    • Profit Center
    • Cost Center
    • GL Account
    • Cost Element

Custom master data model

For any client business use case that demands governance of master data objects that are not delivered by Standard, SAP provides a framework to govern the same.

Sample business cases that give rise to the creation of custom data model:

  • To govern the creation of reference data, e.g., Bank Codes, Plants, and Storage Location
  • To governs the creation of Master Data, e.g., Services, Employee data, and WBS Elements

Client Requirement is to govern Service Master and the following sections outline the development process.

Note: Below development process is developed and Tested in MDG 6.1.

Technical solution

Key design considerations for building a custom data model

  • Data modeling
  • Mode
  • Replication strategy

Data modelling

Relating to designing an application, the first step in building custom model is to decide on the underlying tables/fields and the relations between them.

In MDG, the entities, attributes, and relationships for a data model are defined, which are in turn used by system uses to generate database tables in which the master data can be stored.

Mode

Active Area: Holds data that is ready to be used by applications

Staging: Holds the data that is not yet approved; current change request

  • Reuse Mode (Reuse Active Area)
    • Existing data structures (i.e., data base tables) of applications are reused. For example, MDG-M makes use of MARA tables in ECC to store the data of activated CR.
  • Flex Mode (Generated active area)
    • Tables as defined in the MDG (Data Model) are used to store both the active and inactive data. For example, MDG-F makes use of Flex Mode.

Replication strategy

Deployment options:

a.   Hub-based

b.   Co-deployment

If Hub-based:

  1. All the data models, irrespective of Reuse or Flex, need to be replicated to operational ECC.

If Co-deployment:

  1. Only data models that are being operated in Flex mode need to be replicated, so that data gets saved in respective operational database ECC Tables for transactional use.

Client requirement

As-is process

  • Microsoft Excel templates and email communication to create and maintain Service data (Transactions: AC01/AC02 in ECC)
  • Master Data Control Group to manually create/update the data in the ECC system

To-be process

  • Requests with custom validations/requirements to create/update service master data in reuse mode
  • Requests to be routed through custom workflow
  • Automatic data replication to ECC upon approval

Solution implementation

Prerequisites

  • Relevant Master Data configuration should be in place. For Service Master, all the relevant configuration in SPRO-> Material Management -> Purchasing -> External Services Management -> Service Master should be in place
  • If replication is needed, then all relevant IDOC configurations should be in place, like Ports, Partner profiles, Distribution Models, etc.

Step 1: Data Model Creation

  • Start SAP GUI and login to transaction ‘MDGIMG’.
  • Navigate to the path MDGIMG->General Settings->Data Modeling->Edit Data Model.
  • Click a new data model by clicking the ‘New Entries’ option.
  • Enter the data Model name as ‘ZS’ and description as ‘SERVICE MASTER’.
  • Navigate to data model and mention the active area as ‘ZSERVICE’.*

  • Click on entity types to add new entity types

Entity Type

Storage Type

Data Element

Key Assignment

Attachment

Search Help

Active Area

Deletion Allowed

Temporary Keys

LANGUCODE

3

SPRAST

1

Deletion allowed

SERVICE

1

ASNUM

4

Yes

ASMDT

ZSERVICE*

Deletion allowed

LEISTUNG

SER_LTXT

4

1

Deletion allowed

  • Storage Type:
  • 1 — Changeable via Change Request; Generated Database Tables
  • 3 — Not Changeable via MDG; No Generated Tables        
  • 4 — Changeable via Other Entity Type; Generated Database Tables
  • Key Assignment:
  • 1 — Key Cannot Be Changed; No Internal Key Assignment
  • 4 — Key Can Be Changed; Internal Key Assignment is Possible

  • Attributes:

Entity Type

Attribute

Data Element

Required Entry

Search Help

Description

SERVICE

ASKTX

ASKTX

Yes

Short Text Description

SERVICE

ASTYP

ASTYP

Service Category

SERVICE

BEGRU

BEGRU

Authorization Group

SERVICE

BKLAS

BKLAS

Valuation Class

SERVICE

GLACC

CHAR10

SAKO

GL Account

SERVICE

LVORM

LVORM

Deletion Indicator - Service Master

SERVICE

MATKL

MATKL

H_T023

Commodity Service Code

SERVICE

MEINS

MEINS

H_T006

Unit of Measure

SERVICE

SPART

SPART

Davison

LANGUCODE

N/A

N/A

N/A

N/A

SER_LTXT

NOTE_SLTX

SYSTRING

Service Long Text

  • Relationships

From-Entity Type

Relationship

To-Entity Type

Relationship Type

Cardinality

Description

LANGUCODE

LANG_LTXT

SER_LTXT

Qualifying

1 : N

Qualifying Language Code for Service Long Text

SERVICE

SER_LTXT

SER_LTXT

Leading

1 : N

Leading Service for Long Text

  • Access Class — ZSMCL9_MDG_ACCESS_CLASS_SER
  • Create an access class implementing the interface IF_USMD_PP_ACCESS.
  • Save and Activate the data model
  • Navigate to the path MDGIMG->General settings->UI Modeling->Edit UI Configuration.
  • Create a new UI ZSM_USMD_ENTITY_VALUE2 by doing a deep copy of USMD_ENTITY_VALUE2 and arrange the attributes on UI as per the requirements.

Step 2: UI Creation

  • Navigate to the path MDGIMG->General settings->UI Modeling->Edit UI Configuration.
  • Create a new UI ZSM_USMD_ENTITY_VALUE2 by doing a deep copy of USMD_ENTITY_VALUE2 and arrange the attributes on UI as per the requirements.

Step 3: Business Objects

  • Start transaction MDGIMG.
  • Navigate to path MDGIMG->General Settings->Data Replication->Enhance default settings for outbound implementations->Define business objects and object identifiers->Define Business Objects.
  • Create a new Business Object ‘ZS_BO’.
  • Assign the Business Object Type to the Data Model created in Step 1.

Step 4: Business Activities

As per the function needs, create business activities.

Navigate to transaction MDGIMG and navigate to the path MDGIMG->General Settings->Process Modeling->Business Activities->Create Business Activity.

Business Activity

Description

Data Model

Business Object

Logical Action

ZSCR

ZS: Create Service Master

ZS

ZS_BO

CREATE

ZSUP

ZS: Update Service Master

ZS

ZS_BO

CHANGE

Step 5: Create Change Request

Any workflow that suits the requirement can be assigned to the change request.

  • Navigate to the path MDGIMG->General Settings->Process Modeling->Change Requests->Create Change Request type.
  1. No.

Request

Request Type

Create/ Update

Workflow

UI Entity

Business Activities

1

Create Service Master

ZSMCRE01

Create

WSXXXX

ZSM_USMD_ENTITY_VALUE2

ZSCR

2

Update Service Master

ZSMUPD01

Update

WSXXXX

ZSM_USMD_ENTITY_VALUE2

ZSUP

Step 6: Access Class*

Access class ‘ZSMCL9_MDG_ACCESS_CLASS_SER’ is created implementing the interface IF_USMD_PP_ACCESS

This interface must be implemented for integrating a reuse active area in the custom data model. This interface can be used for the following activities:

  • Reading of (active) data from the reuse active area
  • Writing of (active) data from a change request to the reuse active area
  • Consistency checks that are specific for the reuse active area
  • Data derivations that are specific for the reuse active area
  • Authorization checks for data in the reuse active area
  • Locking of data in the reuse active area
  • Reading of change documents from the reuse active area

Implementations in the reuse active area (for example, BAPIs) typically already exist for these activities, which can be reused in the custom implementations.

For Service Master Data, BAPI ‘BAPI_SERVICE_CREATE’ and ‘BAPI_SERVICE_UPDATE’ can be used to create/update the data.

Step 7: Data Replication Framework

  • Define Object Identifiers
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations Define Business Objects and Object Identifiers -> Define Object Identifiers

  • Define Business Objects
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations Define Business Objects and Object Identifiers -> Define Business Objects

  • Define Object Nodes
    • Path: Transaction MDGIMG-> General Settings -> Key Mapping -> Enhance Key Mapping Content -> Define Object Nodes

  • Assign key structures to Identifiers
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations -> Define Business Objects and Object Identifiers -> Assign Key Structures to Object Identifiers

  • Create Outbound Implementation
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations -> Define Outbound Implementations

  • Mention the outbound Interface Model name, Outbound Implementation class, and communication channel (Options that can be used: IDOC, File, RFC, or Web services).
  • Generic Outbound Implementation class CL_MDG_OIF_DRF_OUTBOUND_IMPL can be used.
  • Create Filter Object
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations -> Define Filter Objects
    • Assign this filter to Outbound Implementation in the above step.

  • Define Replication Model
    • Path: Transaction DRFIMG-> Define Custom Settings for Data Replication -> Define Replication Models.
    • Create a Replication Model using Outbound Implementation from the above step and activate the replication model.

  • Define Interface Model
    • Path: Transaction DRFIMG-> Enhance Default Settings for Outbound Implementations -> Define Outbound Interface Models
    • This interface model will create a Function Module in background that has all the necessary Staging data as importing parameters.
    • This FM should host the code for posting the data to ECC system. It can be a RFC call or IDOC posting, whichever is suitable for client needs.

* Note: This step is optional. If the requirement is to directly replicate the data to ECC operational box on activation of change request (i.e., Flex Mode), this step need not be performed.

Challenges faced

a.   Framework does not allow to assign any feeder class for the UI; hence, any UI requirements (which are not achievable by BADIs) should be implemented using post exits of the feeder class - CL_USMD_ENTITY_VALUE2_PROXY.

b.   Data replication framework only helps in tracking the status of CR w.r.t replication to ECC; however, all the replication logic needs to be implemented in the Interface Model for any custom data model apart from mentioning the communication channel.

Skill set needed

Resource

Skill set/primary activities

Basis

Installing MDG, downloading the latest software package, and implementing SAP Notes.

Functional

Configuration regarding the Service Master (SPRO-> External Services Management->Service Master).

Technical

Custom development for using BAPIs and transferring the IDOC. Resource need to be aware of FPM (Floor Plan Manager) and Workflows.

Labels in this area