+ All Categories
Home > Documents > idoc for R/3

idoc for R/3

Date post: 07-Aug-2018
Category:
Upload: kodatic
View: 216 times
Download: 0 times
Share this document with a friend
181
SAP R/3 IDoc Cookbook for EDI and Interfaces This book is an in-depth discussion and cookbook for IDoc developent in R/3 for EDI and eCoerce !  "here #as the $one% &one' ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ) 1.1 Communication......................................................................................................................................... 9 1.2 Psychology of Communication ............................................................................................................... 10 1.3 Phantom SAP Standards and a Calculation............................................................................................. 11 1.4 Strategy....................................................................................................................................................  12 1.5 Who s on !uty " ..................................................................................................................................... 13 1.# $arcus %. Cicero ..................................................................................................................................... 14 *  "hat Are SAP R/3 IDocs' ((((((((((((((((((((((((((((((((((((((( ((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+ 2.1 What are !ocs" ...................................................................................................................................... 1# 2.2 &'(loring a %y (ical Scenario .................................................................................................................. 1) 3  &et a ,eelin for IDocs (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !. 3.1 *et a +eeling for !ocs ........................................................................................................................... 20 3.2 %he !oc Control ,ecord........................................................................................................................ 22 3.3 %he !oc !ata......................................................................................................................................... 23 3.4 nter(reting an !oc Segment nfo..........................................................................................................  24 3.5 !oc -ase !ata/ase % a/les sed to Store !ocs................................................................................. 25  E0ercise1 Settin 2p IDocs((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( * 4.1 uicly Setting u( an &'am(le ...............................................................................................................  2) 4.2 &'am(l e %he !oc %y(e MATMAS01  .................................................................................................... 2 4.3 &'am(l e %he !oc %y(e ORDERS01  .................................................................................................... 29 +  Saple Processin Routines(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((((((((((( 34 5.1 Sam(le Processing ,outine s................................................................................................................... 31 5.2 Sam(le ut/ound ,outines....................................................................................................................  32 5.3 Sam(le n/ound ,outines ....................................................................................................................... 34  IDocs Terinolo% and 5asic Tools((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 3 #.1 -asic %erms............................................................................................................................................. 3) #.2 %e rminology ............................................................................................................................................ 3 6  IDocs Custoisin(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ! ).1 -asic Customising Settings ..................................................................................................................... 42 ).2 Creatin g an !oc Segment WE31  ............................................................................................................45 ).3 !efi nin g the $ess age %y(e 6  EDMSG7....................................................................................................  49 ).4 !efine 8 alid Com/inat ion of $essage and !oc %y (es ............................................ ....... ...................... 50 ).5 Assignin g a Processi ng +unctio n 6%a/le EDIFCT  7 .............................................................................. 51 ).# Processing Cod es.....................................................................................................................................  52 ).) n/ound Processing Code........................................................................................................................ 55 )  IDoc 7utbound Triers (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +6 .1 ndiidual A-AP ..................................................................................................................................... #0 .2 :AS% $essag es -ased ut/ound !ocs................................................................................................  #1 .3 %he ,S:AS%00 A-AP ........................................................................................................................... #3 .4 Sending !ocs 8i a ,S:AS%&! ............................................................................................................. #4 .5 Sending !ocs 8ia ,S:AS%00 .............................................................................................................. #5 .# Wo rflo; -ased ut/ound !ocs .......................................................................................................... ## .) Worflo; &ent +rom Change !ocument .............................................................................................. #) . A<& Change Pointers .............................................................................................................................. # .9 Actiation of change ( ointer u(date ....................................................................................................... #9 .10 !is(atching A<& !ocs for Change Pointers......................................................................................... )0 .  IDoc Recipes (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 6* 9.1 =o; the !oc &ngine W ors ...................................................................................................................  )3 9.2 =o; SAP Standard Processes n/ound !ocs........................................................................................ )4 9.3 =o; to Create the !oc !ata .................................................................................................................. )5 9.4 nterface Structure of !oc Proc essing +unctions ...................................................................................  )#
Transcript

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 1/181

SAP R/3 IDoc Cookbook for EDI and InterfacesThis book is an in-depth discussion and cookbook for IDoc developent in R/3 for EDI andeCoerce

!  "here #as the $one% &one' ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( )

1.1 Communication .................................................................................................................................. ....... 91.2 Psychology of Communication ............................................................................................................... 101.3 Phantom SAP Standards and a Calculation ............................................................................................. 111.4 Strategy .................................................................................................................................................... 121.5 Who s on !uty" ............................................................................................................................. ........ 131.# $arcus %. Cicero ............................................................................................................................ ......... 14

*  "hat Are SAP R/3 IDocs' ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+

2.1 What are !ocs" .................................................................................................................................. .... 1#2.2 &'(loring a %y(ical Scenario ............................................................................................................... ... 1)

