You are on page 1of 14

Chapter 2: Master Data Distribution and

Interfaces
Overview
In this chapter, we learn about the distribution of master data using ALE and
the steps involved in building a master data interface. Many SAP
implementations re!uire the distribution of master data to other "#$
systems or e%ternal systems. &or e%ample, certain applications running on
legacy systems may re!uire the 'ustomer Master database to process
transactions outside of "#$, or in a distributed environment, the sales
department(s "#$ system may need to )eep its customer database in sync
with head!uarters. Master data in SAP encompasses a wide range of data
such as materials, customers, vendors, classes, classification,
characteristics, bills of materials, pricing conditions, general ledger master,
cost elements, and so forth. In "#$, there are over *+ message types
available for master data distribution using ALE services.
,here are three methods of communicating master data from SAP "#$.
,he first method is to -send. data directly, that is, an ALE program selects the
master data present on "#$ databases based on user/specified criteria,
and creates I01's of that type. ,hese I01's are communicated to the other
system through the ALE communication layer. ,he second method is to
capture all changes occurring to the master data, e%ecute an ALE program to
convert the changes to an I01', and then communicate it. ,he third method
is to -fetch. the master data from another "#$ system2this option is
available for only a few message types.
Let us further e%plore the second method. "#$ provides robust
mechanisms to capture changes occurring to the master data through its
Shared Master 0ata tool. As shown in &igure 3/4, when changes 5changes
are create, change, delete2mar) for deletion6 are posted to the master data
by the application, change document services record these changes in tables
'070" and '0P1S. ,hese changes are recogni8ed by the Shared Master
0ata tool which chec)s if they are relevant for distribution by ALE services. If
so, it creates change pointers. ,hese change pointers are maintained in
tables 90'P and 90'PS. 5,able 90'PS maintains a status flag for a given
pointer and message type. ,his flag indicates if the change pointer has been
processed.6 An ALE program is run to select all change pointers not yet
processed for a given message type, access the master databases through
function modules, and populate the I01' segments pertaining to that I01'
type. ,he ALE program chec)s the 'ustomer 0istribution Model to determine
the receiving logical system5s6 for that particular message type, filters the
data based on filter ob:ects, chec)s the partner profile for the I01' type, and
then creates communication I01's.
Figure 2-1 'hange Pointer Mechanism
In this section, we develop an ALE interface for distributing material master
data to a non/"#$ system, using message type MA,MAS. ;e also build an
"#$/"#$ interface to distribute 'lass 5message type 'LSMAS6 and
'haracteristics 5message type '7"MAS6 data. ;e will step through the
process of -sending. data directly, as well as capturing changes via change
pointers, and then communicating them to other systems. ,his section also
teaches you the basic configuration that needs to be in place for ALE and E0I
interfaces to function.
Basic Configuration
In order to use ALE functionality in the "#$ system, you have to configure
certain basic elements of the system. ,his can be performed through the ALE
customi8ing menu 5see &igure 3/36. ,o invo)e it, use transaction SALE or
IMG Cross-Applications Components Distribution (ALE)
Basic Configuration.
Figure 2-2 SALE2ALE 'ustomi8ing Menu
&irst, let us set up the base logical system. As mentioned earlier, every client
in an "#$ instance needs to have a base logical system. ,his LS will be the
-sender. in outbound interfaces and -receiver. in inbound interfaces. ,o
create a logical system<
= E%pand the tree Set up Logical System
= E%ecute Maintain Logical System
= 'lic) on push/button >E; E>,"IES

= Enter the name of the logical system, for e%ample, 9?4'L>,+4+. 5@ou
can adopt a naming standard for base LS< aaa'L>,bbb, where aaa is the
instance and bbb is the client. ,his helps in correlating the base LS with its
instance and client.6
= Enter a description
= Save
>e%t, let us allocate the base logical system to its client. ,his panel can also
be accessed by e%ecuting transaction SCC4.
= E%ecute Allocate Logical System to te Client

= @ou should find an entry for your client, say +4+. Select that row, by
double/clic)ing on it, using the push button for details.
= Enter 9?4'L>,+4+ in the field for logical system
= Save

