Ale IDOC

76
06/28/22 Overview of ALE/IDOCs 1 Overview of ALE / EDI / IDOCs

Transcript of Ale IDOC

Page 1: Ale IDOC

05/02/23 Overview of ALE/IDOCs 1

Overview of ALE / EDI / IDOCs

Page 2: Ale IDOC

Overview of ALE/IDOCs 205/02/23

EDI

What is EDI? Type of EDI process• Outbound EDI Process• Inbound EDI Process

Page 3: Ale IDOC

Overview of ALE/IDOCs 305/02/23

What is EDI?

EDI is electronic exchange of business documents between the computer systems of business partner using a standard format over a communication network EDI is also called a paperless exchange.

Page 4: Ale IDOC

Overview of ALE/IDOCs 405/02/23

Typical EDI/IDOC Scenario

Page 5: Ale IDOC

Overview of ALE/IDOCs 505/02/23

Outbound Process With Message Control Directly -With out Message Control

Page 6: Ale IDOC

Overview of ALE/IDOCs 605/02/23

Inbound Process

With Function Module

Page 7: Ale IDOC

Overview of ALE/IDOCs 705/02/23

EDI Configuration

How to Set Up an RFC Destination in SAP The Port Definitions Configure Partner Profile Configure Message Control

Page 8: Ale IDOC

Overview of ALE/IDOCs 805/02/23

Complete EDI/ ALE scenario

Page 9: Ale IDOC

Overview of ALE/IDOCs 905/02/23

ALEALE What is ALE? Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Questions

Page 10: Ale IDOC

Overview of ALE/IDOCs 1005/02/23

ALE TerminologyALE Terminology•ALE - Application Linking & Enabling

•IDoc - Intermediate Document

•EDI - Electronic Data Interchange

Page 11: Ale IDOC

Overview of ALE/IDOCs 1105/02/23

ALE Objective ALE Objective

Page 12: Ale IDOC

Overview of ALE/IDOCs 1205/02/23

ALE!! What is it ??

It is a set ofIt is a set of Tools, programs and data definitions

Provides distribution model and technology that enables SAP Customer to interconnect programs across various platforms and systems..

Page 13: Ale IDOC

Overview of ALE/IDOCs 1305/02/23

Features –ALE / IDocsFeatures –ALE / IDocs Distributed System yet integrated with SAP R/3

Based on ‘Application-to-Application integration using ‘Message Architecture’

Reliable communication Data is exchanged using “IDocs”

Support both R/2, R/3 and External system

If network problem, message is buffered

ALE support backward compatibility

ALE ensure that , data is transferred only once

Page 14: Ale IDOC

Overview of ALE/IDOCs 1405/02/23

ALE Scenario ALE Scenario

Document

SAP System R/3 SAP System R/3IDoc

EDI SubsystemEDI Subsystem

IDocIDoc

Page 15: Ale IDOC

Overview of ALE/IDOCs 1505/02/23

What is ALE ?

Components of ALE. Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Trouble Shooting

Questions

Topics to coverTopics to cover

Page 16: Ale IDOC

Overview of ALE/IDOCs 1605/02/23

Components of ALE Components of ALE

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Page 17: Ale IDOC

Overview of ALE/IDOCs 1705/02/23

Application ServicesApplication Services

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

This is where the SAP applications ( SD, FI, MM etc. ) generate their data and documents

Page 18: Ale IDOC

Overview of ALE/IDOCs 1805/02/23

Distribution ServicesDistribution ServicesServices:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services