3  &et a ,eelin for IDocs (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !.

3.1 *et a +eeling for !ocs .................................................................................................................... ....... 203.2 %he !oc Control ,ecord ........................................................................................................................ 22

3.3 %he !oc !ata .................................................................................................................................. ....... 233.4 nter(reting an !oc Segment nfo .......................................................................................................... 243.5 !oc -ase !ata/ase %a/les sed to Store !ocs ...................................................................... .......... . 25

  E0ercise1 Settin 2p IDocs ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( *

4.1 uicly Setting u( an &'am(le ............................................................................................................... 2)4.2 &'am(le %he !oc %y(e MATMAS01 .............................................................................................. ...... 24.3 &'am(le %he !oc %y(e ORDERS01 .............................................................................................. ...... 29

+  Saple Processin Routines (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 34

5.1 Sam(le Processing ,outines .............................................................................................................. ..... 315.2 Sam(le ut/ound ,outines .................................................................................................................... 325.3 Sam(le n/ound ,outines .................................................................................................................. ..... 34

  IDocs Terinolo% and 5asic Tools ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 3#.1 -asic %erms ...................................................................................................................................... ....... 3)#.2 %erminology ................................................................................................................................. ......... .. 3

6  IDocs Custoisin (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !

).1 -asic Customising Settings ..................................................................................................................... 42).2 Creating an !oc Segment WE31 ............................................................................................................ 45).3 !efining the $essage %y(e 6 EDMSG7 .................................................................................................... 49).4 !efine 8alid Com/ination of $essage and !oc %y(es ............................................................ ........ ..... 50).5 Assigning a Processing +unction 6%a/le EDIFCT  7 ................................................................... .......... . 51).# Processing Codes ..................................................................................................................................... 52).) n/ound Processing Code ........................................................................................................................ 55

)  IDoc 7utbound Triers (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +6

.1 ndiidual A-AP ................................................................................................................................. .... #0.2 :AS% $essages -ased ut/ound !ocs ................................................................................................ #1.3 %he ,S:AS%00 A-AP ........................................................................................................................... #3.4 Sending !ocs 8ia ,S:AS%&! ............................................................................................................. #4.5 Sending !ocs 8ia ,S:AS%00 ...................................................................................................... ........ #5.# Worflo; -ased ut/ound !ocs .................................................................................................. ........ ##.) Worflo; &ent +rom Change !ocument .............................................................................................. #). A<& Change Pointers .............................................................................................................................. #.9 Actiation of change (ointer u(date ................................................................................................. ...... #9.10 !is(atching A<& !ocs for Change Pointers .............................................................................. .......... . )0

.  IDoc Recipes (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 6*

9.1 =o; the !oc &ngine Wors ................................................................................................................... )3

9.2 =o; SAP Standard Processes n/ound !ocs ................................................................................... ..... )49.3 =o; to Create the !oc !ata .................................................................................................................. )59 4 nterface Structure of !oc Processing +unctions )#

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 2/181

9.5 ,eci(e to !eelo( an ut/ound !oc +unction ................................................................................... .. ))9.# Conerting !ata into !oc Segment +ormat ........................................................................................... )

!4  IDoc Recipes ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 6.

10.1 =o; the !oc &ngine Wors ................................................................................................................... 010.2 =o; SAP Standard Processes n/ound !ocs ................................................................................... ..... 110.3 =o; to Create the !oc !ata .................................................................................................................. 210.4 nterface Structure of !oc Processing +unctions ................................................................................... 310.5 ,eci(e to !eelo( an ut/ound !oc +unction ................................................................................... .. 410.# Conerting !ata into !oc Segment +ormat ........................................................................................... 5

!!  Partner Profiles and Ports ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( )

11.1 !oc %y(e and $essage %y(e ........................................................................................................... ...... )11.2 Partner Profiles ....................................................................................................................................... . 11.3 !efining the (artner (rofile 6 WE20  7 ...................................................................................................... 911.4 !ata Ports 6 WE21  7 ................................................................................................................................. 90

!*  R,C Reote ,unction Call  (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( .!

12.1 What s ,emote +unction Call ,+C" ...................................................................................................... 9212.2 ,+C in ,>3 .............................................................................................................................. .......... ...... 93

12.3 %ele(ort %e't !ocuments With ,+C ................................................................................................ ....... 9412.4 Calling A Command <ine 8ia ,+C " .............................................................................................. ........ 9#

!3  "orkflo8 Technolo% (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( .)

13.1 Worflo; in ,>3 and ts se for !eelo(ment ....................................................................................... 9913.2 &ent Cou(ling 6&ent <inage7 ........................................................................................................... 10013.3 Worflo; from Change !ocuments ...................................................................................................... 10113.4 %rigger a Worflo; from $essaging .................................................................................................... 10213.5 &'am(le? =o; to Create a Sam(le Worflo; =andler ......................................................................... 103

!  A9E - Application 9ink Enablin ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !46

14.1 A !istri/ution Scenario -ased on !ocs ............................................................................................... 1014.2 &'am(le A<& !istri/ution Scenario ..................................................................................................... 10914.3 A<& !istri/ution Scenario .................................................................................................................... 11114.4 seful A<& %ransaction Codes ............................................................................................................ . 11214.5 A<& Customi@ing SALE ..................................................................................................................... .. 11414.# -asic Settings SALE .............................................................................................................................. 11514.) !efine the !istri/ution $odel 6%he Scenario7 BD64 ....................................................................... 11#14. *enerating Partner Profiles WE20 ........................................................................................................ 1114.9 Creating !ocs and A<& nterface from -AP SDBG ........................................................................... 12214.10  !efining +ilter ,ules ..................................................................................................................... 12)

!+  Callin R/3 :ia 79E/;avaScript ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !34

15.1 ,>3 ,+C from $S ffice 8ia 8isual -asic .................................................................................. ........ 13115.2 Call %ransaction +rom 8isual -asic for W,! 9) ................................................................... ........ ... 13215.3 ,>3 ,+C from BaaScri(t ...................................................................................................................... 13415.4 ,>3 ,+C><& %rou/leshooting ................................................................................................... ......... 13)

!  5atch Input Recordin ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !3)

1#.1 ,ecording a %ransaction With SHDB ........................................................................................... ......... 1391#.2 =o; to se the ,ecorder &fficiently .................................................................................................. .. 1421#.3 nclude -!C,&CDD to ,e(lace -!C,&CDD ................................................................... .......... . 1431#.4 -,C,&CDDE+-E*&: *enerate a +unction from ,ecording ............................................ .......... 145

!6  EDI and International Standards ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !.

1).1 &! and nternational Standards ......................................................................................................... .. 1501).2 Characteristics of the Standards ........................................................................................................... . 1511).3 D$< ................................................................................................................................................... ... 1521).4 A:S D.12 ............................................................................................................................................. 154

!)  EDI Converter ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+

1.1 Conerter ............................................................................................................................................. .. 15)

Alphabetic Inde0 ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+)

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 3/181

9ast Pae ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !4

 

SAP R/3 made an old dream come true: enter your business data once in your computer and triggerall the following activities automatically, send the data to another computer without typing them inagain.

acts, !now"how and recipes, that is all you can e#cept from this boo$.1.   •  &sta/lish &! communication ;ith your clients or su((liers

2.   •  communicate in realtime ;ith your legacy and satellite systems

3.   •  send and receie data to and from your (roduction machine

4.   •  integrate PC or :D a((lications directly in ,>3 ;ith ,+C

5.   •  automate your /usiness from order entry to inoicing

#.   •  surey your (urchase orders for goods recei(t to clearing (ayments

%he authors $now, that nobody will believe them: but it is so imple and easy with R/3 to set up anautomated business scenario with &'ocs, A() and *or$flow

%his boo$ teaches you how SAP R/3 approaches in a coherent concept the electronic data e#changewith another computer. *ith this $now"how

Paper is out - EDI is in

+o modern global playing company will allow their suppliers any more, to deliver their order, delivery,transport and invoice information on paper. %hey reuire

Read in this book< 8h%

).   •  &! ;ill /e uneita/le in future glo/al /usiness

.   •  &! (roFects ;ith ,>3 ;ould often cost fie to ten times as much as necessary"

9.   •  !ocs and A<& are the ideal /ridge /et;een ,>3 and legacy systems

10.   •  !ocs are the frame;or for a fully automated /usiness ;orflo;

&n the technical part of the boo$ you will learn, how to

11.   •  customi@e the ,>3 !oc engine

12.   •  interface !ocs ;ith standard conerters for D.12? &!+AC%? 8!A etc.

13.   •  design your o;n !oc structures

14.   •  ;rite !oc handler (rograms in an hour

15.   •  trigger !ocs from any ,>3 a((lication ia messages or ;orflo;

1#.   •  set u( automated ;orflo; /ased on !ocs

1).   •  set u( A<& scenarios for automated data re(lications

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 4/181

PrefaceProper =no8-#o8 Saves Costs

*e always believed, what has been confirmed over and over again in manifold pro-ects: %he mainsource to cutting pro-ect costs, is a proper education of the team. iving the team members the sameboo$ to read homogenies the $nowledge and sharpens a common sense within the group.

A ,re>uentl% &iven Ans8ers 5ook

%his boo$ is the result of thousands of hours of discussion and wor$ with R/3 consultants, developerand clients about interface development from and to R/3. *hen we started a new big pro-ect inautumn 0112 at the Polar ircle, which involved a big number of interfaces, & observed curiously, thatmy developers were ordering numerous boo$s, all being related to )'&.

*ell, those boo$s did not say any word about R/3 and it was obvious that they were not very helpfulfor our team. & conseuently searched the directories for boo$s on R/3 &'ocs, but there was nothing.So & started to compile my material on &'ocs and A() with the intent to publish it in the ***. Since &submit the site http://idocs.de to some search engines & got an astonishing amount of hits. )mailsas$ed for a written version of the stuff on the web. So 4 here it is.

$%ster% EDI 2nveiled

)'& and e"commerce are miracle words in today5s &% world. (i$e any other mystery it draws its magicfrom the ignorance of the potential users. &t is true that there are many fortune ma$ing companies inthe &% world who specialie on )'&. %hey sell software and $now"how for giant sums of money.(oo$ing behind the scenes reveals, that the whole )'& business can simply be reduced to writingsome conversion programs. %his is not too easy, but the secret of )'& companies is, that the so"calledstandards are sold for a lot of money. As soon as you get hold of the documentation, things turn out tobe easy.

IDocs< A 2niversal Tool for Interface Prorain

 Although R/3 &'ocs had been introduced as a tool to implement )'& solution for R/3, it is nowaccepted as a helpful tool for any $ind of interface programming. *hile this is not taught clearly inSAP5s learning courses, we put our focus on writing an interface uic$ly and easily.

http://idocs.de

*e praise cutting edge technology. So this boo$ ta$es advantage of the modern multimedia hype.(atest updates, corrections and more sophisticated and detailed e#amples are found on our web site.

 A#el Angeli in 'ecember 0111

(ogos6 &nformati$ mb7

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 5/181

About The AuthorsA0el Aneli<

is born in 0180. 7e is a %op (evel SAP R/3 consultant and R/3 cross"application development coach.7e specialies in coaching of large multi"national, multi"language development teams andtroubleshooting development pro-ects.

7is -ob description is also $nown as computer logistics, a delicate discipline that methodically wa$esthe synergetic effects in team to accelerate and mediate &% pro-ects.

7e is a learned ybernetics scientist 9also $nown as Artificial &ntelligence in the tradition of the ;arvin;ins$y <The society of mind = and Synergetics group of 7erman 7a$en and ;aria !rell. 7iscompetence in computer science is based on the wor$s of 'onald !nuth <The Art of ComputerProgramming =, +i$las *irth 9the creator of the PASA( language, the ob-ect oriented approach asdescribed and developed during the >)R?> PAR pro-ect 9where the mouse and windows style @&shave been invented in the early 01Bies and Corland languages.

Cefore his life as SAP consultant, he made a living as a computer scientist for medical biometry andspecialist for high precision industry robots. 7e concentrates now on big international pro-ects. 7espea$s fluently several popular languages including erman, )nglish, rench and Slavic.

 š  [email protected]

Robi &onfalonieri<

 born in 018D is a senior ACAP &E developer and R/3 consultant for S' and ;;. 7e is a learnedeconomist turned ACAP &E developer. 7e specialies in international, multi"language pro-ects both asdeveloper and S' consultant. 7e spea$s fluently several languages including erman, rench,)nglish and &talian.

š  [email protected]

2lrich Streit<

 born in 01D is ACAP &E developer and interface specialist. 7e developed a serious of legacy systeminterfaces and interface monitors for several clients of the process industry. š ulisFlogosworld.de

loos8orld(co

is a group of loosely related freelance R/3 consultants and consulting companies. urrent members ofthe logosworld.com bond are the following fine companies:

(ogos6 &nformati$ mb7, CrGhl, ermany: R/3 technical troubleshooting

?So mb7, ;annheim, ermany: SAP R/3 implementation partner 

@+&(A+ orp., %e#as: ?RA() implementation competence

or true international R/3 competence and enthusiastic consultants,

email us š infoFlogosworld.de

or visit http://idocs.de

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 6/181

 +or !oris? Paul? $ini und $a'i

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 7/181

 

Danke< Thank ?ou< &ra@ias< Tack s %cket< $erci<5edankt< &raBie< Dana8ad< andri< Se-Se& due special than$s to a variety of people, clients, partners and friends. %heir insistence in finding a

solution and their way to as$ the right uestions made this boo$ only possible.& want especially honour Francis Bettendorf , who has been e#actly that genre of $nowledgeable ande#perienced &% professionals & had in mind, when writing this boo$. A man who understands analgorithm when he sees it and without being too proud to as$ precise and well"prepared uestions. 7eused to see me every day with the same phrase on the lips: H)very day one uestion.H 7e heavilyinfluenced my writing style, when & tried to write down the answers to his uestions. 7e also often gavethe pulse to write down the answers at all. At the age of IJ, he -oyfully left wor$ the evening of%uesday the J3rd ;arch 0111 after & had another fruitful discussion with him. 7e entered immortalitythe following *ednesday morning. *e will all $eep his memory in our heart.

%han$s to Detlef  and Ingmar Streit  for doing the great cartoons.

%han$s also to Pete !ellogg of @+&(A+ orp., %e#as, Kuergen ?lbricht, *olfgang Seehaus and histeam of ?So, ;annheim for continuously forming such perfect pro-ect teams. &t is -oy wor$ing withthem.

Plans are fundamentally ineffective because the Hcircumstances of our actions are never fullyanticipated and are continuously changing around usH. Suchman does not deny the e#istence or useof plans but implies that deciding what to do ne#t in the pursuit of some goal is a far more dynamic andconte#t"dependent activity than the traditional notion of planning might suggest.

*endy Suchman, >ero# PAR http://innovate.bt.com/showcase/wearables/

 "ho "ould Read This 5ook'

%his boo$ was written for the e#perienced R/3 consultants, who wants to $now more about interfaceprogramming and data migration. &t is mainly a compilation of scripts and answers who arose duringmy daily wor$ as an R/3 coach.

uid F "hat is that book about'

The R/3 Guide is a reuently iven Answers boo$. &t is a collection of answers, & have given touestions regarding )'& over and over again, both from developers, consultants and client5s technicalstaff. &t is focussed on the technical aspect of SAP R/3 &'oc technology. &t is not a tutorial, but asupplement to the R/3 documentation and training courses.

uis F "ho should read the book'

The R/3 Guide has been written with the e#perienced consultant or ACAP developer in mind. &t doesnot e#pect any special $nowledge about )'&, however, you should be familiar with ACAP &E and theR/3 repository.

uo odo F ho8 do %ou benefit fro the book'

*ell, this boo$ is a L7ow toM boo$, or a L!now"howM"boo$. The R/3 Guide has its value as acompendium. &t is not a novel to read at a stretch but a boo$, where you search the answer when youhave a uestion.

uo G2biH F "here 8ould %ou use the book'

Nou would most li$ely use the boo$ when being in a pro-ect involved in data interfaces, not necessarilya clean )'& pro-ect. &'ocs are also helpful in data migration.

uando F 8hen should %ou read the book

The R/3 Guide is not a tutorial. Nou should be familiar with the general concept of &'ocs and it ismeant to be used after you have attended an R/3 course on &'ocs, A() or similar. &nstead of attendingthe course you may alternatively read one of the R/3 &'oc tutorial on the mar$et.

Cur F "h% should %ou read the book

Cecause you always wanted to $now the technical aspects of &'oc development, which you cannotfind in any of the publicly accessible R/3 documentation.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 8/181

Table 7f Contents!  "here #as the $one% &one' ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( )

1.1 Communication .................................................................................................................................. ....... 91.2 Psychology of Communication ............................................................................................................... 101.3 Phantom SAP Standards and a Calculation ............................................................................................. 11

1.4 Strategy .................................................................................................................................................... 121.5 Who s on !uty" ............................................................................................................................. ........ 131.# $arcus %. Cicero ............................................................................................................................ ......... 14

*  "hat Are SAP R/3 IDocs' ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+

2.1 What are !ocs" .................................................................................................................................. .... 1#2.2 &'(loring a %y(ical Scenario ............................................................................................................... ... 1)

3  &et a ,eelin for IDocs (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !.

3.1 *et a +eeling for !ocs .................................................................................................................... ....... 203.2 %he !oc Control ,ecord ........................................................................................................................ 223.3 %he !oc !ata .................................................................................................................................. ....... 233.4 nter(reting an !oc Segment nfo .......................................................................................................... 243.5 !oc -ase !ata/ase %a/les sed to Store !ocs ...................................................................... .......... . 25

  E0ercise1 Settin 2p IDocs ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( *

4.1 uicly Setting u( an &'am(le ............................................................................................................... 2)4.2 &'am(le %he !oc %y(e MATMAS01 .............................................................................................. ...... 24.3 &'am(le %he !oc %y(e ORDERS01 .............................................................................................. ...... 29

+  Saple Processin Routines (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 34

5.1 Sam(le Processing ,outines .............................................................................................................. ..... 315.2 Sam(le ut/ound ,outines .................................................................................................................... 325.3 Sam(le n/ound ,outines .................................................................................................................. ..... 34

  IDocs Terinolo% and 5asic Tools ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 3

#.1 -asic %erms ...................................................................................................................................... ....... 3)

#.2 %erminology ................................................................................................................................. ......... .. 36  IDocs Custoisin (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !

).1 -asic Customising Settings ..................................................................................................................... 42).2 Creating an !oc Segment WE31 ............................................................................................................ 45).3 !efining the $essage %y(e 6 EDMSG7 .................................................................................................... 49).4 !efine 8alid Com/ination of $essage and !oc %y(es ............................................................ ........ ..... 50).5 Assigning a Processing +unction 6%a/le EDIFCT  7 ................................................................... .......... . 51).# Processing Codes ..................................................................................................................................... 52).) n/ound Processing Code ........................................................................................................................ 55

)  IDoc 7utbound Triers (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +6

.1 ndiidual A-AP ................................................................................................................................. .... #0.2 :AS% $essages -ased ut/ound !ocs ................................................................................................ #1

.3 %he ,S:AS%00 A-AP ........................................................................................................................... #3.4 Sending !ocs 8ia ,S:AS%&! ............................................................................................................. #4.5 Sending !ocs 8ia ,S:AS%00 ...................................................................................................... ........ #5.# Worflo; -ased ut/ound !ocs .................................................................................................. ........ ##.) Worflo; &ent +rom Change !ocument .............................................................................................. #). A<& Change Pointers .............................................................................................................................. #.9 Actiation of change (ointer u(date ................................................................................................. ...... #9.10 !is(atching A<& !ocs for Change Pointers .............................................................................. .......... . )0

.  IDoc Recipes (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 6*

9.1 =o; the !oc &ngine Wors ................................................................................................................... )39.2 =o; SAP Standard Processes n/ound !ocs ................................................................................... ..... )49.3 =o; to Create the !oc !ata .................................................................................................................. )5

9.4 nterface Structure of !oc Processing +unctions ................................................................................... )#9.5 ,eci(e to !eelo( an ut/ound !oc +unction ................................................................................... .. ))9.# Conerting !ata into !oc Segment +ormat ........................................................................................... )

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 9/181

!4  IDoc Recipes ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 6.

10.1 =o; the !oc &ngine Wors ................................................................................................................... 010.2 =o; SAP Standard Processes n/ound !ocs ................................................................................... ..... 110.3 =o; to Create the !oc !ata .................................................................................................................. 210.4 nterface Structure of !oc Processing +unctions ................................................................................... 310.5 ,eci(e to !eelo( an ut/ound !oc +unction ................................................................................... .. 4

10.# Conerting !ata into !oc Segment +ormat ........................................................................................... 5!!  Partner Profiles and Ports ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( )

11.1 !oc %y(e and $essage %y(e ........................................................................................................... ...... )11.2 Partner Profiles ....................................................................................................................................... . 11.3 !efining the (artner (rofile 6 WE20  7 ...................................................................................................... 911.4 !ata Ports 6 WE21  7 ................................................................................................................................. 90

!*  R,C Reote ,unction Call  (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( .!

12.1 What s ,emote +unction Call ,+C" ...................................................................................................... 9212.2 ,+C in ,>3 .............................................................................................................................. .......... ...... 9312.3 %ele(ort %e't !ocuments With ,+C ................................................................................................ ....... 9412.4 Calling A Command <ine 8ia ,+C " .............................................................................................. ........ 9#

!3  "orkflo8 Technolo% (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( .)13.1 Worflo; in ,>3 and ts se for !eelo(ment ....................................................................................... 9913.2 &ent Cou(ling 6&ent <inage7 ........................................................................................................... 10013.3 Worflo; from Change !ocuments ...................................................................................................... 10113.4 %rigger a Worflo; from $essaging .................................................................................................... 10213.5 &'am(le? =o; to Create a Sam(le Worflo; =andler ......................................................................... 103

!  A9E - Application 9ink Enablin ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !46

14.1 A !istri/ution Scenario -ased on !ocs ............................................................................................... 1014.2 &'am(le A<& !istri/ution Scenario ..................................................................................................... 10914.3 A<& !istri/ution Scenario .................................................................................................................... 11114.4 seful A<& %ransaction Codes ............................................................................................................ . 11214.5 A<& Customi@ing SALE ..................................................................................................................... .. 114

14.# -asic Settings SALE .............................................................................................................................. 11514.) !efine the !istri/ution $odel 6%he Scenario7 BD64 ....................................................................... 11#14. *enerating Partner Profiles WE20 ........................................................................................................ 1114.9 Creating !ocs and A<& nterface from -AP SDBG ........................................................................... 12214.10  !efining +ilter ,ules ..................................................................................................................... 12)

!+  Callin R/3 :ia 79E/;avaScript ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !34

15.1 ,>3 ,+C from $S ffice 8ia 8isual -asic .................................................................................. ........ 13115.2 Call %ransaction +rom 8isual -asic for W,! 9) ................................................................... ........ ... 13215.3 ,>3 ,+C from BaaScri(t ...................................................................................................................... 13415.4 ,>3 ,+C><& %rou/leshooting ................................................................................................... ......... 13)

!  5atch Input Recordin ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !3)

1#.1 ,ecording a %ransaction With SHDB ........................................................................................... ......... 1391#.2 =o; to se the ,ecorder &fficiently .................................................................................................. .. 1421#.3 nclude -!C,&CDD to ,e(lace -!C,&CDD ................................................................... .......... . 1431#.4 -,C,&CDDE+-E*&: *enerate a +unction from ,ecording ............................................ .......... 145

!6  EDI and International Standards ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !.

1).1 &! and nternational Standards ......................................................................................................... .. 1501).2 Characteristics of the Standards ........................................................................................................... . 1511).3 D$< ................................................................................................................................................... ... 1521).4 A:S D.12 ............................................................................................................................................. 154

!)  EDI Converter ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+

1.1 Conerter ............................................................................................................................................. .. 15)

Alphabetic Inde0 ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+)

9ast Pae ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !4

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 10/181

! !  "here #as the $one% &one'EDI proects can soon becoe ver% e0pensive( #o8ever< 8hen anal%sin the reasons for hih

costs< one finds >uickl% that it is not the technical ipleentation of the EDI proectthat e0plodes the total costs(

Suar%

$ost of the im(lementation time and costs get lost in agreeing on common standards and esta/lishingformalities /et;een the sender and the receier A successful &! (roFect reGuires that the deelo(ers on /oth ends sit together face to faceSticing to a (hantom HSAP standardI for !ocs? ;hich does not actually e'ist in ,>3? lets the costs of the

 (roFect soar

Kust ma$e a plan, ;ach nur einen Plan,

 And let your spirit hail. Sei ein groOes (icht,

%hen you ma$e another plan, 'ann mach noch einen weiten Plan

 And both will fail. ehen tun sie beide nicht.

Bertold Brecht and Kurt Weill, Three Penny pera

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 11/181

!(! !(!  Counication

$ore than )4 of the tie of an EDI proect is lost in 8aitin for ans8ers< tr%in to understandproposals and retrievin data nobod% actuall% needs(

&! means to e'change information /et;een a sender and a receier.

-oth communication (artners need to s(ea the same language tounderstand each other.%he language for &! is com(rised of the file formats and descri(tion languages used in the&! data files. n the sim(le case of e'changing (lain data files? the (artners need to agree ona common file format.%he time s(ent on finding an agreement of a common format ;astes a great deal of money.See a common scenario%he receiing (arty defines a file structure in ;hich it lies to receie the data. %his is usuallyan image of the data structure of the receiing com(uter installation.%his is a good a((roach for the /eginning? /ecause you hae to start some;here. -ut no; thedisaster taes course.

%he (ro(osal is sent to the other end ia email. %he deelo(er of the sender system taes aloo at it and remains Guiet. %hen he starts (rogramming and tries to sGuee@e his o;n datainto the structure.

f it /ecomes too tedious? a first hum/le a((roach taes (lace toconince the other (arty to change the initial file format. Again it is

sent ia email and the ans;er comes some days later. !ead time? /ut the consultant is (aid.t can /e een ;orse one (arty (ro(oses a format and the other (artydoes not understand the meaning of some fields.

Another field cannot /e filled? /ecause the sender does not hae theinformation. <ooing closer you find out? that the information

originated from the receiing (artner any;ay. %he (rogrammer ;ho (ro(osed the format;anted it filled Fust for his (ersonal ease. %his is no;n as Echoing, and it is al;ays a nice tohae feature.

A real disaster ha((ens if /oth (arties use the same e'(ression fordifferent items. A classic case is the term HdelieryI What is no;nas an S! trans(ort in ,>3 is no;n as a deliery in many legacy

systems.%here are many other situation ;here one thing al;ays ha((ens time is ;asted. And time ismoney.

%he solution is Guite sim(le /ring the (eo(le together. !eelo(ers of /oth (arties need to sit together? (hysically face to face. f each can

see ;hat the other (erson does? they understand each other.

 A common language

*aiting for a response

Cadly described meaningof a field

)choing

@sing the same term fordifferent ob-ects

ace to face

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 12/181

!(* !(*  Ps%cholo% of Counication

5rinin developers toether accelerates ever% proect( Especiall% 8hen both parties are souch dependent on each other as in an EDI proect< the partners need tocounicate 8ithout pause(

%here is a negatie (sychological as(ect in the communication (rocess? if the (arties on /othends do not no; each other or reduce communication ;ith each other to the a/soluteminimum?S(oradic communication leads to latent aggression on /oth sides? ;hile s(ending timetogether /uilds u( mutual tolerance. Communicating directly and regularly (ositiely affectsthe mutual res(ect. nce the (arties acce(t the com(etence of each other? they acce(t theotherJs reGuirements more readily

 What if (eo(le sit on t;o ends of the ;orld? one in America the otherin &uro(e" %he ans;er is a/solutely clear get them a /usiness classflight and send them oer the ocean.%he time you ;ill sae ;hen the (eo(le sit together com(ensates a

multitude of the trael costs. So do not thin t;ice.

Sitting together also enhances the com(rehension of the total system. An &! communicationforms a logical entity. -ut if your left hand does not no; ;hat your right hand does? you ;illneer handle things firmly and securely.

Another effect is thus a mutual learning. t means learning ho; the /usiness is e'ecuted on /oth sides. Seeing the similarities and thedifferences allo;s fle'i/ility. And it allo;s for correct decision

maing ;ithout needing to as the communication (artner.

Send them over theocean.

%ravel cost will be

refunded by the savedtime

See the business on bothends

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 13/181

!(3 !(3  Phanto SAP Standards and a Calculation

SAP R/3 delivers a serious of predefined EDI proras( $an% proect adinistrators see theas standards 8hich should not be anipulated or odified( The truth is< that theseIDoc processin functions are recoendations and e0aple routines< 8hich can bereplaced be o8n routines in custoiBin(

SAP ,>3 is deliered ;ith a series of (redefined !oc ty(es andcorres(onding handler function modules.

Some of the handler (rograms hae /een designed ;ith usere'its ;here a deelo(er canim(lement some data (ost(rocessing or add additional information to an !oc.Kou must al;ays see those (rograms as e'am(les for !oc handling. f the (rograms alreadydo ;hat you ;ant? it is Fust fine. -ut you should neer stic to those (rograms too long? if youneed different data to /e sent.

%he ,>3 standard !oc (rograms ;ere designed L consciously or not ;ith the *erman association of automo/ile manufacturers 68!A7 inmind. %he 8!A is a committee ;hich defines &! standards for their

mem/ers? e.g. 8ols;agen? -$W? !aimler-en@Chrysler. :ot eerycar manufacturer? e.g. +,! uses these recommendations. ther industries define their o;nstandards ;hich are not (resent in ,>3.f a file e'change format already e'ists for your com(any or your industry? you may ;ant touse that one. %his means ty(ing in the file format? ;riting the (rogram that fills the structureand customising the ne; !oc and message ty(es.A sim(le calculation

!iscussing the solutions 5 days

%y(ing in the file formats 1>2 dayWriting the (rogram to fill the segments 1 days

AdFust the customi@ing 1>2 day%esting and correcting eerything 3 days%rael time 2 days%otal 12 days%his is not an o(timistic calculation. Kou ;ill notice that eight out of the t;ele days areaccounting for non % related tass lie discussing solutions? educating each other and testing.f a (roFect taes longer than that? it sim(ly means that unantici(ated time ;as s(entdiscussing and ada(ting solutions? /ecause things hae changed or turned out to /e differentas initially (lanned.

Predefined not standard

R/3 &'ocs were primarilydesigned for theautomotive industry

alculation

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 14/181

!( !(  Strate%

Do not loose %our tie in plans( #ave protot%pes developed and take the as a basis(

!o not stic to the illusion? that a (ro(er design in the /eginning ;illlead to a good result. t is the age old error in trusting the theorem of

<a(lace“Tell me all the acts o the world abo!t the presence and " will

 predict the !t!re or #o!.$

<et aside the fact? that modern (hysics since =eisen/erg and hisuncertainty theorem has (roen? that een no;ing eerything a/outno;? does not allo; to (redict the future deterministically.f you ;ant to no; all the eentualities of a (roFect? you hae to /egone through similar (roFects. t is only your e'(erience that allo;syou to mae a good (lan. =o;eer? you usually do a (roFect only

once? unless you are a consultant.%he Guestion is f you hae neer /een through an &! (roFect? ho; ;ill you o/tain thenecessary e'(erience"

%he ans;er is mae a (rototy(e? a little (roFect. !o not loose yourtime in ;riting (lans and detailed deelo(ment reGuests. ,ather start

;riting a tiny (rototy(e. ntroduce this (rototy(e and maintain your solution. <isten to thearguments and im(roe the (rototy(e steadily.%his is ho; you learn.%his is ho; you succeed.

Nou cannot predict alleventualities

(aplace

7eisenberg anduncertainty

Nou do not $now thepremises before

Prototypes

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 15/181

!(+ !(+  "ho Is on Dut%'

"ritin interface proras is uch like translatin lanuaes( The sae rule appl%(

Writing interface (rograms is lie translating a language. Kou hae information distri/uted /yone system and you hae to translate this information into a format that the other system

understands.A translation should al;ays /e done /y a natie s(eaer of the target language. %his a((lies tointerface (rograms as ;ell.f data needs to /e conerted? do this al;ays in the target system. f in dou/t let the sourcesystem send eerything it can. f the target does not need the information it can ignore it.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 16/181

!( !(  $arcus T( Cicero

Soe a% have learned it in school1 the basic rules of rhetoric accordin to Cicero( ?ou 8illkno8 the ans8ers< 8hen %our prora is at its end( "h% donJt %ou ask the >uestionsin the beinnin' Ask the riht >uestion< then %ou 8ill kno8(

When starting a ne; tas? you hae al;ays to ans;er the magic HI s of rhetoric. t is asystematic ;ay to get the ans;er you need to no; any;ay.What is the su/Fect you are dealing ;ith" $ae clear the conte't youare in and that all (arties tal a/out the same.Who is inoled in the /usiness" *et the names and mae sure? thatthey no; each other /efore the (roFect enters the hot (hase.=o; do you ;ant to achiee your goal" -e sure all (artici(antschoose the same methods. And ho; do you name the things" Agree on

a common terminologyMWhere do things tae (lace" !ecide for a common (lace to ;or.!ecide the (latform? ;here elements of the (rograms should run.

When do you e'(ect a result" !efine milestones and discuss the ;hy;hen the milestones ;ere missed. Kou should al;ays chec ;hy your

initial estimate ;as ;rong? also if you are faster than (lanned.Why do you ;ant to install a certain solution" snJt there a /etteralternatie"

uid 4 *hat

uis 4 *ho

uo modo 4 how

uo 9@bi 4 where

uando " when

ur 4 *hy

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 17/181

* *  "hat Are SAP R/3 IDocs'IDocs are SAPJs file forat to e0chane data 8ith a forein s%ste( This chapter is intended as

an introduction to the concept(

Suar%

!ocs are an ASC file format to e'change data /et;een com(utersN the format is chosen ar/itrarily

!ocs are similar to segmented filesN they are not a descri(tion language lie A:S D.12? &!+AC% or D$<%he !oc contents are (rocessed /y function modules? ;hich can /e assigned in customi@ing

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 18/181

*(! *(!  "hat are IDocs'

IDocs are structured ASCII files Gor a virtual e>uivalentH( The% are the file forat used b% SAPR/3 to e0chane data 8ith forein s%stes(

!ocs are sim(le ASC data streams. When they are stored to a dis

file? the !ocs are sim(le flat files ;ith lines of te't? ;here the linesare structured into data fields. %he ty(ical structured file has records?each record starting ;ith a leading string that identifies the record

ty(e. %heir s(ecification is stored in the data dictionary.!ocs is the acronym for nterchange !ocument. %his indicates a setof 6electronic7 information ;hich /uilds a logical entity. An !oc ise.g. all the data of a single customer in your customer master data file?

or the !oc is all the data of a single inoice.!oc data is usually e'changed /et;een systems and (artners that arecom(letely inde(endent. %herefore? the data should /e transmitted in aformat that can easily /e corrected /y the com(uter o(erators. t is

therefore mandatory to (ost the data in a human reada/le form. :o;adays? this means that data is coded in ASC format? including num/ers ;hich are sentas a string of figures 0 to 9. Such data can easily /e read ;ith any te't editor on any com(uter?

 /e it a PC? $acintosh? :D System? S>390 or any internet /ro;ser.%he information ;hich is e'changed /y !ocs is called a message andthe !oc is the (hysical re(resentation of such a message. %he nameHmessagesI for the information sent ia !ocs is used in the same

;ays as other &! standards. .&ery/ody ;ho has eer dealt ;ith interface (rogramming? ;ill find!ocs ery much lie the hierarchical data files used in traditionaldata e'change.

nternational standards lie the !&%%& or 8!A formats are designed in the same ;ay as!ocs are.

ther &! standards lie D$<? A:S D.12 or &!+AC%>: are /ased on a data descri(tion language. %hey differ (rinci(ally from the!ocs conce(t? /ecause they use a (rogramming language synta' 6e.g.lie Postscri(t or =%$<7 to em/ed the data.

&'ocs are SAPQsimplementation ofstructured te#t files

)lectronic &nterchange'ocument

'ata &s transmitted in AS&& format, i.e. humanreadable form

&'ocs e#changemessages

&'ocs are used li$eclassical interface files

>;(, A+S& >:0J or)'&A% use adescription language

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 19/181

*(* *(*  E0plorin a T%pical Scenario

The IDoc process is a straiht for8ard counication scenario( A counication isre>uested< then data is retrieved< 8rapped and sent to the destination in a predefinedforat and envelope(

R/3 Database File(e.g. DB/2,

ADABAS, ORAC LE

IDoc CreatingFunction Module

IDoc

DocumentStructuredASCII File

R/3 Application

ABAP

Transaction

11 Applica tion writes

data to R/3database tables

22 An Application

request sendingof an IDoc

33 An Idoc handler 

creates the Idoc andconverts data to

 ASCII format 

M!" #12#$DIFACT ###Con%erter

(PC program

&& An external program

e!g! running on "#$converts to internationalstandards

'' Data is sent 

to receiver%e!g! via &#'%ISD" protocol

optio!al

A t(pical $DI/IDocscenario in R/3

• ,iure !1  A t%pical EDI scenario fro the vie8point of R/3

%he illustration a/oe dis(lays a setch for a ty(ical !oc communication scenario. %he ste(s

are Fust the same as ;ith eery communication scenario. %here is a reGuesting a((lication? areGuest handler and a target.%he setch sho;s the communication out/ound ,>3. !ata is leaing the ,>3 system.IDoc Document

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 20/181

An ,>3 a((lication creates data and u(dates the data/asea((ro(riately. An a((lication can /e a transaction? a standaloneA-AP ,e(ort or any tool that can u(date a data/ase ;ithin ,>3.f the a((lication thins that data needs to /e distri/uted to a foreignsystem? it triggers the !oc mechanism? usually /y leaing a

descri(tie message record in the message ta/le %&ST .%he a((lication then either directly calls the !oc engine or a collector Fo/ eentually (icsu( all due !oc messages and determines ;hat to do ;ith them.

f the engine /eliees that data is ready to /e sent to a (artner system?then it determines the function module ;hich can collect and ;ra( thereGuired !oc data into an !oc.

n !oc customising? you s(ecify the name of the function module to use. %his can either /eone ;hich is (redefined /y ,>3 standard or a user;ritten one.

When the !oc is created it is stored in an ,>3 ta/le and from there itis sent to the foreign system.

f the foreign system reGuires a s(ecial conersion? e.g. to D$<?&!+AC% or D.12 then this Fo/ needs to /e done /y an e'ternalconerter? lie the See/urger &<O& system. %hese conerters arenot (art of ,>3.

f you hae to decide on a conerter solution? ;e strongly recommend using a (lain PC /asedsolution. Conersion usually reGuires a lot of fine tuning ;hich stands and falls ;ith theGuality of the (roided tools.

R/3 application createsdata

&'oc engine pic$s up thereuest

&'oc engine determinesa handler function fromcustomising

&'oc is bac$up up in R/3and sent out

onversion to standardsis done by e#ternalprogram

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 21/181

3 3  &et a ,eelin for IDocsIDocs are relativel% siple to understand( 5ut< like ost siple thins the% are difficult to

e0plain( In this chapter 8e 8ant to look at soe IDocs and describe their eleents< sothat %ou can et a feelin for the(

Suar%

%he first record in an !oc is a control record descri/ing the content of the dataAll /ut the first record are data records ;ith the same formal record structure&ery record is tagged ;ith the segment ty(e and follo;ed /y the segment data%he inter(retation of the segment is done /y the !oc a((lication-oth sent and receied !ocs are logged in ,>3 ta/les for further reference and archiing (ur(oses

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 22/181

3(! 3(!  &et a ,eelin for IDocs

,or the beinnin 8e 8ant to ive %ou a feelin of 8hat IDocs are and ho8 the% a% look <8hen %ou receive the as plain te0t files(

!ocs are /asically a small num/er of records in ASC format?

 /uilding a logical entity. t maes sense to see an !oc as a (lain andsim(le ASC te't file? een if it might /e trans(orted ia other means.

Any !oc consists of t;o sections

the control record;hich is al;ays the first line of the file and (roides the administratie information.the data record;hich contains the a((lication de(endent data? as in our e'am(le /elo; the material masterdata.We ;ill discuss the e'change of the material master !oc M&TM&S  in the (aragra(hs that

follo;..%he definition of the !oc structure M&TM&S'( is de(osited in thedata dictionary and can /e ie;ed ;ith )E*' .

IDOC "um#er Se!der Recei$er Port %e&&age 'pe IDoc 'pe

000012345# ,3PA,S ,3$&:C=&: +<& ,!&,S ,!&,S01• ,iure *1  Siplified e0aple of an IDoc control record for sales orders

Segme!t'pe Sold)'o S*ip)'o +alue Deldate &er

,!&,=&A!&, 10 109 12500?50 2412199 $icy $aus• ,iure 31  Siplified e0aple of an IDoc data record for sales orders

&'ocs are plain AS&&files 9resp. a virtualeuivalent

ontrol record plus manydata records 0 &'oc

&'ocs are defined in*)30

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 23/181

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 24/181

3(* 3(*  The IDoc Control Record

The ver% first record of an IDoc packae is al8a%s a control record( The structure of thiscontrol record is the DDic structure EDIDC  and describes the contents of the datacontained in the packae(

%he control record carries all the administratie information of the!oc? such as its origin? its destination and a categorical descri(tionof the contents and conte't of the attached !oc data. %his is erymuch lie the enelo(e or coer sheet that ;ould accom(any any

 (a(er document sent ia (ostal mail.+or ,>3 in/ound (rocessing? the control record is used /y the standard!oc (rocessing mechanism to determine the method for (rocessingthe !oc. %his method is usually a function module /ut may /e a

 /usiness o/Fect as ;ell. %he (rocessing method can /e fullycustomised.

nce the !oc data is handed oer to a (rocessing function module?

you ;ill no longer need the control record information. %he functionmodules are a;are of the indiidual structure of the !oc ty(e and themeaning of the data. n other ;ords for eery conte't and synta' of

an !oc? you ;ould ;rite an indiidual function module or /usiness o/Fect 6note a /usinesso/Fect is also a function module in ,>37 to deal ;ith.

%he control record has a fi'ed (redefined structure? ;hich is definedin the data dictionary as  ED"D+  and can /e ie;ed ;ith SE(( in the,>3 data dictionary. %he header of our e'am(le ;ill tell us? that the!oc has /een receied from a sender ;ith the name -+%T('' 

and sent to the system ;ith the name DE0+%T('' . t further tells us that the !oc is to /einter(reted according to the !oc definition called $A%$AS01 .  %A'%AS- ... DE+CL"'-- PROCL"'-- ...

• ,iure 1  Scheatic e0aple of an IDoc control record

%he senderQs identification -+%T('' tells the receier ;ho sentthe !oc. %his seres the (ur(ose of filtering un;anted data and also

 (roides the o((ortunity to (rocess !ocs differently ;ith res(ect to the sender.%he receierQs identification DE0+%T('' should /e included in the!oc header to mae sure that the data has reached the intended

reci(ient.%he name of the !oc ty(e M&TM&S'( is the ey information for the

!oc (rocessor. t is used to inter(ret the data in the !oc records?;hich other;ise ;ould /e nothing more than a seGuence of meaningless characters.

ontrol record serves ascover slip for thetransport

ontrol record is used bythe receiver to determinethe processing algorithm

ontrol record not

necessary to process the&'oc 'ata

ontrol Record structureis defined as !DIDC  in''ic

Sender 

Receiver 

&'oc %ype

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 25/181

3(3 3(3  The IDoc Data

All records in the IDocs< 8hich coe after the control record are the IDoc data( The% are allstructured alike< 8ith a seent inforation part and a data part 8hich is !444characters in lenth< fillin the rest of the line(

All records of an !oc are structured the same ;ay? regardless of theiractual content. %hey are records ;ith a fi'ed length segment info (artto the left? ;hich is follo;ed /y the segment data? ;hich is al;ays1000 characters long.We ;ill e'amine an !oc of ty(e M&TM&S'( . %he !oc ty(e

 M&TM&S'( is used for transferring material master data ia A<&. Koucan ie; the definition of any !oc data structure directly ;ithin ,>3

;ith transaction WE30. Segme!t I!o Segme!t Data)à  

...E%ARA% ....-------201345 $aterial /ase segment

...E%ARC% ....PL-5 Plant Segment

...E%ARD% ....SL- Storage location data

...E%ARD% ....SL-2 Another storage location

...E%ARC% ....PL-2 Another (lant

E6ample o a! IDoc 7it* o!e &egme!t per li!e, a! i!o tag to t*e let o eac* &egme!t a!d t*e IDoc datato t*e rig*t

 ,egardless of the used !oc ty(e? all !ocs are stored in the samedata/ase ta/les ED"D1 for release 4.' and ED"D* for release 2.' and3.'. -oth release formats are slightly different ;ith res(ect to the

lengths of some fields. Please read the cha(ter on (ort ty(es for details.!e(ending on the ,>3 release? the !oc data records are formatted either according the !!icstructure ED"D* or  ED"D*. %he difference /et;een the t;o structures reflects mainly thechanges in the ,>3 re(ository? ;hich allo; longer names starting from release 4.'.

 All &'oc data record havea segment info part and0BBB characters for data

&'oc type definition canbe edited with WE30

'ata and segment infoare stored in !DID"

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 26/181

3( 3(  Interpretin an IDoc Seent Info

All IDoc data records are e0chaned in a fi0ed forat< reardless of the seent t%pe( TheseentJs true structure is stored in R/3Js repositor% as a DDic structure of the saenae(

%he segment info tells the !oc (rocessor ho; the current segmentdata is structured and should /e inter(reted. %he information? ;hich isusually the only interest? is the name of the segment ED"D12

SEG%&M .%he segment name corres(onds to a data dictionary structure ;ith thesame name? ;hich has /een created automatically ;hen defining the!oc segment definition ;ith transaction WE31 .+or most a((lications? the remaining information in the segment infocan /e ignored as /eing redundant. Some older? nonSAPcom(liant

 (artners may reGuire it. &.g. the !oc segment info ;ill also store theuniGue segment num/er for systems? ;hich reGuire numeric segment identification.

%o hae the segment made u( for (rocessing in an A-AP? it is usually ;ise to moe thesegment data into a structure? ;hich matches the segment definition.+or a segment of ty(e e(maram the follo;ing coding is commonly used

 'ABLES8 emaram.  . . .%O+E edidd)&data 'O emaram.

%hen you can access the fields of the !oc segment ED"DD2SD&T& as fields of the structuree(maram  .

9RI'E8 emaram)mat!r.

%he follo;ing coding sam(le? sho;s ho; you may read a M&TM&S  !oc and e'tract the data for the M&-& and M&-+ segments to some

internal aria/les and ta/les.DA'A8 6mara LI:E emaram.

!A%A tmarc AS S%A:!A,! %A-<& + e1marcmW%= =&A!&, <:&.

<P A% edidd.  CAS& ediddsegnam.

W=&: Q&1$A,A$Q.  $8& ediddsdata % 'mara.

W=&: Q&1$A,C$Q.  $8& ediddsdata % tmarc.

  APP&:! tmarc.  &:!CAS&.&:!<P.now do something with xmara and tmarc!

R/3 is only interested inthe segment name

Segment name tells thedata structure

Remaining information isonly for foreign systems

'ata in )'&'D"S'A%A

'ata in )'&'D"S'A%A

Sample coding

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 27/181

3(+ 3(+  IDoc 5ase - Database Tables 2sed to Store IDocs

"hen R/3 processes an IDoc via the standard inbound or outbound echanis< the IDoc isstored in the tables( The control record oes to table EDIDC  and the data oes to tableEDID4(

All !oc? ;hether sent or receied are stored in the ta/le ED"D1. %hecorres(onding control file header goes into ED"D+ .

%here are standard (rograms that read and ;rite the data to and from the !oc /ase. %hese (rograms and transaction are heaily de(endent on the customising? ;here rules are defined;hich tell ho; the !ocs are to /e (rocessed.

f course? as !ocs are nothing more than structured ASC data? youcould al;ays (rocess them directly ;ith an A-AP. %his is certainlythe Guic and dirty solution? /y(assing all the internal checs and

 (rocessing mechanisms. We ;ill not reinent the ;heel here.%o do this customising setting? chec ;ith transaction WEDI and seethe (oints? dealing ;ith (orts? (artner (rofiles? and all under !ocdeelo(ment.

 

• ,iure +1  Tables used to store the IDoc 8ithin R/3

 

 All inbound andoutbound 'ocuments arestored in )'&'D

 Avoid reinventing thewheel

ustomising is done from

the central menu WEDI

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 28/181

  E0ercise1 Settin 2p IDocsThe best 8a% to learn is b% doin( This chapter tells %ou ho8 to set up %our R/3 s%ste so that

it can send IDocs to itself( "hen sendin IDocs to %our o8n s%ste %ou can test theprocedures 8ithout the need for a second client or installation(

Suar%

!efine a ne; internal ,+C destination :%&,:A<&'(lore /oth the transactions W&! and SA<& and adFust the settings as necessaryse transaction -A<& to generate an ar/itrary !oc

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 29/181

(! (!  uickl% Settin up an E0aple

If %ou have a naked s%ste< %ou cannot send IDocs iediatel%( This chapter 8ill uide %outhrouh the iniu steps to see ho8 the IDoc enine 8orks(

Kou can access most of the transactions used in the e'am(le /elo; in the menu W&! and

SA<&.We ;ill assume? that ;e ;ant to send material master data from thecurrent system to a remote system. %o simulate this scenario ;e do not

need to hae a second system. With a little tric? ;e can set u( the system to send an !oc /ac to the sending client.We ;ill set u( the system to use an ,+C call to itself. %herefore ;e need to define an ,+Cremote destination? ;hich (oints /ac to our o;n client. %here is a irtual ,+C destinationcalled NONE ;hich al;ays refers to the calling client.

,+C destinations are installed ;ith the transaction S$59. Create ane; ,>3 destination of ty(e < 6<ogical destination7 ;ith the nameINTERNAL and the destination NONE.

 :ote !o not use ,+C ty(e internal. Although you could create them manually? they areresered for /eing automatically generated. =o;eer? there is the internal connection::& or -ACO ;hich ;ould do the same Fo/ as the destination ;e are creating no;.

%he ne't ste( is defining a data (ort? ;hich is referenced /y the !ocsending mechanism to send the !oc through. !eclaring the (ort isdone /y transaction W&21.We ;ill no; declare an A<& connection from our client to the (artnerINTERNAL. A<& uses !ocs to send data to a remote system. %here is aconenient transaction to send material master data as !ocs ia the

A<&.

%he set u( is done in transaction SA<&. Kou first create a ne; A<&model? to aoid interfering ;ith eentual e'isting definitions. %henyou sim(ly add the !oc message MATMAS as a alid (ath from yourclient to INTERNAL.n order to send the !oc? you call the transaction -A<& and choosethe distri/ution of material master data 6-!107. Choose a material?enter INTERNAL as receier and go.%o see? ;hich !ocs hae /een sent? you can use the transactionW&05. f you did eerything as descri/ed a/oe? you ;ill find the

!ocs ;ith an error status of 29? meaning that there is no alid (artner (rofile. %his is true? /ecause ;e hae not defined one yet.

hec$ )'&'D with S)08

'eclare the Rdestination to receive the&'oc

'efine a data port forINTERNAL

'eclare a new A()model with SA() .

'eclareMATMAS01

 as a

valid A() ob-ect to besent to INTERNAL

Send the &'oc withtransaction CA().

'isplay &'ocs with *)BI

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 30/181

(* (*  E0aple1 The IDoc T%pe  MATMAS01 

To sharpen %our understandin< 8e 8ill sho8 %ou an e0aple of an IDoc of t%pe  MATMAS01<

8hich contains aterial aster data(

 :ote Kou can chec ;ith transaction W&05 ? if there are already any !ocs in your system.

Kou can call transaction W&30 to dis(lay the structure of the doc ty(eof the found !oc.

-elo; is the dis(lay of an !oc of ty(e MATMAS01. 

• ,iure 1  Structure of the $AT$AS4! Idoc t%pe

 MATMAS01 mirrors ;idely the structure of ,>3Js material master entity.

f this !oc ;ould hae /een ;ritten to a file? the file content ;ouldhae looed similar to this

...%A'%AS- DE+CL"'-- I"'ER"AL...

...&1$A,A$ ...and here the data

...&1$A,C$ ...and here the data

...&1$A,!$ ...and here the data

&'oc structure can beseen with *)3B

ontent of &'oc file

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 31/181

(3 (3 

E0aple1 TheIDoc T%peORDERS01 

To allo8 an

interference< here is a saple of IDoc t%pe ORDERS01 8hich is used for purchase

orders and sales orders(

Purchasing and sales orders naturally share the same !oc ty(e /ecause ;hat is a (urchaseorder on the sender side ;ill /ecome a sales order on the receier side.ther than MATMAS01? the !oc ty(e ORDERS01 does not reflect the structure of the underlying,!- entity? neither the one of S! 68A017 nor the one of $$ 6$&217. %he structure is rather

deried from the &! standards used in the automo/ile industry. nfortunately? this does notmae it easier to read.

 :ote With transaction W&05 you can monitor? if there are already any !ocs in your system.Kou can call transaction W&30 to dis(lay the structure of the !oc ty(e of the found !ocf this !oc ;ould hae /een ;ritten to a file? the file content ;ould hae looed similar tothis...ORDERS- DE+CL"'-- I"'ER"AL...

...&1&!OA1 ....and here the data

...&1&!OA2 ....and here the data

...&1&!P19 ....and here the data• ,iure 61  Structure of the 7RDERS4! IDoc t%pe

ORDERS01 is used for

purchasing and salesorder data

&'oc structure can beseen with *)3B

ontent of &'oc file

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 32/181

+ !  Saple Processin RoutinesThis chapter deonstrates ho8 an IDoc is prepared in R/3 for outbound and ho8 a receivin

R/3 s%ste processes the IDoc(

K ee(I t

S im(le and

S mart

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 33/181

+(! !(!  Saple Processin Routines

Creatin and processin IDocs is priaril% a echanical task< 8hich is certainl% true for ostinterface prorain( "e 8ill sho8 a short e0aple that packs SAP R/3 SAPscriptstandard te0t eleents into IDocs and stores the(

ut/ound !ocs from ,>3 are usually created /y a function module.%his function module is dynamically called /y the !oc engine. Aso(histicated customising defines the conditions and (arameters to find the correct functionmodule.%he interface (arameters of the (rocessing function need to /e com(ati/le ;ith a ;elldefinedstandard? /ecause the function module ;ill /e called from ;ithin another (rogram.

!oc in/ound functions are function modules ;ith a standardinterface? ;hich ;ill inter(ret the receied !oc data and (re(are it for 

 (rocessing.%he receied !oc data is (rocessed record /y record and inter(reted according to thesegment information (roided ;ith each record. %he (re(ared data can then /e (rocessed /y

an a((lication? a function module? or a self;ritten (rogram.%he e'am(le (rograms in the follo;ing cha(ters ;ill sho; you ho; te'ts from the te't (oolcan /e conerted into an !oc and (rocessed /y an in/ound routine to /e stored into anothersystem.%he follo;ing ;ill gie you the /asics to understand the e'am(le

SAP ,>3 allo;s the creation of te't elements? e.g. ;ith transactionS10. &ach standard te't element has a control record ;hich is stored

in ta/le S%D=. %he te't lines themseles are stored in a s(ecial cluster ta/le. %o retriee thete't from the cluster? you ;ill use the standard function module u!ctio! READ;'E<' .We ;ill read such a te't and (ac it into an !oc. %hat is ;hat the follo;ing sim(le functionmodule does.f there is no conenient routine to (rocess data? the easiest ;ay to hand oer the data to ana((lication is to record a transaction ;ith transaction S=!- and create a sim(le (rocessingfunction module from that recording.

ut/ound routines are called /y the triggering a((lication? e.g. the,S:AS%00 (rogram.

n/ound (rocessing is triggered /y the central !oc in/ound handler?;hich is usually the function module "D+3"%4T  . %his function isusually actiated /y the gateee(er ;ho receies the !oc.

?utbound function

&nbound function

%e#t from R)A'%)>%

?utbound is triggered bythe application

&nbound is triggered byan e#ternal event

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 34/181

+(* !(*  Saple 7utbound Routines

The ost difficult 8ork 8hen creatin outbound IDocs is the retrieval of the application data8hich needs sendin( 7nce the data is retrieved< it needs to be converted to IDocforat< onl%(

F"C'IO"

RRR<oale SchnittstelleR $P,%:*R 8A<&6E%!-B&C%7 <O& %=&A!%!-B&C% !&+A<% Q%&D%QR 8A<&6E%!!7 <O& %=&A!%!! !&+A<% QS%QR 8A<&6E%!:A$&7 <O& %=&A!%!:A$&R 8A<&6E%!SP,AS7 <O& %=&A!%!SP,AS !&+A<% SK<A:*R &DP,%:*R 8A<&6&E%=&A!7 <O& %=&A! S%,C%,& %=&A!

R %A-<&SR !CE!A%A S%,C%,& &!!! P%:A<R !CEC:%,< S%,C%,& &!!C P%:A<R %<:&S S%,C%,& %<:& P%:A<RR RRR ,eading the a((lication !ata RRRR  CA<< +:C%: Q,&A!E%&D%Q  &DP,%:*  ! %E=&A!%!!  <A:*A*& %E=&A!%!SP,AS  :A$& %E=&A!%!:A$&

  -B&C% %E=&A!%!-B&C%  $P,%:*  =&A!&, &E%=&A!  %A-<&S  <:&S %<:&S.R RRR Pacing the a((lication data into !oc

$8& &E%=&A! % !CE!A%AS!A%A.  $8& QKADDE%=&A!Q % !CE!A%AS&*:A$.  APP&:! !CE!A%A.  <P A% %<:&S.

$8& &E%=&A! % !CE!A%AS!A%A.

R RRR ;e still need to fill more segment info$8& QKADDE%<:&Q % !CE!A%AS&*:A$.

  APP&:! !CE!A%A.  &:!<P.R RRR Pacing the !oc control record RRRR C<&A, !CEC:%,<.  !CEC:%,<!C%P QKADDE%&D%Q.R RRR ;e still should fill more control record info  APP&:! !CEC:%,<.&:!+:C%:.• ,iure !1  Saple IDoc outbound function odule

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 35/181

We ;ill sho; a short e'am(le that (acs SAP ,>3 Sa(Scri(t standardte't elements into !ocs and stores them /ac to te'ts in a second

routine. %he te't elements can /e edited ;ith S10.&ach ,>3 standard te't element has a header record ;hich is stored inta/le S%D=. %he te't lines themseles are stored in a s(ecial cluster

ta/le. %o retriee the te't from the cluster? you ;ill use the standard function moduleu!ctio! -E&D3TE5T .

%he (rogram /elo; ;ill retriee a te't document from the te't (ool?conert the te't lines into !oc format? and create the necessary

control information.%he first ste( is reading the data from the a((lication data/ase /y calling the function module,&A!E%&D%.= === ))) Readi!g t*e applicatio! Data ))) ====

  CA<< +:C%: Q,&A!E%&D%Q  &DP,%:*

  ! %E=&A!%!!  <A:*A*& %E=&A!%!SP,AS  :A$& %E=&A!%!:A$&  -B&C% %E=&A!%!-B&C%  $P,%:*  =&A!&, &E%=&A!  %A-<&S  <:&S %<:&S.• ,iure *1  Readin data

ur ne't duty is to (ac the data into the !oc record. %his means moing the a((lication

data to the data (art of the !oc record structure &!!! and filling the corres(ondingsegment information.= === ))) Pac>i!g t*e applicatio! data i!to Idoc

  $8& &E%=&A! % !CE!A%AS!A%A.R the receier needs the segment name

in order to inter(ret the segment  $8& QKADDE%=&A!Q % !CE!A%AS&*:A$.  APP&:! !CE!A%A.  <P A% %<:&S.

$8& &E%=&A! % !CE!A%AS!A%A.

R RRR ;e still need to fill more segment info$8& QKADDE%<:&Q % !CE!A%AS&*:A$.  APP&:! !CE!A%A.  &:!<P.• ,iure 31  Convertin application data into IDoc forat

+inally? ;e hae to (roide a correctly filled control record for this !oc. f the !oc routineis used in a standard automated enironment? it is usually sufficient to fill the field &!!C!C%P ;ith the !oc ty(e? &!!C$&S%KP ;ith the conte't message ty(e and thereceier name. %he remaining fields are automatically filled /y the standard (rocessingroutines if a((lica/le.

= === ))) Pac>i!g t*e Idoc co!trol record ))) ====

 C<&A, !C C:%,<.

 

%e#t from R)A'%)>%

?utbound processing

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 36/181

R RRR ;e still need to fill more control rec info  APP&:! !CEC:%,<.• ,iure 1  ,illin control record inforation

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 37/181

+(3 !(3  Saple Inbound Routines

Inbound processin is basicall% the reverse process of an outbound(( The received IDoc has tobe unpacked< interpreted and transferred to an application for further processin(

F"C'IO"

()**********************************************************************

RR<oale SchnittstelleR $P,%:*R 8A<&6:P%E$&%=!7 <O& -!W+APEPA,:P%$&%=!R 8A<&6$ASSEP,C&SS:*7 <O& -!W+APEPA,$ASSEP,CR &DP,%:*R 8A<&6W,O+<WE,&S<%7 <O& -!W+APEPA,,&S<%R 8A<&6APP<CA%:E8A,A-<&7 <O& -!W+APEPA,APP<E8A, R 8A<&6:EP!A%&E%ASO7 <O& -!W+APEPA,P!A%&%ASO R 8A<&6CA<<E%,A:SAC%:E!:&7 <O& -!W+APEPA,CA<<%,A:S

R %A-<&SR !CEC:%,< S%,C%,& &!!CR !CE!A%A S%,C%,& &!!!R !CES%A%S S%,C%,& -!!CS%A%R ,&%,:E8A,A-<&S S%,C%,& -!W+,&%8A, R S&,A<A%:E:+ S%,C%,& -!ES&, R  DA'A8 <'?EAD LI:E '?EAD .

  !A%A %<:&S <O& %<:& CC,S 0 W%= =&A!&, <:&. C<&A, D%=&A!.

,&+,&S= %<:&S.( ((( *** +npac,ing the IDoc *** (((

  LOOP A' IDOC;DA'A.

  CAS& !CE!A%AS&*:A$.  W=&: QKADDE%=&A!Q.  $8& !CE!A%AS!A%A % D%=&A!.  W=&: QKADDE%<:&Q.  $8& !CE!A%AS!A%A % %<:&S.  &:!CAS&.  &:!<P.( ((( *** Calling the application to process the received data *** (((

  CALL F"C'IO" @SA+E;'E<'@

  &DP,%:*  =&A!&, D%=&A!  SA8&$!&E!,&C% QDQ  %A-<&S  <:&S %<:&S.  A!! SKS-,C % O.( f-llen ID.CStatus

R fill !CEStatus

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 38/181

  IDOC;S'A'S)DOC"% IDOC;CO"'RL)DOC"%.

  !CES%A%S$S*81 !CEC:%,<!C%P.  !CES%A%S$S*82 D%=&A!.  !CES%A%S$S*! Q3Q.

  !CES%A%S$S*: Q000Q.  + O :& 0.  !CES%A%SS%A%S Q51Q.  !CES%A%S$S*%K Q&Q.  &<S&.  !CES%A%SS%A%S Q53Q.  !CES%A%S$S*%K QSQ.  CA<<E%,A:SAC%:E!:& QDQ.  &:!+.  APP&:! !CES%A%S.&:!+:C%:.

• ,iure +1  Saple IDoc outbound function odule

%his e'am(le of a sim(le in/ound function module e'(ects as in(ut an!oc ;ith ro;s of (lain te't as created in the out/ound e'am(lea/oe. %he (rocedure ;ill e'tract the te't name and the te't line from

the !oc and hand oer the te't data to the function module S&0E3TE5T  ;hich ;ill store thete't in the te't (ool.

%he receied !oc data is (rocessed record /y record and data issorted out according to the segment ty(e.

= === ))) !pac>i!g t*e IDoc ))) ===

  <P A% !CE!A%A.//  CAS& !CE!A%AS&*:A$.  W=&: QKADDE%=&A!Q.  P&,+,$ :PACOE!C %A-<&S !CE!A%A S:* D%=&A!.  W=&: QKADDE%<:&Q.  P&,+,$ :PACOE%A- %A-<&S !CE!A%A %<:&S.  &:!CAS&.  &:!<P. When the !oc is un(aced data is (assed to the a((lication.= === ))) Calli!g t*e applicatio! to proce&& t*e recei$ed data ))) ===

  CA<< +:C%: QSA8&E%&D%Q  &DP,%:*  =&A!&, D%=&A!  %A-<&S  <:&S %<:&S.• ,iure 1  Storin data

+inally the (rocessing routine needs to (ass a status record to the !oc (rocessor. %his statusindicates successful or unsuccessful (rocessing and ;ill /e added as a log entry to the ta/le&!!S.= ll IDOC;Statu&

  + O :& 0.

&nbound processingfunction module

@npac$ing the &'oc data

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 39/181

R !CES%A%S.. . fill the other fields to log information  &<S&.  !CES%A%SS%A%S Q53Q.  &:!+.  APP&:! !CES%A%S.

• ,iure 61  "ritin a status lo

%he status alue Q51Q indicates a general error during a((lication (rocessing and the status Q53Qindicates eerything is O.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 40/181

*  IDocs Terinolo% and 5asic ToolsThis chapter addresses coon e0pressions used in conte0t 8ith IDocs( ?ou should be

failiar 8ith the( Soe are also used in non-IDoc conte0t 8ith a copletel% differenteanin< e(( the ter message< so avoid isunderstandins( $an% fihts in proectteas arise fro different interpretations of the sae e0pression(

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 41/181

(! *(!  5asic Ters

There are several coon e0pressions and ethods that %ou need to kno8< 8hen dealin8ith IDoc(

%he message ty(e defines the semantic conte't of an !oc. %he

message ty(e tells the (rocessing routines? ho; the message has to /einter(reted.%he same !oc data can /e sent ;ith different message ty(es. &.g. %he same !oc structure;hich is used for a (urchase order can also /e used for transmitting a sales order. magine thesituation that you receie a sales order from your clients and in addition you receie co(ies of sales orders sent /y an su/sidiary of your com(any.

An !oc ty(e defines the synta' of the !oc data. t tells ;hichsegments are found in an doc and ;hat fields the segments are made

of.%he (rocessing code is a logical name that determines the (rocessingroutine. %his (oints usually to a function module? /ut the (rocessing

routine can also /e a ;orflo; or an eent.%he use of a logical (rocessing code maes it easy to modify the (rocessing routine for aseries of (artner (rofiles at once.

&ery senderreceier relationshi( needs a (rofile defined. %his onedetermines

7   •  the (rocessing code

8   •  the (rocessing times and conditions

9   •  and in the case of out/ound !ocs

10   •  the media (ort used to send the !oc and

11   •  the triggers used to send the !oc%he !oc (artners are classified in logical grou(s. ( to release 4.5there ;ere the follo;ing standard (artner ty(es defined <S? O? <.%he logical system is meant to /e a different com(uter and ;as

 (rimarily introduced for use ;ith the A<& functionality. Kou ;oulduse a (artner ty(e of <S? ;hen lining ;ith a different com(uter system? e.g. a legacy orsu/system.

%he (artner ty(e customer is used in classical &! transmission todesignate a (artner? that reGuires a serice from your com(any or is inthe role of a de/tor ;ith res(ect to your com(any? e.g. the (ayer? sold

to(arty? shi(to(arty.%he (artner ty(e su((lier is used in classical &! transmission todesignate a (artner? that deliers a serice to your com(any. %his isty(ically the su((lier in a (urchase order. n S! orders you also find

< ty(e (artners? e.g. the shi((ing agent.

;essage %ype

&'oc %ype

Processing ode

Partner profile

Partner %ype

(S " (ogical Systems

!@ " ustomer <ger.:!unde=

(& " Supplier <er.:(ieferant=

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 42/181

!!(! *(*  Terinolo%

;essage %ype 4 7ow to !now *hat the 'ata ;eans

Data e0chaned b% an IDoc via EDI is kno8n as essae( $essaes of the sae kind belon

to the sae essae t%pe( 

%he message ty(e defines the semantic conte't of an !oc. %hemessage ty(e tells the receierho; the message has to /e inter(reted.

%he term message is commonly used in communication? /e it &! ortelecommunication. Any stream of data sent to a receier ;ith ;elldefined information in itis no;n as a message. &!+AC%?A:S>D.12? D$< and others use message the same ;ay.nfortunately? the term message is used in many conte'ts other than&! as ;ell. &en ,>3 uses the ;ord message for the internal

communication /et;een a((lications. While this is totally O fromthe a/stract (oint of ie; of data modelling? it may sometimes causeconfusion if it is unclear ;hether ;e are referring to !oc messages or 

internal messages.%he s(ecification of the message ty(e along ;ith the sent !oc (acage is es(eciallyim(ortant ;hen the (hysical !oc ty(e 6the data structure of the !oc file7 is used fordifferent (ur(oses.A classical am/iguity arises in communication ;ith customs ia &!. %hey usually set u( auniersal file format for an ar/itrary ind of declaration? e.g. ntrastat? &'trastat? &'(ortdeclarations? monthly re(orts etc. !e(ending on the message ty(e? only a((lica/le fields arefilled ;ith alid data. %he message ty(e tells the receier ;hich fields are of interest at all.

Partner Profiles 4 7ow to !now the ormat of the Partner 

Different partners a% speak different lanuaes( "hile the inforation reains the sae<different receivers a% re>uire copletel% different file forats and counicationprotocols( This inforation is stored in a partner profile(

n a (artner (rofile you ;ill s(ecify the names of the (artners ;hichare allo;ed to e'change !ocs to your system. +or each (artner youhae to list the message ty(es that the (artner may send.

+or any such message ty(e? the (rofile tells the !oc ty(e? ;hich the (artner e'(ects for that ind of message.

+or out/ound (rocessing? the (artner (rofile also sets the media totrans(ort the data to its receier? e.g.

12   •  an o(erating system file

13   •  automated +%P

14   •  D$< or &!+AC% transmission ia a /roer>conerter 

15   •  internet

16   •  direct remote function call

%he means of trans(ort de(ends on the receiing (artner? the !oc ty(e and message ty(e6conte't7.

'efine the semanticconte#t

;essages areinformation for a foreignpartner 

%he term message isalso used for R/35sinternal communication

between applications

Partner profiles are thecatalogue of active )'&connection from and toR/3

Partner profiles store the&'oc type to use

?utbound customisingagrees how data iselectronically e#changed

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 43/181

%herefore? you may choose to send the same data as a file to yourendor and ia +%P to your remote (lant.

Also you may decide to e'change (urchase data ;ith a endor ia +%P /ut send (aymentnotes to the same endor in a file.

+or in/ound (rocessing? the (artner (rofile customi@sng ;ill alsodetermine a (rocessing code? ;hich can handle the receied data.

%he (artner (rofile may tell you the follo;ing 

Supplier ;A!?

sends the message S7&PP&+A'E&S)

via the port named &+%)R+)%using &'oc type S7PA'EB0

processed with code S7&P;)+%()%

 

Sales agent (?*S)((

sends the message SA()S?R')RS

via the port named R(&+!

using &'oc type ?R')RSB0processed with code @S%?;)R?R')R

 

Sales agent S@P)RS)((

sends the message SA()S?R')RS

via the port named R(&+!

using &'oc type ?R')RSB0

processed with code A)+%?R')R

 

&'oc %ype 4 %he Structure of the &'oc ile

The IDoc t%pe is the nae of the data structure used to describe the file forat of a specificIDoc(

An !oc is a segmented data file. t has ty(ically seeral segments.%he segments are usually structured into fieldsN ho;eer? differentsegments use different fields.

%he doc ty(e is defined ;ith transaction WE30? the res(ectie segments are defined ;ithtransaction WE31.

'ifferent partners,different profiles

&nbound customising

determines theprocessing routine

 

&'oc type defines thestructure of the segments

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 44/181

Processing odes

The processin code is a pointer to an alorith to process an IDoc( It is used to allo8 orefle0ibilit% in assinin the processin function to an IDoc essae(

%he (rocessing code is a logical name for the algorithm used to (rocess the !oc. %he (rocessing code (oints itself to a method or

function? ;hich is ca(a/le of (rocessing the !oc data.

A (rocessing code can (oint to an SAP (redefined or a self;ritten /usiness o/Fect or function module as long as they com(ly ;ith

certain interface standards.%he (rocessing codes allo; you to easily change the (rocessingalgorithm. -ecause the (rocess code can /e used for more than one

 (artner (rofile? the algorithm can /e easily changed for eeryconcerned !oc.

%he !oc engine ;ill call a function module or a /usiness o/Fect;hich is e'(ected to (erform the a((lication (rocessing for thereceied !oc data. %he function module must (roide e'actly theinterface (arameters ;hich are needed to call it from the !oc engine.

%he logical processingcode determines thealgorithm in R/3 used to

process the &'oc

 

 Allows changing thealgorithm easily

%he processing codedefines a method or

function to process an&'oc

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 45/181

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 46/181

!63  IDocs CustoisinIn addition to the 8ritin of the processin function odules< IDoc developent re>uires the

definition of the seent structures and a series of custoisin settins to controlthe flo8 of the IDoc enine(

Suar%

Customise /asic installation (arameters!efine segment structures!efine message ty(es? (rocessing codes

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 47/181

!6(! 3(!  5asic Custoisin Settins

Seents define the structure of the records in an IDoc( The% are defined 8ith transaction"E3!(

Chec first? ;hether the client you are ;oring ;ith already has a logical system name

assigned.%he logical system name is stored in ta/le T''' as T'''2GS6S .%his is the ta/le of installed clients.

f there is no name defined? you need to create a logical systemname . %his means sim(ly adding a line to ta/le T7DS . Kou can editthe ta/le directly or access the ta/le from transaction S&E .%he recommended naming conention is

&&id CL"' clie!t

f your system is DE0  and client is (''? then the logical system name should /e DE0+%T(''.System - ;ith client (8* ;ould /e -+%T(8* etc.

%he logical system also needs to /e defined as a target ;ithin the ,>3net;or. %hose definitions are done ;ith transaction S$59 and areusually (art of the ;or of the ,>3 /asis team.

T###  4 name of ownlogical system

TBD$S 4 list of $nownlogical destinations

+aming conventions:')E(+%0BBPR?(+%0J3%S%(+%111

 SM59 4 define physical

destination andcharacteristics of alogical system

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 48/181

• ,iure )1  Step to custoise outbound IDoc processin

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 49/181

• ,iure .1  Eleents that influence IDoc processin

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 50/181

!6(* 3(*  Creatin an IDoc Seent  WE31

The seent defines the structure of the records in an IDoc( The% are defined 8ith transaction WE31( "e 8ill define a structure to send a te0t fro the te0t database(

%ransaction WE31 calls the !oc segment editor. %he editor defines the

fields of a single segment structure. %he thus defined !oc segment isthen created as a data dictionary structure. Kou can ie; the created

structure ;ith SE11 and use it in an A-AP as any %A-<&S declaration.%o demonstrate the use of the !oc segment editor ;e ;ill set u( ane'am(le? ;hich allo;s you to send a single te't from the te't (ool

6ta/les ST59  and ST57 as an !oc. %hese are the te'ts that you can see ;ith S10 or editfrom ;ithin many a((lications.We ;ill sho; the ste(s to define an !oc segment 6&553T9E&D ;ith the !!ic structure ofT9E&D.

'efine a ''ic structure

with W!%&

)#ample:

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 51/181

• ,iure !41  "E3!< Definin the IDoc seent

• ,iure !!1  ain the seent

• ,iure !*1  Selectin a teplate

%o facilitate our ;or? ;e ;ill use the co(yfromtem(latetool?

;hich reads the definition of a !!C structure and inserts the field

opy the segment

structure from a ''icob-ect

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 52/181

and the matching definitions as ro;s in the !oc editor. Kou could? of course? define thestructure com(letely manually? /ut using the tem(late maes it easier.

• ,iure !31  o8 select it reall%

%he tool in release 4.0/ lets you use /oth !!C structures or another !oc segment definitionas a tem(late.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 53/181

• ,iure !1  Created structure

%he thus created structure can /e edited any time. When saing? it ;illcreate a data dictionary structure /ased on the definition in W&31. %he!!C structure ;ill retain the same name. Kou can ie; the structureas a ta/le definition ;ith SE(( and use it in an A-AP the same ;ay.

%he definitionautpmatically creates acorresponding ''icstructure

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 54/181

!6(3 3(3  Definin the $essae T%pe GEDMSG H

The essae t%pe defines the conte0t under 8hich an IDoc is transferred to its destination( Itallo8s for usin the sae IDoc file forat for several different applications(

magine the situation of sending a (urchase order to a su((lier. When

the !oc ;ith the (urchase order reaches the su((lier? it ;ill /einter(reted as a sales order receied from a customer? namely you.

Simultaneously you ;ant to send the !oc data to the su((lierQs;arehouse to inform it that a (urchase order has /een issued and is onthe ;ay.

-oth !oc receiers ;ill receie the same !oc formatN ho;eer? the !oc ;ill /e tagged ;itha different message ty(e. While the !oc to the su((lier ;ill /e flagged as a (urchase order6in SAP ,>3 standard message ty(e ,!&,S7? the same !oc sent to the ;arehouseshould /e flagged differently? so that the ;arehouse can recogni@e the order as a mereinformational co(y and (rocess it differently than a true (urchase order.

%he message ty(e together ;ith the !oc ty(e determine the (rocessing function.

%he message ty(es are stored in ta/le &!$S*.

!efining the message ty(e can /e done from the transaction W&!

• ,iure !+1  ED$S&1 Definin the essae t%pe G!H

%he entry is only a /ase entry ;hich tells the system that the message

ty(e is allo;ed. ther transactions ;ill use that ta/le as a chec ta/leto alidate the entry.

• ,iure !1  ED$S&1 Definin the essae t%pe G*H

Sales order becomespurchase order forreceiver 

Sales order can beforwarded and remains asales order 

;essage type plus &'octype determineprocessing algorithm

)';S

*)'&

)';S used as chec$table

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 55/181

!6( 3(  Define :alid Cobination of $essae and IDoc T%pes

The valid cobinations of essae t%pe and IDoc t%pe are stored in table EDI$S&(

%he declaration of alid com/inations is done to allo; alidation? ifthe system can handle a certain com/ination.

• ,iure !61  EDIMSG 1 Define valid cobination of essae and IDoc t%pes

@sed for validation

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 56/181

!6(+ 3(+  Assinin a Processin ,unction GTable EDIFCT H

The cobination of essae t%pe and IDoc t%pe deterine the processin alorith( This isusuall% a function odule 8ith a 8ell defined interface or a SAP business obect andis set up in table EDI,CT(

%he entry made here (oints to a function module ;hich ;ill /e called ;hen the !oc is to /e (rocessed.%he entries for message code and message function are usually left /lan. %hey can /e used toderie su/ ty(es of messages together ;ith the (artner (rofile used.

• ,iure !)1  Assin a handler function to a essae/essae t%pe

%he definition for in/ound and out/ound !ocs is analogous. f course? the function module;ill /e different.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 57/181

!6( 3(  Processin Codes

R/3 uses the ethod of loical process codes to detach the IDoc processin and theprocessin function odule( The% assin a loical nae to the function instead ofspecif%in the ph%sical function nae(

%he !oc functions are often used for a series of message ty(e>!octy(e com/ination. t is necessary to re(lace the (rocessing function /ya different one. &.g. ;hen you mae a co(y of a standard function to

aoid modifying the standard.%he com/ination message ty(e>!oc ;ill determine the logical

 (rocessing code? ;hich itself (oints to a function. f the functionchanges? only the definition of the (rocessing codes ;ill /e changed

and the ne; function ;ill /e immediately effectie for all !ocs associated ;ith the (rocesscode.+or in/ound (rocessing codes you hae to s(ecify the method to use for the determination ofthe in/ound function.

(ogical pointer to aprocessing method

)asily replacing theprocessing method

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 58/181

• ,iure !.1  Assin an outbound processin code GStep !H

%his is the o(tion you ;ould usually choose. t allo;s (rocessing iathe A<& scenarios.

Processing with A()

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 59/181

• ,iure *41  Associate a processin code 8ith a essae t%pe

After defining the (rocessing code you hae to assign it to one orseeral logical message ty(es. %his declaration is used to alidate? if a

message can /e handled /y the receiing system.

Ealidate allowedmessage types

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 60/181

!6(6 3(6  Inbound Processin Code

The inbound processin code is assined analoousl%( The processin code is a pointer to afunction odule 8hich can handle the inbound re>uest for the specified IDoc andessae t%pe(

%he definition of the (rocessing code is identifying the handler routine and assigning a seriousof (rocessing o(tions.Kou need to clic Processing ;ith A<&? if your function can /e usedia the A<& engine. %his is the o(tion you ;ould usually choose. t

allo;s (rocessing ia the A<& scenarios.

Associate a function module ;ith a (rocess code+or in/ound (rocessing you need to indicate ;hether the function ;ill

 /e ca(a/le of dialog (rocessing. %his is meant for those functions;hich (rocess the in/ound data ia call transaction. %hose functions

Processing with A()

%able TBD'& to define if

visible C%& is allowed

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 61/181

• ,iure *!1  Define if the processin can be done in dialo via call transaction

After defining the (rocessing code? you hae to assign it to one orseeral logical message ty(es. %his declaration is used to alidate? if amessage can /e handled /y the receiing system.

• ,iure **1  Associate a processin code 8ith a essae t%pe

%he e'am(les a/oe sho; only the association ;ith a function module. Kou can also define /usiness o/Fects ;ith transaction SWO1 and define them as a handler. +or those familiar ;iththe o/Fect model of ,>3? it may /e a design decision. n this /oo? ;e ;ill deal ;ith thefunction modules only.

Ealidate allowedmessage types

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 62/181

!)  IDoc 7utbound TriersIDocs should be sent out at certain events( Therefore %ou have to define a trier( A lot of

consideration is re>uired to deterine the correct oent 8hen to send out the IDoc(The IDoc can be triered at a certain tie or 8hen an event is raised( R/3 usesseveral copletel% different ethods to deterine the trier point( There are

essaes to tell the s%ste that there is an IDoc 8aitin for dispatchin< there are lofiles 8hich a% be evaluated to see if IDocs are due to send and there can be a8orkflo8 chain triered< 8hich includes the sendin of the IDoc(

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 63/181• ,iure *31  &eneral Process loic of IDoc outbound

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 64/181

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 65/181

!)(! (!  Individual A5AP

The siplest 8a% to create IDocs< is to 8rite an A5AP( The individual A5AP can either be atrierin A5AP 8hich runs at certain events< e(( ever% niht< or it can be an A5AP8hich does the coplete IDoc creation fro scratch(

A triggering A-AP ;ould sim(ly try to determine ;hich !ocs needsending and call the a((ro(riate !oc creation routines.Kou may also imagine the A-AP to do all the Fo/. As this is mostlyreinenting the ;heel? it is not really recommended and should /eresered to situation? ;here the other solution do not (roide an

a((ro(riate mean.

%riggering ACAP

 ACAP creates the whole&'oc

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 66/181

!)(* (*  AST $essaes 5ased 7utbound IDocs

 ?ou can use the R/3 essae concept to trier IDocs the sae 8a% as %ou trier SAPscriptprintin(

ne of the ey ta/les in ,>3 is the ta/le %&ST . %his ta/le records reminders ;ritten /y

a((lications. %hose reminders are called messages.&ery time ;hen an a((lications sees the necessity to (assinformation to a third (arty. a message is ;ritten to %&ST . A messagehandler ;ill eentually chec the entries in the ta/le and cause ana((ro(riate action.%he conce(t of :AS% messages has originally /een designed fortriggering SAPscri(t (rinting. %he ery same mechanism is used for!ocs? ;here the !oc (rocessor re(laces the (rint tas? as an !oc is

only the (a(erless form of a (rinted document.%he messages are usually /e created using the condition techniGue? amechanism aaila/le to all maFor ,>3 a((lications.

%he conditions are set u( the same ;ay for any out(ut media. So youmay define a condition for (rinting a document and then Fust changethe out(ut media from (rinter to !oc>&! or A<&.

• ,iure *1  Counicatin 8ith essae via table AST

Creating :AS% messages is a standard functionality in most of theSAP core a((lications. %hose a((lications e.g. 0&'(? ME8( 

 (erform calls to the central function module MESS&G"%G of grou(0(7. %he function module uses customi@ing entries? mainly those ofthe ta/les %#1R to %#5R.

 Applications writemessages to +AS%,which will be processedby a message handler 

)'& uses the samemechanism as printing

ondition techniue canmostly be used

Printing, )'& and A()use the same trigger 

+AS% messages arecreated by application bycalling function module(!SSA)I*)

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 67/181

A :AS% out(ut message is stored as a single record in the ta/le :AS%. %he record stores all information that is necessary to create an!oc. %his includes mainly an o/Fect ey to identify the (rocessed

o/Fect and a((lication to the message handler and the sender and receier information.%he messages are ty(ically (rocessed /y

FOR% E"'R i! PRORA% RS"AS'--.

f ;e are dealing ;ith (rinting or fa'ing andFOR% EDI;PROCESSI" i! PRORA% RS"AS'ED.

f ;e are dealing ;ith !ocsFOR% ALE;PROCESSI" i! PRORA% RS"AS'ED.

f ;e are dealing ;ith A<&.%he follo;ing (iece of code does (rinci(ally the same thing as -S%&ST'' does and maesfull use of all customi@ing settings for message handling.

 'ABLES8 "AS'.

S&<&C% R +,$ :AS% ...P&,+,$ ein@elnachricht : P,*,A$ ,S:AS%00

%he (rocessing routine for the res(ectie media and message iscustomi@ed in the ta/le T%&-. %his ta/le records the name of a+,$ routine? ;hich (rocesses the message for the chosen mediaand the name of an A-AP ;here this +,$ is found.

+AS% contains ob-ect$ey, sender and receiver 

Programs RS+AS%BBand RS+AS%)' provideversatile subroutines for+AS% processing

?R; einelnachricht &+PR?RA; RS+AS%BB

Programs arecustomied in table%+APR

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 68/181

!)(3 (3  The RSAST44 A5AP

The A5AP RSAST44 is the standard A5AP< 8hich is used to collect unprocessed ASTessae and to e0ecute the assined action(

 -S%&ST'' can /e e'ecuted as a collector /atch run? that eentually

loos for un(rocessed !ocs. %he usual ;ay of doing that is to definea /atchrun Fo/ ;ith transaction SM37. %his Fo/ has to /e set for

 (eriodic (rocessing and start a (rogram that triggers the !oc resending.

+a;e<  -S%&ST'' ;ill only loo for !ocs ;hich are set to %&ST2

0S=T > ?(?  or ?8?  6%ime of (rocessing7. 0S=T > ?*?  or ?1?  is ignored /y -S%&ST''.

Start -S%&ST'' in the foreground first and find the (arameters thatmatch your reGuired selection criteria. Sae them as a 8A,A:% andthen define the (eriodic /atch Fo/ using the ariant.

f -S%&ST'' does not meet 100T your needs you can create an o;n (rogram similar to -S%&ST''. %he only reGuirement for this (rogram are t;o ste(s= Read t*e "AS' e!tr to proce&& i!to &tructure "AS'ta#le& !a&t.data8 &u#rc li>e &)&u#rc.....&elect rom "AS' 7*ere .......= t*e! call FOR% ei!Gel!ac*ric*t(r&!a&t-- to proce&& t*e recordPERFOR% ei!Gel!ac*ric*t(r&!a&t-- SI" &u#rc.

RS+AS%BB is thestandard batch collectorfor messages

RS+AS%BB processesonly messages of acertain status

or batch e#ecution aselection variant isreuired

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 69/181

!)( (  Sendin IDocs :ia RSASTED

Standard R/3 provides %ou 8ith po8erful routines< to trier< prepare and send out IDocs in acontrolled 8a%( There are onl% a fe8 rare cases< 8here %ou do not 8ant to send IDocsthe standard 8a%(

%he ACAP +S*AST##  is the standard routine to send &'ocs from entries in the message control. %hisprogram can be called directly, from a batch routine with variant or you can call the F+( einelnachricht-screen.+S*AST##/  from any other program, while having the structure +AS%

correctly filled with all necessary information.

f there is an entry in ta/le NAST? RSNAST00 loos u( the associated (rocessing routine in ta/le TNAPR. f it is to send an !oc ;ithstandard means? this ;ill usually /e the routineRSNASTED(EDI_PROCESSING) or

RSNASTED(ALE_PROCESSING) in the case of A<& distri/ution.,S:AS%&! itself determines the associated !oc out/ound functionmodule? e'ecutes it to fill the &!!' ta/les and (asses the (re(ared

!oc to the (ort.Kou can call the standard (rocessing routines from any A-AP? /y e'ecuting the follo;ing callto the routine. Kou only hae to mae sure that the structure :AS% is declared ;ith the ta/lesstatement in the calling routine and that you fill at least the ey (art and the routine 6%:AP,7information /efore. 'ABLES "AS'.

 :AS%$A:!% SK$A:!%. :AS%OSC=< Q&!OQ. :AS%OAPP< Q81Q. :AS%-BOK Q0012345#)Q.

 :AS%PA,:, Q!012345#)Q.P&,+,$ ein@elnachrichtEscreen6,S:AS%007.Calling !"#$"%&'!&'_*&" determines ho; the message is (rocessed. f you;ant to force the !oc(rocessing you can call it directly '"APR)PRO" @@.

%:AP,,%: Q&:%,KQ.P&,+,$ ediE(rocessing6,S:AS%&!7.

RS+AS%BB determines if it is &'oc or SAPscriptetc.

RS+AS%)' processes&'ocs

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 70/181

!)(+ (+  Sendin IDocs :ia RSAST44

#ere is the principle flo8 ho8 RSAST44 processes essaes for IDocs(

• ,iure *+1  Process loic of RSAST44 A5AP

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 71/181

!)( (  "orkflo8 5ased 7utbound IDocs

2nfortunatel%< there are application that do not create essaes( This is especiall% true foraster data applications( #o8ever< ost applications fire a 8orkflo8 event durinupdate< 8hich can easil% be used to trier the IDoc distribution(

$any SAP ,>3 a((lications issue a call to the functionS)E3E0E%T3+-E&TE during u(date. %his function module ignites asim(le ;orflo; eent.

%echnically a ;orflo; eent is a timed call to a function module?;hich taes the issuing eent as the ey to (rocess a su/seGuentaction.f an a((lication ;rites regular change documents 6ger.Underungs/elege7 to the data/ase? it ;ill issue automatically a;orflo; eent. %his eent is triggered from ;ithin the function+9&%GED+4ME%T3+SE . %he change document ;orflo;

eent is al;ays triggered? inde(endent of the case ;hether a change document is actually

;ritten.n order to mae use of the ;orflo; for !oc (rocessing? you do nothae to go through the cum/ersome ;orflo; design (rocedure as itis descri/ed in the ;orflo; documentation. +or the mentioned

 (ur(ose? you can register the ;orflo; handler from the menu? ;hichsays &ent Cou(ling from the BALD transaction.

%riggering the !oc from a ;orflo; eent has a disadantage if the!oc has to /e re(eated for some reason? the eent cannot /e re(eatedeasily. %his is due to the nature of a ;orflo; eent? ;hich is

triggered usually from a (recedent action. %herefore you hae to find an o;n ;ay ho; tomae sure that the !oc is actually generated? een in the case of an error. Practically this isnot a ery /ig (ro/lem for !ocs. n most cases the creation of the !oc ;ill al;ays tae

 (lace. f there is a (ro/lem? then the !oc ;ould /e stored in the !oc /ase ;ith a res(ectiestatus. t ;ill sho;n in transaction WE05 and can /e resend from there.

SW!-!0!*T-C+!AT! 

*or$flow is a call to afunction module

 Applications with changedocuments alwaystrigger wor$flow events

*or$flow coupling canbe done by utilityfunctions

*or$flow cannot easilybe restarted

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 72/181

!)(6 (6  "orkflo8 Event ,ro Chane Docuent

Instead of 8aitin for a pollin ob to create IDocs< the% can also be created iediatel% after atransaction finishes( This can be done b% assinin an action to an 8orkflo8 event(

$ost a((lication fire a ;orflo; eent from the u(date routine /y

calling the function

F"C'IO" &7e;e$e!t;create

Kou can chec if an a((lication fires eents /y actiating the eent logfrom transaction SWLD. Calling and saing a transaction ;ill ;rite theeentJs name and circumstances into the log file.

f an a((lication does not fire ;orflo; eents directly? there is still another chance that a;orflo; may /e used ;ithout touching the ,>3 original (rograms.

&ery a((lication that ;rites change documents triggers a ;orflo;eent from ;ithin the function module CHANGEDOC+MENT_CLOSE?

;hich is called form the u(date (rocessing u(on ;riting the changedocument. %his ;ill call the ;orflo; (rocessor 

F"C'IO" &7e;e$e!t;create;c*a!gedocume!t

-oth ;orflo; ty(es are not com(ati/le ;ith each other ;ith res(ect to the function modulesused to handle the eent.

-oth ;ill call a function module ;hose name they find in the;orflo; linage ta/les. swe3e;ent3create ;ill loo in ta/leS)ET6E+4  ;hile swe3e;ent3create3changedoc!ment  ;ould loo in S)E+D7  for the name of the function module.f a name is found? the function module ;ill then /e calleddynamically. %his is all to say a/out the linage of the ;orflo;.

%he dynamic call loos lie the follo;ing.CALL F"C'IO" &7ecdo#H)o#Htpe#E<POR'I"c*a!gedocume!t;*eader c*a!gedocume!t;*eadero#Hecttpe &7ecdo#H)o#HtpeI%POR'I"o#Hecttpe &7ecdo#H)o#Htpe 'ABLESc*a!gedocume!t;po&itio! c*a!gedocume!t;po&itio!.

*or$flow events areusually fired from anupdate routine

S*(' lets install and logwor$flows

*or$flow )vents are alsofired from changedocument

%he wor$flow types areincompatible but wor$according the sameprincipal

%he wor$flow handler will

be called dynamically

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 73/181

!)() ()  A9E Chane Pointers

Applications 8hich 8rite chane docuents 8ill also tr% to 8rite chane pointers for A9Eoperations( These are lo entries to reeber all odified data records relevant forA9E(

$ost a((lications ;rite change documents. %hese are (rimarily log entries in the ta/les+D9D- and +DS .Change documents remem/er the modified fields made to thedata/ase /y an a((lication. %hey also remem/er the user name and thetime ;hen the modification too (lace.%he decision ;hether a field modification is releant for a changedocument is triggered /y a flag of the modified fieldJs data element.Kou can set the flag ;ith SE11 /y modifying the data element.

+or the (ur(ose of distri/uting data ia A<& to other systems? youmay ;ant to choose other fields? ;hich shall /e regarded releant fortriggering a distri/ution.

%herefore ,>3 introduced the conce(t of change (ointers? ;hich are nothing else than asecond log file s(ecially designed for ;riting the change (ointers ;hich are meant to trigger!oc distri/ution ia A<&.

So the change (ointers ;ill remem/er the ey of the document eerytime ;hen a releant field has changed.

Change (ointers are then ealuated /y an A-AP ;hich calls the !occreation? for eery modified document found in the change (ointers.

%he Change (ointers are ;ritten from the routine+9&%GED+4ME%T3+SE  ;hen saing the generated changedocument. So change (ointers are automatically ;ritten ;hen areleant document changes.

%he follo;ing function is called from ;ithin +9&%GED+4ME%T3+SE  in order to;rite the change (ointers.CALL F"C'IO" @C?A"E;POI"'ERS;CREA'E@E<POR'I"c*a!ge;docume!t;*eader cd*dr 'ABLESc*a!ge;docume!t;po&itio! i!&;cdpo&.

hange docs rememberchanges in transaction

'ata elements aremar$ed to be relevant for change documents

 A() may need othertriggers

hange pointersremember $ey of thedocument

 An ACAP creates the&'ocs

hange pointers arewhen change documents

have been written

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 74/181

!)(. (.  Activation of chane pointer update

Chane pointers are lo entries to table 5DCP 8hich are 8ritten ever% tie a transactionodifies certain fields( The chane pointers are desined for A9E distribution and8ritten b% the function C#A&EKD7C2$ETKC97SE(

Change (ointers are ;ritten for use ;ith A<&. %here are A-APs lie ,-!$!C ;hich canread the change (ointers and trigger an !oc for A<& distri/ution.%he change (ointers are mainly the same as change documents. %hey ho;eer can /e set u(differently? so fields ;hich trigger change documents are not necessarily the same that causechange (ointers to /e ;ritten.n order to ;or ;ith change (ointers there are t;o ste(s to /e (erformed

19   •  %urn on change (ointer u(date generally

20   •  !ecide ;hich message ty(es shall /e included for change (ointer u(date

,3 allo;s to actiate or deactiate the change (ointer u(date. +or this

 (ur(ose it maintains a ta/le T7D&(. %he decision ;hether the change (ointer u(date is actie is done ;ith aFu!ctio! Ale;Compo!e!t;C*ec>

Currently 6release 40-7 this chec does nothing else than to chec? if this ta/le has an entry or not. f there is an entry in T7D&(? the A<& change (ointers are generally actie. f this ta/leis em(ty? change (ointers are turned off for eery/ody and eerything? regardless of the othersettings.%he t;o (oints read lie you had the choice /et;een turning it on generally or selectiely.%his is not the case you al;ays turn them on selectiely. %he s;itch to turn on generally is

meant to actiate or deactiate the ;hole mechanism.%he change (ointers ;hich hae not /een (rocessed yet? can /e read;ith a function module.

Call Fu!ctio! @C?A"E;POI"'ERS;READ@

%he A-AP ,-!$!C ;ill (rocess all o(en change (ointers anddistri/ute the matching !ocs.When you ;ant to send out an !oc unconditionally eery time atransaction u(dates? you /etter use the ;orflo; from the changedocuments.

 Activate hange Pointerenerally

 

reading the changepointers which are notyet processed

RC';&'?

@se hange 'ocuments&nstead ?f hangePointers

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 75/181

*4(! (!4  Dispatchin A9E IDocs for Chane Pointers

Chane pointers ust be processed b% an A5AP< e(( R5D$ID7C(

%he actual distri/ution of documents from change (ointers must /edone /y an A-AP? ;hich reads the change (ointers and (rocesses

them. %he standard A-AP for that is -7DM"D+ . +or recurringe'ecution it can /e su/mitted in a scheduled Fo/ using SM35 .t then calls dynamically a function module ;hose name is stored inta/le T7DME  for each message ty(e.

Call Fu!ctio! '#dme)Idoc#!ameE6porti!g

%e&&age;'pe %e&tpCreatio!;Date;?ig* DateCreatio!;'ime;?ig* 'ime

E6ceptio!&Error;Code;.

A com(le' e'am(le for a function module? ;hich collects the change (ointers? can /e e'amined in M&STE-"D+3+-E&TE3SMD3DE7M&S  .%his one reads change (ointers for de/tors 6customer masters7. !uring the (rocessing? it callsthe actual !oc creating module M&STE-"D+3+-E&TE3DE7M&S  .%o summari@e the change (ointer conce(t

21   •  Change (ointers record releant u(dates of transaction data

22   •  Change (ointers are ;ritten se(arate from the changedocuments? ;hile at the same time

23   •  Change (ointers are ealuated /y a collector run

Change (ointer StatusChange (ointer 

A ie; ;ith 7D+  and 7D+S  com/ined Change (ointer ;ith status

!eclare actiate message ty(es for change (ointers ;ith ie;03T7D&8.or transaction BD50 or .

SALE V Actiate change (ointers for message ty(es%he ie; 03T7D8 defines those fields ;hich are releant for change

 (ointer creation. %he ta/le is ealuated /y the+9&%GE3D+4ME%T3+SE  function. %he o/Fect is the same used /y the changedocument. %o find out the o/Fect name? loo for +9&%GE3D+4ME%T3+SE  in thetransaction you are ins(ecting or see ta/le +D9D- for traces.• ,iure *1  Tables involved in chane pointers processin

Object

Table name

Field

!&-O:A1

 :A$&3!&-Oann1

RC';&'? processeschange pointers andsends the &'ocs

unction module definedin table %C';)

)#ample

BDCPS

BDCP 

BDCP0 

TBDA1 

TBD21 

Sample content of view0-TBD21 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 76/181

,%01!&-Oann1,&*• ,iure *61  Saple content of vie8 :KT5D*

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 77/181

*+  IDoc RecipesThis chapter 8ill sho8 %ou ho8 an IDoc function is principall% desined and ho8 R/3

processes the IDocs( I cannot stop repeatin< that 8ritin IDoc processin routines isa prett% siple task( "ith a nuber of recipes on hand< %ou can easil% build %our o8nprocessors(

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 78/181

*(! +(!  #o8 the IDoc Enine "orks

IDocs are usuall% created in a four step process1 retrievin the data< convertin it to IDocforat< addin a control record< and deliverin the IDoc to a port(

%his is the single most im(ortant tas in out/ound (rocessing. Kou

hae to identify the data/ase ta/les and data de(endencies ;hich areneeded in the !oc to /e sent. %he smartest ;ay is usually to select the

data from the data/ase into an internal ta/le using SELECT , FROM -.%.$ INTO!%. /// WHERE /..

%he collected data must /e transformed into ASC data and filled intothe (redefined !oc segment structures. %he segment definitions are

done ;ith transaction W&31 and the segments allo;ed in an !oc ty(e are set u( intransaction W&30. Segments defined ;ith W&31 are automatically created as SAP !!Cstructures. %hey can /e ie;ed ;ith S&11? ho;eer? they cannot /e edited.

&ery !oc must /e accom(anied /y a control record ;hich mustcontain at least the doc ty(e to identify the syntactical structure of thedata and the name and role of the sender and the receier. %his header 

information is checed against the (artner definitions for out/ound. nly if a matching (artner definition e'ists? can the !oc /e sent. Partner definitions are set u( ;ith transactionW&20.

When the (artner (rofile chec matches? the !oc is for;arded to alogical (ort? ;hich is also assigned in the (artner (rofile. %his (ort is

set u( ;ith transaction W&21 and defines the medium to trans(ort the !oc? e.g. file or ,+C.%he ,+C destinations are set u( ;ith transaction S$5) and must also /e entered in ta/le%-!<S ;ith an S$31 ie;. !irectories for out/ound locations of files are set u( ;ithtransaction +<& and directly in W&21. t also allo;s the use of a function module ;hich

generates file names. Standard functions for that (ur(ose /egin lie &!E+<&R.

ollect data from R/3database

*rap data in &'oc format

reate the &'oc controlrecord

Send data to port

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 79/181

*(* +(*  #o8 SAP Standard Processes Inbound IDocs

"hen %ou receive an IDoc the standard 8a%< the data is stored in the IDoc base and a functionodule is called< 8hich decides ho8 to process the received inforation(

!ata is stored in ta/le &!!4 6&!!3 u( to release 3.''? &!!! u(

to release 2.''7An accom(anying control record ;ith im(ortant conte't andadministratie information is stored in ta/le &!!C.After the data is stored in the !oc /ase ta/les? an eent is fired tosignal that there is an !oc ;aiting for (rocessing. %his eent is

consumed /y the !oc handler? ;hich decides? ;hether to (rocess the !oc immediately? (ost(one (rocessing? or decline actiity for ;hateer reason.

When the !oc (rocessor thins it is time to (rocess the !oc it ;illsearch the ta/le &!+C% ? ;here it should find the name of a functionmodule ;hich ;ill /e called to (rocess the !oc data.

%his function module is the heart of all in/ound (rocessing. %he !oc (rocessor ;ill call this

routine and (ass the !oc data from &!!4 and the control record from &!!C for theres(ectie !oc.

-ecause this routine is called dynamically? it must adhere to astrictconention All function interface (arameters must e'actly matchthe calling conention. +or e'act s(ecifications see nterface

Structure of !oc Processing +unctions later in this cha(ter.%he (rocessing ste(s and their res(ectie status results are stored inta/le &!!S.n addition? the routine has to (ro(erly determine the ne't status ofthe !oc in ta/le &!!SN usually it ;ill /e &!!SS%A% 53 forO or 51 for error.

)'&'D " 'ata

)'&' " ontrol Record

)vent signals readiness

)'&% " Processingfunction

unction has a fi#edinterface

)'&'S " Status log

Status must be loggedproperly

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 80/181

*(3 +(3  #o8 to Create the IDoc Data

R/3 provides a sophisticated IDoc processin frae8ork( This frae8ork deterines afunction odule 8hich is responsible for creatin or processin the IDoc(

%he ernel of the !oc (rocessing is al;ays a distinct function

module. +or the out/ound (rocessing? the function module creates the!oc and leaes it in an internal ta/le? ;hich is (assed as an interface

 (arameter.!uring in/ound (rocessing the function module receies the !oc ia an interface (arameterta/le. t ;ould inter(ret the !oc data and ty(ically u(date the data/ase either directly or ia acall transaction.

%he function modules are called dynamically from a standard routine.%herefore? the function must adhere to a ;elldefined interface.

Kou may ;ant to inestigate the function grou( ED"% ? ;hich containsa num/er of !oc handler routines and ;ould call the customised

function.%he easiest ;ay to start the deelo(ment of an out/ound !ocfunction module is to co(y an e'isting one. %here are many sam(les inthe standard ,>3 re(ositoryQN most are named !CE%-:!R or 

!CE%P%RF"C'IO" IDOC;O'P';ORDERS-

 

F"C'IO" IDOC;I"P';ORDERS-

 

F"C'IO" %AS'ERIDOC;CREA'E;%A'%AS

 

unction module togenerate the &'oc

unction are calleddynamically

unction group !DI*  with useful routines

opy and modify e#istingroutines

?utbound samplefunctions are named li$eIDC-3TP3T4 

&nbound samplefunctions are named li$eIDC-I*P3T4 

?utbound samplefunctions for master dataare named li$e(AST!+IDC-I*P3T4 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 81/181

• ,iure *)1  Scheatic of an IDoc outbound process

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 82/181

*( +(  Interface Structure of IDoc Processin ,unctions

To use the standard IDoc processin echanis< the processin function odule ust havecertain interface paraeters because the function is called d%naicall% fro astandard routine(

%he automated !oc (rocessor ;ill call your function module from ;ithin the (rogramRS"AS'ED? usually either from the FOR% ALE;PROCESSI" or EDI;PROCESSI".n order to /e com(ati/le ;ith this automated call? the interface of the function module must

 /e com(liant.F"C'IO" ;IDOC;O'BO"D;SA%PLE.

() I0'.R#I"1

R 8A<&6+<E%&S%7 <O& ,S3<P%:A< !&+A<% QDQR 8A<&6+<EC$$%7 <O& ,S3<P%:A< !&+A<% SPAC&R &DP,%:*R 8A<&6+E!CE=&A!&,7 <O& &!!C S%,C%,& &!!C

R %A-<&SR %E!CEC:%,< S%,C%,& &!!CR %E!CE!A%A S%,C%,& &!!!R C=A:*:*R 8A<&6C:%,<E,&C,!E:7 <O& &!!C S%,C%,& &!!CR 8A<&6-B&C%7 <O& :AS% S%,C%,& :AS%R &DC&P%:SR &,,,E:E!CEC:%,<R &,,,EW,%:*E!CES%A%SR &,,,E:E!CE!A%AR S&:!:*E<*CA<ESKS%&$E:O:W:

R :O:W:E&,,, • ,iure *.1  Interface structure of an AST copatible function odule

n/ound functions are also called ia a standard mechanism.F"C'IO" IDOC;I"P';SO%E'?I".

() I0'.R#I"1

R 8A<&6:P%E$&%=!7 <O& -!W+APEPA,:P%$&%=!R 8A<&6$ASSEP,C&SS:*7 <O& -!W+APEPA,$ASSEP,CR &DP,%:*R 8A<&6W,O+<WE,&S<%7 <O& -!W+APEPA,,&S<%

R 8A<&6APP<CA%:E8A,A-<&7 <O& -!W+APEPA,APP<E8A, R 8A<&6:EP!A%&E%ASO7 <O& -!W+APEPA,P!A%&%ASO R 8A<&6CA<<E%,A:SAC%:E!:&7 <O& -!W+APEPA,CA<<%,A:SR %A-<&SR !CEC:%,< S%,C%,& &!!CR !CE!A%A S%,C%,& &!!!R !CES%A%S S%,C%,& -!!CS%A%R ,&%,:E8A,A-<&S S%,C%,& -!W+,&%8A, R S&,A<A%:E:+ S%,C%,& -!ES&, • ,iure 341  Interface structure of an IDoc inbound function

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 83/181

*(+ +(+  Recipe to Develop an 7utbound IDoc ,unction

This is an individual codin part 8here %ou need to retrieve the inforation fro the databaseand prepare it in the for the recipient of the IDoc 8ill e0pect the data(

%he first ste( is reading the data from the data/ase? the one you ;ant

to send.F"C'IO" ;A<<;COO:BOO:;'E<';IDOC;O'B.

()**********************************************************************

RR<oale SchnittstelleR $P,%:*R 8A<&6E%!-B&C%7 <O& %=&A!%!-B&C% !&+A<% Q%&D%QR 8A<&6E%!!7 <O& %=&A!%!! !&+A<% QS%QR 8A<&6E%!:A$&7 <O& %=&A!%!:A$&R 8A<&6E%!SP,AS7 <O& %=&A!%!SP,AS !&+A<% SK<A:*R &DP,%:*

R 8A<&6&E%=&A!7 <O& %=&A! S%,C%,& %=&A!R %A-<&SR !CE!A%A S%,C%,& &!!! P%:A<R !CEC:%,< S%,C%,& &!!C P%:A<R %<:&S S%,C%,& %<:& P%:A<R &DC&P%:SR +:C%:E:%E&DS%R 8&,S:E:%E+:!R  CALL F"C'IO" @READ;'E<'@

  &DP,%:*  ! !  <A:*A*& <A:*A*&  :A$& :A$&  -B&C% -B&C%  %A-<&S  <:&S <:&S.( now stu2 the data into the Idoc record format 

  PERFOR% PAC:;LI"E 'ABLES IDOC;DA'A SI" @'?EAD@ E;'?EAD.

  <P A% <:&S.

  P&,+,$ PACOE<:& %A-<&S !CE!A%A S:* Q%=&A!Q <:&S.  &:!<P.&:!+:C%:.

Read data to send

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 84/181

*( +(  Convertin Data into IDoc Seent ,orat

The ph%sical forat of the IDocs records is al8a%s the sae( Therefore< the application dataust be converted into a !444 character strin(

An !oc is a file ;ith a rigid formal structure. %his allo;s the

corres(ondents to correctly inter(ret the !oc information. Were it fordata e'change /et;een SAPsystems only? the !oc segments could

 /e sim(ly structured lie the corres(ondent !!C structure of the ta/les ;hose data is sent.=o;eer? !ocs are usually trans(orted to a ariety of legacy systems ;hich do not run SAP.-oth corres(ondents therefore ;ould agree on an !oc structure ;hich is no;n to thesending and the receiing (rocesses.

All data needs to /e com(iled in an internal ta/le ;ith the structure ofthe standard SAP ta/le &!!!. %he records for &!!! are

 (rinci(ally made u( of a header string descri/ing the segment and aaria/le length character field 6called S!A%A7 ;hich ;ill contain theactual segment data.

FOR% PAC:;LI"E 'ABLES IDOC;DA'A SI" @'?EAD@ E;'?EAD.

  %A-<&S %=&A!.  $8&C,,&SP:!:* &%=&A! to 1%=&A!.  $8& 1%=&A!J % !CE!A%AS&*:A$.  $8& 1%=&A! % !CE!A%AS!A%A.  APP&:! !CE!A%A.&:!+,$.H• ,iure 3!1  Routine to ove the translate to IDoc data

+inally? the control record has to /e filled ;ith meaningful data?

es(ecially telling the !oc ty(e and message ty(e.  IF IDOC;CO"'RL)S"DPR" IS I"I'IAL.

  S&<&C% S:*<& R +,$ %000 W=&,& $A:!% & SK$A:!%.  $8& %000<*SKS % !CEC:%,<S:!P,:.  &:!+.  !CEC:%,<S:!P,% Q<SQ.R %rans ;e20 V ut/ound Controls muss ents(rechend geset@t ;erden.R 2 %ransfer !oc immediatelyR 4 Collect !ocs!CEC:%,<%$! Q2Q. 1imediately? su/system

 C<&A, !CEC:%,<.  !CEC:%,<!C%P QKADDE%&D%Q.  APP&:! !CEC:%,<.• ,iure 3*1  ,ill the essential inforation of an IDoc control record

 

ill the data segmentswhich ma$e up the &'oc

%ransfer the whole &'octo an internal table,having the structure of)'&''

ill control record

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 85/181

*+  IDoc RecipesThis chapter 8ill sho8 %ou ho8 an IDoc function is principall% desined and ho8 R/3

processes the IDocs( I cannot stop repeatin< that 8ritin IDoc processin routines isa prett% siple task( "ith a nuber of recipes on hand< %ou can easil% build %our o8nprocessors(

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 86/181

*+(! (!  #o8 the IDoc Enine "orks

IDocs are usuall% created in a four step process1 retrievin the data< convertin it to IDocforat< addin a control record< and deliverin the IDoc to a port(

%his is the single most im(ortant tas in out/ound (rocessing. Kou

hae to identify the data/ase ta/les and data de(endencies ;hich areneeded in the !oc to /e sent. %he smartest ;ay is usually to select the

data from the data/ase into an internal ta/le using SELECT , FROM -.%.$ INTO!%. /// WHERE /..

%he collected data must /e transformed into ASC data and filled intothe (redefined !oc segment structures. %he segment definitions are

done ;ith transaction W&31 and the segments allo;ed in an !oc ty(e are set u( intransaction W&30. Segments defined ;ith W&31 are automatically created as SAP !!Cstructures. %hey can /e ie;ed ;ith S&11? ho;eer? they cannot /e edited.

&ery !oc must /e accom(anied /y a control record ;hich mustcontain at least the doc ty(e to identify the syntactical structure of thedata and the name and role of the sender and the receier. %his header 

information is checed against the (artner definitions for out/ound. nly if a matching (artner definition e'ists? can the !oc /e sent. Partner definitions are set u( ;ith transactionW&20.

When the (artner (rofile chec matches? the !oc is for;arded to alogical (ort? ;hich is also assigned in the (artner (rofile. %his (ort is

set u( ;ith transaction W&21 and defines the medium to trans(ort the !oc? e.g. file or ,+C.%he ,+C destinations are set u( ;ith transaction S$5) and must also /e entered in ta/le%-!<S ;ith an S$31 ie;. !irectories for out/ound locations of files are set u( ;ithtransaction +<& and directly in W&21. t also allo;s the use of a function module ;hich

generates file names. Standard functions for that (ur(ose /egin lie &!E+<&R.

ollect data from R/3database

*rap data in &'oc format

reate the &'oc controlrecord

Send data to port

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 87/181

*+(* (*  #o8 SAP Standard Processes Inbound IDocs

"hen %ou receive an IDoc the standard 8a%< the data is stored in the IDoc base and a functionodule is called< 8hich decides ho8 to process the received inforation(

!ata is stored in ta/le &!!4 6&!!3 u( to release 3.''? &!!! u(

to release 2.''7An accom(anying control record ;ith im(ortant conte't andadministratie information is stored in ta/le &!!C.After the data is stored in the !oc /ase ta/les? an eent is fired tosignal that there is an !oc ;aiting for (rocessing. %his eent is

consumed /y the !oc handler? ;hich decides? ;hether to (rocess the !oc immediately? (ost(one (rocessing? or decline actiity for ;hateer reason.

When the !oc (rocessor thins it is time to (rocess the !oc it ;illsearch the ta/le &!+C% ? ;here it should find the name of a functionmodule ;hich ;ill /e called to (rocess the !oc data.

%his function module is the heart of all in/ound (rocessing. %he !oc (rocessor ;ill call this

routine and (ass the !oc data from &!!4 and the control record from &!!C for theres(ectie !oc.

-ecause this routine is called dynamically? it must adhere to astrictconention All function interface (arameters must e'actly matchthe calling conention. +or e'act s(ecifications see nterface

Structure of !oc Processing +unctions later in this cha(ter.%he (rocessing ste(s and their res(ectie status results are stored inta/le &!!S.n addition? the routine has to (ro(erly determine the ne't status ofthe !oc in ta/le &!!SN usually it ;ill /e &!!SS%A% 53 forO or 51 for error.

)'&'D " 'ata

)'&' " ontrol Record

)vent signals readiness

)'&% " Processingfunction

unction has a fi#edinterface

)'&'S " Status log

Status must be loggedproperly

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 88/181

*+(3 (3  #o8 to Create the IDoc Data

R/3 provides a sophisticated IDoc processin frae8ork( This frae8ork deterines afunction odule 8hich is responsible for creatin or processin the IDoc(

%he ernel of the !oc (rocessing is al;ays a distinct function

module. +or the out/ound (rocessing? the function module creates the!oc and leaes it in an internal ta/le? ;hich is (assed as an interface

 (arameter.!uring in/ound (rocessing the function module receies the !oc ia an interface (arameterta/le. t ;ould inter(ret the !oc data and ty(ically u(date the data/ase either directly or ia acall transaction.

%he function modules are called dynamically from a standard routine.%herefore? the function must adhere to a ;elldefined interface.

Kou may ;ant to inestigate the function grou( ED"% ? ;hich containsa num/er of !oc handler routines and ;ould call the customised

function.%he easiest ;ay to start the deelo(ment of an out/ound !ocfunction module is to co(y an e'isting one. %here are many sam(les inthe standard ,>3 re(ositoryQN most are named !CE%-:!R or 

!CE%P%RF"C'IO" IDOC;O'P';ORDERS-

 

F"C'IO" IDOC;I"P';ORDERS-

 

F"C'IO" %AS'ERIDOC;CREA'E;%A'%AS

 

• ,iure 331  Scheatic of an IDoc outbound process

unction module togenerate the &'oc

unction are calleddynamically

unction group !DI*  with useful routines

opy and modify e#istingroutines

?utbound samplefunctions are named li$eIDC-3TP3T4 

&nbound samplefunctions are named li$eIDC-I*P3T4 

?utbound samplefunctions for master dataare named li$e(AST!+IDC-I*P3T4 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 89/181

*+( (  Interface Structure of IDoc Processin ,unctions

To use the standard IDoc processin echanis< the processin function odule ust havecertain interface paraeters because the function is called d%naicall% fro astandard routine(

%he automated !oc (rocessor ;ill call your function module from ;ithin the (rogramRS"AS'ED? usually either from the FOR% ALE;PROCESSI" or EDI;PROCESSI".n order to /e com(ati/le ;ith this automated call? the interface of the function module must

 /e com(liant.F"C'IO" ;IDOC;O'BO"D;SA%PLE.

() I0'.R#I"1

R 8A<&6+<E%&S%7 <O& ,S3<P%:A< !&+A<% QDQR 8A<&6+<EC$$%7 <O& ,S3<P%:A< !&+A<% SPAC&R &DP,%:*R 8A<&6+E!CE=&A!&,7 <O& &!!C S%,C%,& &!!C

R %A-<&SR %E!CEC:%,< S%,C%,& &!!CR %E!CE!A%A S%,C%,& &!!!R C=A:*:*R 8A<&6C:%,<E,&C,!E:7 <O& &!!C S%,C%,& &!!CR 8A<&6-B&C%7 <O& :AS% S%,C%,& :AS%R &DC&P%:SR &,,,E:E!CEC:%,<R &,,,EW,%:*E!CES%A%SR &,,,E:E!CE!A%AR S&:!:*E<*CA<ESKS%&$E:O:W:

R :O:W:E&,,, • ,iure 31  Interface structure of an AST copatible function odule

n/ound functions are also called ia a standard mechanism.F"C'IO" IDOC;I"P';SO%E'?I".

() I0'.R#I"1

R 8A<&6:P%E$&%=!7 <O& -!W+APEPA,:P%$&%=!R 8A<&6$ASSEP,C&SS:*7 <O& -!W+APEPA,$ASSEP,CR &DP,%:*R 8A<&6W,O+<WE,&S<%7 <O& -!W+APEPA,,&S<%

R 8A<&6APP<CA%:E8A,A-<&7 <O& -!W+APEPA,APP<E8A, R 8A<&6:EP!A%&E%ASO7 <O& -!W+APEPA,P!A%&%ASO R 8A<&6CA<<E%,A:SAC%:E!:&7 <O& -!W+APEPA,CA<<%,A:SR %A-<&SR !CEC:%,< S%,C%,& &!!CR !CE!A%A S%,C%,& &!!!R !CES%A%S S%,C%,& -!!CS%A%R ,&%,:E8A,A-<&S S%,C%,& -!W+,&%8A, R S&,A<A%:E:+ S%,C%,& -!ES&, • ,iure 3+1  Interface structure of an IDoc inbound function

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 90/181

*+(+ (+  Recipe to Develop an 7utbound IDoc ,unction

This is an individual codin part 8here %ou need to retrieve the inforation fro the databaseand prepare it in the for the recipient of the IDoc 8ill e0pect the data(

%he first ste( is reading the data from the data/ase? the one you ;ant

to send.F"C'IO" ;A<<;COO:BOO:;'E<';IDOC;O'B.

()**********************************************************************

RR<oale SchnittstelleR $P,%:*R 8A<&6E%!-B&C%7 <O& %=&A!%!-B&C% !&+A<% Q%&D%QR 8A<&6E%!!7 <O& %=&A!%!! !&+A<% QS%QR 8A<&6E%!:A$&7 <O& %=&A!%!:A$&R 8A<&6E%!SP,AS7 <O& %=&A!%!SP,AS !&+A<% SK<A:*R &DP,%:*

R 8A<&6&E%=&A!7 <O& %=&A! S%,C%,& %=&A!R %A-<&SR !CE!A%A S%,C%,& &!!! P%:A<R !CEC:%,< S%,C%,& &!!C P%:A<R %<:&S S%,C%,& %<:& P%:A<R &DC&P%:SR +:C%:E:%E&DS%R 8&,S:E:%E+:!R  CALL F"C'IO" @READ;'E<'@

  &DP,%:*  ! !  <A:*A*& <A:*A*&  :A$& :A$&  -B&C% -B&C%  %A-<&S  <:&S <:&S.( now stu2 the data into the Idoc record format 

  PERFOR% PAC:;LI"E 'ABLES IDOC;DA'A SI" @'?EAD@ E;'?EAD.

  <P A% <:&S.

  P&,+,$ PACOE<:& %A-<&S !CE!A%A S:* Q%=&A!Q <:&S.  &:!<P.&:!+:C%:.

Read data to send

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 91/181

*+( (  Convertin Data into IDoc Seent ,orat

The ph%sical forat of the IDocs records is al8a%s the sae( Therefore< the application dataust be converted into a !444 character strin(

An !oc is a file ;ith a rigid formal structure. %his allo;s the

corres(ondents to correctly inter(ret the !oc information. Were it fordata e'change /et;een SAPsystems only? the !oc segments could

 /e sim(ly structured lie the corres(ondent !!C structure of the ta/les ;hose data is sent.=o;eer? !ocs are usually trans(orted to a ariety of legacy systems ;hich do not run SAP.-oth corres(ondents therefore ;ould agree on an !oc structure ;hich is no;n to thesending and the receiing (rocesses.

All data needs to /e com(iled in an internal ta/le ;ith the structure ofthe standard SAP ta/le &!!!. %he records for &!!! are

 (rinci(ally made u( of a header string descri/ing the segment and aaria/le length character field 6called S!A%A7 ;hich ;ill contain theactual segment data.

FOR% PAC:;LI"E 'ABLES IDOC;DA'A SI" @'?EAD@ E;'?EAD.

  %A-<&S %=&A!.  $8&C,,&SP:!:* &%=&A! to 1%=&A!.  $8& 1%=&A!J % !CE!A%AS&*:A$.  $8& 1%=&A! % !CE!A%AS!A%A.  APP&:! !CE!A%A.&:!+,$.H• ,iure 31  Routine to ove the translate to IDoc data

+inally? the control record has to /e filled ;ith meaningful data?

es(ecially telling the !oc ty(e and message ty(e.  IF IDOC;CO"'RL)S"DPR" IS I"I'IAL.

  S&<&C% S:*<& R +,$ %000 W=&,& $A:!% & SK$A:!%.  $8& %000<*SKS % !CEC:%,<S:!P,:.  &:!+.  !CEC:%,<S:!P,% Q<SQ.R %rans ;e20 V ut/ound Controls muss ents(rechend geset@t ;erden.R 2 %ransfer !oc immediatelyR 4 Collect !ocs!CEC:%,<%$! Q2Q. 1imediately? su/system

 C<&A, !CEC:%,<.  !CEC:%,<!C%P QKADDE%&D%Q.  APP&:! !CEC:%,<.• ,iure 361  ,ill the essential inforation of an IDoc control record

ill the data segmentswhich ma$e up the &'oc

%ransfer the whole &'octo an internal table,having the structure of)'&''

ill control record

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 92/181

*6  Partner Profiles and PortsR/3 defines partner profiles for ever% EDI partner( The profiles are used to declare the

counication channels< schedule< and conditions of processin(

Suar%

Partner (rofiles declare the communication medium to /e used ;ith a (artner.

Ports define the (hysical characteristics of a communication channel.f you define an A<& scenario for your !oc (artners? you can use the A<& automated (artner (rofilegeneration 6 → A<& 7.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 93/181

*(! 6(!  IDoc T%pe and $essae T%pe

An IDoc file re>uires a iniu of accopan%in inforation to ive sense to it( These are theessae t%pe and the IDoc t%pe( "hile the IDoc t%pe tells %ou about the fields andseents of the IDoc file< the essae t%pe flas the conte0t under 8hich the IDoc8as sent(

A receier of an !oc must no; the e'act syntactical structure of thedata (acage receied. :aturally? the receier only sees a te't file ;ithlines of characters. n order to inter(ret it? it is necessary to no;

;hich segment ty(es the file may contain and ho; a segment is structured into fields. SAPsends the name of the !oc ty(e in the communication header.

%he !oc ty(e descri/es the file structure. %he !oc ty(e is definedand ie;a/le ;ith transaction WE30.&'am(les of !oc ty(es are M&TM&S'(? -DE-S'(? +%D3&'( or +SM&S'(.%he message ty(e is an identifier that tags the !oc to tell the receier

ho; the !oc is meant to /e inter(reted. t is therefore the tag for thesemantic content of the !oc.&'am(les of message ty(es are M&TM&S ? -DE-S ? +%D3& or+SM&S .%he com/ination of !oc ty(e and message ty(e gies the !oc thefull meaning. %heoretically? you could define only a single !oc ty(efor eery !oc you send. %hen? all !ocs ;ould hae the samesegments and the segments ;ould al;ays hae the same fieldstructure. According to the conte't some of the record fields are filledN

others are sim(ly oid. $any antiGuated interfaces are still ;oring that ;ay.%y(ical com/inations of !oc and message ty(es are the follo;ing  ;essage %ype &'oc %ype

Sales order, older format ?R')RS ?R')RSB0

Sales order< ne8er forat ?R')RS ?R')RSBJ

Purchase Re>uisition P@RR) ?R')RSB0

 %he e'am(le sho;s you that sales orders can /e e'changed in different file formats. %heremay /e some customers ;ho acce(t the latest !oc format -DE-S'8? ;hile others stillinsist on receiing the old format -DE-S'(.%he !oc format for sales orders ;ould also /e used to transfer a (urchase reGuisition. Whilethe format remains the same? the different message ty(e signals that it is not an actual order

 /ut a reGuest.

&'oc type signalssyntactical structure

&'oc type 9*)3B

)#amples:

;essage type signals thesemantic conte#t

)#amples

or any combination ofmessage type andreceiving partner, aprofile is maintained

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 94/181

*(* 6(*  Partner Profiles

Partner profiles pla% an iportant role in EDI counications( The% are paraeter files 8hichstore the EDI partner dependent inforation(

When data is e'changed /et;een (artners? it is im(ortant that sender

and receier agree on the e'act synta' and semantics of the data to /ee'changed. %his agreement is called a partner proile and tells thereceier the structure of the sent file and ho; its content is to /einter(reted.

 %he follo;ing information is defined ;ith the (artner (rofile.

27   •  !oc ty(e and message ty(e as ey identifier of the (artner  (rofile

28   •   :ames of sender and receier to e'change the !ocinformation for the res(ectie !oc and message ty(e

29   •  <ogical (ort name ia ;hich the sender and receier? res(. ;ill

communicatef you e'change e.g. sales orders ;ith (artners? you may do this iadifferent media ;ith different customers. %here may /e one customerto communicate ;ith you ia %CP>P 6the nternet7 ;hile the otherstill insists on receiing disette files.%hey must /e defined for eery ,>3 client indiidually. %hey cannot

 /e trans(orted using the ,>3 trans(ort management system. %his is /ecause the (rofile contains the name of the sending system? ;hich is

naturally different for consolidation and (roduction systems.%he (rofiles allo; you to o(en and close &! connection ;ithindiidual (artners and s(ecify in detail ;hich !ocs are to /e

e'changed ia the interface.%he (rofile is also the (lace to loc (ermanently or tem(orarily an!oc communication ;ith an &! (artner. So you shut the gate fore'ternal communication ;ith the (rofile.

Partner profiles definethe type of data andcommunication paths ofdata to be e#changedbetween partner 

or any combination ofmessage type andreceiving partner, aprofile is maintained

1

%he communicationmedia is assigned by theprofile

Profiles cannot betransported

Profiles define theallowed )'& connections

Profiles can also used tobloc$ an )'&communication

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 95/181

*.(! 6(3  Definin the partner profile G  WE20 H

The transaction "E*4 is used to set up the partner profile(

%he (rofiles are defined ;ith transaction WE20? ;hich is also found inthe &! master menu WEDI. +rom there you need to s(ecify (artner

and (artner ty(e and ;hether you define a (rofile for in/ound or out/ound. Additionally? youmay assign the (rofile to a :AS% message ty(e.

%he (artner ty(e defines from ;hich master data set the (artnernum/er originates. %he (artner ty(es are the ones ;hich are used inthe standard a((lications for S!? $$ or +. %he most im(ortant ty(esfor &! are < 6<ieferant? su((lier7? C 6Customer7 or <S 6<ogicalsystem7. %he logical system is of s(ecial interest ;hen you e'change

data ;ith com(uter su/systems ia A<& or other ,+C means.+or eery (artner and eery direction of communication? ;hether youreceie or send !ocs? a different (rofile is maintained. %he in/ound

 (rofile defines the (rocessing routine. %he out/ound (rofile definesmainly the target? ;here to send the data .

f you send !ocs out of an a((licationJs messaging? i.e. acommunication ia the :AS% ta/le? then you hae to lin the messagety(e ;ith an !oc (rofile. %his is also done in transaction W&20.%he (rocessing code is a logical name for the (rocessing functionmodule or o/Fect method. %he (rocessing code is used to uniGuelydetermine a function module that ;ill (rocess the receied !oc data.%he in/ound (rofile ;ill (oint to a (rocessing code.

WE20

Partner type, e.g.(&Supplier @ustomer (S(ogical system

&nbound and outbounddefinitions

(in$ message type tooutbound profile

&nbound profilesdetermine the processinglogic

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 96/181

*.(* 6(  Data Ports G  WE21 H

IDoc data can be sent and received throuh a ultitude of different edia( In order to decouplethe definition of the edia characteristics fro the application usin it< the edia isaccessed via ports(

A (ort is a logical name for an in(ut>out(ut deice. A (rogram tals toa (ort ;hich is (resented to it ;ith a common standard interface. %he (ort taes care of the translation /et;een the standard interface formatand the deice de(endent format.nstead of defining the communication (ath directly in the (artner

 (rofile? a (ort num/er is assigned. %he (ort num/er then designatesthe actual medium. %his allo;s you to define the characteristics of a

 (ort indiidually and use that (ort in multi(le (rofiles. Changes in the (ort ;ill then reflect automatically to all (rofiles ;ithout touching them.%y(ical (orts for data e'change

30   •  !is file ;ith a fi'ed name

31   •  !is file ;ith dynamic names

32   •  !is file ;ith trigger of a /atch routine

33   •  Standard ,+C connection ia %CP>P

34   •  A net;or channel

35   •  %CP>P +%P destination 6%he nternet7

36   •  Call to a indiidual (rogram e.g. &! conerter 

&ery a((lication should send or receie its data ia the logical (ortsonly. %his allo;s you to easily change the hard;are and soft;are used

to mae the (hysical > connection ;ithout interfering ;ith the (rogram itself.%he transactions used to define the (orts are

37   •  WE21 to create the (ort and assign a logical name? and

38   •  SM59 to define the (hysical characteristics of the >deice used.

%here are different (ort ersions for the res(ectie ,>3 releases as sho;n in the matri' /elo;

PortT%pe

DDic,orat

Release

0 notused

not used

J )'&'3 J.#, 3.#

3 )'&'D D.#

• ,iure 3)1  R/3 port t%pes b% release

%he difference /et;een the (ort ty(es is mainly the length of somefields. &.g. does (ort ty(e 3 allo; segment names u( to 30 charactersin length? ;hile (ort ty(e 3 is constrained to a ma'imum segment

name of characters.

 A port is a logical nameto access a physicalinput/output device

ommunication media isdefined via a portdefinition

ommunication media

2

)very program shouldcommunicate with othercomputers via the ports

only

WE21 defines the portT

SM59 sets up media

3

Port types

Port versions differ inlength of fields

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 97/181

3.)  R,C Reote ,unction CallA reote function call R,C enables a coputer to e0ecute a prora an a different coputer

8ithin the sae 9A< "A or Internet net8ork( R,C is a coon 2IL feature< 8hichis found also in other obect-oriented operatin s%stes( R/3 provides special D99sfor "ID7"S< T and 2IL to allo8 R,C calls fro and to R/3(

Suar%,+C can lin t;o systems together.,+C function modules are lie standard function ;ith only a fe; limitations.,+C can also call (rogram on a non ,>3 system.

 '*ere@& a &tor a#out &ome rog& t*at teac*e& u& all a $alua#le le&&o! a#out lie.

%he story goes lie this

A grou( of frogs ;ere traelling through the ;oods. %;o of them fell into a dee( (it. All the other frogs gathered around the (it.When they sa; ho; dee( the (it ;as they told the t;o frogs thatthey ;ere as good as dead. %he t;o frogs ignored the comments and

tried to Fum( u( out of the (it ;ith all of their might. %he other frogse(t telling them to sto(? saying that they ;ere as good as dead.+inally? one of the frogs too heed of ;hat the other frogs ;eresaying and gae u(. =e fell do;n and died.

%he other frog continued to Fum( as hard as he could. nceagain? the cro;d of frogs yelled at him to sto( the (ain and Fust die.=e Fum(ed een harder and finally made it out. When he got out? theother frogs said? !id not you hear us" %he frog e'(lained to themthat he ;as deaf. =e thought they ;ere encouraging him the entiretime.

%his story teaches us t;o lessons. %here is (o;er of life and death inthe tongue. An encouraging ;ord to someone ;ho is do;n can lifthim u( and hel( him mae it through difficult times. A destructie;ord to someone ;ho is

do;n? can /e ;hat it taes to ill him.

So letQs /e careful ;hat ;e say. <et us s(ea life to those ;ho crossour (ath. Words are so (o;erful? itQs sometimse hard to understandthat an encouraging ;ord can go such a long ;ay. Oee(ing this inmind? letQs al;ays /e careful and thin a/out ;hat ;e hae to say.

 -ecei;ed as a S&M A“send phenomenal amo!nt o mail$B e2mail  rom !nCnown

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 98/181

3.(! )(!  "hat Is Reote ,unction Call R,C'

A Reote ,unction Call enables a coputer to e0ecute a prora an another coputer( Thecalled prora is e0ecuted locall% on the reote coputer usin the reotecoputerJs environent< CP2 and data storae(

,emote function call is one of the great achieements of %CP>Pnet;ors. &ery com(uter ;ithin the net;or can acce(t an ,+Ccalland decides ;hether it ;ants to e'ecute the reGuest. &ery modern+%P serer im(lementation includes the ,+C calling feature.

A classical net;or serer stores the (rogram code in a centrallocation. When the (rogram is called? the code ;ill /e trans(orted iathe net;or to the calling com(uter ;orstation and e'ecuted on thecalling com(uter? consuming the callerJs resources of CP? memoryand dis.

An ,+C calls the (rogram on the remote com(uter. t is Fust lie

ste((ing oer to the remote com(uter? ty(ing in the (rogram commandline ;ith all (arameters and ;aiting for the result to /e re(orted /ac to the calling com(uter. %he calling com(uter does not (roide anyresources other than the (arameters s(ecified ;ith the call.

=ere is again ;hat an ,+C does.

40   •  t calls the (rogram on a remote com(uter and s(ecify (arameters if and as necessary.

41   •  %he remote com(uter decides ;hether to fulfil the reGuest ande'ecute the (rogram.

42  •

  &ery mani(ulation done /y the called (rogram is effectie inthe same ;ay as if the (rogram had started on the remote system.

43   •  %he calling (rogram tas ;aits mean;hile for the called (rogram to terminate.

44   •  When the ,+C (rogram terminates? it returns result alues if a((lica/le.

45   •  %he called (rogram needs not to /e (resent on the callingcom(uter.

46   •  %he called (rogram can /e run under a com(letely differento(eration system? so you can call a W:!WS (rogram from :D and iceersa.

A ty(ical ,+C e'am(le is the internet ;ith a ;e/ /ro;ser as the ,+Cclient and the ;e/ serer as the ,+C serer. &'ecuting a serer a((lete.g. ia C* or a BA8A or BA8ASC,P% serer side a((let is actuallya remote function call from the ;e/ /ro;ser to the =%%P serer.

f ,>3 is doing ,+C calls into another system? then it does e'actly;hat a /ro;ser does ;hen (erforming a reGuest on the =%%P or +%Pserer.

R allows e#ecutesubroutines on a remotecomputer 

lassical networ$ingloads the program to theclient computer 

R e#ecutes theprogram on the server 

%he internet is a typicalR application

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 99/181

(! )(*  R,C in R/3

R,C provides interface shis for different operatin s%stes and platfors< 8hich provide thecounication APIs for doin R,C fro and to R/3(

SAP ,>3 is designed as a multiserer architecture. %herefore? ,>3 is

eGui((ed ;ith a communication architecture that allo;s datae'change and communication /et;een indiidual ,>3 a((lication anddata/ase serers. %his communication channel also ena/les ,>3 toe'ecute (rograms running on a remotely connected serer using ,+Ctechnology.

SAP ,>3 (roides s(ecial routines to ena/le ,+C from and to ,>3 for seeral o(eration systems. +or :% and W:!WS the !<<s aredeliered ;ith the SAP*

 :on SAP ,>3 (rograms can access function modules in ,>3? ;hich isdone /y calling an SAP (roided interface stem. nterfaces e'ist for 

:D? Windo;s and -$ S>390 (latforms.,>3 systems ;hich are tied together ia %CP>P are al;ays ,+Cca(a/le. ne ,>3 system can call function modules in a remote ,+Csystem? Fust as if the function ;here (art of the o;n calling system.

A function module can /e called ia ,+C if the function has ,+Cena/led. %his is a sim(le flag on the interface screen of the function.

&na/ling ,+C for a function does not change the function. %he onlydifference /et;een ,+Cena/led and standard functions is that ,+Cfunctions hae some restriction namely? they cannot hae unty(ed

 (arameters.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 100/181

(* )(3  Teleport Te0t Docuents "ith R,C

This e0aple deonstrates the use of R,C functions to send data fro one SAP s%ste to areote destination( The e0aple is a siple deonstration of ho8 to efficientl% and>uickl% use R,C in %our installation(

A te't in SAP is an ordinary document? not a customi@ing or deelo(ment o/Fect. %herefore? te'ts are neer automaticallytrans(orted from a deelo(ment system to a (roduction system. %hise'am(le hel(s to co(y te't into a remote system.

%he A-AP E,+CECPK%&D% selects te'ts from the te't data/asesS%D= and S%D<. %he A-AP reads the S%D= data/ase only toretriee the names of the te't documents that match the selectionscreen. %he te't itself is read using the standard SAP function module,&A!E%&D%.

%hen the A-AP calls the function module KE,+CESA8&E%&D%

remotely in the destination system. %he function runs com(letely onthe other com(uter. %he function needs not e'ist in the calling system.

F"C'IO" ;RFC;SA+E;'E<'.

()**********************************************************************

RR<oale Schnittstelle

R $P,%:*

R 8A<&6C<&:%7 <O& SK$A:!% !&+A<% SK$A:!%

R 8A<&6=&A!&,7 <O& %=&A! S%,C%,&%=&A!

R &DP,%:*

R 8A<&6:&W=&A!&,7 <O& %=&A! S%,C%,&%=&A!

R %A-<&S

R <:&S S%,C%,& %<:&

R &DC&P%:S

R !R <A:*A*&

R :A$&

R -B&C%

R

  CALL F"C'IO" @SA+E;'E<'@

  &DP,%:*

R C<&:% SK$A:!%

  =&A!&, =&A!&, 

R :S&,% Q Q

Step 0: Reading the te#tdocuments in thesending system

Step J: Sending the te#tand saving it in thedestination system

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 101/181

  SA8&$!&E!,&C% QDQ

R W:&,ESP&C+&! Q Q

  $P,%:*

R +:C%:

  :&W=&A!&, :&W=&A!&, 

  %A-<&S

  <:&S <:&S.

&:!+:C%:.

• ,iure 3.1  MKREADKTELT< a cop% of function READKTELT 8ith R,C enabled

 

REPOR' ;RFC;COP'E<'.

%A-<&S %=&A!? S%D=? ,SSC&.

S&<&C%P%:S %!:A$& +, ,SSC&%!:A$&$&$,K ! %:A -<*A%,K.

S&<&C%P%:S %!-B&C% +, ,SSC&%!-B&C%$&$,K ! %-.

S&<&C%P%:S %!! +, ,SSC&%!! $&$,K !%!.

PA,A$&%&,S ,C8SKS <O& %000<*SKS $&$,K! <* -<*A%,K.

!A%A %=&A!S <O& S%D= CC,S 0 W%= =&A!&, <:&.

!A%A %<:&S <O& %<:& CC,S 0 W%= =&A!&, <:&.

!A%A D%&S% <O& %&S% 8A<& QDQ.

S%A,%+S&<&C%:.

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

R *et all the matching te't modules R

RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

RRRRRRRRRRRRRRRRRSELEC' = FRO% S'<? I"'O 'ABLE '?EADS

  W=&,& %!-B&C% : %!-B&C%

  A:! %!! : %!!

  A:! %!:A$& : %!:A$&.

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

R Process all found te't modules R

RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 102/181

LOOP A' '?EADS.

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

R ,ead the te't from (ool R

RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

RRRRRRRRRRRRRRRRR  CALL F"C'IO" @READ;'E<'@

  &DP,%:*

  ! %=&A!S%!!

  <A:*A*& %=&A!S%!SP,AS

  :A$& %=&A!S%!:A$&

  -B&C% %=&A!S%!-B&C%

  $P,%:*  =&A!&, %=&A!

  %A-<&S

  <:&S %<:&S

  &DC&P%:S

  %=&,S .

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

R ,+C call to function in (artner system that stores the te't there R

RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

  CALL F"C'IO" @;RFC;SA+E;'E<'@

  !&S%:A%: JP,C<:%100J

  &DP,%:*

  =&A!&, %=&A!

  %A-<&S

  <:&S %<:&S.  &DC&P%:S

  %=&,S 5.

• ,iure 41  Prora to cop% te0t odules into a reote s%ste via R,C

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 103/181

(3 )(  Callin A Coand 9ine :ia R,C '

R/3 R,C is not liited to counication bet8een R/3 s%stes( Ever% coputer providinsupport for the R,C protocol can be called fro R/3 via R,C( SAP providesnecessar% API libraries for all operatin s%stes 8hich support R/3 and an% aorprorain lanuaes e(( CNN< :isual 5asic or Delphi(

Calling a (rogram ia ,+C on a PC or a :D system is ery muchlie calling it in another ,>3 system. ndeed? the calling system ;illnot een /e a/le to recogni@e ;hether the called (rogram runs onanother ,>3 or on a PC.

%o mae a system ,+C com(liant? you hae to run an ,+C serer  (rogram on the remote com(uter. %his (rogram has to hae a callinginterface ;hich is ;ell defined /y SAP. n order to create such aserer (rogram? SAP deliers an ,+C deelo(ment it along ;ith theSAP*.

%he ,+C call to Windo;s follo;s the <&>AC%8&D standard?;hile :D is connected ia %CP>P ,+C ;hich is a standard in all%CPcom(liant systems.

+or most (ur(oses you might /e satisfied to e'ecute a command line (rogram and catch the (rogram result in a ta/le. +or that (ur(ose youcan use the (rogram RFCEEC ;hich comes ;ith the e'am(les of the,+C deelo(ment it /oth for :D and W:!WS. Search for it inthe SAP* directory. %his (rogram ;ill call the o(erating systemscommand line inter(reter along ;ith an ar/itrary string that you may

 (ass as (arameter.

n order to call rcexec, it has to /e defined as a %CP>P destination inSM59. ,>3 comes ;ith t;o destinations (redefined ;hich ;ill callrcexec either on the ,>3 a((lication serer SE-0E-3E5E+  or on thefront end  +&3E5E+ . -y s(ecifying another com(uter name youcan redirect the call for ,+C&D&C to the named com(uter. f course?the target com(uter needs to /e accessi/le from the ,>3 a((licationserer 6not from the ;orstation7 and hae rcexec installed.

%he o/Fect interface of rcexec su((orts t;o methods only? ;hich arecalled as remote function call from ,>3.

rc3remote3exec  ;ill call ,+C&D&C and e'ecute the command

inter(reter ;ith the (arameter string. :o results ;ill /e returned /esides an eentual error code.

CALL F"C'IO" JRFC;RE%O'E;E<ECK

  !&S%:A%: X,+CE&D&CJ

  &DP,%:* C$$A:! Jdir cYsa(gui Vin(utJ

%he e'am(le call a/oe ;ould e'ecute the follo;ing ;hen run on a!S system.

command.com >c co(y cYconfig.sys cYtem(

rc3remote3pipe  ;ill call ,+C&D&C? e'ecute the command lineinter(reter ;ith the (arameter string and catch the out(ut into ani l /l

R does not now thephysics of the remotesystem

R server must beactive on remotecomputer 

+FC!5!C  must bedefined as Rdestination with S;I1

rfc-remote-e6ec 

rfc-remote-pipe

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 104/181

CALL F"C'IO" JRFC;RE%O'E;PIPEK

  !&S%:A%: X,+CE&D&CJ

  &DP,%:* C$$A:! Jdir cYsa(gui Vin(utJ

%he e'am(le call a/oe ;ould e'ecute the follo;ing ;hen run on a!S system?

command.com >c dir cYsa(gui Vin(ut

;hile the file in(ut is caught /y rc3remote3pipe and returned to thecalling system.

A common a((lication for the use of rc3remote3pipe  is toautomatically chec a file system for ne;ly arried files and (rocessthem. +or that (ur(ose? you ;ould create three directories? e.g. thefollo;ing.

68i!comi!g

'Y;or 

'Y(rocessed

%he statement retriees the file list ;ith rc3remote3pipe into an ,>3internal ta/le.

dir 'Yincoming >/

%hen the files are moe into a ;oring directory.

moe 'YincomingYfile 'Y;or 

+inally the files are (rocessed and moed into an archie directory.moe 'Y;or 'Y(rocessed

Process incoming files

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 105/181

6.  "orkflo8 Technolo%There are t8o faces of 8orkflo8 in R/3( 7ne is the business oriented 8orkflo8 desin as it is

tauht in universities( This is ipleented b% the SAP 5usiness "orkflo8O(#o8ever< the 8orkflo8 is also a tool to link transactions easil%( It can be used toeasil% define e0ecution chains of transactions or to trier user actions 8ithout the

need to odif% the SAP standard code( This can even be achieved 8ithout laboriousl%custoisin the #R related 8orkflo8 settins(

Suar%

Worflo; eent linage allo;s the e'ecution of another (rogram ;hen a transaction finishes.%he ;orflo; eent linage mechanism can /e easily used ;ithout customising the full ;orflo; scenarios.%his ;ay ;e use the ;orflo; engine to chain the e'ecution of transaction and circument the setu( of theS& 7!siness )orClow.

%here are seeral inde(endent ;ays to trigger the ;orflo; eent linage.America!& 7or> *ard #ecau&e t*e are optimi&t&.

*ermans ;or hard /ecause they fear the future.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 106/181

6(! .(!  "orkflo8 in R/3 and Its 2se for Developent

SAP R/3 provides a echanis< called "orkflo8 that allo8s conditional and unconditionaltrierin of subse>uent transactions fro another transaction( This allo8s %ou tobuild up autoatic processin se>uences 8ithout havin the need to odif% the SAPstandard transactions(

%he SAP /usiness ;orflo; ;as originally designed to model /usiness ;orflo;s according to scientific theories ;ith the samename -usiness Worflo;. %his is mainly a modelling tool that usesgra(hical means? e.g.. flo; charting to setch the flo; of eents in asystem to achiee the reGuired result. SAP allo;s you to transcri(tthese eent modellings into customi@sng entries? ;hich are thene'ecuted /y the SAP Worflo; mechanism.

%he transaction to enter the gra(hical model? to define the eents ando/Fects? and to deelo( necessary triggering and (rocessing o/Fects isSW1 6t is an not a @ero7.

;ill not een try to descri/e ho; to design ;orflo;s in SAP.  /eliee that the ;ay ;orflo;s are reali@ed in SAP is far toocom(licated and unnecessarily com(le' and ;ill fill a se(arate /oo.

+ortunately? theunderlying mechanismfor ;orflo;s is lesscom(le' as the formal

oerhead. $ost maFor transactions ;ill trigger the ;orflo; iaS)E3E0E%T3+-E&TE  . %his ;ill mae a call to a ;orflo; handler routine? ;hose name can usually /e customised dynamically andim(lemented as a function module.

*or$flow as businessmethod

%ransaction S*?0

SAP approachunnecessary comple#and formal

*or$flow events can beused for owndevelopments

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 107/181

6(* .(*  Event Couplin GEvent 9inkaeH

Contrar% to 8hat %ou ostl% hear about R/3 8orkflo8< it is relativel% eas% and echanical todefine a function odule as a consecutive action after another routine raised a8orkflo8 event(,or e0aple< this can be used to call the e0ecution of a transactionafter another one has finished(

%he ;hole ;orflo; mechanism is /ased on a ery sim(le (rinci(le.&ery ;orflo; ena/led transaction ;ill call directly or indirectly thefunction module during S)E3E0E%T3+-E&TE  u(date.

%he function module

S)E3E0E%T3+-E&TE  ;ill then consult a customising ta/le. +or asim(le ;orflo; cou(ling? the information is found in the ta/le

S)ET6E+4   . %he ta/le ;ill tell the name of the su/seGuent (rogram to call? either a function module or an o/Fect method.

%his ;ay of defining the su/seGuent action is called ty(e cou(ling /ecause the action de(ends on the o/Fect ty(e of the calling eent.

%he call to the follo;ing eent is done ;ith a dynamic function call.%his reGuires that the called function module has a ;elldefinedinterface definition. =ere you see the call as it is found inS)E3E0E%T3+-E&TE  .

CALL F"C'IO" tpecou)recget# call recei$er;tpe;get;#

&DP,%:*

o/Fty(e ty(ecouo/Fty(e

o/Fey o/Fey

eent eent

genericErecty(e ty(ecourecty(e

$P,%:*

recty(e ty(ecourecty(e

%A-<&SeentEcontainer eentEcontainer

&DC&P%:S

%=&,S 1.

• ,iure !1  This is the call of the t%pe coupled event in release 45

Call Fu!ctio! @C?A"E;POI"'ERS;READ@

%he A-AP ,-!$!C ;ill (rocess all o(en change (ointers anddistri/ute the matching !ocs

)very wor$flow enabledtransaction will callSW!-!0!*T-C+!AT!  

SW!-!0!*T-C+!AT!  will loo$ in a table, e.g.SW!T7P!C3  to getthe name of the followingaction

Reading the changepointers which are notyet processed

RC';&'?

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 108/181

6(3 .(3  "orkflo8 fro Chane Docuents

Ever% tie a chane docuent is 8ritten< a 8orkflo8 event for the chane docuent obect istriered( This can be used to chain unconditionall% an action fro a transaction(

%he most interesting chaining (oint for ;orflo; eents is the

creation of the change document. :early eery transaction ;riteschange documents to the data/ase. %his document is committed to thedata/ase ;ith the function module +9&%GED+4ME%T3+SE .%his function ;ill also trigger a ;orflo; eent.

%he ;orflo; handler triggered /y an eent ;hich is fired fromchange documents is defined in ta/le SW&C!-B . +or eery changedocument ty(e? a different eent handler can /e assigned. %his isusually a function module and the call for it is the follo;ing

CALL F"C'IO" &7ecdo#H)o#Htpe#E<POR'I"

c*a!gedocume!t;*eader c*a!gedocume!t;*eader

o#Hecttpe &7ecdo#H)o#HtpeI%POR'I"

o#Hecttpe &7ecdo#H)o#Htpe 'ABLES

c*a!gedocume!t;po&itio! c*a!gedocume!t;po&itio!.

• ,iure *1  This is the call of the chane doc event in release 45

Change (ointers are created /y calling  4%+T"% 

+9&%GED+4ME%T3+SE   ;hich ;rites the usual changedocuments into ta/le +D9D-  and +DS . %his function then callsthe routine +9&%GE3"%TE-S3+-E&TE,  ;hich creates the change

 (ointers.CALL F"C'IO" @C?A"E;POI"'ERS;CREA'E@

E<POR'I"c*a!ge;docume!t;*eader cd*dr

 'ABLESc*a!ge;docume!t;po&itio! i!&;cdpo&.

• ,iure 31  This is the call of the t%pe coupled event in release 45

C8A*)!DC3(!*T-C$S! 

&n addition, changepointers for A() arewritten

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 109/181

6( .(  Trier a "orkflo8 fro $essain

The third coon 8a% to trier a 8orkflo8 is doin it fro essain(

When the ,>3 messaging creates a message and (rocesses itimmediately? then it actually triggers a ;orflo;. Kou can use this to

set u( conditional ;orflo; triggers? /y defining a message ;ith themessage finding and lin the message to a ;orflo;.

Kou define the message the usual ;ay for your a((lication as you;ould do it for defining a message for SAPscri(t etc. As a (rocessingmedia you can assign either the ty(e )  for ;orflo; or F for s(ecial

 (rocessing.

%he media ty(e )   for ;orflo; ;ould reGuire defining an o/Fect inthe o/Fect re(ository. We ;ill only sho; ho; you can trigger the;orflo; ;ith a standard A-AP using the media ty(e F.

Kou need to assign a (rogram and a form routine to the message inta/le T%&-. %he form routine you s(ecify needs e'actly t;oS:*(arameters as in the e'am(le /elo;.

REPOR' S"AS'9F.

%A-<&S :AS%.

+,$ &:%,K S:* ,&%,:EC!& SESC,&&:.

R =ere you go

na call your ;orflo; action

  ,&%,:EC!& 0.  SK$S*! Q3Q.

  SK$S*: Q000Q.

  SK$S*: QQ.

  SK$S*81 QWorflo; called ia :AS%Q.

  CA<< +:C%: Q:AS%EP,%C<EP!A%&Q

  &DP,%:*

  $S*EA,-*- SKS%$S*!

  $S*E:, SKS%$S*:

  $S*E%K SKS%$S*%K

  $S*E81 SKS%$S*81

  $S*E82 SKS%$S*82

  $S*E83 SKS%$S*83

  $S*E84 SKS%$S*84

  &DC&P%:S

  %=&,S 1.&:!+,$.

'efine a message forcondition techniue

 Assign media W  or 9 

orm routine reuirestwo parameters

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 110/181

n addition? you need to declare the ta/le %&ST  ;ith a ta/les statement (u/lic in the A-AP ;here the form routinely resides. When the formis called? the aria/le  %&ST  is filled ;ith the alues of the calling

 %&ST  message.

+AS% must be declaredpublic in the calledprogram

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 111/181

6(+ .(+  E0aple< #o8 to Create a Saple "orkflo8 #andler 

9et us sho8 %ou a function odule 8hich is suitable to serve as a function odule and definethe linkae(

We ;ant to create a ery sim(le function module that ;ill /e triggered

u(on a ;orflo; eent. %his function is called from ;ithin functionS9E;E+E"';CREA'E. %he (arameters must com(ly ;ith thecalling standard as sho;n /elo;.

CALL F"C'IO" tpecou)recget#

&DP,%:*

o/Fty(e ty(ecouo/Fty(e

o/Fey o/Fey

eent eent

genericErecty(e ty(ecourecty(e

$P,%:*

recty(e ty(ecourecty(e

%A-<&S

eentEcontainer eentEcontainer

&DC&P%:S

%=&,S 1.

!)( 9istin !1  Call of the t%pe coupled event in release 45

 

,elease 40- (roides the function module)3E4"3+9&%GE3&TE-3&SSET   ;hich could /e used as atem(late for the interface. So ;e ;ill co(y it and (ut our coding ininstead..

F"C'IO" ;9OR:FLO9;?A"DLER.

RR<oale Schnittstelle

R $P,%:*

R 8A<&6-BO&K7 <O& SW&:S%C-BO&K

R 8A<&6&8&:%7 <O& SW&%KP&C&8&:%

R 8A<&6,&C%KP&7 <O& SW&%KP&C,&C%KP&

R 8A<&6-B%KP&7 <O& SW&%KP&C-B%KP&

R %A-<&S

R &8&:%EC:%A:&, S%,C%,& SWC:%

R &DC&P%:S

R :EW,O+<W  ,&C&8&,S&DP,&SS Q Q.

reate a function modulethat will be triggered by awor$flow event

%emplate for wor$flowhandler 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 112/181

  ,&C&8&,S,&C&8&, SKS-,C.

  APP&:! ,&C&8&,S.

  !C$&:%E!A%A-BE!&SC, -BEO&K.

  C:%&:% -BEO&K.

 APP&:! C:%&:%.

  CA<< +:C%: QSE:&WE!C$&:%ES&:!EAP1Q

  &DP,%:* !C$&:%E!A%A !C$&:%E!A%A

  %A-<&S -B&C%EC:%&:% C:%&:%

  ,&C&8&,S ,&C&8&,S.

&:!+:C%:.

!.( 9istin *1  A 8orkflo8 handler that sends an Sap 7ffice ail

%he function can /e registered as a handler for an eent. %his is done;ith transaction SWLD.

f you do not no; the o/Fect ty(e that ;ill trigger the eent? you canuse the eent log. Kou hae to actiate it from SWLD and then e'ecutethe eent firing transaction. When the eent has /een fired? it ;illtrace it in the eent log.

• ,iure 1  Transaction S"9D to define event linkae and see event lo

All ;orflo; handlers are called ia ,+C to a dummy destination)-H)3+&3''' ;here 000 is to /e re(laced /y the clientnum/er.

$ost errors are caused /y follo;ing reasons

48   •  Kou forgot to set the ,+C flag in the interface definition of your eent handling function module.

49   •  %here is a synta' error in your function module 6chec ;ithgenerate function grou(7.

50 • Kou misty(ed something ;hen defining the cou(ling

(in$ handler to caller 

)vent logging

7it list of common errors

4

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 113/181

51   •  %he internal ;orflo; destination )-H)3+&3'''

is not defined.

f you thin your handler did not e'ecute at all? you can chec the listof (ending /acground tass ;ith transaction S$5. f your eent isnot there? it has either neer /een triggered 6so your ta/les

S)ET6EE%&  and SS)ET6E7  may hae the ;rong entries7 or your eent handler e'ecuted indeed and (ro/a/ly may hae donesomething other than you e'(ected. &rgo your mistae.

Kour eent handler function is called I" BAC:RO"D 'AS: .Kou may ;ant to read carefully the hel( on this to(ic in the SAP hel(.6hel( for Hcall functionI from the editor command line7

S;I2 to display whathappened to your event

Read carefully the helpfor A(( @+%&?+ ..&+ CA!R?@+' %AS!

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 114/181

 

F"C'IO" A<<9F;%AIL;O";E+E"'.

RH $P,%:*

RH 8A<&6-BO&K7 <O& SW&:S%C-BO&KRH 8A<&6&8&:%7 <O& SW&%KP&C&8&:%

RH 8A<&6,&C%KP&7 <O& SW&%KP&C,&C%KP&

RH 8A<&6-B%KP&7 <O& SW&%KP&C-B%KP&

RH %A-<&S

RH &8&:%EC:%A:&, S%,C%,& SWC:%

52   •  %his e'am(le sends a mail to the calling user and tells

53   •  a/out the circumstances ;hen the eent ;as fired.

54   •  Bust for fun? it also lists all current enGueue locs  DA'A8 E"M LI:E SEM0 OCCRS - 9I'? ?EADER LI"E.

  !A%A !CE!A%A <O& S!CC=*1.

  !A%A $A< <O& S%A:!A,! %A-<& + S<S%1 W%==&A!&, <:&.

  !A%A ,&C<S% <O& S%A:!A,! %A-<& + S$<,&C1W%= =&A!&, <:&.

  $A<<:& &ent fired /y user ZJ.

  ,&P<AC& ZJ W%= SK:A$& :% $A<<:&.  APP&:! $A<.

RR

  $A<<:& /Fect Oey ZJ.

  ,&P<AC& ZJ W%= -BO&K :% $A<<:&.

  APP&:! $A<.

RR

  $A<<:& &ent :ame ZJ.

  ,&P<AC& ZJ W%= &8&:% :% $A<<:&.

  APP&:! $A<.

RR

  $A<<:& ,ecty(e ZJ.

  ,&P<AC& ZJ W%= ,&C%KP& :% $A<<:&.

  APP&:! $A<.

RR

  $A<<:& /Fect %y(e ZJ.  ,&P<AC& ZJ W%= -B%KP& :% $A<<:&.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 115/181

  APP&:! $A<.

RR

  $A<<:& Container contentsJ.

  APP&:! $A<.

RR

  <P A% &8&:%EC:%A:&,.

  C:CA%&:A%& &8&:%EC:%A:&,&<&$&:%&8&:%EC:%A:&,8A<&

  :% $A<<:& S&PA,A%&! -K SPAC&.

  APP&:! $A<.

  &:!<P.

;rite the current enGueues into the message 6for demo7

  $A<<:& Actie enGueue locs ;hen eent ;as triggeredJ.

  APP&:! $A<.

  CA<< +:C%: &:&&E,&A!J %A-<&S &: &:.

  <P A% &:.

  C:CA%&:A%& &:*:A$& &:*A,* &:*$!&&:*S, &:*S,8-

  &:*-B &:*C<&:% &:*:A$& &:*%A,* &:*%C!&

  :% $A<<:& S&PA,A%&! -K >J.

  APP&:! $A<.

  &:!<P.

  + &:[\ S :%A<.

  $A<<:& RRR ::& RRRJ.

  APP&:! $A<.

  &:!+.

RR

55   •  fill the receier list  REFRES? RECLIS'.

  ,&C<S%,&C&8&, S&,DKJ.

  ,&C<S%,&CE%KP& -J.

  ,&C<S%&DP,&SS .

56   •  recliste'(ress DJ. ];ill (o( u( a notification on receier screen

  APPE"D RECLIS'.

R R

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 116/181

  C<&A, !CE!A%A.

  !CE!A%A-BE:A$& W+&8&:%J.

  !CE!A%A-BE!&SC, &ent triggered /y ;orflo; ty(ecou(lingJ.

  !CE!A%A-BES,% W,O+<WJ.

57   •  docEdatao/FEe'(dat

58   •  docEdatasensitity

59   •  docEdatao/FE(rio

60   •  docEdatanoEchange=))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))=

  CA<< +:C%: SE:&WE!C$&:%ES&:!EAP1J

  &DP,%:*

  !C$&:%E!A%A !CE!A%A

R !C$&:%E%KP& ,AWJ

R P%E:E%-D

61   •  $P,%:*= SE"';'O;ALL

R :&WE-B&C%E!

  %A-<&S

R -B&C%E=&A!&,

  -B&C%EC:%&:% $A<

R -B&C%EPA,A

R -B&C%EPA,-

  ,&C&8&,S ,&C<S%

  &DC&P%:S

  %E$A:KE,&C&8&,S 1

  !C$&:%E:%ES&:% 2  !C$&:%E%KP&E:%E&DS% 3

  P&,A%:E:EA%=,A%: 4

  PA,A$&%&,E&,,, 5

  DE&,,, #

  &:&&E&,,, )

  %=&,S .

RR

&:!+:C%:.

*4( 9istin 31  Send an SAP office ail triered b% a 8orkflo8 event Gfull e0apleH

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 117/181

*!4  A9E - Application 9ink EnablinA9E is an R/3 technolo% for distribution of data bet8een independent R/3 installations( A9E is

an application 8hich is built on top of the IDoc enine( It sipl% adds soe structured8a% to ive R/3 a ethodical eans to find sender< receiver< and trierin events fordistribution data(

$ake 2se of A9E for ?our Developents%ransfer master data for material? customer? su((lier and more to a different client or system ;ith BALECo(y your settings for the ,>3 classification and ariant configurator to another system? also in BALE Co(y (ricing conditions ;ith A<& from the conditions oerie; screen 6e.g. 12 7

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 118/181

*(! !4(!  A Distribution Scenario 5ased on IDocs

A9E has becoe ver% faous in business circles( "hile it sounds %sterious and like a enialsolution< it is sipl% a eans to autoate data e0chane bet8een SAP s%stes( It isainl% eant to distribute data fro one SAP s%ste to the ne0t( A9E is a ereenhanceent of SAP-EDI and SAP-R,C technolo%(

magine your com(any has seeral sister com(anies in differentcountries. &ach com(any uses its o;n local SAP installation. Whenone com(any creates master data? e.g.? material or customer master? itis ery liely that these data should /e no;n to all associates. A<&allo;s you to immediately trigger an !oc sent to all associates assoon as the master record is created in one system.

Another common scenario is that a com(any uses differentinstallations for com(any accounting and (roduction and sales. n thatcase? A<& allo;s you to co(y the inoices created in S! immediatelyto the accounting installation.

A<& defines a set of data/ase entries ;hich are called the A<&scenario. %hese ta/les contain the information as to ;hich !ocs shall

 /e automatically re(licated to one or more connected ,>3com(ati/ledata systems.

%o /e clear A<& is nota ne; technology. t isonly a handful of  customiing settings

and /acground routines that allo; timed and triggered distri/ution of data to and from SAP or ,+Ccom(liant systems. A<& is thus a mereenhancement of SAP&! and SAP,+C technology.

 A() is an SAP designedconcept to automaticallydistribute and replicatedata between webbedand mutually trustingsystems

 A() defines the logicand the triggering eventsthat describe how andwhen &'ocs aree#changed between thesystems

 A() is an application putupon the &'oc and Rmechanisms of SAP

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 119/181

*(* !4(*  E0aple A9E Distribution Scenario

To better understand< let us odel a sall e0aple A9E scenario for distribution of asterdata bet8een several offices(

<et as assume that ;e ;ant to distri/ute three ty(es of master data

o/Fects the material master? the creditor master? and the de/tor master.<et us assume that ;e hae four offices. %his gra(hic scenario sho;sthe ty(e of data e'changed /et;een the offices. Any of these officeso(erates an its o;n stand alone ,>3 system. !ata is e'changed as!ocs ;hich are sent from the sending office and receied from thereceiing office.

 

• ,iure +1  A9E distribution scenario

!ata /Fect

Sender 

,eceier 

%A'%AS

$aterial $aster 

,3:KD

 :e; Kor ffice

,38&:

8enice ffice

$A%$AS

$aterial $aster 

,3:KD :e; Kor ffice

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 120/181

Paris ffice

$A%$AS

$aterial $aster 

,3:KD

 :e; Kor ffice

,3<AD

<os Angeles

$A%$AS

$aterial $aster 

,3PA, 

Paris ffice

,38&:8enice ffice

$A%$AS

$aterial $aster 

,3<AD

<os Angeles

,38&:

8enice ffice

!&-$AS

!e/itor $aster 

,3PA, 

Paris ffice

,38&:

8enice ffice

!&-$AS

!e/itor $aster ,3PA, 

Paris ffice

,3<AD

<os Angeles

C,&$AS

Creditor $aster 

,3:KD

 :e; Kor ffice

,38&:

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 121/181

8enice ffice

C,&$AS

Creditor $aster 

,3PA, 

Paris ffice

,38&:

8enice ffice

C,&$AS

Creditor $aster 

,3<AD

<os Angeles

,38&:8enice ffice

• ,iure 1  Scenario in tabular for

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 122/181

*(3 !4(3  A9E Distribution Scenario

A9E is a siple add-on application based on the IDoc concept of SAP R/3( It consists of acouple of predefined A5APs 8hich rel% on the custoisable distribution scenario(These scenarios sipl% define the IDoc t%pes and the pairs of partners 8hiche0chane data(

A<& defines the logic and the triggering eents ;hich descri/e ho;and ;hen !ocs are e'changed /et;een the systems. f the A<&&engine has determined ;hich data to distri/ute? it ;ill call ana((ro(riate routine to create an !oc. %he actual distri/ution is then

 (erformed /y the !oc layer.

A<& is? of course? not restricted to the data ty(es ;hich are already (redefined in the -A<& transaction. Kou can ;rite your A<&distri/ution handlers ;hich should only com(ly ;ith some formalstandards? e.g.? not /y(assing the A<& scenarios.

All A<& distri/ution uses !ocs to re(licate the data to the targetsystem. %he A<& a((lications chec ;ith the distri/ution scenario anddo nothing more than call the matching !oc function module? ;hichis alone res(onsi/le for gathering the reGuested data and /ringingthem to the reGuired data (ort. Kou need to thoroughly understand the!oc conce(t of SAP /eforehand? in order to understand A<&.

%he (rocess is e'tremely sim(le &ery time a data o/Fect? ;hich ismentioned in an A<& scenario changes? an !oc is triggered from oneof the defined triggering mechanisms. %hese are usually an A-AP or atechnical ;orflo; eent.

!istri/ution A-APs are started manually or can /e set u( as atriggered or timed /atch Fo/. Sam(le A-APs for A<& distri/ution arethose used for master data distri/ution in transaction -A<&? lie theones /ehind the transaction -!10? -!12 etc.

%he ;orflo; for A<& is /ased on change (ointers. Change (ointersare entries in a s(ecial data/ase entity? ;hich record the creation or modification of a data/ase o/Fect. %hese change (ointers are erymuch lie the SAP change documents. %hey are also ;ritten from;ithin a change document? i.e. from the functionC=A:*&!C$&:%EC<S&. %he ;orflo; is also triggeredfrom ;ithin this function.

SAP ;rites those A<& change (ointers to circument a maFor dra; /ac of the change documents. Change documents are only ;ritten if a alue of a ta/le column changes? if this column is associated ;ith adata element ;hich is mared as releant for change documents 6seeS&117. A<& change (ointers use a customised ta/le ;hich containsthe names of those ta/le fields ;hich are releant for change (ointers.

%he predefineddistribution ACAPs canbe used as templates forown development

 A() uses &'ocs totransmit data betweensystems

 ACAPs can be used inbatch routine

*or$flow is triggeredfrom change document

Relevance for changepointers is defined in&;

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 123/181

*( !4(  2seful A9E Transaction Codes

A9E is custoised via three ain transaction( These are SALE<  WEDI and BALE(

%his is the core transaction for SA<& customi@sng. =ere you findeerything A<& related ;hich has not already /een coered /y the

other customising transactions.

• ,iure 61  SALE - A9E Specific Custoisin

=ere you define all the !oc related (arts? ;hich mae u( most of the

;or related to A<&.

*)'& " &'oc Administration

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 124/181

• ,iure )1   WEDI 

enu

%his is a menu ;hich com/ines most functions necessary for A<&distri/ution? es(ecially the triggering of manual distri/ution of master data or ariant configuration or classification.

CA() 4 entral menu

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 125/181

• ,iure .1  BALE enu

*ood stuff for (o;er deelo(ers. t allo;s you to generate all !ocdefinitions including segments and !oc ty(es from the !!C entriesfor a -AP definition.

C'C " Automatically

generate &'ocs rom ACAP&

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 126/181

*(+ !4(+  A9E CustoiBin SALE 

A9E custoisin is relativel% straihtt for8ard( The onl% andator% task is the definition of theA9E distribution scenario( The other eleents did not prove to be ver% helpful inpractical applications(

All A<& s(ecial customiing is done from ;ithin the transactionSA<&? ;hich lins you to a su/set of the SAP $*.

%he scenario defines the !oc ty(es and the (airs of !oc (artners;hich (artici(ate in the A<& distri/ution. %he distri/ution scenario isthe reference for all A-APs and functionality to determine ;hich datais to /e re(licated and ;ho could /e the receiing candidates. %hisste( is? of course? mandatory.

%he change (ointers can /e used to trigger the A<& distri/ution. %hisis only necessary if you really ;ant to use that mechanism. Kou can?ho;eer? send out !ocs eery time an a((lication changes data. %his

does not reGuire the setu( of the change (ointers.SAP allo;s the definition of rules? ;hich allo; a filtering of data?

 /efore they are stored in the !oc /ase. %his allo;s you to selectielyacce(t or decline indiidual !oc segments.

A<& allo;s the definition of conersion rules. %hese rules allo; thetransition of indiidual field data according ma((ing ta/les.nfortunately? the use of a function module to conert the data is notreali@ed in the current ,>3 release.

%he filter and conersion functionality is only attractie on a firstglance. +orm (ractical e'(erience ;e can state that they are not reallyhel(ful. t taes a long time to set u( the rules? and rules usually arenot (o;erful enough to aoid modifications in an indiidual scenario.Conersion rules tend to remain sta/le? after they hae once /eendefined. %hus? it is usually easier to call an indiidual !oc (rocessingfunction module? ;hich (erforms your desired tas more fle'i/ly andeasily.

SA()

'istribution scenarios

hange pointers

ilters

onversion

onversion

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 127/181

*( !4(  5asic Settins SALE 

5asic settins have to be adusted before %ou can start 8orkin 8ith A9E(

• ,iure +41  Custoisin transaction SA9E

-efore ;e start? ;e need to maintain some logical systems. %hese arenames for the ,+C destinations ;hich are used as communication

 (artners. An entry for the logical system is created in the ta/le%-!<S.

• ,iure +!1  S$3! - :ie8 aintenance T5D9S

+inally. you ;ill hae to assign a logical system to the clientsinoled in A<& or !oc distri/ution. %his is done in ta/le %000?;hich can /e edited ia S$31 or ia the res(ectie SA<& treeelement.

(ogical System

 Assign logical system toa client

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 128/181

• ,iure +*1  S$3! - :ie8 aintenance T444

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 129/181

*(6 !4(6  Define the Distribution $odel GThe ScenarioH BD64 

The distribution odel Galso referred to as A9E-ScenarioH is a ore or less raphical approachto define the relationship bet8een the participatin senders and receivers(

%he distri/ution model is shared among all (artici(ating (artners. t

can? therefore? only /e maintained in one of the systems? ;hich ;eshall call the leading system. nly one system can /e the leadingsystem? /ut you can set the leading system to any of the (artners atany time? een if the scenario is already actie.

%his ;ill /e the name under ;hich you ;ill address the scenario. tseres as a container in ;hich you (ut all the fromto relations.

• ,iure +31  Create a odel vie8

Kou can hae many scenarios for eentual different (ur(oses. Koumay also ;ant to (ut eerything in a single scenario. As a rule of thum/? it (roed as successful that you create one scenario (er administrator. f you hae only one A<& administrator? there is no usehaing more than one scenario. f you hae seeral de(artments ;ithdifferent reGuirements? then it might /e hel(ful to create one scenario

 (er de(artment.

;odel can only bemaintained by leadingsystem

C'8D

Suggestion: ?nescenario peradministration area

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 130/181

• ,iure +1  Add a essae t%pe to the scenario

• ,iure ++1  $odel vie8 after addin $AT$AS

• ,iure +1  Add an 77P obect ethod the scenario

• ,iure +61  $odel vie8 after addin custoer(chanefrodata

%he model ie; dis(lays gra(hically the fromto relations /et;eenlogical systems. Kou no; hae to generate the (artner (rofiles ;hich

+ow go on definingpartner profiles

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 131/181

are used to identify the (hysical means of data trans(ortation /et;eenthe (artners.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 132/181

*() !4()  &eneratin Partner Profiles  WE20 

A ver% useful utilit% is the autoatic eneration of partner profiles out of the A9E scenario(Even if %ou do not use A9E in %our installation< it could be onl% helpful to define theEDI partners as A9E scenario partners and enerate the partner profiles(

f you define the first (rofile for a (artner? you hae to create the (rofile header first. Clic an the /lan (a(er sheet.

• ,iure +)1  Create a partner 

%he alues gie here are not really im(ortant. %he (artner class is onlya classification alue. Kou can gie an ar/itrary name in order togrou( the ty(e of (artners? e.g. &! for e'ternal ones? A<& for internalones? and -$ for connection ;ith -$ S>390 systems.

*)JB

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 133/181

• ,iure +.1  Specif% partner details

• ,iure 41  7utbound partner profile before eneration

• ,iure !1  Inbound partner profile before eneration

• ,iure *1 Ports defined 8ith S$+.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 134/181

• ,iure 31  &enerate partner profiles for SA9E enu

• ,iure 1  Autoaticall% created partner profile

%here hae /een t;o (rofiles generated. %he one is for  M&TM&S ?

;hich ;e e'(licitly assigned in the distri/ution scenario. %he secondone is a mandatory !oc ty(e ;ith the name S6%+9  ?;hich is used

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 135/181

for ,+C control information and synchronisation. %his one is onlycreated if it does not yet e'ist.

• ,iure +1  7utbound partner profile after eneration

=ere is a detail ie; of the (arameters generated. %he receier (ort isthe ,+C destination that had /een created for TESTT&-GET   ;ithSM59.

!ata goes to ta/le ED(*.

• ,iure 1  Assinin the port to partner link

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 136/181

*(. !4(.  Creatin IDocs and A9E Interface fro 5API SDBG 

There is a ver% po8erful utilit% 8hich allo8s %ou to enerate ost IDoc and A9E interfaceobects directl% fro a 5APIJs ethod interface(

%he transaction reGuires a alid -AP o/Fect and method as it is

defined ;ith SW1. Kou ;ill also hae to s(ecify a deelo(mentclass and a function to store the generated !oc (rocessing function.

;ill demonstrate the use ;ith the o/Fect O:A1 and methodC=A:*&+,$!A%A. %his o/Fect is e'ecuted eery time ;hen thedata of a customer 6ta/le O:A17 is modified? e.g. ia transactionsD!01 or D!02. %his o/Fect ;ill automatically trigger a ;orflo;eent after its o;n e'ecution? ;hich can /e used for the A<&triggering. -!-* ;ill generate an A<& interface ;ith all docdefinitions necessary. %his A<& introduced can /e introduced in ascenario. =ence? eery time the customer data is modified? the data is

going to /e distri/uted as an doc according to the A<& scenariosetu(.

C'C

)very time CAP& ise#ecuted, the A()distribution is chec$ed

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 137/181

• ,iure 61  Enter the obect and the ethod(

• ,iure )1  Specif% a nae for the created essae t%pe( The essae t%pe 8ill be created

in table EDMSG  (

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 138/181

• ,iure .1  Define the naes of the processin function odules and the associated IDoc

t%pes(

 :o; you can s(ecify the reGuired !oc ty(es and the names of thefunction module and function grou( for the (rocessing routines. :ote?that the deelo(ment class 6&nt;iclungslasse7 and the functiongrou( 6+untionsgru((e7 need to /e in your customer name s(ace? i.e.should /egin ;ith K or . %he alues (ro(osed on this screen areusually ina((ro(riate.

Clic on generated o/Fects to see ;hat ;as generated in detail.Result report

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 139/181

• ,iure 641  &eneration protocol

A detailed re(ort is sho;n. %he re(ort is clica/le so that you candirectly ie; the generated o/Fects. %he hots(ot ;ill a((ear;henyou moe oer a clica/le o/Fect.

%he transaction has generated an !oc ty(e.

%he !oc ty(e is generated ;ith a header section containing theinterface alues of the o/Fect and a data section ;ith the remainingfields of the o/Fect data structure.

%he -APs interface definition loos lie that.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 140/181

F"C'IO" #api;cu&tomer;c*a!geromdata.=))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))==Lo>ale Sc*!itt&telle8= I%POR'I"= +ALE(PI;ADDRESS LI:E BAPI:"A- S'RC'RE BAPI:"A-= +ALE(PI;SALESOR LI:E BAPI:"A-2)SALESOR= +ALE(PI;DIS'R;C?A" LI:E BAPI:"A-2)DIS'R;C?A" OP'IO"AL= +ALE(PI;DI+ISIO" LI:E BAPI:"A-2)DI+ISIO" OP'IO"AL= +ALE(CS'O%ER"O LI:E BAPI:"A-0)CS'O%ER= E<POR'I"= +ALE(PE;ADDRESS LI:E BAPI:"A- S'RC'RE BAPI:"A-= +ALE(RE'R" LI:E BAPIRE'R" S'RC'RE BAPIRE'R"=))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

*!( 9istin 1  ,unction interface of the 5API

+or each of the (arameters in the -APQs interface? the generator created a segment for the !oc ty(e. Some segments are used for !ocin/ound onlyN others for !oc out/ound instead. Parameter fields thatare not structured ;ill /e com/ined in a single segment ;hich is

 (laced as first segment of the !oc ty(e and contains all these fields.%his collection segment receies the name of the !oc ty(e. n our e'am(le? this is the generated segment =(=&553H%&(3+9&%GED.

%he segment /elo; has /een created as a header leel segment andcom/ines all function module (arameters ;hich do not hae astructure? i.e. those ;hich are single fields. +or e'am(le? . if the -APhas (arameters? a (arameter iEmaterial <O& maramatnr? then it ;ill

 /e (laced in the control segment. =o;eer? if it is declared iEmaterialS%,C%,& mara? then it ;ill create its o;n !oc segment.

• ,iure 6!1  Seent M!MALLK=A!KC#A&ED

enerated segmentstructure from CAP&function interfaceparameter 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 141/181

*(!4 !4(!4  Definin ,ilter Rules

A9E allo8s %ou to define siple filter and transforation rules( These are table entries 8hichare processed ever% tie the IDoc is handed over to the port( Dependin on theassined path< this happens either on inbound or outbound(

,ules are defined ;ith the SALE transaction.

• ,iure 6*1  SA9E

SA()

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 142/181

,iure 631 

Assinin the conversion rule to an IDoc seent

 

• ,iure 61  Tell 8here the value for a field should coe fro

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 143/181

• ,iure 6+1  Define a rule

• ,iure 61  Assinin the filter to a partner link

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 144/181

3!!  Callin R/3 :ia 79E/;avaScript2sin the 79E/Active-L functionalit% of R/3 %ou can call R/3 fro an% obect a8are lanuae(

Actuall% it ust be able to do D99 calls to the R,C libraries of R/3( SAP R/3 scattersthe docuentation for these facilities in several subdirectories of the SAP&2Iinstallation( ,or details %ou have to look for the SAP&2I Autoation Server and the

SD= GR,C soft8are developent kitH(Suar%

,>3 can e'change its !oc /y calling a (rogram that resides on the serer %he (rograms can /e ;ritten in any language that su((orts <&2>ActieD technologyProgramming sills are mainly reGuired on the PC side? e.g. you need to no; !el(hi? BaaScri(t or 8isual-asic ;ell

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 145/181

3(! !!(!  R/3 R,C fro $S 7ffice :ia :isual 5asic

The $icrosoft 7ffice suite incorporates 8ith :isual 5asic for Applications G:5AH a full% obectoriented lanuae( ;avaScript and ;A:A are naturall% obect oriented( Therefore %oucan easil% connect fro ;avaScript< ;A:A< "7RD< ELCE9 and all the other :5Acopliant soft8are to R/3 via the C7R5A copatible obect librar% Gin "ID7"Skno8n also D99s or ACTI:E-L GQ79E/*H coponentsH(

8isual -asic is finally designed as an o/Fect oriented languagecom(liant to !C$ standard.

BaaScri(t is a ty(icalo/Fect orientedlanguage ;hich is

com(liant to /asic C,-A? !C$ and other (o(ular o/Fectstandards.

SAP ,>3 (roides a set of o/Fect li/raries? ;hich can /e registered

;ith 8isual -asic. %he li/rary adds o/Fect ty(es to 8-A ;hich allo;,+C calls to ,>3.

%he li/raries are installed to the ;orstation ;ith the SAP*installation. %hey are technically (u/lic lina/le o/Fects? inW:!WS these are !<<s or AC%8&D controls 6;hich are !<<sthemseles7.

%he o/Fect li/rary SAP contains among others the o/Fect ty(e+:C%:S ;hose /asic method CA<< (erforms an ,+C call to as(ecified ,>3 function module. With the call you can (ass o/Fect

 (ro(erties ;hich ;ill /e inter(reted as the interface (arameters of the

called function module.f the ,+C call a((ear not to /e ;oring? you should first try out tocall one of the standard ,>3 ,+C function lie,+CECA<<E%,A:SAC%:ES:* 6calls a s(ecified transactionor ,+CE*&%E%A-<& 6returns the content of a s(ecified ,>3 data/aseta/le7.

SAP ,>3 (roides a set of o/Fect li/raries? ;hich can /e registered;ith BaaScri(t to allo; ,+C calls to ,>3.

%he o/Fect li/rary SAP contains among others the o/Fect ty(e+:C%:S ;hose /asic method CA<< (erforms an ,+C call to a

s(ecified ,>3 function module.

f the ,+C call a((ears to /e not ;oring? you should first try out tocall one of the standard ,>3 ,+C functions lie,+CECA<<E%,A:SAC%:ES:* 6calls a s(ecified transaction7or ,+CE*&%E%A-<& 6returns the content of a s(ecified ,>3 data/aseta/le7.

Eisual Casic is '?;compliant

KavaScript or KAEA areob-ect languages

'((s installed withSAP@&

?b-ect library SAPprovides a method A((which will call a functionmodule with all interfaceparameters

%ry to call standardroutines for testing

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 146/181

3(* !!(*  Call Transaction ,ro :isual 5asic for "7RD .6

This is a little "7RD .6 acro< that deonstrates ho8 R/3 can be called 8ith a ouse clickdirectl% fro 8ithin "7RD .6(

%he sho;n macro calls the function module

 -+3+&3T-&%S&+T""%34S"%G  . %his function e'ecutes adynamic call transaction using the transaction code s(ecified as the

 (arameter.

Kou can call the macro from ;ithin ;ord? /y attaching it to a (seudohy(erlin. %his is done /y adding a $AC,-%%: field to theW,! te't. %he macrob!tton  statement must call the 8-A macro,3Call%ransaction and hae as the one and only (arameter the nameof the reGuested transaction

%ACROB''O" R0Call'ra!&actio! +A-2

%his ;ill call transaction 8A02 ;hen you clic on the macrob!tton in

the te't document. Kou can re(lace 8A02 ;ith the code of your transaction.

+or more information see the $icrosoft ffice hel( for  M&+-74TT%  and 8isual -asic.

Calling SA' R/3 from within .RD 45 with a mouse clic, 

Word 9) $acro /y A'el Angeli <ogosM nformati *m/= !#)2-ruehl

+rom ;e/site htt(>>;;;.logos;orld.com

%his W,! 9) document contains a 8isual -asic ProFect ;hichallo;s to call SAP ,>3 transaction using the SAP automation *.%he call is done ia the W,! field insertion $AC,-%%:.Kou must hae the SAP Automation * or SAP ,+C !eelo(mentOit installed on your ;orstation to gie SAP the reGuired <&functionality.

&'am(le

Clic to start transaction ^ $AC,-%%: ,3Call%ransaction8A02 _

and another call to ^ $AC,-%%: ,3Call%ransaction 8A02 _

.%o sho; the coding of the $AC,-%%: statement? rightmouseclic on the transaction code lin and choose %oggle +ieldCodes.

**( 9istin +1  "7RD .6 te0t 8ith $ACR752TT7 field inserted

Dim !& A& O#Hect

!im conn As /Fect

!im SAPElogon As -oolean

Su/ ,3Call%ransaction67

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 147/181

Q get the %C!& from the W,! te't? $AC,-%%: does notallo; (arameters

  tcode Selection.%e't Z Actie!ocument.+ields617.Code

ll <en6$AC,-%%: ,3Call%ransaction 7 ` 3

tcode $id6tcode? ll7

  ,3Call%ransaction&'ecute 6tcode7

&nd Su/

Su/ ,3Call%ransaction&'ecute6tcode7

n &rror *o%o &rrCall%ransaction

  ,3<ogonEfE:ecessary

  ,esult fns.,+CECA<<E%,A:SAC%:6&'ce(tion?tcodetcode7

  theEe'ce(tion &'ce(tion

  &rrCall%ransaction Q &rror =andler *eneral

!e/ug.Print &rr 

f &rr 43 %hen

  $sg-o' +unction module not found or ,+C disa/led

  ,3<ogoff Q <ogoff to release the connection MMM

  &'it Su/

&lse  $sg-o' &rr.!escri(tion

&nd f 

&nd Su/

Su/ ,3<ogonEfE:ecessary67

  f SAPElogon bV 1 %hen ,3<ogon

&nd Su/

Su/ ,3<ogon67

SAPElogon +alse

Set fns Create/Fect6SAP.+unctions7 Q Create functions o/Fect

fns.logfilename ;dtflog.t't

fns.logleel 1

Set conn fns.connection

conn.A((licationSerer r3

conn.System !&8

conn.user useridconn.Client 001

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 148/181

conn.<anguage &

conn.traceleel #

conn.,+CWith!ialog %rue

f conn.logon60? +alse7 bV %rue %hen

  $sg-o' Cannot logonM.

  &'it Su/

&lse

  SAPElogon conn.sConnected

&nd f 

&nd Su/

Su/ ,3<ogoff67

  conn.logoff   SAPElogon +alse

&nd Su/

Eisual Casic code with macros to call R/3 from *?R' 1

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 149/181

3(3 !!(3  R/3 R,C fro ;avaScript

;avaScript is a full% obect oriented lanuae( Therefore %ou can easil% connect fro;avaScript to R/3 via the C7R5A copatible obect librar% Gin "ID7"S kno8n alsoD99s or ACTI:E-L GQ79E/*H coponentsH(

BaaScri(t is a ty(ical o/Fect oriented language ;hich is com(liant to /asic C,-A? !C$ and other (o(ular o/Fect standards.

SAP ,>3 (roides a set of o/Fect li/raries? ;hich can /e registered;ith BaaScri(t to allo; ,+C calls to ,>3.

%he li/raries are installed to the ;orstation ;ith the SAP*installation.

%he o/Fect li/rary SAP contains among others the o/Fect ty(e+:C%:S ;hose /asic method CA<< (erforms an ,+C call to as(ecified ,>3 function module.

f the ,+C call a((ears to /e not ;oring? you should first try out tocall one of the standard ,>3 ,+C functions lie,+CECA<<E%,A:SAC%:ES:* 6calls a s(ecified transaction7or ,+CE*&%E%A-<& 6returns the content of a s(ecified ,>3 data/aseta/le7.

• ,iure 661  #T$9 Pae 8ith a button to call a transaction via R,C

N&cript la!guagea$aScript

bM

retcd 0N

e'ce(tions 0N

>> RRR SAP<ogon67 creates an o/Fect that has the methods to

>> e'ecute a call to an SAP function modulefunction SAPlogon67

'((s installed withSAP@&

%ry to call standardroutines for testing

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 150/181

trans fns.%ransactionsN

conn fns.connectionN >R get a ne; connection o/Fect R>

conn.System !&8N >R Set the system ! 6see SKSKS!7 R>

conn.user useridN>R set userid 6/lan for dialog7 R>

conn.(ass;ord N >R set (ass;ord 6/lan for dialog7 R>

conn.Client 100N >R set (ass;ord 6/lan for dialog7 R>

conn.<anguage &N >R set language 6/lan for default7R>

conn.traceleel #N >R set (ass;ord 6/lan for dialog7 R>

conn.,+CWith!ialog 1N >R true o(ens isi/le session ;indo;R>

e'ce(tions 0N

conn.logon60? 07N >R RRR this call creates the o/Fect RRR R>

  _N

function SAPlogoff67

  ^ conn.logoff60? 07N

e'ce(tions 0N

  _N

>> RRR e'ecute the SAP function $!<&,+CECA<<E%,A:SAC%:ES:*

>> as a method e'ecution of o/Fect ty(e SAP.functions

function SAPcall%ransaction6tcode7

  ^ e'ce(tions 0N

callta fns.add6,+CECA<<E%,A:SAC%:ES:*7N

callta.e'(orts6%C!&7 8A02N

callta.e'(orts6$!&7 &N

retcd callta.callNconn.logoff67N

alert6retcd7N

SAPcall%ransaction retcdN

  _N

>> Vb>scri(tV

b/odyV

bMCreate an =%$< /utton ;ith a BaaScri(t call attached V

Call 8A02

bin(ut %KP& su/mit

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 151/181

  8A<& 8A02

  nClic SAPlogon67N

SAPcall%ransaction6ZGuotN8A02ZGuotN7N

SAPlogoff67

V

b>/odyV

• ,iure 6)1  ;avaScript e0aple to call an R/3 function odule via 79E/R,C

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 152/181

3( !!(  R/3 R,C/79E Troubleshootin

Probles connectin via R,C can usuall% be solved b% reinstallin the full SAP&2I and/orcheckin %our net8ork connection 8ith R/3(

f you hae (ro/lems to connect to ,>3 ia the ,+C !<<s then you

should chec your net;or installation. t ;ould /e out of the reach of this (u/lication to detail the causes and solutions ;hen an ,+Cconnection does not ;or.

may say? that in most cases a full install of the SAP* on thecom(uter ;hich runs the calling (rogram ;ill secure a relia/leconnection? (roided that you can login to ,>3 (ro/lemfree ;ith thisery same SAP* installation.

Another triial /ut often cause are sim(le net;or (ro/lems. Soim(ossi/le it may a((ear? you should al;ays go /y the /oo and firstchec the net;or connection /y (inging the ,>3 system ;ith the

P:* utility and checing the (ro(er access authorities.=o;eer? if you successfully (assed the SAPlogon method? then the

 (ro/lem is mostly a miss(elling of o/Fect or method names or anincom(ati/ility of the called function.

f you are Guite sure that you s(elled eerything right and correct? andstill get an error e'ecuting the SAP.+:C%:S.CA<< method thenyou should inestigate the function module in ,>3.

*enerate the functiongrou( to see if there is

an synta' error $ae sure that the function is tagged as ,+C allo;ed

Reinstall the full SAP@&

hec$ spelling

;a$e certain that thefunction module in R/3 ismar$ed as LRallowedM

hec$ for synta# errors

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 153/181

!*  5atch Input RecordinThe batch input G5TCIH recorder GSHDBH is a precious tool to develop inbound IDocs( It records

an% transaction like a acro recorder( ,ro the recordin< an A5AP fraent can becreated( This lets %ou easil% create data input proras 8ithout codin ne8transactions(

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 154/181

(! !*(!  Recordin a Transaction "ith SHDB 

The 5TCI recorder lets %ou record the screen se>uences and values entered durin atransaction( It is one of the ost precious tools in R/3 since release 3(!( It allo8s afruitful cooperation bet8een proraer and application consultant(

%he section /elo; ;ill sho; you an e'am(le of ho; the transactionSHDB ;ors. With the recording? you can easily create an A-AP ;hichis a/le to create -%C files.

Kou ;ill /e ased for a session name and the name of the transactionto record. %hen you can enter the data into the transaction as usual.

• ,iure 6.1  Startin a ne8 recordin 8ith S#D5

%he follo;ing screens ;ill sho; the usual transaction screens. Allentries that you mae are recorded together ;ith the screen name andeentual cursor (ositions.

Record a session withtransaction S7'C

+ow the transaction is

played and all entriesrecorded

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 155/181

• ,iure )41  ,irst screen of MB1C  Goods entr%H

• ,iure )!1  Recorded list screen for oods entr%

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 156/181

• ,iure )*1  Recorded detail screen for oods entr%

After you finished the recording? you hae the (ossi/ility to generateA-AP coding from it. %his ;ill /e a seGuence of statements ;hichcan generate a /atch in(ut session? ;hich is an e'act re(lay of therecorded one.

%he generated (rogram contains an include  7D+-E+55 ;hichcontains all the +,$ routines referenced.

%o mae the recorded code usa/le for other (rograms? you should

mae a function module out of it. Starting ;ith release 4.5A therecorded code (roides a feature to automatically generate such afunction module. +or earlier releases? ;e gie the coding of a (rogram;hich fulfils this tas further do;n.

rom the recordedsession, you cangenerate an ACAP

Put the coding into afunction module

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 157/181

(* !*(*  #o8 to 2se the Recorder Efficientl%

This routine replaces 5DCRECLL to allo8 e0ecutin the prora enerated b% S#D5 via a calltransaction instead of eneratin a 5TCI file(

%he S=!- transaction creates an A-AP from the recording. When

you run this A-AP? it ;ill generate a -%C grou( file? ;ith e'actly thesame data as in the recording.

%he recorder is a/le to generate an A-AP. ,eleases /efore 4.5Ainclude a routine -!C,&CDD. %his include contains +,$ routines;hich fill the -!C!A%A ta/le and e'ecute the routines-!CEP&:E*,P and -!CEC<S&E*,P. %hese are theroutines ;hich create /atch in(ut files.

f ;e modify this +,$ routines a little /it? ;e can mae the A-APre(lay the recording online ia a +& T-&%S&+T"% ? ;hich ismuch more suita/le for our deelo(ment and testing (ur(oses. f you

re(lace the standard include  7D+-E+55   ;ith the sho;n one ==7D+-E+55 ? you can re(lay the recording online.

Starting ;ith release 4.5A you can create a function module from therecording. %his function module re(laces the recorded constants ;ith

 (arameters and gies you the o(tion to choose /et;een a /atch in(utfile or a direct call transaction.

A remar on screen (rocessing? if there are ta/le controls 6scrollareas7. f you enter many lines or try to e'tend a list? it ;ill /eim(ossi/le to tell ;here to (lace the cursor. %herefore? mosttransactions (roide a menu o(tion that (ositions the list in a

calcula/le manner. f you choose a ne; item? most transactions ;illeither (o( u( a detail screen or ;ill (osition the list? so that the ne'tfree line is al;ays line 2. f this feature is not (roided in atransaction? it is regarded as a malfunction /y SAP and can /ere(orted to SAP:&%>SS.

rom the recordedsession, you cangenerate an ACAP

Replace the include withmodified ?R; routinesto allow A((%RA+SA%&?+

Scrolling areas with tablecontrols reuire to modifythe recording and to adda loop.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 158/181

(3 !*(3  Include MM5DCRECLL to Replace 5DCRECLL

This routine replaces 5DCRECLL to allo8 e0ecutin the prora enerated b% SHDB via a call

transaction instead of eneratin a 5TCI file(

(**********************************************************************(

R :C<!& -!C,&CDD R

RR

FOR% OPE";ROP.

  ,&+,&S= -!C!A%A.

&:!+,$.

(*********************************************************************(

FOR% CLOSE;ROP.

&:!+,$.

(**********************************************************************(

FOR% BDC;'RA"SAC'IO" SI" 'CODE.

  CA<< %,A:SAC%: %C!& S:* -!C!A%A $!& QAQ$&SSA*&S :% -!C$&SS.

&:!+,$.

(*********************************************************************(

FOR% BDC;'RA"SAC'IO";%ODE SI" 'CODE A%ODE.

  CA<< %,A:SAC%: %C!& S:* -!C!A%A P!A%& QSQ

  $!& A$!& $&SSA*&S :% -!C$&SS.

&:!+,$.

(**********************************************************************(

FOR% BDC;D"PRO SI" PRORA% D"PRO.

  C<&A, -!C!A%A.

  -!C!A%AP,*,A$ P,*,A$.

  -!C!A%A!K:P, !K:P,.  -!C!A%A!K:-&*: QDQ.

  APP&:! -!C!A%A.

&:!+,$.

(**********************************************************************(

FOR% BDC;FIELD SI" F"A% F+AL.

 +&<!SK$-<S b+<!V.

  ASS*: 6+:A$7 % b+<!V.

  C<&A, -!C!A%A.

!&SC,-& +&<! +8A< %KP& SK +%KP&

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 159/181

  CAS& SK+%KP&.

  W=&: QCQ.

  W,%& +8A< % -!C!A%A+8A<.

  W=&: %=&,S.

  C:!&:S& +8A<.

  W,%& +8A< % -!C!A%A+8A< <&+%BS%+&!.

  &:!CAS&.

  -!C!A%A+:A$ +:A$.

  APP&:! -!C!A%A.

&:!+,$. -!CE+&<!

(**********************************************************************(

FOR% E';%ESSAES 'ABLES P;%ESS'AB S'RC'RE BDC%SCOLL.

  PE$&SS%A-[\ -!C$&SS[\.

  <P A% PE$&SS%A-.

  A% <AS%.

  ,&A! %A-<& PE$&SS%A- :!&D SK%A-D.

  $8&C,,&SP:!:* PE$&SS%A- % SKS%.

  &:!A%.

  &:!<P.

&:!+,$. *&%E$&SSA*&S

(**********************************************************************(

FOR% E';RESL'S 'ABLES %ESS'AB S'RC'RE BDC%SCOLL

  ,&%,:E8A,A-<&S S%,C%,&-!W+,&%8A, 

  C=A:*:* W,O+<WE,&S<% <O&-!W+EPA,A$,&S<%.

  P&,+,$ *&%E$&SSA*&S %A-<&S $&SS%A-.

  !&SC,-& %A-<& $&SS%A- <:&S SK%+<<.

  ,&+,&S= ,&%,:E8A,A-<&S.

  C<&A, W,O+<WE,&S<%? ,&%,:E8A,A-<&S.

  W,O+<WE,&S<% 99999.

  + SK%+<< *% 0.

  ,&A! %A-<& $&SS%A- :!&D SK%+<<.

  + $&SS%A-$S*%KP CA QSQ.

  W,O+<WE,&S<% 0.  ,&%,:E8A,A-<&S!CE:$-&, $&SS%A-$S*81

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 160/181

  APP&:! ,&%,:E8A,A-<&S.

  &:!+.

  &:!+.

6"D&.R0! ) 16#R6S+7#S

• ,iure )31  Prora MM5DCRECLL Gfind at http1//888(idocs(deH

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 161/181

( !*(  MM5RCRECLLK,5K&E1 &enerate a ,unction fro Recordin

The sho8n routine MM5DCRECLLK,5K&E replaces 5DCRECLL in a recorded A5AP( 2pone0ecutin< it 8ill enerate a function odule fro the recordin 8ith all variables asparaeters(

%he A-AP generated /y S=!- is a ery useful tool for deelo(ers.=o;eer? it does not re(lace the recorded constants /y aria/les.

%he follo;ing routine generates a function module from the recording.All you hae to do is (ut the coding /elo; in an include.

*ie it the name ==7D+-E+5537GE% .

%hen re(lace theinclude 7D+-E+55  in

the recording ;ith ==7D+-E+5537GE% .

When you e'ecute the A-AP? a function module in an e'isting

function grou( ;ill /e created. %he created function ;ill contain therecording ;ith all the constants re(laced /y aria/les? ;hich sho; inthe function module interface.

%he follo;ing useful routine is ;ritten for releases u( to 4.0-. nrelease 4.5- a similar functionality is (roided. Kou can generate afunction module from the recording transaction directly.

-efore you generate the function? a function grou( must e'ist. %hisyou hae to do manually. %he function grou( must also contain theinclude -!C,&CDD sho;n /efore? to hae the declarations of thereferenced +,$ routines.

=))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))=

PA,A$&%&,S +:C:A$& <O& ,S3<:A$& !&+A<%QE%&S%:*E-%CE1Q.

PA,A$&%&,S +*, <O& ,S3<A,&A !&+A<%QE-%CE%&S%:*Q.

RR

!A%A %A-AP <O& A-AP%&D% CC,S 0 W%= =&A!&, <:&.

!A%A -&*: + DC:S% CC,S 0?  :A$ <O& !!03<+&<!:A$&? +,&+ <O& !!03<+&<!:A$&?

  +8A< <O& -!C!A%A+8A<? +!D6#7?

  &:! + DC:S%.

!A%A S%,<1 <O& SK+!PS.

!A%A S%,<2 <O& S%,<1.

!A%A $P,%EPA,A$&%&, <O& ,S$P CC,S 0

W%= =&A!&, <:&.!A%A &DP,%EPA,A$&%&, <O& ,S&DP CC,S 0

::BDC+!C55-FB)!* 

Replace C'R)>>

)#ecute the ACAP once

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 162/181

!A%A %A-<&SEPA,A$&%&, <O& ,S%-< CC,S 0W%= =&A!&, <:&.

!A%A C=A:*:*EPA,A$&%&, <O& ,SC=A CC,S 0W%= =&A!&, <:&.

!A%A &DC&P%:E<S% <O& ,S&DC CC,S 0 W%==&A!&, <:&.

!A%A PA,A$&%&,E!C <O& ,S+! CC,S 0W%= =&A!&, <:&.

!A%A S=,%E%&D% <O& %+%%S%&D%

  8A<& Q*enerated -%C for transaction Q.

!A%A D%C!& <O& SK%C!&.

!A%A S%,25562557.

%A-<&S %<-*? %+!,.RR

+,$ P&:E*,P.

  +,$A% C<, C<E%%A<.

  W,%& > Q%rying to generate function Q? +:C:A$&.

  +,$A% ,&S&%.

  <:&.

  S&<&C% S:*<& R +,$ %<-* W=&,& A,&A & +*,.

  + SKS-,C :& 0.

  $&SSA*& 000637 W%= Q+unction PoolQ +*, Qdoes not e'itQ.

  &D%.

  &:!+.

  $8& QP&,+,$ P&:E*,P.Q % %A-AP.

  APP&:! %A-AP.

RR

  DC:S%+:A$ Q:P%E$&%=!Q.  DC:S%+,&+ Q-!W+APEPA,:P%$&%=!Q.

  DC:S%+8A< QAQ.

 APP&:! DC:S%.

&:!+,$.

RR

+,$ C<S&E*,P.

  <P A% DC:S%.

  $P,%EPA,A$&%&,PA,A$&%&, DC:S%+:A$.

$P,% PA,A$&%&,!-+&<! DC:S%+,&+.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 163/181

  C:CA%&:A%& QQQQ DC:S%+8A< QQQQ :%

  $P,%EPA,A$&%&,!&+A<%.

  $P,%EPA,A$&%&,P%:A< QDQ.

  CAS& DC:S%+!D.

  W=&: Q&Q.

  $8&C,,&SP:!:* $P,%EPA,A$&%&, %&DP,%EPA,A$&%&,.

  APP&:! &DP,%EPA,A$&%&,.

  W=&: QRQ.

  W=&: %=&,S.

  APP&:! $P,%EPA,A$&%&,.

  &:!CAS&.

R mae ta/le (arameters for o/ious loo( fields 6fields ;ith inde'7

  + DC:S%+!D CA Q7RQ.

  $8&C,,&SP:!:* $P,%EPA,A$&%&, %%A-<&SEPA,A$&%&,.

  %A-<&SEPA,A$&%&,!-S%,C% $P,%EPA,A$&%&,!-+&<!.

  + DC:S%+!D :& QRQ.

  %A-<&SEPA,A$&%&,PA,A$&%&,617 Q%Q.

  &:!+.

  + DC:S%+!D CA QRQ.

  APP&:! %A-<&SEPA,A$&%&,.

  &:!+.

  +,$A% C<, C<EPS%8&.

  &:!+.

  W,%& > DC:S%+:A$ C<, C<E%%A<? 6#07

DC:S%+8A<.  &:!<P.

R S,% im(ortE(arameter -K (arameter.

R !&<&%& A!BAC&:% !P<CA%&S +,$ im(ortE(arameter C$PA,:* (arameter.

R S,% ta/lesE(arameter -K (arameter.

R !&<&%& A!BAC&:% !P<CA%&S +,$ ta/lesE(arameter C$PA,:* (arameter.

RR

  <P A% %A-AP.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 164/181

  &:!<P.

RR

  ,&P<AC& QQ W%= D%C!& :% S=,%E%&D%.

  W,%& > +:C:A$& C<, C<E:&*A%8&.

  W,%& > S=,%E%&D%.

  S&<&C% S:*<& R +,$ %+!, W=&,& +:C:A$& &+:C:A$&.

  + SKS-,C & 0.

  $&SSA*& 000637 W%= Q+unctionQ +:C:A$& Qalreadye'istsQ.

  P&,+,$ SCC&SSE$&SSA*&

  S:* Q+unctionQ +:C:A$& Qalready e'istsQ SPAC& Q Q.

  &D%.

  &:!+.

  CA<< +:C%: Q,PKE+:C%:$!<&E:S&,%Q

  &DP,%:*

  +:C:A$& +:C:A$&

  +:C%:EP< +*, 

  S=,%E%&D% S=,%E%&D%

  %A-<&S  $P,%EPA,A$&%&, $P,%EPA,A$&%&, 

  &DP,%EPA,A$&%&, &DP,%EPA,A$&%&, 

  %A-<&SEPA,A$&%&, %A-<&SEPA,A$&%&, 

  C=A:*:*EPA,A$&%&, C=A:*:*EPA,A$&%&, 

  &DC&P%:E<S% &DC&P%:E<S%

  PA,A$&%&,E!C PA,A$&%&,E!C

  S,C& %A-AP  &DC&P%:S

  %=&,S ).

  + SKS-,C :& 0.

  $&SSA*& 000637 W%= Q&rror creatingQ Q+unction Q+:C:A$&.

  &:!+.

&:!+,$.

RR

+,$ -!C %,A:SAC%: S:* %C!&.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 165/181

  APP&:! QRQ % %A-AP.

  $8& QP&,+,$ -!CE%,A:SAC%:E$!& S:*E%C!& :P%E$&%=!.Q

  % %A-AP.

  APP&:! %A-AP.

RR

  D%C!& %C!&.

  S%,255 +:C:A$&.

  ,&P<AC& Q1Q W%= D%C!& :% S%,255.

  C:!&:S& S%,255 :*APS.

  +:C:A$& S%,255.

RR

  DC:S%+:A$ QE%C!&Q.

  DC:S%+,&+ QSKS%%C!&Q.

  DC:S%+8A< %C!&.

  DC:S%+!D SPAC&.

  :S&,% DC:S% :!&D 1.

RR

  $8& QP&,+,$ *&%E,&S<%S %A-<&S %$&SS%A-Q %

%A-AP.  APP&:! %A-AP.

  $8& Q ,&%,:E8A,A-<&SQ % %A-AP.

  APP&:! %A-AP.

  $8& Q S:* QQ1QQ Q % %A-AP.

  APP&:! %A-AP.

  $8& Q C=A:*:* W,O+<WE,&S<% .Q %%A-AP.

  APP&:! %A-AP.  $8& Q ,&A! %A-<& ,&%,:E8A,A-<&S :!&D 1.Q %%A-AP.

  APP&:! %A-AP.

  $8& Q !CE:$-&, ,&%,:E8A,A-<&S!CE:$-&,.Q % %A-AP.

  APP&:! %A-AP.

RR

  DC:S%+:A$ Q%$&SS%A-Q.  DC:S%+,&+ Q-!C$S*C<<Q.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 166/181

  DC:S%+8A< SPAC&.

  DC:S%+!D QRQ.

  :S&,% DC:S% :!&D 1.

RR

  DC:S%+:A$ Q,&%,:E8A,A-<&SQ.

  DC:S%+,&+ Q-!W+,&%8A,Q.

  DC:S%+8A< SPAC&.

  DC:S%+!D QRQ.

  :S&,% DC:S% :!&D 1.

RR

  DC:S%+:A$ QW,O+<WE,&S<%Q.

  DC:S%+,&+ Q-!W+EPA,A$,&S<%Q.  DC:S%+8A< SPAC&.

  DC:S%+!D Q&Q.

  :S&,% DC:S% :!&D 1.

RR

  DC:S%+:A$ QAPP<CA%:E8A,A-<&Q.

  DC:S%+,&+ Q-!W+EPA,A$APP<E8A,Q.

  DC:S%+!D Q&Q.

  :S&,% DC:S% :!&D 1.

RR

  DC:S%+:A$ Q!CE:$-&,Q.

  DC:S%+,&+ SPAC&.

  DC:S%+!D Q&Q.

  :S&,% DC:S% :!&D 1.

&:!+,$.

RR+,$ -!CE!K:P, S:* P,*,A$ !K:P,.

  %A-AP QRQ.

  APP&:! %A-AP.

  C:CA%&:A%&

  QP&,+,$ -!CE!K:P, S:* QQQ P,*,A$ QQQQ Q QQQ!K:P, QQQ.Q

  :% %A-AP.

  APP&:! %A-AP.

&:!+,$.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 167/181

RR

+,$ -!CE+&<! S:* +:A$ +8A<.

  !A%A D+8A< <O& -!C!A%A+8A<.

  C<&A, DC:S%.

  CAS& +:A$.

  W=&: Q-!CEOC!&Q , Q-!CEC,S,Q , Q-!CES-SC,Q.

  C:CA%&:A%& QQQQ +8A< QQQQ :% D+8A<.

  P&,+,$ A!!E-!C+&<! S:* +:A$ D+8A<.

  W=&: %=&,S.

  SP<% +:A$ A% Q6Q :% DC:S%+,&+ DC:S%+!D.

  C:CA%&:A%& QEQ +:A$ :% DC:S%+:A$.

  %,A:S<A%& DC:S%+:A$ S:* QE6E7 Q. :o dashesallo;ed

  $8& +8A< % DC:S%+8A<.

  %,A:S<A%& DC:S%+8A< % PP&, CAS&.

  APP&:! DC:S%.

  P&,+,$ A!!E-!C+&<! S:* +:A$ DC:S%+:A$.

  &:!CAS&.

&:!+,$. -!CE+&<!

RR

+,$ A!!E-!C+&<! S:* +:A$ D+:A$.

  C:CA%&:A%&

  QP&,+,$ -!CE+&<! S:* QQQ +:A$ QQQ Q :% %A-AP.

  S%,<1 S%,<&:6 %A-AP 7 ` S%,<&:6 D+:A$ 7.

  + S%,<1 *% )#.

  APP&:! %A-AP.  C<&A, %A-AP.

  &:!+.

  C:CA%&:A%& %A-AP D+:A$ Q.Q :% %A-AP S&PA,A%&!-K SPAC&.

  APP&:! %A-AP.

&:!+,$. addE/dcfield usinf fnam fal.

RR

+,$ SCC&SSE$&SSA*& S:* 81 82 83 84 O.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 168/181

  C:CA%&:A%& 81 82 83 84 :% SK<S&< S&PA,A%&!-K SPAC&.

  ,&P<AC& QQ W%= +:C:A$& :% SK<S&<.

  $!+K <:& 1.

  + O & SPAC&.

  $!+K <:& 1 <:& +,$A% C<, C<E:&*A%8&.

  &<S&.

  $!+K <:& 1 <:& +,$A% C<, C<EPS%8&.

  &:!+.

&:!+,$. ccessEmessage S:* 1 2 3 4 o.

• ,iure )1  Prora MM5DCRECLLK,5&E found on http1//888(idocs(de

%he created function module should ;or ;ithout modification for testing at least. =o;eer? you (ro/a/ly ;ill need to modify it? e.g. /yadding a loo( for (rocessing multi(le entries in a ta/le control 6scrollarea7.

%est the function moduleand add eventual loopsfor detail processing.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 169/181

+!3  EDI and International Standards"ith the ro8in iportance of EDI< the fiht for international standards heats up( "hile there

are an% business sectors like the autootive industr% and book distribution 8hohave used EDI for a lon tie and 8ant to continue their investent< there are others8ho insist on a ne8 odern standard for ever%bod%(

 '*e #attle i& &till to reac* it& clima6, #ut I &*all e&timate t*at t*e ora o t*e 90C or <%L 7ill &ucceed a!dma>e <%L t*e EDI &ta!dard o t*e uture.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 170/181

+(! !3(!  EDI and International Standards

Electronic Data Interchane GEDIH as a tool for paperless inter-copan% counication andbasic instruent for e-coerce is heavil% reulated b% several internationalstandards(

nfortunately? it is true for many areas in the industry that aninternational standard does not mean that eery/ody uses the sameconentions.

%oo many organi@ations (lay their o;n game and define standardsmore or less com(ati/le ;ith those set /y com(eting organi@ations.

%he main contendersare the nationalstandards organi@ations

and (riate com(anies ersus the /ig international organi@ations Sand A:S.

%he (riate com(anies /eing /aced u( /y their country organi@ationsusually fight for maintaining conentions? ;hich hae /een oftenesta/lished for many years ;ith satisfaction.

%he /ig  &merican

 %ational Standards

rganisation A:Sand the international

 (artner  "nternational Standards rganiIation  S ;ill usually fightfor a solid o(en standard to coer the reGuirements of eery/ody.

%his generally leads to a more or less foul tradeoff /et;een (ragmatism and com(leteness. %ragically the /ig organi@ations (utthemseles in Guestion. %heir (u/lications are not free of charge. %hestandards are (u/lications ;hich cost a lot of money. So they mostlyremain unread.

 :o;adays com(uting standards hae mostly /een (u/lished andesta/lished /y (riate organi@ations ;ho made their no;ledgeaccessi/le free of charge to eery/ody. &'am(les are manifold liePostScri(t /y Ado/e? =%$< and BaaScri(t /y :etsca(e? Baa /yS:? SCS /y APP<&? P /y PO Systems or $P3 /y L ;ho cares?D$< /y W3C and &!+AC% /y the nited :ations rgani@ation

:&SC.

;anifold standards resultin a Cabylon

+ational organiationsversus A+S&/&S?

Private companies wantwell establishedstandards

 All inclusive standards bythe big ones A+S& and&S?

Pragmatism beats

completeness

Standards need to beaccessible and publishedfree of charge

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 171/181

+(* !3(*  Characteristics of the Standards

The 8ell-kno8n standards EDI,ACT< L(!* and L$9 have siilar characteristics and aredesined like a docuent description lanuae( 7ther standards and R/3 IDocs arebased on seented files(

A:S D.12 is the S standard for &! and ecommerce. Why is itstill the standard" %here are chances that D.12 ;ill /e soon re(laced /y the more fle'i/le D$<? es(ecially ;ith the u(coming /oost of ecommerce. A:S D.12 is a document descri(tion language.

An A:S D.12 message is made u( of segments ;ith fields. %hesegments hae a segment identifier and the fields are se(arated /y as(ecial se(arator character? e.g. an asteris.

BE=--="E=20134Q==2==AC

&!+AC% ;as originally a &uro(ean standard. t /ecame (o(ular 

;hen chosen /y the : for their &! transactions. &!+AC% is adocument descri(tion language. &!+AC% is ery similar to A:SD.12 and differs merely in syntactical details and the meaning of tags.

D$< and the internet (age descri(tion language =%$< are /othsu/sets deried from the su(er standard S*$<...

%he (atent and trademar holder of D$< 6W3C? htt(>>;3c.org7descri/es the adantages of D$< ery (recisely as follo;s.

+igure 1 1.  D$< is a method for (utting structured data in a te't file.

+igure 2 2.  D$< loos a /it lie =%$< /ut isnQt =%$<.

+igure 3 3.  D$< is te't? /ut isnQt meant to /e read.+igure 4 4.  D$< is er/ose? /ut that is not a (ro/lem.

+igure 5 5.  D$< is licensefree and (latforminde(endent.

And D$< is fully integrated in the ;orld ;ide ;e/. t can /e said /riefly D$< sends the form Fust as the customer entered the data.

 A+S& >.0J

)'&A%/@+

>;(

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 172/181

+(3 !3(3  L$9

This is an e0cerpt of an L$9 EDI essae( The difference fro all other EDI standards is thatthe essae inforation is taed in a 8a% that it can be displa%ed in huanreadable for b% a bro8ser(

D$< differs from the other standards. t is a document maru(language lie its sister and su/set =%$<.

D$< defines additional tags to =%$<? ;hich are s(ecially designedto mar u( formatted data information.

%he adantage is that the D$< message has the same information asan &!+AC% or D.12 message. n addition? it can /e dis(layed in anD$< ca(a/le ;e/ /ro;ser 

NTDOC'PE Sale&)Order PBLIC

bPurchase rder Customer12345#)9 Send

tohtt(>>;;;.idocs.de>order.inVbtitleV!C.de rder +ormb>titleV

brder:oV12345#)b>rder:oV

b$essage!ateV1999112b>$essage!ateV

b-uyer&A:V12345000b>-uyer&A:V

brder<ine ,eference:o0121314V

buantityV250b>uantityV

b>rder<ineV

bin(ut ty(echec/o' name(artial alueallo;ed>V

bte'tV%ic here if a delayed>(artial su((ly of order is acce(ta/le

b>te'tV

bin(ut ty(echec/o' nameconfirmation aluereGuested>V

bte'tV%ic here if Confirmation of Acce(tance of rder is to /ereturned /y email

b>te'tV

bin(ut ty(echec/o' name!eliery:ote aluereGuired>Vbte'tV%ic here if email !eliery :ote is reGuired to confirm detailsof deliery

b>te'tV

b>-oorderV

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 173/181

• ,iure )+1  L$9 sales order data

 

• ,iure )1  L$9 7rder for as displa%ed in a bro8ser after interpretation b% a ;A:A applet

%he e'am(le sho;s an D$< sales order. n order to /e dis(layed ;itha standard /ro;ser lie nternet &'(lorer 5? (lugins and BA8Aa((lets e'ist that inter(ret the D$< and translate the D$< s(ecificdata tags into =%$< form.

>;( plug"ins e#ist oftenas KAEA applets forstandard browsers

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 174/181

+( !3(  ASI L(!*

This is an e0aple of ho8 an ASI L(!* EDI essae for a sales order looks ( The e0aples donot sho8 the control record Gthe envelopeH( EDI,ACT looks ver% uch the sae(

%he e'am(le descri/es a sales order from customer 0111213 for 250

O*$. %he fields of a segment are se(arated /y an asteris 6R7.We start ;ith a header record descri/ing the ty(e of message 6507.!ocs ;ould store this information in the control record.

S'=Q-=-------

S%01

S%02

%ransaction 50 Purchase rder 

Set control num/er 453

Signal /egin of transaction and identifies sender 

BE=--="E=20134Q==2==AC

8619:

-&*02

-&*03

-&*04

-&*05

-&*0)00 riginal transaction? not a resend

 :& :e; rder

P :um/er 12345#)9

8!

P !ate 25>:8>1999

Client reGuests an acno;ledgment ;ith details and changes

-illto (arty and Shi(to (arty

"=B'===-20

":9:

 :104

-ill to 68-PAPA,8W7

0111213 num/er of /illto(arty 6 8-PAPA,:,7

"=S'===334Q

":9:

 :104Shi( to 68-PAPA,8W7

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 175/181

55##)9 68-PAPA,:,7

%he item segments for item 01 L 250 g of material $K1001 for 15.3 (er g

PO==2-=:%=.0=SR=EA"=%--

'.:9:

P102

P103

P104

P10#

P10)

<ine item 1 L 8-APPS:,

uantity 250 8-APOW$&:*

nits Oilogram 8-AP$&:S

15.30 8-APP,&S

&A: L $aterial num/er

$K1001 68-AP$A%:,7

Summary information to erify com(leteness

C''==2

C##9:

C%%02

1 P1 segments

2 some of Guantities 6ignore unit7

SE=4=-------

S69:

S&02

) segments altogether 

Control num/er 453. %his is the same as S%02

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 176/181

!  EDI Converter R/3 does not provide an% tool to convert IDocs into international EDI forat like ASI L(!*<

EDI,ACT or L$9( This conversion needs to be done b% an e0ternal add-on product8hich is provided b% a variet% of copanies 8ho specialiBe in eneral EDI and e-coerce solutions(

Suar%,>3 does not (roide conersion to &! standard formats lie D.12? &!+AC% or D$<.Conerters e'ist on :D and PC (latforms.$any conerters are sim(le PC (rograms.,>3 certification only guarantees that the conerter com(lies to ,+C technology and ;ors fine ;ith standard!oc scenarios.,eal life situations reGuire a fle'i/le and easily ada(ta/le conerter (rogram.

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 177/181

(! !(!  Converter 

SAP R/3 has foreone ipleentin routines to convert IDocs into international EDI standardforats and for8ards those re>uests to the nuerous third part% copanies 8hospecialiBe in coercial EDI and e-coerce solutions((

 :early eery standard organi@ation defined an o;n &! standard for their mem/ers. So there is D.12 /y A:S for the S? &!+AC%>:ado(ted /y the nited :ations rgani@ation : or D$< as

 (ro(osed /y the internet research gurus of W3C.

-ut there is still more a/out it. All maFor industry com(anies define anadditional file format standard for their &! (artners. &en if theyadhere officially to one of the /ig standards? they yet issueinter(retation guidelines ;ith their o;n modifications according totheir needs.

f a com(any does not (lay in the (remier league of industry or 

 /aning com(anies? it ;ill hae to com(ly ;ith the demands of thelarge cor(orations.

As this leads to the insight that there are as many different &!formats as com(anies? it is eident that an &! conerter needs tohae at least one maFor feature? ;hich is  lexibilit#  in the sense of o(enness to;ards modification of the conersion rules.

%here are hundreds of conerter solutions on the maret not countingthe indiidual inhouse (rogramming solutions done /y manycom(anies.

&! is a maret on its o;n. :umerous com(anies s(eciali@e in (roiding &! solutions and serices. %he maFority of thosecom(anies also (roide conerters.

$any of the conerters are certified /y SAP to /e used ;ith ,>3.=o;eer? this does not tell anything a/out the usa/ility or suita/ilityto tas of the (roducts.

+umerous )'& standards

 Cig companies definetheir own standards ordialects

 A converter needs to beopen and fle#ible

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 178/181

Alphabetic Inde0

AC%8&>D? <&>2 130

A<& A((lication <in &na/ling 107

A<& Change Pointers 68

A:S D.12 151? 154

Change document 67

Change (ointer? actiation 69

Change Pointers? %rigger !ocs ia A<& 68

Conerter 156

&! Conerter 156

&! Customi@ing 42

&! Standard? A:S D.12 151? 154

&! Standard? &!+AC%>: 151

&! Standard? D$< 151? 152

&!+AC%>: 151

&ngine? !oc engine 72? 79

&ent linage? Worflo; 100

!oc &ngine 72? 79

!oc Segment? Creating 45

!oc ty(e 39

!oc %y(e 37

!oc ty(e? (ur(ose 87

BaaScri(t? ,+C 134

<CA<E&D&C? ,+C 96

logical system 37

<ogical System 42

$ail? send ia SAPoffice 103

message ty(e 37

$essage %y(e 38

$essage %y(e? define 49

$essage ty(e? (ur(ose 87

 :AS% 61

 :AS%? ,S:AS%00 63

 :AS%? send ia ,S:AS%&! 64

<&? AC%8&>D 130

 (artner (rofile 37

 (artner (rofiles 38

Partner Profiles !efine ;ith W&20 88

 (artner ty(e 37

Port? !efine ;ith W&21 90

 (rocessing code 37? 39? 52

 (rocessing code? in/ound 55

Processing function? assign 51

,+C? Calling ,>3 from BaaScri(t 134

,+C? Calling ,>3 from $S &'cel 131

,+C? Calling ,>3 ;ith $SW,! 132

,+C? calling the o(erating system 96

,+C? <CA<E&D&C 96

,+C? remote function call 92

,+C? trou/leshooting 137

rfcEremoteEe'ec 96

,S:AS%00 65

,S:AS%00? send :AS% messages 63

,S:AS%&!? send !ocs from :AS% 64

Sam(le n/ound ,outine 34

Sam(le ut/ound ,outine 32

Sam(le ;orflo; handler 103

SAPoffice mail 103

%erminolgy 38

%rigger from change document 67

%rigger !oc send 57

%rigger ia A<& Change Pointers 68

%rigger ia :AS% 61

%rigger ia ,S:AS%00 63

%rigger ia ;orflo; 66

%rou/leshooting? ,+C 137

8isual -asic? ,+C ia <& 131

8isual -asic? ,+C ;ith W,! 132

Worflo; 98

Worflo; eent cou(ling 100

Worflo; eent linage 100

Worflo; from change document 67

Worflo; from change documents 101

Worflo; from messaging 6:AS%7 102

Worflo; handler ho; to 103

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 179/181

Worflo;? send SAPoffice mail 103

D.12? A:S 151? 154

D$< 151? 152

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 180/181

 

8/20/2019 idoc for R/3

http://slidepdf.com/reader/full/idoc-for-r3 181/181

9ast Pae

There is no new Cnowledge in this world.

 &nd #et #o! tho!ght to ind it in these pagesJ

 &rth!r SchnitIler 


Recommended