You are on page 1of 50

BC621 - SAP IDoc Interface (Development)

BC621

SAP IDoc Interface


(Development)
 SAP AG 1999
Copyright

Copyright 2000 SAP AG. All rights reserved.


Neither this training manual nor any part thereof may
be copied or reproduced in any form or by any means,
or translated into another language, without the prior
consent of SAP AG. The information contained in this
document is subject to change and supplement without prior
notice.

All rights reserved.

 SAP AG 1999
Business Integration Technologies II

Level 2 Level 3
BC619 3 days
Application Link
Enabling (ALE)
Technology
BC620 2 days BC621 1 day
SAP IDoc Interface SAP IDoc Interface - Data Exchange
Technology Development

BC095 3 days CA210 4 days

Business Integration EDI Interface


Technology

CA150 2 days
Building Enterprise BC420 5 days
Solutions with SAP Data Transfer
Components BC415 2 days
Communication
CA925 5 days Interfaces in ABAP Interface
Programming with Programming
BAPIs in Visual Basic CA926 5 days
Programming with
CA927 5 days BAPIs in JAVA
R/3 Interface and BAPI
Programming in C++
 SAP AG 1999
Course Prerequisites

 Recommended: Basis BC 400 - ABAP


Workbench Basics
 Required: Basis BC620 - IDoc Interface (Standard)

 SAP AG 1999
Target Group

 ABAP Developers
 Consultants

 SAP AG 1999
Introduction: Contents

 Course Goals
 Course Objective(s)
 Course Content
 Course Overview Diagram
 Main Business Scenario

 SAP AG 1999
Course Goals

At the conclusion of this course, you will be


able to:
 Extend IDoc types
 Define new IDoc types

 SAP AG 1999
Course Objectives

At the conclusion of this course, you will be able


to:
 Build and extend the data structure of IDoc types
 Use the IDoc type editor and segment editor
 Use customer exits to process IDoc types

 SAP AG 1999
Course Content

Preface

Unit 1 Introduction
Unit 2 Development Environment for IDoc Types
Unit 3 Extension of IDoc Types
Unit 4 Development of IDoc Types

Appendix

 SAP AG 1999
BC621 Course Overview Diagram

Development
of IDoc Types

Extension of
IDoc Types

1 Development
Environment for
IDoc Types

Introduction

 SAP AG 1999
Main Business Scenario

Enterprise trading
Enterprise trading
company A wants Vendor
Vendor B
company A
B to ship their material orders via EDI.
Herrmann & Riemer will die entsprechenden
Bestellungen gleich elektronisch verbuchen.
Als Grundlage wollen die Unternehmen den
IDoc-Typ ORDLGT01 verwenden, der aber
eventuell noch den Bedürfnissen
entsprechend erweitert werden muß. Als
Projektteammitglied
SAP R/3 System informieren SieSAP
sichR/3
also
System
über die Entwicklungsmöglichkeiten, die die
IDoc-Schnittstelle
IDoc bietet. IDoc

Message
EDI Subsystem EDI Subsystem

 SAP AG 1999
Development Environment for IDoc Types

 Data Structures:
 IDoc Record Types
 IDoc Types
 IDoc Segments
 Development and Extension

 SAP AG 1999
Course Objectives

 Understand the development environment for IDoc


types
 Describe the functionality of the development
environment for IDoc types
 Explain the difference between development and
extensions

 SAP AG 1999
Course Overview Diagram

Development
of IDoc Types

2
Extension of
IDoc Types

Development
Environment
for IDoc Types

Introduction

 SAP AG 1999
Components of the IDoc Process

Application

Function module Business Workflow

Program Function module ing


s s
Report c e
IDoc Type o
Pr
n d
ou
g b
sin Segment In
e s
oc
Pr
n d Segment Segment
o u
b type name
O ut
IDoc Interface
r e
c t u
tr u
s
a ta
D
 SAP AG 1999
IDoc Record Types

Control Record IDoc ID


Partner
IDoc Type and Logical Message
External Structure

Data Records

Control Part Application Data

Status Records IDoc ID


Status Information

 SAP AG 1999