Note ,he aforementioned activities are client/independent customi8ing.
,hese two activities are essential both for ALE and E0I. 0ata for
logical systems is stored in tables ,90LS and ,90LS,.
,he other activities in this basic setup include number ranges for ports,
I01's, change pointers, IS1 codes, and wor)flow settings. 1ther than
wor)flow settings, of which we learn in a later chapter, it is not mandatory to
configure the number ranges as these will default to SAP/supplied
intervals.
As part of the elementary configuration, we also have to set up global
company codes and business areas. ,his concept is relevant to ALE
distribution for "#$/to/"#$ in general. ;hen we distribute data pertaining
to a particular company code and business area, they have to refer to the
corresponding company code and business area in the target system.
7ence, we specify the company code and business area cross/reference in
this configuration. ALE re!uires that we perform this activity for "#$ to non/
"#$ system interfaces as well. ,o do this, from SALE<
= E%pand tree Distribution Scenarios
= E%pand tree Global !rgani"ation #nits
= E%ecute Set up global company co$es

= 'hoose cross-system company co$es. 'reate new entries for the
target system(s company codes.
= Save

= Perform activity Assign cross-system company co$e to cart
of accounts

= Perform activity Assign Company co$e to cross-system company
co$e. 5,his is where you build a cross/reference of sending and receiving
system(s company codes.6
= E%ecute Set up global business areas
= Perform similar activities for business areas as with company codes
Interface to Non-!"# $%ste&
Let us build a master data interface to a non/"#$ 5e%ternal6 system. ;e
communicate material master data using message type MA,MAS and I01'
type MA,MAS+3. ;e then configure the system to -send. material data as
well as capture changes via change pointers, and create master I01's.
'reate a logical system, as e%plained earlier, to represent the e%ternal non/
"#$ system. Let us call it EA4MA,MAS3. ,his logical system will be the
receiving LS for MA,MAS+3 I01's.
Configuring the Distribution Custo&er Mode'
,he Distribution Customer Model represents the flow of messages from one
system to another. 1ther than specifying the message type that a logical
system will receive from the -sender. base logical system, it also applies
filtering criteria to the data being communicated using filter ob:ects. As
mentioned earlier, the model is applicable only to ALE.
,o configure the model<
= E%ecute transaction SALE
= E%pand tree Distribution customer mo$el
= E%pand tree Maintain $istribution customer mo$el $irectly
= 'hoose Maintain $istribution customer mo$el $irectly

= Enter 9?4'L>,+4+ in the field for logical system. ,his is the base logical
system.
= Enter a name for the model, say ALEM10EL+4
= 'lic) the '"EA,E button

= @ou will see a tree structure with the base logical system as the parent,
and all other logical systems as its children, as seen in &igure 3/$. Place
the cursor on the logical system EA4MA,MAS3.
Figure 2-" 'onfiguring 'ustomer 0istribution Model

= 'lic) on the '"EA,E MESSABE ,@PE button. @ou will get a pop/up
screen.

= Enter MA,MAS as the logical message type, and clic) on the ,"A>S&E"
button
= Save

Note @ou have the option of maintaining the customer distribution model
using the P' tool as well. ,his provides a graphical interface to the
model. In this boo), we maintain the model directly using SAP
screens.
9y configuring the customer distribution model, we have indicated that we
want to distribute message type MA,MAS to the logical system
EA4MA,MAS3, with the base system being 9?4'L>,+4+.
'ustomer distribution model data are stored in tables ,90++ and ,90+$.
@ou can access the maintenance of the model by using transaction 90CD as
well.
(ctivating Change )ointers
Change pointers are ob:ects that reflect the changes to master data. ,hey
are enabled through change document services and the Shared Master 0ata
tool. ALE programs and APIs use change pointers to select changed master
data for populating I01's of the relevant message type. 'hange pointers
are stored in database tables 90'P and 90'PS. ,able 90'PS maintains
the processing status of the change pointer, with its )ey being a uni!ue
change pointer identifier and the message type. 1nce the change pointer is
processed, field P"1'ESS on table 90'PS is mar)ed with a value of EA.(
'hange pointer generation has to be activated at both the general level and
message type. ,o do this, from SALE<
= E%pand tree Distribution scenarios
= E%pand tree Master $ata $istribution
= E%pand tree Acti%ate cange pointer
= E%ecute Acti%ate cange pointer (generally), chec) mar) the
field Active
= Save
= E%ecute Acti%ate cange pointer for message types

