Change Pointers in IDOCs
Change Pointers in IDOCs
IDOCS / BDOCS
Change pointers for a custom message type
User Rating: / 1
Written by Henrik Frank
Tuesday, 24 February 2009
Scenario: We want to crerate a custom message type for idoc type MATMAS03, activate change pointers
for the message type and use a distribution model to filter and distribute the idoc.
2. WE82 make connection between IDOC type MATMAS03 and message type ZMATMAS_SIMATIC
3. BD59 Create the field that we will use to filter the idoc in the distribution model
We will use plant (WERKS) and material type (MTKLAS) to filter the idocs:
Note: You can take a look at the standard message type MATMAS to find ALE object type and Segm. type
Under the message type ZMATMAS_SIMATIC choose the filter and add the fields from step 3 and the filter
cirterias.
We only want to distribute IDOC where plant = 1002 and material type is HALB or ROH.
5. BD60 To be able to use change pointers for the new message type, it must have a reference to the
original message type MATMAS. You make this reference in BD60.
6. BD52 In this transaction you set up the fields that triggers a change. Note that it is not possible to copy
the fields from and existing message type (For example from MATMAS). However, you can use an existing
message type in BD52 to find out Object and table name for the fields.
In the example below we only wants to trigger a change pointer when the material text changes.
7. You should now be ready to test that the change pointer works for the new transaction.
Make a change to the material text for a material in plant 1002 of material type HALB or
ROH
Run transaction BD21 or ABAP program RBDMIDOC for message type
ZMATMAS_SIMATIC
Check that an outbound IDOC has been created (Transaction WE02)
During integration projects, one might face requirement to trigger delta information
like creation/change of master data out of SAP ERP. There might be additional
requirements to trigger this at scheduled interval or as a nightly job.
To fulfill the above requirement, “Change pointers” can be activated for the required
IDOC’s. A background job can trigger the generated IDOC’s to PI.
Following are the applicable situations:1. Trigger delta data2. Batch processing3.
Timed/Nightly processing
The solution is to activate change pointers from Customizing and use report
program RBDMIDOC. Separate jobs can be scheduled for separate IDOC’s.
Steps to be followed
1. Goto the following path in TCODE: SPRO.SPRO > SAP NetWeaver > Application
Server > Idoc interface/ALE > Modeling and Implementing Business Process >
Master data distribution > Replication of modified data > activate change pointers
for message types.
2. Select the IDOCs where change pointers are to be activated and save your
settings.
3. Run transaction BD22 to delete existing Change pointers. This is required to clear
the existing change pointers. If this is not done, enormous amount of IDOC might be
generated during the first run.
4. Run Schedule report RBDMIDOC ( TCode: BD21)
Tip: You can check for processed IDOC’s using WE05.
Sometimes lot of Change Pointer gets created, but fails to get processed
due to system issues. This report is quite helpful to generate IDocs from
unprocessed change pointers.
See the check box in Further characteristics tab of the data element for change document.SE11-->enter data
element-->Further characteristics tabThe check box is to be checked to trigger change pointers.
The change pointer tables (BDCP & BDCPS) should be as small as possible. Use as few change pointers as possible
and delete change pointers which you no longer need.
2. Do you really need to activate change pointers for this messages type?
If some messages types are no longer to be distributed by change pointers, you can deactivate change pointers for
this messages type.You can deactivate change pointers for the message type and reactivate them again.For
reduced message types, deactivate the change pointer with the Reduction tool (Tcode BD53).
Change pointers are R/3 objexts that mark changes to SAP Master Data. They are the
mechanism through which data can be sent to another SAP systems or external systems if
there is a change to specific fields in the master data. ALE provides powerful capabilities
to capture changes occurring to master data and to distribute them via the IDOC interface.
Not all fields are relevant for other systems. This means that only if specific fields are
changed a message to other system(s) must be created. This setting on field level is done
with transaction BD52. Here fields of a specific message type can be added and/or
deleted.
If for example the field BISMT (Old material Number) is changed by the user then a
change pointer is created.
Later this change pointer can be used to create messages to 1 or more external systems.
The contents of the change document are passed from the change document system to
the SMD Tool. For each document the system checks that the modified field and the table
are assigned to a message type. If this is the case then a change pointer is created.
Change pointers are basically the key fields of the table that contains the changed field
In the distribution model it is determined which messages are sent to which systems. For
example Material Master messages for Plant 1000 are sent to system A and Material
Master messages for Plant 2000 are sent to 2000. If now a change is made to a material
of plant 1000 then a Master Idoc is created. Based on this master idoc and the distribution
model a communication idoc is created for system A. If a change is made to a material of
Plant 3000 then also a Master Idoc is created but as Plant 3000 is not specified in the
distribution model no communication idoc is created and so no message is sent to an
other system.
Note that the Master Idocs are not stored in any table. The communication idocs can be
viewed with transaction WE02 or WE05.
Conversion of IDOCs to XML format at SAP Level
This article details about the step by step in conversion of IDOCs to XML format for further use in
XI or any other application. It is assumed that the reader of this article has some knowledge in
ALE, IDOCs and Change Pointers.
Scenario: Conversion of the Material IDOC (Message type: MATMAS) to XML format and store the
same in the application server of SAP.
Approach Change pointers are used for sending IDOCs for master data like Material Master. To
work with Change pointers, following two steps have to be performed:
• Turn on change pointer update generally • Providing the message types to be included
for change pointer updation.
To do the above configurations: TCode: SALE␣IDOC Interface / Application Link Enabling
(SALE)␣Modeling and implementing Business Processes ␣Master Data Distribution
␣Replication of Master Data
ALE Configuration Steps: 1. Creation of logical system for the sender system. 2.
Assignment of logical system to the client. 3. Create a logical system for the recipient 4.
Creation of RFC destination (Connection type:TCP/IP)
5. Creation of Model View (TCode: BD64).
6. Save the Model View and Generate Partner Profiles. 7. There might be a problem with the
automatic Port creation. Creation of the
port has to be done manually. 8. Create an XML Port from the transaction WE21 (Port type:
XML File).
Here directory is the path on the application server. The Function Module is used for file naming
conventions. Any of the SAP provided function modules could be used for this (Use F4 help to
check on this) or create any custom function module for any other naming conventions.
In the outbound trigger tab, mention the RFC destination created earlier.
9. Make an entry in the partner profile generated earlier for message type MATMAS.
10.A background job need to be scheduled, for a periodic run (interval as required) for the program
RBDMIDOC with the message type MATMAS.
11.Depending on the settings in the partner profiles, it may be necessary to send IDocs directly by
executing the program RSEOUT00 (if the setting is to “Collect IDocs”)
Test the above scenario by creating a material using MM01. An XML file would have been created
in the directory specified in the XML port. The file could be downloaded onto the front-end system
using the transaction CG3Y.
• The data record, which conforms to the structure EDI_DD, contains the
application data. Every EDI_DD record has a key portion that is 55 bytes
in length (or 63, depending on the SAP release), which consists of
several fields describing the content of the record. The key of 55/63
bytes is followed by a field SDATA, which is 1000 bytes in length and of
data type Long Character. The SDATA field holds the application data,
and its structure is determined by the key field SEGNAM (Segment
Name). An IDOC consists of one or more data records, and its sequence
and structure are dictated by the sequence and structure of segments in
a given IDOC type. The SDATA portion of the data record is redefined for
every occurrence based on the structure of the segment, with the first
55/63 bytes of the data record identifying the segment name, sequence,
and hierarchy. In an outbound interface, ALE/EDI function modules
populate these segments with application data. In an inbound interface,
the application modules process the data contained in the segments.
Data records are stored on table EDID2 that belongs to the cluster
EDI30C.
1) Difference between BADI and USER-EXIT.i) BADI's can be used any number of times, where as
USER-EXITS can be used only one time. Ex:- if your assigning a USER-EXIT to a project in (CMOD), then
you can not assign the same to other project.