IDoc Terms: Basic Type and Extensions

Basic type
= IDoc type

Basic type
+ Extension
= IDoc type

 SAP AG 1999
IDoc Terms: Segment

Segment name Version 1


E2ccccc000 e.g. 3.0A
Segment type
E1ccccc Segment name Version 2
E2ccccc001 e.g. 3.0C

Segment name
/partner/ccccc000
Segment name Version 14
E2ccccc013 e.g.7.7x
Segment type Segment name
/partner/ccccc /partner/ccccc001

Segment name
/partner/ccccc013

 SAP AG 1999
IDoc Functions: Release and Version Creation

 By releasing segments and IDoc types, the external


interface is "frozen" and given unique names for
these objects for an external partner system.
 There can only be one segment version for each SAP
Release (for example 4.0B).
 The IDoc definition tools control the release. After
each release, further development leads to new
versions.
 Changes must be made in accordance with strict
rules so that the interface remains compatible.

 SAP AG 1999
ABAP Programming Names

Control record, EDIDC "IDoc Type"

Data records, EDIDD, displayed as a segment tree

E1HDDOC E1TLSUM
M 1 C 1
E1HDADR E1ITDOC
C 5 Parent
M segment
1

E1ITSCH
E1ITSCH
Child segment
C 99 C 5

Status record, EDIDS & EDI_DS

 SAP AG 1999
Subsystem Names

Control record, EDI_DC40 "IDoc Type"

Data records, displayed as a segment tree

E2HDDOC000 E2TLSUM000
M 1 C 1
E1ITDOC
E2HDADR000 E2ITDOC000
C 5 Parent segment
M 1

E1ITSCH
E2ITSCH000
Child segment
C 99 C 5

Status record, EDI_DS40

 SAP AG 1999
When is Which Action Necessary?

 The IDoc type required is available and meets all


requirements:
No action needed!
 The IDoc type required is present but does not meet all
requirements:
Action: Customer extension!
 The IDoc type required is not available or it is present but
does not meet all the requirements:
Action: Development!

 SAP AG 1999
Summary

 An IDoc type is a complex data structure composed


of segments.
 Segment types are structures in the ABAP data
repository.
 IDoc types and their processing can be extended in
the appropriate positions by customers.

 SAP AG 1999
Extension of an IDoc Type

 Extension of the data structure


 Extension of Outbound Processing
 Extension of Inbound Processing

 SAP AG 1999
Course Objectives

 Create IDoc Segment


 Extend an IDoc Type
 Implement a customer exit in outbound processing
 Implement a customer exit in inbound processing

 SAP AG 1999
Course Overview Diagram

3 Development of
IDoc type

Extension of
an IDoc type

Development
environment for
IDoc types

Implementation

 SAP AG 1999
Advantages of Customer Enhancement

 The coding provided in the standard system for


processing is used.
 Developments and corrections of the coding
delivered in the standard system are therefore
automatically available.
 Extension is less time consuming than new
development.

 SAP AG 1999
Basic Rules for Customer Extension

 Additional customer fields are recorded in their own


customer segments.
 Customer segments depend on SAP segments
(successor or child relationships).
 The processing of customer segments is exclusively
implemented in the customer exits of the coding
provided in the standard system.

 SAP AG 1999
Areas of Customer Extension

Application
 Data structure in the WEDI
Function Module Business Workflow area menu
Program Function Module  Outbound and inbound
processing: Typically through
Report
IDoc Type transaction "CMOD", otherwise
through individual technique
Segment  Documentation: In the WEDI
area menu

Segment Segment
Type Name

IDoc Interface

 SAP AG 1999
Steps For Extending the Data Structure

 Combine the required fields and their data


types in the dictionary.
 Definition of required segments,
segment editor.
 Definition of extension, IDoc type editor.
 Assignment of a logical message to the
IDoc type, surrounding field menu of IDoc
type editor.

 SAP AG 1999
Steps for Extending Processing

 Definition of a project,
project management, attribute
 Choosing the "correct" customer exits,
project management, SAP extensions
 Implementation of the selected customer exits,