= 'hoose the row for message type MA&MAS, and chec) mar) the
corresponding field 5see &igure 3/D6.
= Save
Figure 2-* 'hange Pointer Activation for Message ,ype
>ow we have activated change pointer generation at the general level, as
well as message type MA,MAS. @ou can use transaction 90C4 to activate
change pointer at the general level. ,he flag is stored on table ,90A4. ,o
activate change pointer for message types, you can also use transaction
90*+. ,he data for this are stored in table ,90A3.
After having performed the aforementioned activities, change pointers will be
created every time a material master record is created, changed, or mar)ed
for deletion. 5@ou can mar) for deletion a material at the general level, for a
specific plant, storage location, sales organi8ation#distribution channel,
warehouse, or storage type.6 >ote that change pointers for material master
are going to be created even if the changes occur through 90's, 'all
,ransactions, or activation of planned changes.
Co&&unications: )ort Definition
A port is a channel for communication of I01's. ,here are four types of
ports available in SAP "#$< 546 ,ransactional "&' 5"emote &unction
'all6, 536 &ile, 5$6 "#3, and 5D6 Internet. In this e%ample, we define a file/
based port for the communication of material master I01' to the e%ternal
system. ,his will enable us to create a file of I01's.
In order to define a port, from WEDI ID!C 'ort $efinition or use
transaction WE21.
= 'hoose (ile/based port
= 'lic) on the '"EA,E button
= 'lic) on the >E; E>,"IES button

= Enter a name, '&)MA&MAS*, and description for the file port 5see &igure 3/
*6
Figure 2-+ Port 0efinition
= 'lic) on the 1F,91F>0 &ILE button

= @ou will see a pop/up screen where you can enter a directory, file name,
and function module. ,he entry for function module is for invo)ing a routine
that generates a file name. ,here are several SAP/delivered function
modules that will create a file in the specified directory with the name being
a pattern such as user name concatenated with the date and timestamp.
@ou can also create your own function module to name the file according
to your re!uirements. Fse an e%isting function module as a model to
create this routine.
= 'lic) on the '7E'? button to ensure you can connect to the file server

= If you would li)e to invo)e certain processing on a server once the file is
created, such as e%ecuting an &,P, you can lin) this port to a logical "&'
destination. Fse transaction SM59 to create an "&' destination of type
,'P#IP connection. Specify a shell script to be triggered, and the directory
it resides in.
= 'hec)
= Save
,he data behind the port definition are stored in table E0IP1. ,his
configuration is client/independent and is transportable. ;e learn more about
"&' destinations and transactional "&' ports in subse!uent chapters. ,his
configuration is applicable both to ALE and E0I.
Co&&unications: )artner )rofi'e
A partner profile is an identifier for the system being communicated with. In
ALE, it is based on an e%isting logical system. ,he partner profile brings
together several elements of ALE and serves as a gateway between
systems. Let us create a partner profile for the material master outbound
interface 5see &igure 3/C6.
Figure 2-, Partner Profile2Beneral Parameters
&rom WEDI ID!C 'artner 'rofile, or from SALE
Communication Manual maintenance of partner profiles
Maintain partner profile<

= Enter E+)MA&MAS* in the field Partner number. 5"emember, we created
this logical system in an earlier step.6

= Enter LS for logical system in the Partner type field. All ALE partner
profiles will use LS as the partner type.
= 'lic) on the '"EA,E button
= Enter ALE in the field Partner class
= Enter A in the Partner status field
= Save
= ,he partner has been created 5see &igure 3/G6
Figure 2-- Partner Profile21utbound Parameters

= ,o maintain the outbound parameters, clic) on the button 1F,91F>0
PA"AME,E"S
= 'lic) on >E; E>,"IES
= Enter MA&MAS in the Message type field
= Enter '&)MA&MAS* in the "eceiver port field

