Step2: Creating the RFC Connection Names: Go to TCODE SALE. Direct TCODE SM59->Click on
Create button.-> Specify all the details in RFC connection screen ->Click on Logon Security tab and
specify the details. ->Click on the Special options tab and specify the details which you want->Now click
on Test Connection button->It show the connection log in next screen-> Click on Back->Click on
Remote Logon Button ->Depends upon your settings the destination client will open. If you check the
Current user option under Logon/ Security tab, then it will show the screen directly without asking the user
name and password details
Step-3: Creating RFC ports:-> Go to TCODE WE21->Select the Transactional RFC in left side tree and
click on Create button ->In dialog box you can select either Generate port name or own port name. If you
select Generate Port name system will generate automatically. Here I selected Own port name. Click on
continue.-> Specify the description and RFC destination name.-> Click on Save->
Step4: Creating IDOC Segments: Specify a name and Click on Create Button. ->Here specify all the
ZSTUDENTS table fields and their types as shown below->Click on SAVE button, then it will show dialog
box with user name, press continue.-> Specify your package name and click on save.-> Specify your
request and press Continue. ->Click on Back button, and then you will see the created segment.
Step5: Creating Basic IDOC Type: Go to TCODE WE30->Specify a name to your IDOC and click on
create button.-> In next dialog box select create new option and specify the description of IDOC and click
on continue.-> Click on Create segment in the screen.-> In dialog box specify the segment name which
you created and check mandatory check box.-> Click on SAVE and BACK button.-> Go to menu EDIT
->Click Set Release ->In next dialog box, click on Yes.
Step6: Creating Message Type: Go to TCODE WE81.-> Click on Display / Change button.-> Click on
New Entries button. ->Specify a message type name and Description and click on SAVE button->Click on
Back and Save.
Step7: Assign Message Type to Basic IDOC Type: Go to TCODE WE82->Click on Display / Change
Button->Click on New Entries, Specify the Message Type and Basic IDOC Type and Release version.
Click on Save.-> Click on Back.
Step8: Creating Model View and Distributing and Generating Partner profile: Go to TCODE BD64>Click on Display/ Change button->Click on Edit menu -> Model View -> Create-> Specify description of
model view and technical name in dialog box and press continue.-> Select your model view and click on
Edit menu -> Add Message type->In dialog box specify the sender, receiver, message type and click on
continue->Click on Environment Menu -> Generate Partner profile ->It will show the following screen,
click on execute. ->Click on Back button 2 times, it will take back to Distribution Model screen.-> Click on
Edit Menu -> Model View -> Distribute.-> In displayed dialog box select the partner system and click
continue ->Then it will show the Log of Model View Distribution->Click on Back button.
Step9: To check partner profile: Go to TCODE WE20->In displayed screen select the partner system in
left side tree under Partner Type LS.
Step10: Write a Report Program in SE38 to create IDOC control records and transfer it to
destination partner system->Send Idoc Call function
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL
= S_CTRL_REC(EDDIC)
*
OBJ_TYPE
= ''
*
CHNUM
= ''
TABLES
COMMUNICATION_IDOC_CONTROL
= T_COMM_IDOC(EDIDC)
MASTER_IDOC_DATA
= T_EDIDD(EDIDD)
EXCEPTIONS
ERROR_IN_IDOC_CONTROL
= 1
ERROR_WRITING_IDOC_STATUS
= 2
ERROR_IN_IDOC_DATA
= 3
SENDING_LOGICAL_SYSTEM_UNKNOWN
= 4
OTHERS
= 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM.
" SEND_IDO
Now execute the program, and specify the range of records to transfer ->Go to TCODE WE02 to check
the generated IDOC control records.-> Click on Execute
Step16: Transferring the IDOC control records from Client 900 to 800: In source system, go to
TCODE SE38. (In client 900)-> Execute the Report program which you created.
Step17: Check in Destination System: (Here client 800): Go to TCODE WE02-Check in ZSTUDENTS
table in SE11.
LOGICAL SYSTEM:
A Logical System (LS) is the representation of an R/3 or external system in SAP R/3
for the distribution of data to and from the R/3 System.
An entry for the logical system is created in the table TBDLS.
IDOC TYPE: An IDoc type defines the syntax of the IDoc data. It tells which segments
are found in an IDoc and what fields the segments is made up of.
MESSAGE TYPE:
Message represents a specific type of document that is transmitted between two
partners. The message type defines the semantic context of an IDoc. Message type is a
grouping of IDOC types belonging to similar application. The same IDoc data can be
sent under different message types.
DISTRIBUTION MODEL
The Distribution model (also referred to as ALE-Scenario) is a more or less graphical
approach to define the relationship between the participating senders and receivers.
The distribution model is shared between all participating partners
FILTER OBJECT TYPE AND FILTER OBJECTS:
A filter object type is used in the Customer Distribution Model to impose a selection
criterion on the message (type) flowing to a Logical System.
SEGMENT FILTERING:
In segment filtering segments of a particular type are completely removed from the
IDoc.
The segments to be filtered out are determined at runtime as per the settings, and
unwanted segments are removed before the communication IDoc is created.
CHANGE POINTERS:
Basically after the master data is distributed to the other system, if it undergoes a
change in the sending system, the change needs to be re-distributed to the receiving
system. Change pointer is a technique that enables only the changed data to be
redistributed.
CD objects record the changes occurring to master data at a field level. These changes
are stored in tables CDHDR (header table) and CDPOS (detail table).
PORTS:
A port is a logical name for an input/output device. It defines the medium in which
documents are transferred to the destination system. A program talks to a port, which
is presented to it with a common standard interface. The port takes care of the
translation between the standard interface format and the device dependent format.
There are four types of ports that can be defined in R/3,
1>tRFC 2>file 3> R/2 4>XML
Declaring the port is done by transaction WE21.
ALE: ALE supports the distribution of the business functions and process across
loosely coupled R/3 systems. Connections from
R/2 and non SAP systems is also
supported.
IDOC: IDOC is simply a data container used to exchange information between any two
processes that can understand the syntax and semantics of the data.
Control Record
Data Record
Status Record
Control Record
All control record data is stored in EDIDC table. The key to this table
is the IDOC Number
Data record contains application data like employee header info, weekly
details, client details etc
All data record data is stored in EDID2 to EDID4 tables and EDIDD is a
structure where you can see its components.
It contains data like the idoc number, name and number of the segment in
the idoc, the hierarchy and the data
Status Record
Basic IDOC Type defines the structure and format of the business document that
is to be exchanged.
specific name
hierarchy of segments
mandatory/optional segments
Segment defines the format and structure of a data record. Segments are reusable
components.
MESSAGE TYPES
A partner is defined as a business partner with whom you conduct business and
exchange documents
In the partner profile of a partner that we exchange Idocs with, we maintain the
parameters that are necessary for exchanging the data.
The transaction used is We20. We will look at this again while dealing with outbound
and inbound processes
PORT: The port defines the technical characteristics of the connection between SAP and
the subsystem. The port defines the medium in which data is exchanged between the 2
systems. There are different types of ports. The 2 most commonly used are the TRFC
ports used in ALE(will discuss this later) and File ports which EDI uses. For TRFC
ports we have to give the name of the logical destination created using SM59.We will
explain this in detail later. When using file port you can specify the directory where
the idoc file should be placed. The subsystem or the middleware will pick up the file
from here. The Function module can be used to generate a file name for the idoc. Whie
testing you can use Outbound file to specify a constant file name. The tab outbound
trigger can be used to supply information if we want to trigger some processing on
the subsystem when an idoc is created at this location. We have to specify the command
file name and the directory which has to be run(WE21)
Note: Link between a process code and its corresponding function module can be seen by
transaction WE41 for outbound Process code and WE42 for Inbound Process code
Partner Profile
We must maintain the business partners with whom we communicate via IDocs, in
Partner Profiles.
Values can be converted to the required format with the help of rules given above.
Goto Messages , add the new Message Type to the list and Save the
document.
An IDOC will be created and will be dispatched to PORT mentioned.(either
immediately or when RSEOUT00 is run depending on the output mode).
Partner profile
Message type
The settings required for inbound IDoc processing depends on whether a new process
code is defined or a SAP defined process code is used.
In case SAP defined process code is used then execute Step 5 else follow the stepwise
procedure given below:
2) Select the relevant Partner profile (Assuming it has already been created)
3) Go to the Inbound Parameters, Select the required message type and Double click on
the same.
Enter the process code that is attached to the function module and save it.
PROGRAMS FOR CUSTOM IDOCS
IDoc is basically a data container and do not transfer data from one system to
another.
For ensuring this, programming in the IDoc interface needs to be done.
Custom-developed
Extended IDoc
Enhancements
OUTBOUND
INBOUND
PROGRAMS
PROGRAMS
Outbound program is
Written to populate IDocs
are used to read IDoc
a Inbound program
B. INBOUND PROGRAMS
ALE processes for distributing master data are implemented as stand-alone programs.
For example, RBDSEMAT (Transaction code BD10) is a SAP standard report program to
generate material master IDocs.
STEP-WISE PROCEDURE
The Stand alone program consist of following steps:
1.The selection screen allows user to select one or more object, a receiving
system and the message type for which the selection screen is to be
generated. For example, selection screen for material master generation.
2. Determine the key of the application document (in case of Material master the key
object is Material (MATNR).
3.Select the application data from the database using the key object.
4.Populate the control record information. The data is populated in structure of the
type EDIDC. It consists of control information such as receiver port, logical system
and message type.
5.Populate data in internal table of type EDIDD with data records for the various
segments.
7.Commit work.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control
= st_edidc
OBJ_TYPE
= ''
CHNUM
= ''
TABLES
communication_idoc_control
= it_idoc_num
master_idoc_data
= it_edidd
EXCEPTIONS
error_in_idoc_control
= 1
error_writing_idoc_status
= 2
error_in_idoc_data
= 3
sending_logical_system_unknown
= 4
OTHERS
= 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
COMMIT WORK.
LOOP AT it_idoc_num.
WRITE :/ it_idoc_num-docnum INPUT ON.
ENDLOOP.
ENDIF.
PROGRAMS FOR CHANGE POINTERS (FOR CHANGE MASTER DATA)
STEP-WISE PROCEDURE:
The program logic contains:
1.Read the change pointers using function module CHANGE_POINTERS_READ.
3. Determine the key of the application document (in case of Material master the key
object is Material (MATNR).
4.Select the application data from the database using the key object.
5.Populate the control record information. The data is populated in structure of the
type EDIDC. It consists of control information such as receiver port, logical system
and message type.
6.Populate data in internal table of type EDIDD with data records for the various
segments.
9. Commit work.
CALL FUNCTION 'CHANGE_POINTERS_READ'
EXPORTING
*
ACTIVATION_DATE_HIGH
= ' '
ACTIVATION_DATE_LOW
= ' '
ACTIVATION_TIME_HIGH
= '000000'
ACTIVATION_TIME_LOW
= '000000'
CHANGE_DOCUMENT_OBJECT_CLASS
= ' '
CREATION_DATE_HIGH
= ' '
CREATION_DATE_LOW
= ' '
CREATION_TIME_HIGH
= '000000'
CREATION_TIME_LOW
= '000000'
message_type
read_not_processed_pointers
= message_type
= 'X'
TABLES
change_pointers
*
MESSAGE_TYPES
= it_chgptrs
=
EXCEPTIONS
error_in_date_interval
= 1
error_in_time_interval
= 2
OTHERS
= 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
POSTING PROGRAMS
1>how do we debug an idoc ?
Ans. using function module idoc_outbound_<message type>. we
set the break point for this function module.
Using WE19, you can process an existing Inbound Idoc, by
giving its number and specifying the function module that
process it. It will execute with a dummy Idoc number.
can
For Outbound Idoc, find the report that generates it, where
the master idoc distribute FM. is called for that Idoc.
Possibilities are that, it can be called in more than 1 FM.
2>Let me know please 'IN real time What is actual role of an
abaper in ALE-IDOCS and also wt abaper do in case of CHANGE
POINTERS.
Ans. IN REAL TIME MAINLY WE WORK ON EXTENDED IDOC. WE WILL GO FOR
THE CAHNGE POINTER IF THERE IS ANY CHANGE IN THE EXITING
DATA NOT THE NEW DATA.IF WE CHAGE THE DATA (EX-CUSTOMER
ADDRESS)AND EXECUTE BD21 THEN CAHNGW POINTER WILL WORK.IF WE
CREATE A NEW CUSTOEMR THEN CAHNGE POINTER WILL NOT WORK
3>when idoc is created in which table its stored
Ans.EDIDD to store data records.
EDIDC to store control information.
EDIDS to store status of IDOC
4>1.what is master idoc.
2.what is communication idoc.
3.if i want to send the five records throgh BD10 then how
may no of
master and communication idocs will generate depends on
what they are
generating the master and communication idocs.
Ans. MASTER IDOCS : IT IS AN IDOC WHICH CONTAINS THE ORIGINAL
DATA TO BE TRANSFERRED BETWEEN SENDOR & RECEIVER.
COMMUNICATION IDOCS: THIS IS THE INSTANCE OF THE MASTER IDOCS
1.
2.
3.
4.
5.
PROFILE LOC #1
PROFILE LOC #2
PROFILE LOC #3
DISCOUNT STRUCTURE LOC #1
DISCOUNT STRUCTURE LOC #2
DISCOUNT STRUCTURE LOC #3
Message Type.
Sendor Info.
Port Number.
Output Mode.
Partner Type.
IDOC Basic Type.
This information will help to Communication & ALE Service layer to process further.
FLOW:
(network) --> communication layer -->
ALE Service Layer( here it will check the "ALE Inbound Partner Profile") and send to
the respected program.
11. what is Tcode for Basic ALE configuration?
ANS. SALE is correct - through this we can define all the basic's of IDoc
IDOC sending system knows the status of IDOC . there are 75 status record
0 to 49 are recorded for outbound and 50 to 74 are for
inbound.
14. 16. what is the status code when IDOC is created?
ANS.
01 for Outbound side
51 for Inbound Side.
64. How do you get output from IDOC?
ANS. Function moudles or processing routines are alloted
dynamically based on message type andn IDCO type. We use
these function modules to process IDOC segments to get data
and move this segment data into internal tables.
77. I am transferring 10 data records from outbound though idocs but
8 records are transferred , what about reaming records but
it did not show any error?
ANS. Just Check the Filter settings.Remove the filter for the
fields and then transfer the datarecords again.If the filter
is set it will not show any error.
83. can any body tell what is idoc archieving and how to do that?
ANS. Archiving means collection of HISTORIAL Idocs that can be
stored out side of The Database,By using this We can reduce
load on the data base.
"WE10" is the TCODE for archive idoc info structure.
Here 2 options is availabale.
1. Database
2. Archive
-> We can select Archive idoc then it give the information
about This.
configuration?
ANS. ALE configuration :
Goto SALE T-code then
1) Design LogicalSystem and go back to IMG initial Screen
and 2) Assign Logical System to the client.
3)then Goto SM59 to create RFC Destinatio for the Logical
System (i.e.receiver system.).
4) then Goto WE21 T-code for Port Creation in WE20 select
TranscationalPort and create your Own Port.
5) Goto BD64 T-code for Distribution Model
here we create Model view and specifies the what kind of
Message is distributed between them .
6)we'll save and goto environment in the menu bar..
7) goto we20 T-code for Partner Profile ..create the
Partner file ..and give inbound and outbound messagetypes.
These r the steps for ALE Configuration.
Suppose If u Specify Matmas as Message type ...got BD10 and
sent the material .
484. if idoc generated successfully where it can be stored i know
database)?
ANS. EDID4 - Data Records are Stored in this Data Base Table.
EDIDS - Status records are Stored in this DB Table.
EDIDC - Control Records are Stored in this DB Table
485. how to process the idoc?
ANS. idoc can be processed by using processing codes
transaction codes for processing codes:
we41 for out bound process codes
we42 for in bound process codes
577. How do you get output from IDOC?
ANS. Function moudles or processing routines are alloted
dynamically based on message type andn IDCO type. We use
these function modules to process IDOC segments to get data
and move this segment data into internal tables.
589. What are the steps need to setup
ANS. Communication Settings:
1) Create and Assining Logical Systems
2) Maintain RFC destination
3) Maintain TRFC Port
-- BD64
-- WE20
T.code SALE
T.code: SALE
Tcode: SM59
Tcode: we21
Tcode: WE20
In partner profile we specify the names of the partners which are allowed to exchange
IDocs .
Double Click on the Message type MATMAS the following opens.
Enter the details for Receiving port, Pack size and Basic type.
Step 6: Create Customer Distribution model Tcode: BD64
Click on the Create button and enter the short text, Technical name
Now select the created model view and click on Add message type button .A pop up box
appears, enter Sending system, receiving system and message type.
Save the Distribution model
Generate Partner Profiles
Click the menu item Generate Partner Profiles.
It leads to the next transaction where in the selection screen you have to provide Model
view name, Partner System logical system and execute.
Then, you will be intimated about the partners, port creation, and outbound parameters
creation.
Distribute Customer Distribution Model
In the menu item Distribute to the destination client.
Popup window appears , press Enter.
T.code MM01.
T.code BD10
Enter the material created or changed, message type and the destination system as
follow and execute.
We get the information as 1 master Idoc created, 1Communication Idoc created.
Step 9: View the IDoc
T.code we05
T.code WE20
For the partner add the message type .here the message type is MATMAS
Double click on the message type and enter the processing code (MATM) and
select Trigger Immediately radio button, save.
Get the material
T.code BD11.
Enter the material created or changed, and the Message as shown below.
If every thing is fine IDOC will be created.
View the Idoc in the T.code We09.
T.Code BD61
Check the box so that change pointers get activated and keep track the changes to
trigger ALE process.
T.code BD50
Issue
Solution
Issue
Time-out if too many IDocs are created at once (e.g. direct sending of
master data)
Solution
Issue
Solution
Issue
Create IDocs not immediately but later via regularly scheduled program
RSNAST00
Issue
Slow update of documents that trigger the creation of IDocs via message
control (e.g. sales order, purchase order)
Solution
Long response times for online users because ALE processing occupies
available dialog work processes
Solution
Use separate application servers for online users and ALE processing
Issue
Solution
Issue
Solution
Issue
Many WPs are blocked on receiving system (< R/3 Release 4.0)
Solution
Use background processing in inbound partner profile and schedule report
RBDAPP01 (with parallel processing)
Issue
For the automatic retry of failed RFCs, usually batch jobs are scheduled
automatically. This can cause performance problems (too many batch jobs
scheduled)
Solution
Issue
Solution
Issue
The connection between R/3 and an external system is slow because the
external system is started for every RFC call
Solution
Do not use parallel processing if multiple IDocs exist for the same
application object (e.g., goods movements)
Issue
Solution
...
Issue
Solution