Upload
sundaran-nair
View
243
Download
0
Embed Size (px)
Citation preview
7/27/2019 ALE Overview for Beginners Step by Step Approach
1/48
ALE Application
ALE (Application Link Enabling)
Some Important Definition
Idoc : Idoc is container that can be used to exchange data between any two processes. AnIdoc represent Idoc type and Idoc datadepending on context in which idoc is used. Idoctype represents the structure and format of data being exchanged. The idoc data is aninstance of an idoc type.
Idoc structure consists of several segments and segment consists of several fields. Eachidoc is assigned a unique number for tracking and future reference.Idoc consists of 1 control record, 1 or many data record, 1 or many status record.
Control record: It contains all information about an idoc including idoc no, sender andreceiver information, information about message type and idoc type. Control record issame for all idoc and defined by SAP. Control record format is EDIDC (TransparentTable).
Data Record: Idoc contains multiple data records as defined by Idoc structure. Segmenttranslates into data records. Data record store application data such as purchase order header information. Data record having format EDIDD (Structure) and EDID4(Transparent Table).
Status record: Multiple status record is attached to an Idoc. A status code, data and dateand time are assigned to Idoc at every milestone. It is having format of EDIDS table.Status record is created by system for outbound process. For inbound it is created by user.
For outbound status record is 1-49 for inbound status record is 50-74.
Message Type: It represents specific type of document that is transmitted between two partners. An idoc type in SAP can be used to represent several message or servicedocuments. Message must be logically related.
Message1 (information regarding employee sal)Idoc Type
Message2 (information regarding employee security)
Contains salary info
Message type material master is MATMAS.
Port: Port is used in an outbound process to define the medium in which documents aretransferred to destination system. ALE uses tRFC (transactinaol Remote Function Call)
port which transfers data in memory buffers.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
2/48
ALE Application
RFC: RFC destination is a logical name used to define the characteristics of acommunication link to a remote system on which function needs to be executed. In ALERFC specifies information required to log on to remote system to which an idoc is beingsent.Partner Profile: Partner profile specifies the component used in an outbound process
(logical name of remote system, idoc type, message type and tRFC port) an idoc packetsize, the mode in which process sends an idoc (match versus immediate).Partner profile is created for each SAP system with which you want to communicate.Transaction data is dispatched using two techniques 1. With message control, 2. Withoutmessage control. The technique depends on application data say SD, MM module usesmessage control to trigger ALE process, FI, PP and HR do not use message control.
Master data between SAP systems is distributed using two techniques 1. Stand alone program, 2. Change pointer. The process flow is same for both process but triggeringmechanism is different that starts IDOC selection process.Stand alone program are started explicitly by a user to transmit data from one SAP
system to another. Standard program exists for several master data objects in SAP. For example material master data can be transferred using RBDSEMAT program or transaction BD10. Stand alone programs specify selection screen to specify the objects to
be transferred and the receiving system.Change pointer technique is used to initiate the outbound process automatically whenmaster data is created or changed. A standard program RBDMIDOC is scheduled to runon periodic basis.
IDOC and Segment are version controlled.
ALE Architecture and processing in each layer
ALE architecture is three layer architecture comprising Application , ALE or distributionand communication layer.
Processing in Application Layer: The customer distribution model is consulted to makesure that a receiver has been defined for the message to be transmitted. If not then
processing ends, if atleast one receiver exists, the Idoc selection program reads master data object from database and creats a master idoc from it. The master idoc is stored inmemory. The programs then calls the ALE layer by using function moduleMASTER_IDOC_DISTRIBUTE, passing master idoc and receiver system if known.
Processing in ALE layer1. Receiver determination2. Idoc filtering3. segment filtering4. field conversion5. version change for segmen and idoc6. communication idoc generation7. syntax check performed
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
3/48
ALE Application
8. idocs dispatched to communication layer
Processing in Communication Layer
To dispatch the idoc to destination system, the system reads the port definition. Specifiedin partner profile which is then used to read RFC destination. The sending system callsINBOUND_IDOC_PROCESS function module asynchronously on destination systemand passes idoc via memory buffers. Function module ARFC_DEST_SHIP transport datato target system.
Processes in ALE
In ALE there are two processes 1. Inbound process, 2. Outbound process.
Like the out bound process, inbound also handles three types of data 1. Trasactional data,2. master data, 3. control data. Transaction and master data are received via ALEinterface layer. Control data is received via CTS process.
The inbound process for any of transactional or master data has two distinct paths for posting the document from IDOCS.
1. via a function module.2. via workflow
The inbound process uses IDOC structure, posting program, filter ojjects, conversionrules, partner profile, service program and configuration table to post an applicationdocument from IDOC.
Posting Program:
Posting programs are implemented as function module. It reads data from IDOC andcreates an application document. A posting program exists for each message type. Each
posting program is assigned a process code ie a function module or work flow. Instandard system process code always points to a function module.
Work Flow:It represents a sequence of customized steps (dialog & background) to be carried out for
a process.
Partner profile:It represents the component used in an inbound process (partner no, message type,
process code, the mode in which idocs are processed (batch versus immediate) and the persons to be notified in case of errors).A partner profile is created for each SAP system with which you communicate, and arecord exists for each inbound message received from a remote SAP system.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
4/48
ALE Application
Process flow for the Inbound process via a function module
1. Processing in communication layer
The Idoc_Inbound_Assynchronous program, triggered as a result of an RFC fromsending system, acts as the entry point for all inbound ALE process. The idoc to be processed is passed an input parameter. Control is passed to ALE/EDI layer.
Processing in ALE layer:a. Basic integrity check, b. segment filtering and conversion, c. application idoc is
created, d. idoc is marked ready for dispatch, e. idoc is passed to posting program.
Processing in Posting Module:
The process code in partner profile points to a posting module for the specific message in
the idoc. Posting program either calls a standard SAP transacton by using the calltransaction for posting the document or invokes direct input function module. If postingis successful, an application document is generated. The idoc gets a status of 53. If idccontains error the status will be 51.
RFC and IDOC:
Idoc is a 16 digit numeric number.There are 2 ways of transferring data between system.
1. Synchronous communication (eg using RFC enabled function module)2. Asynchronous communication (eg IDOC)
In synchronous communication source system expects some return message or flag fromtarget system.In asynchronous communication source system does not expects any return flag fromtarget system.Synchronous communication is reexecuted but it is faster, immediate data transfer.Asynchronous communication is reprocessed. It is slower.Idoc content can be seen in tcode WE02 and WE05.WEDI is the general Tcode where we can see all the Tcode which are used duringcreation of IDOC.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
5/48
ALE Application
Message type (Tcode WE81)To create link (Tcode WE82)
BasicIdoc type (Tcode WE30)
Extended
Segment 2
Segment 1 Segment 3 (Tcode WE31)
Field 1 Field 3 .. .
Field 2
Segment is database structure, collection of fields.Idoc structure type is collection of Segments.
Outbound Process:
There are six outbound process namely Stand alone, message control etc.
Steps of Standalone Outbound process:
ALE Example of Stand Alone approach
Imp Transaction:
BD54:Create Logical SystemSCC4:Assignment of logical system to clientWE81: Create Message type
WE31: Segment typeWE30: IDOC TypeWE82: To create link between message type and Idoc typeSM59: Create TRFCWE21: Port creationWE20: Partner ProfileWE02: Idoc display
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
6/48
ALE Application
Step-by-step procedure for Stand Alone approach
Outbound Process
T-code: BD54---- Create Logical SystemGo to change mode->New entries->in another window give the followingLogical system and name.
Sender LIDReceiver LIR
After giving this click on save.
Transaction: SCC4- Assignment of logical system to client.
Click on new entries A new window will come up give the followingClient, City, logical system and save it.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
7/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
8/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
9/48
ALE Application
Transaction: WE81 Create message type
New entries give message type and short text save
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
10/48
ALE Application
Transaction WE31create segment
Give name and short description give field name data element name save go to edit set release.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
11/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
12/48
ALE Application
Transaction WE30Create IDOC type or basic type
Give obj name chose basic type create follow steps after creating andsaving go to edit set release
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
13/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
14/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
15/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
16/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
17/48
ALE Application
We82create link between message type and idoc type
New entries give message type and basic type and release no.-->saveGo to WE30 give object name click on header icon get the release no.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
18/48
ALE Application
SM59 Create RFC destination
Click on R3 connection click create
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
19/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
20/48
ALE Application
We21Create port
Select transactional port click create
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
21/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
22/48
ALE Application
WE20create partner profile
Create the partner profile in sender and receiver. While creating in sender systemgive the partner no as LS name of receiver and vis a vis.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
23/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
24/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
25/48
ALE Application
SE38- create a program
*&---------------------------------------------------------------------**& Report Z_CUST_IDOC_CREATE **& **&---------------------------------------------------------------------**& **& **&---------------------------------------------------------------------*
REPORT Z_CUST_IDOC_CREATE .Tables: kna1.data: itab like kna1 occurs 0 with header line.data: t_edidc type edidc occurs 0 with header line.data: t_edidd type edidd occurs 0 with header line.data: wa_edidc like t_edidc,
wa_edidd like t_edidd,wa_zcusts1 like zcusts1.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
26/48
ALE Application
select-options: s_kunnr for kna1-kunnr.
start-of-selection.
select * from kna1 into table itab where kunnr in s_kunnr.
*Control Recordwa_edidc-rcvprn = 'LIR'.wa_edidc-rcvprt = 'LS'.wa_edidc-direct = 1.wa_edidc-rcvpor = 'ZSAPLR'.wa_edidc-mestyp = 'ZCUSTOMER'.wa_edidc-idoctp = 'ZCUSTI1'.
* Data Record
loop at itab.move: itab-kunnr to wa_zcusts1-kunnr,
itab-name1 to wa_zcusts1-name1,itab-land1 to wa_zcusts1-land1,itab-ort01 to wa_zcusts1-ort01.
move: 'ZCUSTS1' to t_edidd-segnam,wa_zcusts1 to t_edidd-sdata.append t_edidd.
endloop.
* Create IdocCALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTINGMASTER_IDOC_CONTROL = wa_edidc
* OBJ_TYPE = ''* CHNUM = ''
TABLESCOMMUNICATION_IDOC_CONTROL = t_edidcMASTER_IDOC_DATA = t_edidd
EXCEPTIONSERROR_IN_IDOC_CONTROL = 1ERROR_WRITING_IDOC_STATUS = 2ERROR_IN_IDOC_DATA = 3SENDING_LOGICAL_SYSTEM_UNKNOWN = 4OTHERS = 5
.IF SY-SUBRC 0.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
27/48
ALE Application
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.else.commit work.read table t_edidc index 1.if sy-subrc = 0.write: /1 'Idoc No: ', 25 t_edidc-docnum.endif.ENDIF.
Inbound process
WE81message type sameWE21Port not same
Additional t-code in inbound process areWE42 Create inbound process codeSE37 Create function module
FUNCTION ZIDOC_INPUT_CUST.
*"----------------------------------------------------------------------*"*"Local interface:*" IMPORTING*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC*" VALUE(NO_APPLICATION_LOG) LIKE SY-DATAR OPTIONAL*" VALUE(MASSSAVEINFOS) LIKE MASSSAVINF STRUCTUREMASSSAVINF*" OPTIONAL*" EXPORTING*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR *" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK *" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS*" TABLES*" IDOC_CONTRL STRUCTURE EDIDC*" IDOC_DATA STRUCTURE EDIDD*" IDOC_STATUS STRUCTURE BDIDOCSTAT*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
28/48
7/27/2019 ALE Overview for Beginners Step by Step Approach
29/48
ALE Application
endloop.
ENDFUNCTION.
Save and activate the function module.
TCode BD51 register function module
Click on new entry give your function module name and input type 0 (mass processing) save.
TCode WE57 Assignment of function module with message type and idoc type.
Go to change mode. We get information Table is a cress client. Click on OK.In the next message display click on Ok. Then click on new entries. We will get another window. Give the function module name, function type, basic type, message type and
direction. Choose function type as function module. Direction as inbound. Rests all youhave created from previous step, get it from there.
T-code WE42 Creation of process code in inbound.
Go to change mode. Click on new entries.. Give process code name. Say zcust. Givedescription. Processing type by function module. Click on save. We will get someinformation popup window. Click on Ok. We will get another window. In that windowselect Function module name. Save it.
T-code WE20 create partner profile
Place the cursor on partner type LS on left side then click on OK. Give partner no. Herewe will give source LS name created in BD54. Press enter. Save. You will get host LSname on left side. Select the LS name and click on + button on the inbound parameter section on the right side. You will get another window Give message type and processcode. Click on save.
NB: Every new inbound function module should be created with reference to SAPstandard function module, nothing but same importing, exporting and table parameters. InSE37 we have used SAP standard function module IDOC_INPUT_MATMAS01.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
30/48
ALE Application
Outbound process with data distribution Model:
T-code WE81 : Logical Message type
No need to create. Only check for message type (here MATMAS).
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
31/48
ALE Application
T-code WE30: Basic type (Idoc type)
No need to create. Only check (here MATMAS05).
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
32/48
ALE Application
T-code WE82: Link between message type and idoc type.
No need to create.
T-code WE21: Port creation
Select transactional RFC and click on create.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
33/48
ALE Application
Give port name (ZSAPLIR) and description and RFC destination name. (Create RFCdestination first using SM59).
T-code WE20: Create partner profile
Select Partner type LS and click on create. Give Partner no as receiver system LS nameand partner type LS. Click on Save.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
34/48
ALE Application
Click on + sign in outbound parameters.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
35/48
ALE Application
Give message type (MATMAS), receiver port (ZSAPLIR), packet size (1) and basic type(MATMAS05). Click on save.
While creating distribution model through BD64 and the generate partner profile themessage type SYNCH is created. So initial stage you will only create message typeMATMAS.
T-code BD64 Distribution Model (Master Idoc Conversion)
Click on Create Model view. Get another window. Give Short text say Material Data.Technical name say Material. Click on Ok button. You will see main window. Placethe cursor on Material data and click on Add message type. Give sender name,receiver name and message type. Click on Ok. Click Save.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
36/48
7/27/2019 ALE Overview for Beginners Step by Step Approach
37/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
38/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
39/48
ALE Application
From Menu select Environment generate partner profile.. Give partner system say LIR (receiver). Use F4 help. You will get information about partner, port, and outbound
parameter in another window. Go back Chose from menu bar Edit model view distribute. Then you cab select your logical system from window you got or directly click on Ok button. You will get another window with information.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
40/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
41/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
42/48
ALE Application
Although the screen shot is shown for Material data but the message type usedDEBMAS (please use MATMAS for material master).Create a new material using MM01. Then go to BD10. Give material no created above.
Logical system name as receiver name (LIR). Click on Ok button (send material in full).Click on OK. You will get another message 1 master set up for message typeMATMAS. Click on OK button. You will get another message 1 communication Idocgenerated for message type MATMAS. Click on OK.
Go to WE05. Give direction 1 (outbound). Basic type as MATMAS05. Logical messagetype MATMAS. Click on execute. You can see your Idoc status.
Inbound process: (In receiver system here (LIR)
Log on to target (LIR).
Go to WE42 (Process code). Click on position. Give MATM (SAP standard processcode material master. You will get it in main window.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
43/48
ALE Application
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
44/48
ALE Application
Do not create. Only check that process code for material master in case of inboundis MATM.
T-code BD51
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
45/48
ALE Application
Give function module name as idoc_input_matmas01.
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
46/48
ALE Application
T-code WE57 (Assignment of function module, message type and idoc type)
Click on new entries. In the next screen give the following as the screen shot below.
Click on save.
T-code WE20 (create partner profile)
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
47/48
ALE Application
Select partner type LS and click on create. Give partner no as sender LS (here LIS)and partner type LS. Click on save.
Now click on + sign and give input in another window as per the screen shot below
Prepared and compiled by Amit K Mitra
7/27/2019 ALE Overview for Beginners Step by Step Approach
48/48
ALE Application
Then click on save.
Now everything is ready. Create a material in sender system (here LIS). Go toBD10 and give input as follows.
And execute. Then go to WE05 and check he idoc status. Then go to receiver system go to WE05 and check the idoc status. Go to SE16 and give the table nameMARA give the material no and check to if it exists in receiver system.