= &or 1utput modes, select Collect ID!Cs, and Do not start
subsystem. ,he first parameter instructs ALE communication layer to
collect all I01's until further processing is re!uested. ,he second
parameter is typically used for invo)ing third/party translation software or
E0I subsystems. 5;e discuss these settings and their effects in depth in
'hapter 4+.6
= Enter MA&MAS,* as the I01' type
= Save
;e have now created the partner profile for outbound material master
interface. >ote that the same partner profile can be used for multiple
outbound, as well as inbound, messages, given that the communications are
for the same logical system. Most of the data regarding outbound partner
profile parameters are stored in table E0P4$. @ou can directly access this
activity by e%ecuting transaction WE20.
>ote that outbound master data do not use message control parameters or
process codes. Also, the fields for notification of messages will default to your
user I0. ;e learn more about its significance in the section dealing with
;or)flow2ALE and E0I error handling.
Partner profile configuration is client/dependent and transportable. ,o include
the profile in a ',S re!uest, from the initial screen for 'artner 'rofile
'artner &ransport- Enter the relevant ',S values.
IDOC .%pe M(.M($/2 As configured earlier, in this e%ample we are using
I01' type MA,MAS+3 for the outbound material master interface.
MA,MAS+3 consists of several segments 5record structures6 in a particular
hierarchy. ,ypically, each segment represents a database table or a material
view. &or e%ample, segment E4MA"AM contains fields for basic data and
represents table MA"A, segment E4MA"'M represents the plant view,
E4MA"MM has fields for material units of measure, and so forth. ;hen you
peruse the documentation for MA,MAS+3 using transaction WE60, you will
notice that some of the segments are re!uired 5mandatory6, while others are
optional. ,his means that the mandatory segments will always be populated
and present in an I01', while the optional segments will be present only if
there are data available for it, or if it has changed in case of generating
I01's using change pointers. ,hese segments have several fields that will
be populated with data from the database tables by ALE/selection modules.
,he field names on the segments are usually the same as those on the
database tables. As discussed earlier, these segments will redefine the
S0A,A field on the E0IH00 record of the I01'. Also, the segment can have
a ma%imum length of 4+++ bytes. 5See Appendi% & for details of some master
data I01' types.6
9ased on your application re!uirements, if you need to eliminate the usage of
certain segments, you can perform an activity )nown as IDOC reduction. 1n
the other hand, if you need additional data not present on the 9asic I01'
type, it is possible to add segments using a procedure )nown as IDOC
extension. ;e discuss and learn these concepts in 'hapter D.
0or1ing the Interface
7aving completed the configuration for the material master outbound ALE
interface, we now proceed with the e%citing tas) of testing the interface.
,here are two ways to wor) this interface. ;e can -send. material master
I01's or capture changes occurring to it, and then convert the changes to
I01's. >ote that there is a third method of -fetching. the data wherein we
can re!uest material master data from a reference "#$ system. ,his
approach uses message type MA,&E,.
2$ending3 Master Data ,he first approach to communicating master data is
to -send. I01's using standard ALE programs. In this case, all segments of
the I01' type having data on the master database will be populated, and an
I01' will be created for every master record selected to be sent. ,o do this<

= E%ecute transaction BALE (Distribution A$ministration - ALE)
Master Data Material Sen$
= Select a material or range of materials you want to send
= Specify MA&MAS as the message type
= Specify E+)MA&MAS* as the logical system
= E%ecute
= @ou will receive informational messages indicating the number of I01's
created. 'ommunication I01's are actually the I01's that we dispatch to
the e%ternal system or another "#$ system. ,hese communication
I01's are stored on SAP(s I01' databases. &or e%ample, if in the
distribution model5s6, we specified that two logical systems will receive
message type MA,MAS, then for every material selected, there will be two
communication I01's generated.
@ou can access this panel by e%ecuting transaction BD10 or e%ecuting
program "90SEMA,. If you are sending large volumes of material master
data, you can use the parameters Server Broup and >umber of Materials per
process. 5,his concept is e%plained in 'hapter 4+, - ALE 1ptimi8ation.. 6
Converting Change )ointers to IDOCs ,he second method captures all
changes occurring to the master data, and an ALE program generates
I01's based on these change pointers. As e%plained earlier, ALE has to be
configured to activate change/pointer generation at the general level, as well
as for that message type.

= 'reate, change, or mar) for deletion materials using transactions MM01,
MM02, or MM06

= E%ecute transaction BALE 'erio$ic .or/ Analy"e cange
pointers
= Enter message type MA&MAS
= E%ecute

= @ou will receive informational messages indicating the number of I01's
generated
1nce the change pointers have been processed to create I01's, they are
flagged so that the same changes do not create duplicate I01's. 1bviously,
if changes are made again to the same material, I01's will be created again
based on the new change pointers. 9ear in mind that the I01' will contain
only mandatory segments and segments of fields that were changed on the
material master.
@ou can access this panel by e%ecuting transaction BD21 or e%ecuting
program "90MI01'. ;hen processing large volumes of changes to master
data periodically, the change pointer databases could grow to si8es that
could degrade performance. In order to maintain these tables, and improve
performance of ALE programs and function modules related to creating
master data I01's from change pointers, you can use program "90'P'L".
"ead 'hapter G for details.
Disp'a%ing IDOCs4 IDOC $tatus 7aving created the I01's, let us now
display the I01's and chec) the results of our tests 5see &igure 3/I6. ,he
proof of the puddingJ
Figure 2-5 0isplay of I01' 0ata
= &rom WEDI ID!C ID!C List