Recipients Formats and Filters the data Creates IDocs ( Intermediate Documents

Page 19: Ale IDOC

Overview of ALE/IDOCs 1905/02/23

Communication ServicesCommunication Services

Services:Services:

Application ServicesApplication Services

Distribution ServicesDistribution Services

Communication ServicesCommunication Services •TCP/IP

•RFC

•tRFC

• etc

Page 20: Ale IDOC

Overview of ALE/IDOCs 2005/02/23

Application Data

MasterIDOC Determine

ReceipientsFilter/Convert

Data, Create IDOCComm.IDOC

Application Functions

Filter/ConvertData

Comm.IDOC

Carrier

Application Layer

Distribution/ ALE Layer

Communication Layer

Application

In a Nut ShellIn a Nut Shell

Page 21: Ale IDOC

Overview of ALE/IDOCs 2105/02/23

Topics to coverTopics to cover What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Trouble Shooting

Questions

Page 22: Ale IDOC

Overview of ALE/IDOCs 2205/02/23

IDoc ConceptIDoc Concept

R/3 System

System 1

SAPDocument

EDI subsystem R/3 System R/2 System 3rd party software

System 2

IDoc

Page 23: Ale IDOC

Overview of ALE/IDOCs 2305/02/23

IDoc StructureIDoc Structure

Status Record IDoc-IDStatus information

Data Record IDoc-IDSequence/HierarchySegment Format definition for

• header data• item data

Control Record IDoc-IDSender-IDReceiver-IDIDoc type and logical messageExternal structure

Page 24: Ale IDOC

Overview of ALE/IDOCs 2405/02/23

Control recordData RecordStatus Record

IDOC “Intermediate

Document”

Page 25: Ale IDOC

Overview of ALE/IDOCs 2505/02/23

The very first record of an IDoc package is always a control record. Thestructure of this control record of the structure EDIDC and describes the contents of the data contained in the package. The control record goes to table EDIDC

Control RecordControl Record

Page 26: Ale IDOC

Overview of ALE/IDOCs 2605/02/23

Message TypeMessage Type

Message Type indicates How to Know what the data Means

Data Exchanged by IDOC and EDI is known as Messages

Message of same kind belong to the same message type.

Message types are stored in table EDMSG

Page 27: Ale IDOC

Overview of ALE/IDOCs 2705/02/23

All records in the IDoc, which come after the control record, are the IDoc data. They are all structured alike, with a segment information part and a data part, which is 1000 character in length, filling the rest of the line. Data & Segment info is stored in EDID4 for release 4.x and EDID3 for release 2.x and 3.x.

Data RecordData Record

Page 28: Ale IDOC

Overview of ALE/IDOCs 2805/02/23

Status RecordStatus Record Information about the IDoc status like:IDoc identification numberStatus number - table verifiedIDoc typeDirectionData and time stamp; Structure: EDIDS

Page 29: Ale IDOC

Overview of ALE/IDOCs 2905/02/23

Status of IDOCStatus of IDOC

A two-digit status is assigned to an IDoc to allow the processing to be monitored.

The statuses for outbound IDocs are between '01' and '49', while the statuses for inbound IDocs begin with '50'.

Page 30: Ale IDOC

Overview of ALE/IDOCs 3005/02/23

Idoc SegmentsIdoc Segments

TCODE:

WE31

Page 31: Ale IDOC

Overview of ALE/IDOCs 3105/02/23

Idoc TypesIdoc Types

TCODE:

WE30

Page 32: Ale IDOC

Overview of ALE/IDOCs 3205/02/23

How to Attach SegmentsHow to Attach Segments

Page 33: Ale IDOC

Overview of ALE/IDOCs 3305/02/23

Message TypesMessage Types

WE81WE82

Page 34: Ale IDOC

Overview of ALE/IDOCs 3405/02/23

IDOC Type/ Message Type/ Processing Function IDOC Type/ Message Type/ Processing Function ModuleModule

Valid combination of Message type and IDOC type are stored in table EDIMSG

Combination of message type and IDOC type determine the processing algorithm. This is usually a function module and is set up in table EDIFCT.

Page 35: Ale IDOC

Overview of ALE/IDOCs 3505/02/23

Topics to coverTopics to cover What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing. i.Outbound Processing

ii.Inbound Processing

Transactions For Monitoring and Processing IDocs.

Trouble Shooting

Questions

Page 36: Ale IDOC

Overview of ALE/IDOCs 3605/02/23

Outbound Processing

Page 37: Ale IDOC

Overview of ALE/IDOCs 3705/02/23

Outbound processing: directOutbound processing: directApplication posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDOCs

Comm. layer

asynch. RFCor

EDISystem call FM

( INBOUND_IDOC_

PROCESS )On destination

CLinks C

Comm. layer

Page 38: Ale IDOC

Overview of ALE/IDOCs 3805/02/23

Dispatch controlDispatch controlApplication posting

Need to create IDOC?

Create master IDOC

Customer Distribution Model

Receiver determination

Segment filter

Field value conversion

Version change

ALE layer

Dispatch controlDatabase

M

Application document posted simultaneously with IDocs

C

asynch. RFCor

EDI

Links C

asynch. RFCor

EDI

C

Comm. layer

- Technical comms parameters are Technical comms parameters are defineddefined

- EDI or aRFC (asynch. remote EDI or aRFC (asynch. remote function call)function call)

- Send immediately or cumulate Send immediately or cumulate and send via batch joband send via batch job If batch, packet size is If batch, packet size is

determineddetermined

Page 39: Ale IDOC

Overview of ALE/IDOCs 3905/02/23

Scenario analysisScenario analysis

• How does the IDOC look like ?

• How is data being sent ?

• How is the data being received ?

Page 40: Ale IDOC

Overview of ALE/IDOCs 4005/02/23

Outbound program development

• Program logic– “How is the IDOC being created ?”

• Triggering– “How is the IDOC creation kicked off ?”

Page 41: Ale IDOC

Overview of ALE/IDOCs 4105/02/23

Program logicProgram logic

• Select data from application tables• Fill data into IDOC • Pass IDOC to ALE layer (Call function MASTER_IDOC_DISTRIBUTE)• Commit Work

• Receiver determination• Segment filtering• Version Control• Dispatch Control

IDOC program

ALE layer

MASTER_IDOC_DISTRIBUTE

Page 42: Ale IDOC

Overview of ALE/IDOCs 4205/02/23

MASTER_IDOC_DISTRIBUTEMASTER_IDOC_DISTRIBUTE

Call function ‘MASTER_IDOC_DISTRIBUTE’ Exporting

master_idoc_control: IDOC control record

Tables

communication_idoc_control: returned information about the

distribution

master_idoc_data: IDOC data segments

Page 43: Ale IDOC

Overview of ALE/IDOCs 4305/02/23

Filling an EDIDD structureFilling an EDIDD structure

Header (55bytes) SDATA (1000bytes)…. SEGNAM ….EDIDD

Z1SEG Field1 Field2 Field3 Field4“10” “ABC”

MOVE “Z1SEG” to EDIDD-SEGNAMMOVE “10” to Z1SEG-FIELD1MOVE “ABC” to Z1SEG-FIELD2MOVE Z1SEG to EDIDD-SDATA

Page 44: Ale IDOC

Overview of ALE/IDOCs 4405/02/23

General Programming rulesGeneral Programming rules Design Guidelines for creating IDOC data records:

• Left-justified filing of IDOC Fields

• Replacing SAP codes with ISO codes currency keys country keys unit of measure shipping instructions

• Converting Currency Amounts

Page 45: Ale IDOC

Overview of ALE/IDOCs 4505/02/23

Left-justified FillingLeft-justified Filling All fields must be left-justified

Character fields: automatic

Non-character fields: ‘Condense’ statement must be used Check IDOC documentation to find out which fields

require a ‘condense’ All types unequal to ‘char’, ‘cuky’, ‘clnt’, ‘accp’, ‘numc’,

‘dats’, ‘tims’ or ‘unit’ require a condense

Page 46: Ale IDOC

Overview of ALE/IDOCs 4605/02/23

Code ConversionsCode Conversions Replacing SAP codes with ISO codes

– Currency keys: ‘currency_code_sap_to_iso’– Country keys: ‘country_code_sap_to_iso’– Units of measure: ‘unit_of_measure_sap_to_iso’– Shipping instructions: sap_iso_package_type_code’

• Conversion of currency amounts– ‘currency_amount_sap_to_iso’

Page 47: Ale IDOC

Overview of ALE/IDOCs 4705/02/23

Basic Configuration ElementsBasic Configuration Elements Define RFC Destinations Define Ports Maintain Customer Model Create Partner Profiles

Page 48: Ale IDOC

Overview of ALE/IDOCs 4805/02/23

Maintaining RFC DestinationsMaintaining RFC Destinations

TCODE:

SM59

Page 49: Ale IDOC

Overview of ALE/IDOCs 4905/02/23

Displaying and Maintaining PortsDisplaying and Maintaining Ports

A port is a logical representation of a A port is a logical representation of a communication channel in SAP with communication channel in SAP with the data communicated being IDocsthe data communicated being IDocs.

 

TCODE:

WE21

Page 50: Ale IDOC

Overview of ALE/IDOCs 5005/02/23

Partner ProfilesPartner Profiles

TCODE:

WE20

Page 51: Ale IDOC

Overview of ALE/IDOCs 5105/02/23

Partner Profiles-InboundPartner Profiles-Inbound

Page 52: Ale IDOC

Overview of ALE/IDOCs 5205/02/23

Partner Profiles-OutboundPartner Profiles-Outbound

Page 53: Ale IDOC

Overview of ALE/IDOCs 5305/02/23

ALE For Transactional data ---- Output ALE For Transactional data ---- Output DeterminationDetermination

NACE

Page 54: Ale IDOC

Overview of ALE/IDOCs 5405/02/23

Output Determination -- Output TypesOutput Determination -- Output Types

Page 55: Ale IDOC

Overview of ALE/IDOCs 5505/02/23

Output Types -- DetailsOutput Types -- Details

Page 56: Ale IDOC

Overview of ALE/IDOCs 5605/02/23

Inbound Processing

Page 57: Ale IDOC

Overview of ALE/IDOCs 5705/02/23

Inbound Processing.Inbound Processing.Application posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

Page 58: Ale IDOC

Overview of ALE/IDOCs 5805/02/23

Input ControlInput ControlApplication posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- For each message type and sender For each message type and sender one can defineone can define when to process when to process

(immediate/batch)(immediate/batch) whether to call application whether to call application

directly or start customer directly or start customer workflowworkflow

who should get work items in who should get work items in case of errorcase of error

- Incoming IDOC packets are passed to Incoming IDOC packets are passed to applicationapplication

Page 59: Ale IDOC

Overview of ALE/IDOCs 5905/02/23

Application InputApplication InputApplication posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- Inbound IDOCs are passed to Inbound IDOCs are passed to the application via a the application via a standardized function standardized function interfaceinterface

Page 60: Ale IDOC

Overview of ALE/IDOCs 6005/02/23

SerializationSerializationApplication posting

Field value conversion

ALE layer

Input control

Database

A

Simultaneously update IDOC's status

Comm. layer

asynch. RFCor

EDI

Version change

Segment filter

C

A

Post application document

Process IDOCSerialization

- When processing the When processing the inbound IDOC, the inbound IDOC, the application can call an ALE application can call an ALE API (function module) to API (function module) to check that the IDOC has not check that the IDOC has not been overtakenbeen overtaken If change No. 1 arrives If change No. 1 arrives

after change No. 2, the after change No. 2, the IDOC containing it has IDOC containing it has been overtaken (by the been overtaken (by the IDOC containing the IDOC containing the later change)later change)

Page 61: Ale IDOC

Overview of ALE/IDOCs 6105/02/23

FM Assignment to Message Type and FM Assignment to Message Type and IDoc typeIDoc type

TCODE:

WE57

Page 62: Ale IDOC

Overview of ALE/IDOCs 6205/02/23

Process CodesProcess Codes

WE41WE42

Page 63: Ale IDOC

Overview of ALE/IDOCs 6305/02/23

Process Codes in Inbound and OutboundProcess Codes in Inbound and Outbound

TCODE:

WE64

Page 64: Ale IDOC

Overview of ALE/IDOCs 6405/02/23

FM For Inbound EDI FM For Inbound EDI

TCODE:

BD67

Page 65: Ale IDOC

Overview of ALE/IDOCs 6505/02/23

Inbound Program DevelopmentInbound Program Development

INBOUND_IDOC_PROCESSIDOC

ALE layer

IDOC_INPUT_<MSGTYPE>

• Read IDOC data• Post Application data• Send Success info back to ALE layer

ALE configuration• Partner Profiles• Process Code• Function module attribute• Function module registry

Workflow Task

Call function

Return Variables

If ERROR, trigger

• Version change• Segment filter• Field conversion

Page 66: Ale IDOC

Overview of ALE/IDOCs 6605/02/23

Basic Scenario

Direct Method Call Transaction Method

Page 67: Ale IDOC

Overview of ALE/IDOCs 6705/02/23

Advanced Scenario

Mass processing Serialization Advanced Workflow

Page 68: Ale IDOC

Overview of ALE/IDOCs 6805/02/23

Flow Of Program

Read IDOC-Lock IDOC-Call Inbound Program-Write Status-Commit Work-Unlock IDOC

Page 69: Ale IDOC

Overview of ALE/IDOCs 6905/02/23

Interface of Inbound FM Importing Parameter -Input Method -Mass_processing

EXPORT parameter .-Workflow_result-Application_variable-In_Update_task-Call_transaction_done

Tables parameter : IDOC_ControlIDOC_DATAIDOC_STATUSReturn_variable

Page 70: Ale IDOC

Overview of ALE/IDOCs 7005/02/23

Topics to coverTopics to cover What is ALE ?

Components of ALE.

Anatomy of an IDoc.

ALE Processing

Transactions For Monitoring and Processing IDocs.

Questions

Page 71: Ale IDOC

Overview of ALE/IDOCs 7105/02/23

Monitoring IDocsMonitoring IDocs• The IDoc interface offers 2 different approaches for tracking of data load and data flow:

Reports for monitoring

Workflow for notifications

• Both approaches are based on the concept of status transitions, i.e. an IDoc changes its status from a given value to another value.

Page 72: Ale IDOC

Overview of ALE/IDOCs 7205/02/23

List Of All IDocs Created. (Default, Additional, EDI)-- List Of All IDocs Created. (Default, Additional, EDI)-- WE02/ WE05WE02/ WE05

Page 73: Ale IDOC

Overview of ALE/IDOCs 7305/02/23

Selection Program For Issuing Output -- Selection Program For Issuing Output -- WE15WE15

Page 74: Ale IDOC

Overview of ALE/IDOCs 7405/02/23

Test Tool For Idoc Processing (WE19)Test Tool For Idoc Processing (WE19)

Page 75: Ale IDOC

Overview of ALE/IDOCs 7505/02/23

Idoc Search For Business Contents Idoc Search For Business Contents (Database). WE09(Database). WE09

Page 76: Ale IDOC

Overview of ALE/IDOCs 7605/02/23

QuestionsQuestions