project management, extension components
 Outbound processing: reading of the SAP database
and data in "IDoc format"
 Inbound processing: writing data from the "IDoc
format" into the SAP database
 Activate project in project management

 SAP AG 1999
Summary

 An extension can be limited to processing.


 Normally an extension encompasses the data
structure as well as the processing.
 Extended data structures can be communicated to
the subsystem by the documentation tools.

 SAP AG 1999
Erweiterung eines IDoc-Typs: Exercise
Data Used in the Exercises
Extension of an IDoc Type: Solutions
Unit: Extension of an IDoc Type
Development of IDoc Type

 Development of the data structure


 Processing example

 SAP AG 1999
Topic Objectives

 Create IDoc segments


 Develop new IDoc types
 Template for IDoc outbound processing
 Template for IDoc inbound processing

 SAP AG 1999
Course Overview Diagram

Development of
IDoc type

Extension of
an IDoc type

Development
environment for
IDoc types

Implementation

 SAP AG 1999
Basic Rules for Development

 Segments are formed as logical units based on the


(application) fields. They are reusable "modules" of
IDoc development.
 Segment groups are formed as logical units from
segments.
 IDoc types are derived from segments and segment
groups.
They are the data structure of an application document
for the transmission.
 During development IDoc types are created as basic
IDoc types.
 The business process itself is not identified through
an IDoc type, but rather through the logical message.

 SAP AG 1999
Areas of Development

Application  Data structure:


in the WEDI area menu
Function Module Business Workflow
 Outbound and inbound
Program Function Module
processing: in the Object
Report IDoc Type
Browser "SE80"
 Documentation:
Segment
in the WEDI menu

Segment Segment
Type Name

IDoc Interface

 SAP AG 1999
Steps for the Development of a Data Structure

 Combine the required fields and their data


types in the dictionary
 Definition of required segments,
segment editor
 Definition of basic IDoc types,
IDoc type editor
 Creation of a logical message, surrounding
field menu of IDoc type editor
 Assignment of a logical message to the
IDoc type, surrounding field menu of IDoc
type editor

 SAP AG 1999
Processing Types

 Outbound processing using


 Message Control (MC) ?
 ALE Interface (FM MASTER_IDOC_DISTRIBUTE)?

 Inbound processing using


 Business Workflow (single step or multistep task) ?
 ALE Interface (function module) ?

 SAP AG 1999
Steps for Development of Outbound Processing
using MC

 Checking Message Control, that is, the connection


for the message default:
 Condition table
 Access sequence
 Condition types
 Procedure
 Application
 Implementation of a function module that makes
application data available in "IDoc format"
 Definition of an outbound process code

 SAP AG 1999
Development Steps for Outbound Processing
using the ALE Interface

 Implementation of a program that calls the function module


MASTER_IDOC_DISTRIBUTE. Interface
 Import MASTER_IDOC_CONTROL like EDIDC
 Tables COMMUNICATION_IDOC_CONTROL like EDIDC
MASTER_IDOC_DATA like EDIDD
 For this program you have to define how the control works,
specifically, if the control is to take place via a time table,
event or dialog step.

 SAP AG 1999
Development Steps of Inbound Processing using
Business Workflow

 Implementation of a workflow to control inbound


processing
This includes:
 Definition of object and method(s) in BOR
 Definition of workflow
 Definition of inbound process code

 SAP AG 1999
Development Steps for Inbound Processing using
ALE Interface

 Write function module that posts the IDoc as an


application document
 Implementation of a workflow to send messages in case
of error. This includes:
 Definition of object and method(s) in BOR
 Definition of workflow
 Maintenance of the characteristics for the function
module for the ALE Call
 Allocation of the function module to a logical message
and to an IDoc type for the ALE Call
 Definition of an inbound process code and establishing a
connection with the ALE layer

 SAP AG 1999
Summary

 The data structure is defined as an IDoc type


 Depending on the processing course and direction,
different programming templates can be used
 Outbound uses 2 methods:
Message Control and ALE
 Inbound uses 2 methods:
Workflow and ALE

 SAP AG 1999
Appendix

You might also like