= Enter the selection options such as message type, partner number of
receiver, date of creation, and so forth
= E%ecute

= @ou will see a display with information about the I01's matching the
selection criteria in the previous panel. ,he columns are< 0irection
54K1utbound, 3KInbound6, Status, Message ,ype, Message 'ode,
Message &unction, >umber of I01's, and Status 0escription. @ou will
also see lines for subtotals and totals based on status and direction.

= 0ouble/clic) on the line for message type MA,MAS or place cursor on the
row and clic) on button I01' LIS,

= ,his display will list all I01's selected from the previous panel. ,he
columns are< I01' number2this is a uni!ue number that identifies the
I01', and is internally assignedL message typeL directionL statusL sender
informationL receiver informationL and I01' type.

= 0ouble/clic) on a row or place cursor on the desired row and clic) button
I01' 0ISPLA@.

= @ou will see a hierarchical display of the I01' number with current status,
control record, data records, and status records. 0ouble/clic)ing or
e%panding the trees will result in the display of detailed information. &or the
control record tab, you will see the E0I0' information such as message
type, sender and receiver details2partner number, partner type, port. &or
the data records, you will see a hierarchical display of the I01' segments
that were populated. &or the status records, you will see the various
statuses the I01' has been through, with the current status being the first
entry. Each status record may also have associated messages.
= 0isplaying a segment of the I01' data record will show you the data
contained within the segment. ,he two columns are the segment field
name and its value. @ou will also see a description of the field.
,he I01' status records, which are stored on table E0I0S, indicate the
history of the processing statuses of the I01'. ,hese values are not
e%ternali8ed and are maintained only within the "#$ system. SAP APIs
are used to display the status records. &or a list of status codes, see
Appeppndi% '.
I01's can also be displayed using transaction WE02 .EDI ID!C
Display ID!C or BALE Monitoring ID!C !%er%ie0.
MESSAGE FUNCTION Every segment of master data I01' types has as its
first field MSB&>. ,his $/byte field, the Message &unction, determines the
action to be ta)en by the I01'(s receiving system. &or e%ample, -++M.
indicates that the data contained in the segment represent an original
message, implying that it was newly created. See ,able 3/4 for possible
values of MSB&>. >ote that different segments of the same I01' could
have different values for the message function. &or e%ample, segment
E4MA"AM could have MSB&>K-++D,. indicating that one or more basic data
fields for that material changed, and segment E4MA?,M, being a mandatory
segment, could have MSB&>K-+4I. indicating that the data are being
-resent.. Also, when master data are -sent. through the ALE -send. process
5program "90SEMA, for material master6, the message function fields for
the segments of the I01's will have a value of -++*.2"eplace.
.(B67 2-18 Message Function 9M$:FN; <a'ues
Message
Function
Description
++$ 0elete< Message contains ob:ects to be deleted
++D 'hange< Message contains changes
++* "eplace< ,his message replaces previous
messages
++M 1riginal< &irst message for process
+4I ;ait#Ad:ust< 0ata should not be imported
+3$ "esend
Dispatching IDOCs to Non-!"# $%ste&s 1ne of the settings that we
made while configuring the outbound parameters of the partner profile was to
-collect. I01's. >ow that we have created the material master MA,MAS+3
I01's, we need to dispatch it to the e%ternal system through the port that we
created earlier. 5,his port was associated with the partner profile in the
outbound parameters.6 ,o do this<
= E%ecute program "SE1F,++

= In the selection parameters, specify the message type, sender and
receiver partner details, and so forth
= E%ecute

= @ou will receive an informational message indicating the number of I01's
selected for processing

= 9rowse the file created on the server. It will be in AS'II 5te%t6 format. ,he
file name will be as per the port definition. Each E0I0' record and each
I01' data segment will be a record in the file.

= ,his file can be translated to the format re!uired by the e%ternal system
and processed by programs in the non/"#$ application. ,he translation
can also be accomplished by mapping tools. ,his is discussed in 'hapter
C.
'hec) the status of these I01's through I01' display. @ou will see that they
are in status -+$.20ata passed to port 1?.

You might also like