You are on page 1of 69

BC621 - SAP IDoc Interface (Development) BC621

Release 4.7 15.03.2007

BC621 - SAP IDoc Interface (Development).............................................................................................................1 Copyright.................................................................................................................................................................2 B !ine!! Integration "echnologie! II..................................................................................................................# Co r!e Prere$ i!ite!............................................................................................................................................% "arget &ro p.......................................................................................................................................................' Intro( ction) Content!.............................................................................................................................................1 Co r!e &oal!.......................................................................................................................................................2 Co r!e *+,ective!...............................................................................................................................................# Co r!e Content....................................................................................................................................................% BC621 Co r!e *vervie- Diagram.....................................................................................................................' .ain B !ine!! Scenario......................................................................................................................................6 Development /nvironment for IDoc "ype!............................................................................................................1 Co r!e *+,ective!...............................................................................................................................................2 Co r!e *vervie- Diagram..................................................................................................................................# Component! of the IDoc Proce!!........................................................................................................................% IDoc 0ecor( "ype!..............................................................................................................................................' IDoc "erm!) Ba!ic "ype an( /1ten!ion!............................................................................................................6 IDoc "erm!) Segment..........................................................................................................................................2 IDoc 3 nction!) 0elea!e an( 4er!ion Creation..................................................................................................5 ABAP Programming 6ame!...............................................................................................................................7 S +!y!tem 6ame!.............................................................................................................................................18 IDoc Definition "ool!.......................................................................................................................................11 9hen i! 9hich Action 6ece!!ary:...................................................................................................................12 S mmary...........................................................................................................................................................1# /1ten!ion of an IDoc "ype......................................................................................................................................1 Co r!e *+,ective!...............................................................................................................................................2 Co r!e *vervie- Diagram..................................................................................................................................# A(vantage! of C !tomer /nhancement..............................................................................................................% Ba!ic 0 le! for C !tomer /1ten!ion...................................................................................................................' Area! of C !tomer /1ten!ion..............................................................................................................................6 Step! 3or /1ten(ing the Data Str ct re..............................................................................................................2 Step! for /1ten(ing Proce!!ing...........................................................................................................................5 * tp t Doc mentation of the /1ten!ion.............................................................................................................7 S mmary...........................................................................................................................................................18 /r-eiter ng eine! IDoc-"yp!) /1erci!e............................................................................................................11 /1ten!ion of an IDoc "ype) Sol tion!..............................................................................................................17 Development of IDoc "ype.....................................................................................................................................1 "opic *+,ective!.................................................................................................................................................2 Co r!e *vervie- Diagram..................................................................................................................................# Ba!ic 0 le! for Development..............................................................................................................................% Area! of Development.........................................................................................................................................' Step! for the Development of a Data Str ct re...................................................................................................6

Proce!!ing "ype!.................................................................................................................................................2 Step! for Development of * t+o n( Proce!!ing !ing .C...............................................................................5 Development Step! for * t+o n( Proce!!ing !ing the A;/ Interface.............................................................7 Development Step! of In+o n( Proce!!ing !ing B !ine!! 9or<flo-............................................................18 Development Step! for In+o n( Proce!!ing !ing A;/ Interface....................................................................11 * tp t Doc mentation of 6e- Development...................................................................................................12 S mmary...........................................................................................................................................................1# Appen(i1.................................................................................................................................................................1

0
BC621 - SAP IDoc Interface (Development)

BC621
SAP IDoc Interface (Development)
SAP AG 1999

0=# 0elea!e %.6A >an ary 2888 '88# '268

0.2
Copyright

Copyright 200 SAP A!" All right# re#erve$" %o part of thi# p&'lication may 'e repro$&ce$ or tran#mitte$ in any form or for any p&rpo#e (itho&tthe e)pre## permi##ion of SAP A!" *he information containe$ herein may 'e change$ (itho&t prior notice" All right# re#erve$"

SAP AG 2003

Trademark ! Some !oft-are pro( ct! mar<ete( +y SAP A& an( it! (i!tri+ tor! contain proprietary !oft-are component! of other !oft-are ven(or!. .icro!oft?@ 9I6D*9S?@ 6"?@ /AC/;?@ 9or(?@ Po-erPoint? an( SB; Server? are regi!tere( tra(emar<! of .icro!oft Corporation. IB.?@ DB2?@ DB2 Cniver!al Data+a!e@ *S=2?@ Parallel Sy!ple1?@ .4S=/SA@ AIA?@ S=#78?@ AS=%88?@ *S=#78?@ *S=%88?@ iSerie!@ pSerie!@ 1Serie!@ DSerie!@ D=*S@ A3P@ Intelligent .iner@ 9e+Sphere?@ 6etfinity?@ "ivoli?@ Informi1 an( Informi1? Dynamic Server". are tra(emar<! of IB. Corporation in CSA an(=or other co ntrie!. *0AC;/? i! a regi!tere( tra(emar< of *0AC;/ Corporation. C6IA?@ A=*pen?@ *S3=1?@ an( .otif? are regi!tere( tra(emar<! of the *pen &ro p. Citri1?@ the Citri1 logo@ ICA?@ Program 6eigh+orhoo(?@ .eta3rame?@ 9in3rame?@ 4i(eo3rame?@ . lti9in? an( other Citri1 pro( ct name! reference( herein are tra(emar<! of Citri1 Sy!tem!@ Inc. E".;@ DE".;@ A.;@ AE".; are tra(emar<! or regi!tere( tra(emar<! of 9#C?@ 9orl( 9i(e 9e+ Con!orti m@ .a!!ach !ett! In!tit te of "echnology. >A4A? i! a regi!tere( tra(emar< of S n .icro!y!tem!@ Inc. >A4ASC0IP"? i! a regi!tere( tra(emar< of S n .icro!y!tem!@ Inc.@ !e( n(er licen!e for technology invente( an( implemente( +y 6et!cape. .ar<etSet an( /nterpri!e B yer are ,ointly o-ne( tra(emar<! of SAP A& an( Commerce *ne. SAP@ SAP ;ogo@ 0=2@ 0=#@ mySAP@ mySAP.com@ an( other SAP pro( ct! an( !ervice! mentione( herein a! -ell a! their re!pective logo! are tra(emar<! or regi!tere( tra(emar<! of SAP A& in &ermany an( in !everal other co ntrie! all over the -orl(. All other pro( ct an( !ervice name! mentione( are the tra(emar<! of their re!pective companie!.

0."
B&#ine## Integration *echnologie# II
-evel 2
BC61+ 3 !a s A++lication ,in.na/ling 0A,.1 Technolog BC620 2 !a s SAP I"oc Inter#ace Technolog BC0+, 3 !a s CA210 ."I Inter#ace 4 !a s BC621 1 !a SAP I"oc Inter#ace ) "e*elo+$ent
2B'319 #ro$ 0142002 BIT300 2B'320 #ro$ 0142002 BIT320 2B'321 #ro$ 0442002 BIT350

-evel

Data e)change

Business Integration Technolog

BC.20 "ata Trans#er

5 !a s BC.1, 2 !a s 'o$$unication Inter#aces in ABAP /CA+26 5 !a s Progra$$ing %ith BAPIs in (A&A

/CA+2, 5 !a s Progra$$ing %ith BAPIs in &isual Basic


2'A925 #ro$ 0142002 BIT525 2'A923 #ro$ 0142002 BIT523

Interface Programming

SAP AG 2001

0.#
Co&r#e Prere0&i#ite#

1ecommen$e$2 Ba#i# BC .00 - ABAP 3or4'ench Ba#ic# 1e0&ire$2 Ba#i# BC620 - IDoc Interface (Stan$ar$)

SAP AG 1999

0.$
*arget !ro&p

ABAP Developer# Con#&ltant#

SAP AG 1999

%ote to t&e ' er "he training material! are not teac&-(o'r elf pro)ram . "hey complement t&e co'r e *n tr'ctor+ e,planat*on . *n the !heet!@ there i! !pace for yo to -rite (o-n a((itional information.

1
Intro$&ction2 Content#

Co&r#e !oal# Co&r#e 5'6ective(#) Co&r#e Content Co&r#e 5vervie( Diagram 7ain B&#ine## Scenario

SAP AG 1999

(C) SAP A&

BC621

1.2
Co&r#e !oal#

At the concl&#ion of thi# co&r#e8 yo& (ill 'e a'le to2


9)ten$ IDoc type# Define ne( IDoc type#

SAP AG 1999

(C) SAP A&

BC621

1."
Co&r#e 5'6ective#

At the concl&#ion of thi# co&r#e8 yo& (ill 'e a'le to2


B&il$ an$ e)ten$ the $ata #tr&ct&re of IDoc type# :#e the IDoc type e$itor an$ #egment e$itor :#e c&#tomer e)it# to proce## IDoc type#

SAP AG 1999

(C) SAP A&

BC621

1.#
Co&r#e Content

Preface :nit 1 :nit 2 :nit :nit . Intro!uction "e*elo+$ent .n*iron$ent #or I"oc T +es .5tension o# I"oc T +es "e*elo+$ent o# I"oc T +es

Appen$i)

SAP AG 1999

(C) SAP A&

BC621

1.$
BC621 Co&r#e 5vervie( Diagram

Development of IDoc *ype#

9)ten#ion of IDoc *ype#

Development 9nvironment for IDoc *ype#

Intro$&ction

SAP AG 1999

(C) SAP A&

BC621

'

1.6
7ain B&#ine## Scenario

9nterpri#e tra$ing 9nterpri#e tra$ing company A

company A (ant# ;en$or ;en$or B B to #hip their material or$er# via 9DI" <errmann = 1iemer (ill $ie ent#prechen$en Be#tell&ngen gleich ele4troni#ch ver'&chen " Al# !r&n$lage (ollen $ie :nternehmen $en IDoc-*yp 51D-!*01 ver(en$en8 $er a'er event&ell noch $en Be$>rfni##en ent#prechen$ er(eitert (er$en m&?" Al# Pro6e4tteammitglie$ informieren Sie #ichal#o SAP 1A Sy#tem SAP 1A Sy#tem >'er $ie 9nt(ic4l&ng#m@glich4eiten8 $ie $ie IDoc-Schnitt#telle 'ietet" IDoc IDoc
9DI S&'#y#tem
7e##age

9DI S&'#y#tem

SAP AG 1999

/nterpri!e tra(ing company A -ant! ven(or B to !hip their material or(er! via /DI. 4en(or B -o l( li<e to electronically p(ate the place( or(er! imme(iately. A! a +a!i! for thi! tran!action@ A F B inten( to !e IDoc type *0D;&"81. Eo-ever@ IDoc type *0D;&"81 nee(! to +e e1ten(e( to meet their nee(!. Go r ta!< a! a mem+er of the pro,ect team i! to re!earch the po!!i+ilitie! of the (evelopment of the IDoc Interface.

(C) SAP A&

BC621

2
Development 9nvironment for IDoc *ype#

Data Str&ct&re#2

IDoc 1ecor$ *ype# IDoc *ype# IDoc Segment#

Development an$ 9)ten#ion

SAP AG 1999

(C) SAP A&

BC621

2.2
Co&r#e 5'6ective#

:n$er#tan$ the $evelopment environment for IDoc type# De#cri'e the f&nctionality of the $evelopment environment for IDoc type# 9)plain the $ifference 'et(een $evelopment an$ e)ten#ion#

SAP AG 1999

(C) SAP A&

BC621

2."
Co&r#e 5vervie( Diagram

Development of IDoc *ype#

2
9)ten#ion of IDoc *ype# Development 9nvironment for IDoc *ype# Intro$&ction

SAP AG 1999

(C) SAP A&

BC621

2.#
Component# of the IDoc Proce##

Application
B&nction mo$&le Program 1eport IDoc *ype B&#ine## 3or4flo( B&nction mo$&le

Ou

tb

n ou

o Pr

ce

g in s s

Segment

In

u bo

nd

e oc r P

g in s s

Segment type

Segment name

IDoc Interface

ta Da
SAP AG 1999

str

e tur c u

"he IDoc Interface con!i!t! of a (ata !tr ct re (the IDoc type) an( proce!! program! for thi! (ata !tr ct re. "he S +!y!tem Interface i! + ilt thro gh the (ata !tr ct re. "he proce!! program! are in!erte( +et-een SAP application an( interface. In o t+o n( proce!!ing yo !ho l( +e a+le to rea( the ma!ter an( movement (ata a! -ell a! +e a+le to format it into an IDoc format. In in+o n( proce!!ing yo can generate or change application (ata from the IDoc format.

(C) SAP A&

BC621

2.$
IDoc 1ecor$ *ype#

Control 1ecor$

I"oc I" Partner I"oc T +e an! ,ogical 6essage .5ternal Structure

Data 1ecor$#
'ontrol Part A++lication "ata

Stat&# 1ecor$#

I"oc I" Status In#or$ation

SAP AG 1999

/very IDoc in the SAP (ata+a!e con!i!t! of) *ne control recor(@ Data recor(!@ containing the application (ata in the !egment! (e!cri+ing the hierarchy. "he!e !egment! are in a hierarchy !e$ ence@ Stat ! recor(!@ -hich monitor !pecific IDoc !tep!. "he f rther the IDoc i! in it! proce!! the more !tat ! recor(! it ha!. An IDoc that ha! +een e1change( -ith an e1ternal !y!tem@ -ill only contain "he control recor( an( "he (ata recor(!. If the e1ternal !y!tem comm nicate! the !tat ! of the !en(ing IDoc -ith the 0=# Sy!tem@ thi! can +e carrie( o t -ith a !tat ! confirmation. "he 0=# Sy!tem connect! the receive( !tat ! recor(! to the corre!pon(ing o t+o n( IDoc in the (ata+a!e. "he 0=# Sy!tem can al!o tran!mit !tat ! confirmation! a+o t IDoc! receive(. "hi!@ ho-ever@ can only happen thro gh the !pecific IDoc type SGS"A"81@ that i!@ the control an( (ata recor(! are e1change( here. In thi! ca!e@ the !tat ! information i! therefore containe( in the IDoc (ata recor(!.

(C) SAP A&

BC621

'

2.6
IDoc *erm#2 Ba#ic *ype an$ 9)ten#ion#

Ba#ic type C IDoc type Ba#ic type 9)ten#ion IDoc type

D C

SAP AG 1999

"he IDoc type i! a hierarchy con!i!ting of !egment! an( comple1 (ata !tr ct re! -hich can receive an application (oc ment. "here i! a formal (i!tinction +et-een +a!ic type! an( e1ten!ion!. "he !pecific (oc ment in HIDoc formatH i! calle( an IDoc an( ha! a !pecific IDoc type. An e1ten!ion e1pan(! a +a!ic type (SAP !tan(ar() +y a c !tomer !pecific !egment@ -hich are (irectly or in(irectly (epen(ent of +a!ic type !egment!. "he !egment! of the +a!ic type are repre!ente( +y the root! an( the ! +-tree!@ forme( +y the c !tomer !egment!. "he control recor( i(entifie! the IDoc type !ing the follo-ing fiel(!) ID*C"GP 6ame of the +a!ic type CI."GP6ame of e1ten!ion /1ample!) IDoc type *0D/0S81 from !tan(ar( !y!tem@ not e1ten(e() "he fiel( ID*C"GP ha! the val e *0D/0S81 "he fiel( CI."GP i! empty IDoc type *0D/0S81 from !tan(ar( !y!tem@ e1ten(e( +y c !tomer!) "he fiel( ID*C"GP ha! the val e *0D/0S81 "he fiel( CI."GP ha! the val e of the name of the e1ten!ion

(C) SAP A&

BC621

2.IDoc *erm#2 Segment

Segment type 91ccccc

Segment name 92ccccc000 Segment name 92ccccc001

;er#ion 1 e.g. 3.0A

;er#ion 2 e.g. 3.0'

Segment name ApartnerAccccc000 Segment type ApartnerAccccc Segment name ApartnerAccccc001

Segment name 92ccccc01

;er#ion 1. e.g.7.75

Segment name ApartnerAccccc01

SAP AG 1999

A !egment con!i!t! of one SAP relea!e in(epen(ent !egment type At lea!t one SAP relea!e (epen(ent !egment name (!egment (efinition). Segment type! are !tr ct re! in the (ictionary. "hey are !e( a! internal name! in the SAP Sy!tem. An e1ternal !y!tem@ for e1ample an /DI ! +!y!tem@ can recogniDe the ver!ion of the c rrent !egment +y the !egment name. Segment type! are a ma1im m of 22 (igit!. Segment name! are (erive( from the !egment type! +y a((ing # (igit! (!tarting -ith 888). "he naming convention! are pre!erve( thro gh the IDoc (efinition tool!. SAP !egment! (iffer from thi! r le) Segment type! !tart -ith I/1J@ !egment name! -ith I/2I an( a((itionally have a ver!ion n m+er. "he c !tomer can al!o !e the name!pace HK1H= HK2H or a c !tomer prefi1. Partner! al-ay! !e a prefi1. All !egment fiel(! are of type CEA0. "h ! all SAP (ata type! -ith !imilar character! are permitte(@ for e1ample 6C.C or C;6".

(C) SAP A&

BC621

2..
IDoc B&nction#2 1elea#e an$ ;er#ion Creation

By relea#ing #egment# an$ IDoc type#8 the e)ternal interface i# EfroFenE an$ given &ni0&e name# for the#e o'6ect# for an e)ternal partner #y#tem" *here can only 'e one #egment ver#ion for each SAP 1elea#e (for e)ample ."0B)" *he IDoc $efinition tool# control the relea#e"After each relea#e8 f&rther $evelopment lea$# to ne( ver#ion#" Change# m&#t 'e ma$e in accor$ance (ith #trict r&le# #o that the interface remain# compati'le"

SAP AG 1999

"he ver!ion of an IDoc type or !egment i! create( at a maintenance level. "he la!t ver!ion remain! the c rrent one in all follo-ing maintenance level!. "he c rrent ver!ion i! only replace( +y the (evelopment of a never!ion. All ol( ver!ion! remain in the !y!tem !o that it i! po!!i+le to re( ce the c rrent ver!ion to an ol(er ver!ion at any time. "hi! ena+le! the ! +!y!tem! to +e <ept compati+le even after an pgra(e. Segment ver!ion) 6e- fiel(! can only +e a((e( to an e1i!ting !egment. By (oing thi! the !tr ct re of !egment type! get! e1ten(e(. A ne- !egment name i! forme(. 4er!ion of an IDoc type) Go may only a(( ne- !egment!. A ne- IDoc type i! create(. A ne- ver!ion of an e1i!ting !egment alone (oe! not lea( to a ne- ver!ion of IDoc type. %ote for o't/o'nd proce *n)! In the partner profile! the ver!ion! are li!te( a! follo-!) IDoc type) By entering the IDoc type. Segment) By entering an SAP 0elea!e. "hi! lea(! to the re( ction of all !egment! -hich are !e( in the IDoc type to an ol(er ver!ion@ that i!@ to the c rrent ver!ion !tate( in the relea!e. If the fiel( remain! empty@ the c rrent ver!ion of all !egment! relating to the c rrent relea!e i! !e(. %ote for *n/o'nd proce *n)! 6o !etting! are nece!!ary or po!!i+le. "he IDoc Interface recogniDe! the ver!ion an( proce!!e! the (ata accor(ingly.

(C) SAP A&

BC621

2.0
ABAP Programming %ame#

Control record8 9DIDC

EIDoc *ypeE

Data records8 9DIDD8 $i#playe$ a# a #egment tree 91<DD5C


6 1

91*-S:7
' 1

91<DAD1
' 5

91I*D5C
Parent 6 #egment 1

91I*SC< 91I*SC<
' 99
Chil$ #egment

'

Status record8 9DIDS = 9DIGDS

SAP AG 1999

ABAP programming e1cl !ively !e! the !egment type! of the !egment!@ for e1ample in the "AB;/S !tatement. Segment type! implemente( in the SAP !tan(ar( !y!tem !tart -ith prefi1 H/1H.

(C) SAP A&

BC621

2.10
S&'#y#tem %ame#

Control record8 9DIGDC.0 Data records8 $i#playe$ a# a #egment tree


92<DD5C000 6 1

EIDoc *ypeE

92*-S:7000 ' 1

91I*D5C 92<DAD1000 92I*D5C000


' 5
Parent #egment 6 1

91I*SC< 92I*SC<000
' 99
Chil$ #egment

'

Status record8 9DIGDS.0

SAP AG 1999

"he !egment name! of the !egment! are e1cl !ively vi!i+le +y the ! +!y!tem. Segment name! implemente( in the SAP !tan(ar( !y!tem !tart -ith prefi1 H/2H.

(C) SAP A&

BC621

18

2.11
IDoc Definition *ool#

IDoc *ype 9$itor

WE30

Segment e$itor WE31

91<DD5C

SAP AG 1999

De!ign an( (efinition of IDoc type! an( their !egment! are ! pporte( +y the IDoc (efinition tool! thro gh the follo-ing) "e!ting of the formal (e!ign r le! Simple !age in application of an ABAP (evelopment -or<+ench "he IDoc type e(itor allo-!) Definition of +a!ic type! (po!!i+le thro gh SAP@ partner! an( c !tomer!) Definition of e1ten!ion! (only po!!i+le thro gh c !tomer!) "he !egment e(itor permit! the (efinition of !egment! for later !e in the IDoc type e(itor.

(C) SAP A&

BC621

11

2.12
3hen i# 3hich Action %ece##aryH

*he IDoc type re0&ire$ i# availa'le an$ meet# all re0&irement#2 %o action nee$e$I *he IDoc type re0&ire$ i# pre#ent '&t $oe# not meet all re0&irement#2 Action2 C&#tomer e)ten#ionI *he IDoc type re0&ire$ i# not availa'le or itis pre#ent '&t $oe# not meet all the re0&irement#2 Action2 DevelopmentI

SAP AG 1999

"he c !tomer e1ten!ion@ that i!@ the (evelopment of an e1ten!ion (oe! not repre!ent a mo(ification. Since all action! are capt re( in their o-n name!pace@ the e1ten!ion can a tomatically +e e1pan(e( to ne- ver!ion! of the e1ten(e( IDoc type. "he c !tomer (evelopment i! totally in(epen(ent of the !tan(ar(. "he nece!!ary proce!!e! can ea!ily +e activate( a! ta+le entrie! !ing the proce!! co(e!.

(C) SAP A&

BC621

12

2.1"
S&mmary

An IDoc type i# a comple) $ata #tr&ct&re compo#e$ of #egment#" Segment type# are #tr&ct&re# in the ABAP $ata repo#itory" IDoc type# an$ their proce##ing can 'e e)ten$e$ in the appropriate po#ition# 'y c&#tomer#"

SAP AG 1999

(C) SAP A&

BC621

1#

"
9)ten#ion of an IDoc *ype

9)ten#ion of the $ata #tr&ct&re 9)ten#ion of 5&t'o&n$ Proce##ing 9)ten#ion of In'o&n$ Proce##ing

SAP AG 1999

9e -ill ta<e a loo< at the o tgoing or(er! proce!! (/nterpri!e A i! placing an electronic or(er -ith 4en(or B) a! -ell a! the incoming c !tomer or(er proce!! (or(er +eing electronically proce!!e( +y the c !tomer !ervice (epartment of 4en(or B). "he co r!e !e! a !ample IDoc type (*0D;&"81) for p rcha!e or(er! an( !ale! or(er!. "hi! IDoc type only con!i!t! of a !egment for the (oc ment hea(er an( the item. "he co r!e (oe! not correct any error! in or(er to empha!iDe all important a!pect! of the IDoc type e1ten!ion!. "he IDoc type *0D;&"81 -ith logical me!!age *0D;&" (oe! not ! pport tran!mi!!ion of !peciali!tL! name or (elivery con(ition!. In thi! le!!on@ thi! information -ill +e a((e( to the IDoc type.

(C) SAP A&

BC621

".2
Co&r#e 5'6ective#

Create IDoc Segment 9)ten$ an IDoc *ype Implement a c&#tomer e)it in o&t'o&n$ proce##ing Implement a c&#tomer e)it in in'o&n$ proce##ing

SAP AG 1999

(C) SAP A&

BC621

"."
Co&r#e 5vervie( Diagram

"

Development of IDoc type

9)ten#ion of an IDoc type Development environment for IDoc type# Implementation

SAP AG 1999

(C) SAP A&

BC621

".#
A$vantage# of C&#tomer 9nhancement

*he co$ing provi$e$ in the #tan$ar$ #y#tem for proce##ing i# &#e$" Development# an$ correction# of the co$ing $elivere$ in the #tan$ar$ #y#tem are therefore a&tomatically availa'le" 9)ten#ion i# le## time con#&ming than ne( $evelopment"

SAP AG 1999

(C) SAP A&

BC621

".$
Ba#ic 1&le# for C&#tomer 9)ten#ion

A$$itional c&#tomer fiel$# are recor$e$ in their o(n c&#tomer #egment#" C&#tomer #egment# $epen$ on SAP #egment# (#&cce##or or chil$ relation#hip#)" *he proce##ing of c&#tomer #egment# i# e)cl&#ively implemente$ in the c&#tomer e)it# of the co$ing provi$e$ in the #tan$ar$ #y#tem"

SAP AG 1999

(C) SAP A&

BC621

'

".6
Area# of C&#tomer 9)ten#ion

Application
B&nction 7o$&le Program 1eport IDoc *ype B&#ine## 3or4flo( B&nction 7o$&le

Data #tr&ct&re in the 39DI area men& 5&t'o&n$ an$ in'o&n$ proce##ing2 *ypically thro&gh tran#action EC75DE8 other(i#e thro&gh in$ivi$&al techni0&e Doc&mentation2 In the 39DI area men&

Segment

Segment *ype

Segment %ame

IDoc Interface

SAP AG 1999

(C) SAP A&

BC621

".Step# Bor 9)ten$ing the Data Str&ct&re

Com'ine the re0&ire$ fiel$# an$ their $ata type# in the $ictionary" Definition of re0&ire$ #egment#8 #egment e$itor" Definition of e)ten#ion8 IDoc type e$itor" A##ignment of a logical me##age to the IDoc type8 #&rro&n$ing fiel$ men& of IDoc type e$itor"

SAP AG 1999

In the !egment e(itor yo a!!ign a name to each fiel( an( enter a (ata element that (e!cri+e! the fiel( in the application ((oc mentation). "he e(itor calc late! the nece!!ary character length of the fiel( in the !egment from the (ata element. Segment e(itor@ tran!action 9/#1. In the IDoc type e(itor yo + il( a comple1 (ata !tr ct re from the !ingle !egment!. "here yo (etermine the or(er an( the hierarchical relation!hip of the !egment!. In a((ition@ yo a!!ign a !tat ! (optional=man(atory) a! -ell a! the n m+er of repetition! per !egment an( !egment gro p. "he IDoc API te!t! that the generate( program (o t+o n( proce!!ing) SAP proce!!ing@ in+o n( proce!!ing) ! +!y!tem) conform! to the!e characteri!tic!. 4iolation! of the!e characteri!tic! are recor(e( thro gh the IDoc !tat ! !ynta1 error (o t+o n() I26J@ in+o n( proce!!ing) I68J). IDoc type e(itor@ tran!action 9/#8.

(C) SAP A&

BC621

"..
Step# for 9)ten$ing Proce##ing

Definition of a pro6ect8 pro6ect management8 attri'&te Choo#ing the EcorrectE c&#tomer e)it#8 pro6ect management8 SAP e)ten#ion# Implementation of the #electe$ c&#tomer e)it#8 pro6ect management8 e)ten#ion component#

5&t'o&n$ proce##ing2 rea$ing of the SAP $ata'a#e an$ $ata in EIDoc formatE In'o&n$ proce##ing2 (riting $ata from the EIDoc formatE into the SAP $ata'a#e

Activate pro6ect in pro6ect management

SAP AG 1999

Pro,ect management@ tran!action C.*D@ ra(io + tton Attribute. /nter a pro,ect name an( !elect Create. /nter !hort te1t an( !elect Save. Choo!e SAP /1ten!ion!. Pro,ect management@ tran!action C.*D@ ra(io + tton SAP Extensions. 3in( c !tomer e1it thro gh the (evelopment cla!! (3% Eelp). Select the re$ ire( SAP e1ten!ion! an( choo!e Copy. Select Save an( ret rn to the initial !creen of the tran!action (3#). Pro,ect management@ tran!action C.*D@ ra(io + tton Extension components. Select Change. Po!ition the c r!or on a component an( choo!e Edit component. Do +le-clic< the incl (e in the program e(itor an( follo- the in!tr ction! in the -in(o-. Before !aving the program@ (onLt forget !ynta1 te!ting. Activate the pro,ect after ret rning to the initial !creen of the tran!action.

(C) SAP A&

BC621

".0
5&tp&t Doc&mentation of the 9)ten#ion

Begin J 9n$
M7-

type$efine #tr&ct e$iG$c KJL e$iG$c

SAP AG 1999

"he (oc mentation tool! are !tarte( from the initial no(e of the IDoc Interface +y !electing Documentation. In a((ition@ the par!er o tp t format ha! it! o-n men point for recor( type! a! -ell a! IDoc type!. A tomatic format! are) Simple@ rea(a+le -ith a par!er +egin..en(-Declaration !e$ ence. C-hea(er. .eta IDoc from type SG0/CD81 (IDoc recor( type!) or SGID*C81 (IDoc type!). .eta (ata for IDoc! in A.; format. 6avigation-compati+le format! are) "he tree (i!play in the 0=# Sy!tem. E".; file (three file!@ the MN f-file i! the frame that !ho l( +e loa(e( +y the +ro-!er an( the in(e1 MNi an( act al (oc mentation MN(). Doc mentation@ IDoc recor( type!) "ran!action 9/61 Doc mentation@ IDoc type!) "ran!action 9/68 Doc mentation@ IDoc type (par!er)) "ran!action 9/6#

(C) SAP A&

BC621

".10
S&mmary

An e)ten#ion can 'e limite$ to proce##ing" %ormally an e)ten#ion encompa##e# the $ata #tr&ct&re a# (ell a# the proce##ing" 9)ten$e$ $ata #tr&ct&re# can 'e comm&nicate$ to the #&'#y#tem 'y the $oc&mentation tool#"

SAP AG 1999

(C) SAP A&

BC621

18

".111r2e*ter'n)

e*ne IDoc-T(p ! 1,erc* e

Data 3 ed *n t&e 1,erc* e Tra*n*n) S( tem! T&e *n tr'ctor 2*ll *nform (o' (for e,ample I#0) Cl*ent! T&e *n tr'ctor 2*ll *nform (o' (for e,ample #00) 3 er! BC621-nn Pa 2ord! 435S Port! S3BS6ST17 of T(pe 8Data8 (pre pro)rammed) Data C' tomer! .aterial 4en(or P rcha!ing *rganiDation P rcha!ing &ro p Plant 9endor! .aterial Sol(-to party *r(er "ype Sale! *rganiDation Di!tri+ tion Channel Divi!ion nn i! yo r gro p n m+er SE-188 "-BIOnn "A 1828 22 88 1828 22 88 SE-188 1118 SE-188 "-BI;nn 1888 881 1188 SE-188 181% 1888 881 1188 Data *n Tra*n*n) S( tem Data *n ID1S S( tem

(C) SAP A&

BC621

11

3n*t! 1,ten *on of an IDoc T(pe

.a<e preparation! for the e1ten!ion

In the !cenario !en( a p rcha!e or(er to ven(or "-BI;nn. In the !econ( !tep ma<e the p rcha!e or(er the !ale! or(er from c !tomer "-BIOnn.

In or(er to <eep the e1erci!e! managea+le@ the IDoc type *0D;&"81 ha! +een intro( ce( -ith me!!age *0D;&". "hi! i! a !implification of SAP !tan(ar( *0D/0S81 an( i! only !e( for thi! co r!e. 1-1 Prepare via Logistics -> Materia s management -> Purchasing -> Purchase order -> Create -> !endor "no#n (tran!action ./21) a p rcha!e or(er -ith yo r ven(or "-BI;nn for methanol@ material n m+er SE-188. Go +elong to p rcha!ing organiDation 1888 an( the p rcha!ing gro p i! 881. "he methanol i! +eing p rcha!e( for plant 1188. A partner profile for yo r partner alrea(y e1i!t!. It en! re! that the IDoc i! -ritten in a file an( th ! receive! the !tat ! 8#. 1-2 Go !im late the incoming or(er! via the inbound modi$ied outbound $i e te!t program from the p rcha!e or(er. Go can offer (efa lt val e! for !o rce@ (e!tination an( port +y choo!ing Goto User settings an( !electing the port SCBSGS"/. for the te!t. /nter the follo-ing val e! on the ta+ page Sender) 0ecipient@ Port) Sen(er@ Port) Sen(er@ Partner 6 m+er) Sen(er@ Partner "ype) Sen(er@ Partner 3 nction) SAPPSIDQ@ Sy!tem ID of SAP !y!tem@ for e1ample SAP"58 S3BS6ST17 T-BI4nn 43 A:

(C) SAP A&

BC621

12

A corre!pon(ing in+o n( partner profile i! alrea(y availa+le. Select Execute. "he in+o n( IDoc generate( get! !tat ! '1 -ith the error I(oc ment type 6B n<no-nJ.

(C) SAP A&

BC621

1#

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of In/o'nd Proce *n)

&et to <no- pro,ect management Be a+le to -rite program co(e for in+o n( proce!!ing.

2-1

/1ten( the in+o n( proce!!ing of IDoc type *0D;&"81 to avoi( error! !tat ! I'1J. Change the receive( error (oc ment type 6B in one of the c !tomer e1it! to (oc ment type "A e1pecte( +y the !ale! or(er. "here i! no nee( to e1ten( the IDoc type. Create the Pro;ect BC621-nn in the pro,ect a(mini!tration (tran!action C.*D). Select the SAP e1ten!ion BC6211nn for the pro,ect. 9rite the e1ten!ion co(e in the in+o n( component. 6o- activate yo r pro,ect. 0epeat the in+o n( !ale! or(er proce!! -ith the help of the te!t program %nbound modi$ied outbound $i e (erive( from the alrea(y create( p rcha!e or(er. /nter the follo-ing val e! on the ta+ page Sender) 0ecipient@ Port) Sen(er@ Port) Sen(er@ Partner 6 m+er) Sen(er@ Partner "ype) Sen(er@ Partner 3 nction) SAPPSIDQ@ Sy!tem ID of SAP !y!tem@ for e1ample SAP"58 S3BS6ST17 T-BI4nn 43 A:

2-2

2-# 2-%

nn i! the n m+er of yo r gro p (from 81 to 15)

(C) SAP A&

BC621

1%

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of <'t/o'nd Proce *n)

&et to <no- pro,ect management Be a+le to -rite the program co(e for o t+o n( proce!!ing

In e1erci!e 1 the fiel( for Specia ist name remaine( +lan<@ even tho gh it -a! (efine( in the IDoc type. Since it ha! +een agree( -ith yo r partner to tran!fer the fiel(@ yo (eci(e to ta<e care of the fiel( thro gh a c !tomer e1it. "here i! no nee( to e1ten( the IDoc type.

#-1

Change the Pro;ect BC621-nn in the pro,ect management (tran!action C.*D) or create it for the fir!t time (if yo have not complete( e1erci!e 2). Select the SAP e1ten!ion BC6211nn for the pro,ect. 9rite the program co(e in the e1ten!ion component for the o t+o n( proce!!ing. Activate yo r pro,ect. 6o- repeat the p rcha!e or(er thro gh Logistics -> Materia s management -> Purchasing -> Purchase order -> Create -> !endor "no#n (tran!action ./21) to yo r ven(or "-BI;nn for methanol@ material n m+er SE-188. Change to Purchase order Display. Go can (i!play the IDoc that -a! , !t generate( from the overvie- !creen +y choo!ing System Links. Chec< that the fiel( ha! no- +een fille( -ith the !er name. %ote! "he n m+er of fille( fiel(! i! (i!playe( in the +ottom right area of the (etail (i!play of a (ata recor(. It ha! increa!e( to 5.

#-2 #-#

#-%

nn i! the n m+er of yo r gro p (from 81 to 15)

(C) SAP A&

BC621

1'

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of t&e Data Str'ct're (IDoc T(pe)

Ono- ho- to !e IDoc type e(itor

Go r IDoc type *0D;&"81 (oe! not contain any fiel(! in or(er to tran!fer the (oc ment hea(er (elivery con(ition!. Go have to e1ten( the (ata !tr ct re@ that i!@ the IDoc type@ !ince (elivery con(ition! have +een agree( to -ith yo r partner.

%-1

3ir!t (efine the c !tomer !egment =1I%C<nn in the !egment e(itor. C !tomer !egment K1I6C*nn i! to contain application fiel(! I6C*1 an( I6C*2. In the application +oth fiel(! I6C*1 an( I6C*2 are containe( in the !tr ct re /OO*. In the !egment e(itor@ te!t that yo r (efinition i! correct. Ignore the -arning that the !egment ha! not yet +een relea!e(. Define the e1ten!ion =1>T1%nn in the IDoc type e(itor. /1ten( the +a!ic IDoc type *0D;&"81 +y !egment K1I6C*nn. A(( to the logical me!!age *0D;&" the +a!ic type *0D;&"81 -ith the e1ten!ion K/A"/6nn in the IDoc type e(itor. In the IDoc type e(itor@ te!t that yo r (efinition i! correct. Ignore the -arning that the IDoc type a! -ell a! the !egment K1I6C*nn ha! not yet +een relea!e(.

%-2

%-#

%-%

%-'

nn i! the n m+er of yo r gro p (from 81 to 15)

(C) SAP A&

BC621

16

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of <'t/o'nd Proce *n)

0evi!e pro,ect management 0evi!e programming of o t+o n( proce!!ing

After yo have complete( e1erci!e %@ e1ten(ing the c !tomer !egment K1I6C*nn of the IDoc type@ in or(er to tran!fer the (elivery con(ition!@ yo no- have to enter the (elivery con(ition! in the c !tomer !egment in a c !tomer e1it.

'-1

Change the Pro;ect BC621-nn in the pro,ect management (tran!action C.*D) or create it for the fir!t time. Select the SAP e1ten!ion BC6211nn for the pro,ect. 9rite the program co(e in the e1ten!ion component for the o t+o n( proce!!ing. Activate yo r pro,ect. In partner agreement for ven(or T-BI?nn@ in the o t+o n( parameter ta+le change the IDoc type from +a!ic IDoc type <5D?:T01 to e1ten!ion =1>T1%nn. 6o- repeat the p rcha!e or(er thro gh Logistics -> Materials management -> Purchasing -> Purchase order -> reate -> !endor kno"n (tran!action ./21) to yo r ven(or "-BI;nn for methanol@ material n m+er SE-188. Change to Purchase order Display. Go can (i!play the IDoc that -a! , !t generate( from the overvie- !creen +y choo!ing System Links. Chec< if c !tomer !egment K1I6C*nn -a! create( an( fille(. "he IDoc ha! !tat ! 8#@ that i! a file -a! generate(.

'-2 '-#

'-%

'-'

nn i! the n m+er of yo r gro p (from 81 to 15)

(C) SAP A&

BC621

12

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of In/o'nd Proce *n)

0evi!e pro,ect management 0evi!e programming of inp t proce!!

In e1erci!e %@ after yo e1ten(e( IDoc type -ith c !tomer !egment K1I6C*nn. In or(er to receive the (elivery con(ition!@ yo nee( to rea( the c !tomer !egment -ith (elivery con(ition! in the c !tomer e1it an( thi! nee(! to +e tran!mitte( to the inp t proce!! (BDC).

/1erci!e ' i! a prere$ i!ite for thi! e1erci!e. 6-1 Change the Pro;ect BC621-nn in the pro,ect management (tran!action C.*D). 9rite the program co(e in the e1ten!ion component for the o t+o n( proce!!ing. Activate yo r pro,ect. 0epeat the in+o n( !ale! or(er proce!! -ith the help of the te!t program %nbound modi$ied outbound $i e (erive( from the alrea(y create( p rcha!e or(er. /nter the follo-ing val e! on the ta+ page Sender) 0ecipient@ Port) Sen(er@ Port) Sen(er@ Partner 6 m+er) Sen(er@ Partner "ype) Sen(er@ Partner 3 nction) SAPPSIDQ@ Sy!tem ID of SAP !y!tem@ for e1ample SAP"58 S3BS6ST17 T-BI4nn 43 A:

6-2 6-#

"he generate( IDoc contain! the !tat ! '# (application (oc ment po!te(). 6-% Chec< the or(er to !ee if it contain! the (elivery con(ition!. "he con(ition te1t !ho l( contain the !tring from the c !tomer e1it.

(C) SAP A&

BC621

15

".121,ten *on of an IDoc T(pe! Sol't*on


3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of In/o'nd Proce *n)

2-1 Program co(e for o t+o n( proce!!ing e1ten!ion) 1 2 # % ' 6 2 5 7 18 11 12 1# 1% 1' 16 M----------------------------------------------------------------------M M I6C;CD/ KADIAC82 M----------------------------------------------------------------------M (ata) hNe1hea( li<e e1hea(. peNv+a<621 R piNv+a<621. M /1erci!e 2 loop at ptNi(ocN(ataNrecor(! -here !egnam R L/1E/ADL. hNe1hea( R ptNi(ocN(ataNrecor(!-!(ata. if hNe1hea(-a art R L6BL. peNv+a<621-a art R L"AL. en(if. en(loop. H /1erci!e 2

(C) SAP A&

BC621

17

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of <'t/o'nd Proce *n)

#-1 Program co(e for o t+o n( proce!!ing e1ten!ion) 1 2 # % ' 6 2 5 7 18 11 12 1# 1% M----------------------------------------------------------------------M M I6C;CD/ KADIAC81 M----------------------------------------------------------------------M (ata) <Ne1hea( li<e e1hea(. H /1erci!e #

loop at ptNi(ocN(ataNrecor(! -here !egnam R L/1E/ADL. M /1erci!e # <Ne1hea( R ptNi(ocN(ataNrecor(!-!(ata. <Ne1hea(-name R piNe<<o-ernam. ptNi(ocN(ataNrecor(!-!(ata R <Ne1hea(. mo(ify ptNi(ocN(ataNrecor(!. en(loop.

(C) SAP A&

BC621

28

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of t&e Data Str'ct're (IDoc T(pe)

%-1

Segment K1I6C*nn contain! t-o fiel(!) I6C*1 -ith (ata element I6C*1 in e1port length # I6C*2 -ith (ata element I6C*2 in e1port length 25 "he e1ten!ion K/A"/6nn con!i!t! of !tan(ar( !egment! /1E/AD an( /1I"/.. "he c !tomer !egment K1I6C*nn& a! chil( !egment (epen(! on !tan(ar( !egment /1E/AD.

%-2

(C) SAP A&

BC621

21

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of <'t/o'nd Proce *n)

'-1 1 2 # % ' 6 2 5 7 18 11 12 1# 1% 1' 16 12 15 17 28 21 22 2#

Program co(e for o t+o n( proce!!ing e1ten!ion (e1ten(e( I6C;CD/ from e1erci!e #))

M----------------------------------------------------------------------M M I6C;CD/ KADIAC81 M----------------------------------------------------------------------M (ata) <Ne1hea( li<e e1hea(. (ata) <ND1inco li<e D1inco(1. H /1erci!e # H /1erci!e '

loop at ptNi(ocN(ataNrecor(! -here !egnam R L/1E/ADL. M /1erci!e # <Ne1hea( R ptNi(ocN(ataNrecor(!-!(ata. <Ne1hea(-name R piNe<<o-ernam. ptNi(ocN(ataNrecor(!-!(ata R <Ne1hea(. mo(ify ptNi(ocN(ataNrecor(!. M /1erci!e ' clear ptNi(ocN(ataNrecor(!. clear <ND1inco. <ND1inco-inco1 R piNe<<o-inco1. <ND1inco-inco2 R piNe<<o-inco2. ptNi(ocN(ataNrecor(!-!egnam R LK1I6C*DAL. ptNi(ocN(ataNrecor(!-!(ata R <ND1inco. appen( ptNi(ocN(ataNrecor(!. en(loop.

(C) SAP A&

BC621

22

3n*t! 1,ten *on of an IDoc T(pe Top*c! 1,ten *on of In/o'nd Proce *n)

6-1 1 2 # % ' 6 2 5 7 18 11 12 1# 1% 1' 16 12 15 17 28 21 22 2# 2% 2' 26

Program co(e for in+o n( proce!!ing e1ten!ion (e1ten(e( I6C;CD/ from e1erci!e 2))

M----------------------------------------------------------------------M M I6C;CD/ KADIAC82 M----------------------------------------------------------------------M (ata) hNe1hea( li<e e1hea(. (ata) hND1inco li<e D1inco(1. peNv+a<621 R piNv+a<621. M /1erci!e 2 loop at ptNi(ocN(ataNrecor(! -here !egnam R L/1E/ADL. hNe1hea( R ptNi(ocN(ataNrecor(!-!(ata. if hNe1hea(-a art R L6BL. peNv+a<621-a art R L"AL. en(if. en(loop. M /1erci!e 6 loop at ptNi(ocN(ataNrecor(! -here !egnam R LK1I6C*DAL. hND1inco R ptNi(ocN(ataNrecor(!-!(ata. peNv+a<621-inco1 R hND1inco-inco1. M peNv+a<621-inco2 R hND1inco-inco2. peNv+a<621-inco2 R S"e!t BC621-DAT. en(loop. H /1erci!e 2 H /1erci!e 6

(C) SAP A&

BC621

2#

#
Development of IDoc *ype

Development of the $ata #tr&ct&re Proce##ing e)ample

SAP AG 1999

(C) SAP A&

BC621

#.2
*opic 5'6ective#

Create IDoc #egment# Develop ne( IDoc type# *emplate for IDoc o&t'o&n$ proce##ing *emplate for IDoc in'o&n$ proce##ing

SAP AG 1999

(C) SAP A&

BC621

#."
Co&r#e 5vervie( Diagram

Development of IDoc type

9)ten#ion of an IDoc type Development environment for IDoc type# Implementation

SAP AG 1999

(C) SAP A&

BC621

#.#
Ba#ic 1&le# for Development

Segment# are forme$ a# logical &nit# 'a#e$ on the (application) fiel$#" *hey are re&#a'le Emo$&le#E of IDoc $evelopment" Segment gro&p# are forme$ a# logical &nit# from #egment#" IDoc type# are $erive$ from #egment# an$ #egment gro&p#" *hey are the $ata #tr&ct&re of an application $oc&ment for the tran#mi##ion" D&ring $evelopment IDoc type# are create$ a# 'a#ic IDoc type#" *he '&#ine## proce## it#elf i# not i$entifie$ thro&gh an IDoc type8 '&t rather thro&gh the logical me##age"

SAP AG 1999

In the !egment e(itor yo a!!ign a name to the fiel( an( enter a (ata element that (e!cri+e! the fiel( in the application ((oc mentation). "he e(itor calc late! the nece!!ary character length for the fiel( !ing the (ata element. 1,ample ! ;ogical nit !egment) U An a((re!! con!i!t! of the fiel(! !treet@ po!tal co(e an( city. U Contact per!on con!i!t! of the fiel(L! fir!t name@ la!t name an( telephone n m+er. ;ogical nit of !egment gro p) U A company a((re!! con!i!t! of an a((re!! (logical nit !egment) a! -ell a! !everal contact per!on! (logical nit !egment) in thi! company. Go + il( a comple1 (ata !tr ct re from the !ingle !egment! in the IDoc type e(itor. "here yo (etermine the or(er an( the hierarchical relation!hip of the !egment!. In a((ition@ yo a!!ign a !tat ! (optional=man(atory) a! -ell a! the n m+er of repetition! per !egment an( !egment gro p. "he IDoc API te!t! that the generate( program (o t+o n( proce!!ing) SAP proce!!ing@ in+o n( proce!!ing) ! +!y!tem) conform! to the!e characteri!tic!. 4iolation! of the!e characteri!tic! are recor(e( thro gh the IDoc !tat ! !ynta1 error (o t+o n() 26@ in+o n( 68).

(C) SAP A&

BC621

#.$
Area# of Development

Application
B&nction 7o$&le Program 1eport IDoc *ype B&#ine## 3or4flo( B&nction 7o$&le

Data #tr&ct&re2 in the 39DI area men& 5&t'o&n$ an$ in'o&n$ proce##ing2 in the 5'6ect Bro(#er ES9N0E Doc&mentation2 in the 39DI men&

Segment

Segment *ype

Segment %ame

IDoc Interface

SAP AG 1999

(C) SAP A&

BC621

'

#.6
Step# for the Development of a Data Str&ct&re

Com'ine the re0&ire$ fiel$# an$ their $ata type# in the $ictionary Definition of re0&ire$ #egment#8 #egment e$itor Definition of 'a#ic IDoc type#8 IDoc type e$itor Creation of a logical me##age8 #&rro&n$ing fiel$ men& of IDoc type e$itor A##ignment of a logical me##age to the IDoc type8 #&rro&n$ing fiel$ men& of IDoc type e$itor

SAP AG 1999

In the !egment e(itor yo a!!ign a name to the fiel( an( enter a (ata element that (e!cri+e! the fiel( in the application ((oc mentation). "he e(itor calc late! the nece!!ary character length for the fiel( !ing the (ata element. Segment e(itor@ tran!action 9/#1. Go + il( a comple1 (ata !tr ct re from the !ingle !egment! in the IDoc type e(itor. "here yo (etermine the or(er an( the hierarchical relation!hip of the !egment!. In a((ition@ yo a!!ign a !tat ! (optional=man(atory) a! -ell a! the n m+er of repetition! per !egment an( !egment gro p. "he IDoc API te!t! that the generate( program (o t+o n( proce!!ing) SAP proce!!ing@ in+o n( proce!!ing) ! +!y!tem) conform! to the!e characteri!tic!. 4iolation! of the!e characteri!tic! are recor(e( thro gh the IDoc !tat ! !ynta1 error (o t+o n() 26@ in+o n( 68). IDoc type e(itor@ tran!action 9/#8.

(C) SAP A&

BC621

#.Proce##ing *ype#

5&t'o&n$ proce##ing &#ing


7e##age Control (7C) H A-9 Interface (B7 7AS*91GID5CGDIS*1IB:*9)H

In'o&n$ proce##ing &#ing


B&#ine## 3or4flo( (#ingle #tep or m&lti#tep ta#4) H A-9 Interface (f&nction mo$&le) H

SAP AG 1999

(C) SAP A&

BC621

#..
Step# for Development of 5&t'o&n$ Proce##ing &#ing 7C

Chec4ing 7e##age Control8 that i#8 the connection for the me##age $efa&lt2

Con$ition ta'le Acce## #e0&ence Con$ition type# Proce$&re Application

Implementation of a f&nction mo$&le that ma4e# application $ata availa'le in EIDoc formatE Definition of an o&t'o&n$ proce## co$e

SAP AG 1999

"he f nction mo( le m !t a(here to the follo-ing interface) Import *B>/C" li<e .C C*6"0*;N0/C*0DNI6 li<e /DIDC /1port *B>/C"N"GP/ li<e 93AS1-AS&"P C*6"0*;N0/C*0DN*C" li<e /DIDC "a+le! I6"N/DIDD li<e /DIDD /1ception! /00*0N./SSA&/N0/C/I4/D "he f nction mo( le cannot tran!mit any e1plicit or implicit C*..I"!. 3 nction mo( le@ tran!action S/58. * t+o n( proce!! co(e@ tran!action 9/%1. 3or e1ample!@ !ee the appen(i1.

(C) SAP A&

BC621

#.0
Development Step# for 5&t'o&n$ Proce##ing &#ing the A-9 Interface

Implementation of a program that call# the f&nction mo$&le 7AS*91GID5CGDIS*1IB:*9" Interface


Import *a'le#

7AS*91GID5CGC5%*15- li4e 9DIDC C577:%ICA*I5%GID5CGC5%*15- li4e 9DIDC 7AS*91GID5CGDA*A li4e 9DIDD

Bor thi# program yo& have to $efine ho( the control (or4#8 #pecifically8 if the control i# to ta4e place via a time ta'le8 event or $ialog #tep"

SAP AG 1999

"he f nction mo( le 7AST15@ID<C@DIST5IB3T1 ha! the follo-ing interface) Import .AS"/0NID*CNC*6"0*; li<e /DIDC *B>N"GP/ li<e S/0IA;-*B>N"GP/ CE6C. li<e S/0IA;-CE6C. "a+le! C*..C6ICA"I*6NID*CNC*6"0*; li<e /DIDC .AS"/0NID*CNDA"A li<e /DIDD /1ception! /00*0NI6NID*CNC*6"0*; /00*0N90I"I6&NID*CNS"A"CS /00*0NI6NID*CNDA"A S/6DI6&N;*&ICA;NSGS"/.NC6O6*96 'otes( "he import parameter *B>N"GP/ an( CE6C. -ill +e availa+le for the A;/ SerialiDing a! of 0elea!e %.'. "he program calling the f nction mo( le .AS"/0NID*CNDIS"0IBC"/ ha! to tran!mit a C*..I" 9*0O. *ther-i!e itL! po!!i+le that the IDoc! -ill not +e !ent + t rather -ill remain in the !en(ing !y!tem.

(C) SAP A&

BC621

#.10
Development Step# of In'o&n$ Proce##ing &#ing B&#ine## 3or4flo(

Implementation of a (or4flo( to control in'o&n$ proce##ing *hi# incl&$e#2


Definition of o'6ect an$ metho$(#) in B51 Definition of (or4flo(

Definition of in'o&n$ proce## co$e

SAP AG 1999

B*0 - B !ine!! *+,ect 0epo!itory@ tran!action S9*1 (B !ine!! *+,ect B il(er). 9or<flo-@ tran!action P3"C ntil %.8B@ from %.' on tran!action! P3"CNI6S@ P3"CNCE& an( P3"CNDIS. In+o n( proce!! co(e@ tran!action 9/%2. 3or an e1ample@ !ee the appen(i1.

(C) SAP A&

BC621

18

#.11
Development Step# for In'o&n$ Proce##ing &#ing A-9 Interface

3rite f&nction mo$&le that po#t# the IDoc a# an application $oc&ment Implementation of a (or4flo( to #en$ me##age# in ca#e of error" *hi# incl&$e#2

Definition of o'6ect an$ metho$(#) in B51 Definition of (or4flo(

7aintenance of the characteri#tic# for the f&nction mo$&le for the A-9 Call Allocation of the f&nction mo$&le to a logical me##age an$ to an IDoc type for the A-9 Call Definition of an in'o&n$ proce## co$e an$ e#ta'li#hing a connection (ith the A-9 layer

SAP AG 1999

Po!t application (oc ment) 3 nction mo( le@ tran!action S/58. Ca!e 1) "he f nction mo( le !e! an internal CA;; "0A6SAC"I*6 -hich trigger! a C*..I". In thi! ca!e yo m !t (i!play the A;/ layer in the tran!action BD'1. "he tran!action !e! internal f nction mo( le! ID*CNI6PC"N*P/6 an( ID*CNI6PC"NC;*S/@ in or(er to -rite the IDoc !tat ! -ithin the ;C9. In ca!e of an error@ foregro n( proce!!ing i! po!!i+le !ing ! ch a f nction mo( le. Ca!e 2) "he f nction mo( le !e! internal API! (Programming Interface!) an( (oe! not relea!e a C*..I". In ca!e of an error@ foregro n( proce!!ing i! not po!!i+le !ing ! ch a f nction mo( le. 6otification in ca!e of error) B*0 - B !ine!! *+,ect 0epo!itory@ tran!action S9*1 (B !ine!! *+,ect B il(er). 9or<flo-@ tran!action P3"C ntil %.8B@ from %.' on@ tran!action! P3"CNI6S@ P3"CNCE& an( P3"CNDIS. .aintaining the characteri!tic! of the f nction mo( le) Go m !t ma<e the (technical program) characteri!tic! of the f nction mo( le calle( +y A;/ <no-n to the A;/ layer@ +y !ing tran act*on BD$1. A!!ignment of the f nction mo( le) "he allocation of a f nction mo( le to a + !ine!! proce!!@ calle( +y A;/@ ha! to +e e1ec te( via tran act*on A1$-. In+o n( proce!! co(e an( A;/ Connection) "he proce!! co(e for the IDoc Interface i! (efine( via tran act*on A1#2. A! of thi! point@ tran act*on BD6- +ranche! to e!ta+li!h the connection to the A;/ layer. In ca!e of an error (IDoc trigger event) an( the connection of IDoc an( application (oc ment@ information i! !tore( in a ta+le. 3or e1ample!@ !ee the appen(i1.

(C) SAP A&

BC621

11

#.12
5&tp&t Doc&mentation of %e( Development

Begin J 9n$
M7-

type$efine #tr&ct e$iG$c KJL e$iG$c

SAP AG 1999

"he (oc mentation tool! are !tarte( from the initial no(e of the IDoc Interface +y !electing Documentation. In a((ition@ the par!er o tp t format ha! it! o-n men point for recor( type! a! -ell a! IDoc type!. A tomatic format! are) Simple@ rea(a+le -ith a par!er +egin..en(-Declaration !e$ ence. C-hea(er. .eta IDoc from type SG0/CD81 (IDoc recor( type!) or SGID*C81 (IDoc type!). .eta (ata for IDoc! in A.; format. 6avigation-compati+le format! are) "he tree (i!play in the 0=# Sy!tem. E".; file (three file!@ the MN f-file i! the frame that !ho l( +e loa(e( +y the +ro-!er an( the in(e1 MNi an( act al (oc mentation MN(). Doc mentation@ IDoc recor( type!) "ran!action 9/61 Doc mentation@ IDoc type!) "ran!action 9/68 Doc mentation@ IDoc type (par!er)) "ran!action 9/6#

(C) SAP A&

BC621

12

#.1"
S&mmary

*he $ata #tr&ct&re i# $efine$ a# an IDoc type Depen$ing on the proce##ing co&r#e an$ $irection8 $ifferent programming template# can 'e &#e$

5&t'o&n$ &#e# 2 metho$#2 7e##age Control an$ A-9 In'o&n$ &#e# 2 metho$#2 3or4flo( an$ A-9

SAP AG 1999

(C) SAP A&

BC621

1#

$Append*,
:lo ar(
Acce!! Acce!! !e$ ence Ba!ic type Con(ition element An acce!! i(entifie! the (oc ment fiel(! !e( +y the !y!tem -hen !earching for a con(ition recor(. Se$ ence !e( +y .e!!age Control to acce!! con(ition recor(! -hen !earching for me!!age!. IDoc type ! pplie( +y SAP. Ba!ic type! can +e mo(ifie( +y c !tomer! to create a ne-@ p-ar(-compati+le IDoc type. Part of hierarchy -hich i! e1amine( -hen !earching for a me!!age. An e1ample i! the o tp t type -hich i! at the top of thi! hierarchy) 9hen a (ne-) p rcha!e or(er i! po!te(@ only the me!!age! n(er the no(e for the me!!age type 6/9 are !earche(. Data recor( in -hich the <ey fiel(! repre!ent the con(ition n(er -hich the me!!age i! Hfo n(H. "he remaining fiel(! (e!cri+e the me!!age it!elf. "herefore@ if one of the (ata recor(! tran!ferre( from the application matche! the!e <ey fiel(!@ the me!!age i! fo n( an( can then +e proce!!e( (for e1ample e1porte( a! a print form or a! an electronic me!!age). "he part of an IDoc -hich contain! the (ata for i(entifying the !en(er an( recipient@ a! -ell a! the !tr ct re of the IDoc it!elf. /ach IDoc al-ay! ha! one control recor(. "he part of an IDoc -hich contain! the application (ata. An IDoc ! ally contain! more than one (ata recor(. R /lectronic Data Interchange. /DI (for e1ample of + !ine!! (oc ment!) +et-een + !ine!! partner!@ !ometime! in !eparate co ntrie!@ -ho may !e (ifferent har(-are@ !oft-are an( comm nication !ervice!. "he (ata i! formatte( accor(ing to !pecific !tan(ar(!. Stan!ar! #or$at #or a /usiness +rocess 0#or e5a$+le7 a +urchase or!er1 to /e han!le! / ."I. &arious ."I stan!ar!s 0."I8A'T or A9SI :121 can !e#ine !i##erent ."I $essages #or the sa$e /usiness +rocess. &eneral format for (ata to +e tran!ferre( electronically. An /DI !tan(ar( generally compri!e!) o /DI !ynta1 o Data element !ervice o .e!!age type !ervice "he SAP !tan(ar( LIDocL i! not yet an /DI !tan(ar(@ + t can +e compare( to other /DI !tan(ar(!. /DI ! +!y!tem Sy!tem -hich convert! the SAP !tan(ar( IDoc into an /DI !tan(ar( (for e1ample /DI3AC"@ A6SI A12) an( vice ver!a. In a((ition to thi! ta!< (-hich i! carrie( o t +y the /DI ! +!y!tem convertor)@ there are al!o a(mini!tration activitie!@ for e1ample@ archiving the tran!ferre( me!!age!@ an( technical ta!<!@ for e1ample@ technical connection to the ! +!e$ ent !y!tem an( !ynta1 chec<! for format!@ to +e con!i(ere(. Contain! all fiel(! -hich can +e !electe( a! <ey fiel(! for con(ition ta+le! in .e!!age Control. R port type IfileJ Determine! the po!ition of a !egment in a tree !egment. A !egment carrie! + !ine!! (ata in an IDoc. Depen(encie! in the application (ata can +e repre!ente( in thi! tree !tr ct re@ that i!@ the vario ! hierarchy level!. Definition of format! (IDoc type!@ previo !ly) interme(iate !tr ct re!) an( metho(! (port (efinition!) for electronic (ata e1change +et-een SAP Sy!tem! an( partner BC621 1

Con(ition recor(

Control recor( Data recor( /DI

."I $essage

/DI !tan(ar(

3iel( catalog 3ile interface Eierarchy level

IDoc interface (C) SAP A&

!y!tem!. IDoc type In+o n( proce!!ing SAP format in -hich (ata for a + !ine!! proce!! i! to +e tran!ferre(. An IDoc i! a real + !ine!! proce!! formatte( accor(ing to a certain IDoc type. Conver!ion an( proce!!ing of (ata for a + !ine!! proce!! from the time the (ata i! receive( in IDoc format to the po!ting of the corre!pon(ing (oc ment(!) in the SAP application. "he part of an IDoc type -hich contain! important application (ata an( m !t therefore e1i!t in an IDoc for an act al + !ine!! proce!!. 0 le! for a!!igning the (ata element! of an /DI me!!age type to the fiel(! of an IDoc type. B !ine!! proce!! (for e1ample@ a p rcha!e or(er)@ -hich i! tran!ferre( in IDoc format +et-een an SAP Sy!tem an( an e1ternal !y!tem. .o( le (e!igne( to offer interface! for f rther proce!!ing for application!. "hi! incl (e! (e!cription! of the vario ! (ata config ration! an( the re$ ire( action!. An e1ample of an action i! printing a (oc ment at a certain time in &erman. "he action i! triggere( -hen the application tran!fer! (ata -hich matche! yo r config ration. A chec< to (etermine -hether the application (ata matche! the con(ition recor(! (!pecifie( in C !tomiDing). If thi! i! the ca!e@ one or more me!!age! are Hfo n(H an( can then +e proce!!e( (for e1ample@ !ent electronically). In me!!age (etermination@ a !earch i! ma(e for the con(ition recor(! !ing a pre(efine( hierarchy. R .C recor(. ;og recor( for the .C ta+le -hich (e!cri+e! the !en( !tat ! of a me!!age in .e!!age Control. If an error occ r! (for e1ample@ an IDoc -ith incorrect !ynta1)@ a notification i! !ent to one or more !er!. "he !er! re!pon!i+le are (efine( in the IDoc Interface or in(irectly via the organiDation mo(el. 6otification! are !ent to the integrate( in+o1. Part of an IDoc type -hich can incl (e a((itional@ optional (ata a+o t the + !ine!! proce!!. "he !egment (oe! not therefore have to appear in an IDoc for a !pecific + !ine!! proce!!. Contain! !pecific IDoc! to +e !ent for port type IfileJ. Conver!ion an( proce!!ing of SAP (oc ment (ata from po!ting a (oc ment to !en(ing the (ata in IDoc format. Comm nication partner for the IDoc Interface. Definition from Sale! an( Di!tri+ tion) HAn in(ivi( al -ithin or o t!i(e of yo r o-n organiDation -ho i! of commercial intere!t an( -ho can +e contacte( in the co r!e of a + !ine!! tran!actionH. Definition of the general con(ition! for electronic (ata interchange -ith a + !ine!! partner via the IDoc Interface) -hich me!!age i! !ent in -hich (irection !ing -hich metho(: If a partner profile (oe! not e1i!t@ comm nication -ith a partner via the IDoc Interface i! not po!!i+le. Port De!cription of the channel !e( +y the SAP !y!tem for comm nicating -ith the e1ternal !y!tem ( ring e1ternal (ata interchange. "here are vario ! technical metho(! for implementing thi! type of comm nication (port type!). "he !election of the port type (epen(! on the technical config ration of the e1ternal !y!tem. /1ample) .o!t /DI ! +!y!tem! rea( IDoc! in the form of !e$ ential file!@ that i!@ the port type LfileL i! !e(. A gro p of me!!age!. A proce( re i! !earche( for me!!age! -hich are to +e proce!!e( for the !pecifie( (ata config ration (for e1ample@ !ent electronically or printe(). Another name for a (efine( proce!!ing type@ for e1ample a f nction mo( le or an SAP B !ine!! 9or<flo- ta!<. In contra!t@ a (efine( IDoc type (!tan(ar( format for (ata comm nication) i! ! ally a!!igne( to a certain proce!! co(e. If the proce!! type for thi! IDoc type i! to +e change(@ yo !ho l( a!!ign the corre!pon(ing proce!! co(e to the ne- proce!!ing type. 9itho t thi! proce!! co(e@ thi! IDoc type BC621 2

.an(atory !egment .apping .e!!age .e!!age Control

.e!!age (etermination

.e!!age !tat ! recor( 6otification

*ptional !egment

* t+o n( file * t+o n( proce!!ing Partner

Partner profile

Proce( re

Proce!! co(e

(C) SAP A&

m !t +e a!!igne( to the ne- proce!!ing co(e (irectly. 0ecor( type An IDoc type con!i!t! of the follo-ing three recor( type!) - Control recor( - Data recor( - Stat ! recor( Segment Stat ! Str ct re -hich incl (e! the application (ata for an IDoc from the (ata recor(!. A! a re! lt@ the (ata can +e a!!igne( to the correct application fiel(!. Proce!!ing !tat ! of an IDoc@ either Hgenerate(H or Hrea(y for !en(ingH. An IDoc ! ally ha! !everal !tat !e! -hich are !tore( in the !tat ! recor(! an( reveal information a+o t the IDoc hi!tory. "he c rrent (proce!!ing) !tat ! i! al!o !tore( in the control recor( for the IDoc. Stat ! confirmation 0eport from an e1ternal !y!tem a+o t the proce!!ing !tat ! of + !ine!! (ata receive( from the 0=# Sy!tem in the form of !tat ! recor(!. "he !tat ! confirmation i! a((e( to the IDoc in the 0=# Sy!tem in the form of !tat ! recor(!. 3ile -hich contain! the !tat ! recor(! !ent to the IDoc Interface +y the /DI ! +!y!tem for o t+o n( me!!age!. "he !tat ! gro p contain! !everal !tat !e! (Hmile!tone!H in the proce!! chain)@ !o that the monitoring program! only have to con!i(er the!e gro p! an( not each in(ivi( al !tat !. /1ample!) &ro p # R o t+o n() IDoc in the e1ternal !y!tem &ro p B R in+o n() IDoc !ent to the application Stat ! recor( *ne of three recor( type! in an IDoc (SAP !tan(ar( format for electronic e1change of application (ata). /ach !tat ! recor( contain! a !tat ! -hich corre!pon(! to one !tep in IDoc proce!!ing. "hi! mean! that the n m+er of !tat ! recor(! increa!e! a! the proce!!ing contin e!. "ran!lator "ran!mi!!ion file Convert! internal (ata format! (IDoc!) into /DI me!!age! an( vice ver!a. "he tran!lator i! a component of the /DI S +!y!tem. A (ata pac<et -hich contain! the me!!age! to +e e1change( electronically. "he me!!age! are /DI me!!age!@ that i!@ they are formatte( accor(ing to an /DI !tan(ar( (for e1ample /DI3AC"). "he conver!ion of the SAP !tan(ar( IDoc into the /DI !tan(ar( i! carrie( o t +y an e1ternal !y!tem (/DI ! +!y!tem).

Stat ! file Stat ! gro p

(C) SAP A&

BC621

Important 7en' Pat&


A-9 1egi#tration
IDoc initial no(e) Deve opmentMessage)App ication ob*ect

Archiving
+oo sAdministration& AdministrationData archiving

7aintaining Archiving Stat&#


IDoc initial no(e) Contro Maintain status va ues

IDoc A$mini#tration
IDoc initial no(e) Contro %Doc Administration

D* pla( IDoc
IDoc initial no(e) %DocDisp ay %Doc

IDoc In*t*al %ode


+oo s,usiness Communication& %Doc%Doc ,asis

IDoc Stat* t*c


IDoc initial no(e) %Doc%Doc Statistics

IDoc T(pe 1d*tor


IDoc initial no(e) Deve opment%Doc types

Partner Prof*le
IDoc initial no(e) %DocPartner pro$i e

Port Def*n*t*on
IDoc initial no(e) %DocPort De$initionMaintain -.C destination IDoc initial no(e) %Doc%Doc destination

Se)ment 1d*tor
IDoc initial no(e) Deve opment%Doc segments

Proce *n) Te t
IDoc initial no(e) +est/menu option according to the re0uired $unction>

7e a)e Allocat*on B IDoc T(pe


IDoc initial no(e) Deve opment%Doc type)message

(C) SAP A&

BC621

$.21,ample for 3n*t #


1,ample CStep for development of o't/o'nd proce *n) ' *n) 7CC!
P'rc&a e orderD 77 IDoc type ;ogical me!!age 3 nction mo( le * t+o n( proce!! co(e) *0D/0S81 *0D/0S ID*CN*C"PC"N*0D/0S ./18

<rder conf*rmat*onD SD IDoc type ;ogical me!!age 3 nction mo( le * t+o n( proce!! co(e) *0D/0S81 *0D0SP ID*CN*C"PC"N*0D0SP SD18

In/o'nd proce

code! T>T1 Aorkflo2C! Te,t

1,ample CDevelopment tep of *n/o'nd proce *n) /( B' *ne me a)eD *n/o'nd
IDoc type) ;ogical me!!age) *+,ect -ith metho() *ne-!tep ta!<) In+o n( proce!! co(e) "A"0A981 "A"0A9

ID*C"A"0A9..AI;C0/A"/ "S#8888885 "A"1

1,ample CDevelopment tep for *n/o'nd proce *n) ' *n) A?1 InterfaceC
C' tomer orderD SD "ran!action IDoc type ;ogical me!!age 3 nction mo( le In+o n( proce!! co(e *+,ect -ith metho( *ne-!tep ta!< 4A81 *0D/0S81 *0D/0S ID*CNI6PC"N*0D/0S *0D/ ID*C*0D/0S.I6PC"3*0/&0*C6D "S888858%6

"hi! f nction mo( le !tart! the comman( CA;; "0A6SAC"I*6 an( th ! an implicit C*..I" 9*0O (ca!e 1 in the !li(e). "hi! i! the A;/ layer (tran!action BD'1). 4A81 call! ID*CNI6PC"N*P/6 an( ID*CNI6PC"NC;*S/ in or(er to -rite the IDoc !tat ! in the !ame ;C9 (it i! HA;/-compati+leI). If error! occ r@ foregro n( proce!!ing i! po!!i+le. (C) SAP A& BC621 '

<rder ackno2led)mentD 77 IDoc type ;ogical me!!age 3 nction mo( le In+o n( proce!! co(e *+,ect -ith metho( *ne-!tep ta!< *0D/0S81 *0D0SP ID*CNI6PC"N*0D0SP *0D0 ID*C*0D0SP.I6PC"3*0/&0*C6D "S8888582'

"hi! f nction mo( le !e! API! (not a tran!action) an( (oe! not !tart a C*..I" 9*0O (ca!e 2 on the !li(e). If error! occ r@ foregro n( proce!!ing i! not po!!i+le.

(C) SAP A&

BC621

You might also like