Você está na página 1de 253

Sabine Maisel

Practical Guide to IDoc


Development for SAP

Bonn Boston
332 Book.indb 3 11/3/09 10:21:31 AM
www.sap-press.com
Contents at a Glance
1 Introduction ................................................................ 15
2 Generating IDocs ........................................................ 29
3 Test Tools ..................................................................... 51
4 Changes to IDocs ....................................................... 67
5 Confrmations .............................................................. 187
6 Serializing IDocs ......................................................... 193
7 Administration ............................................................ 211
8 IDocs in Conjunction with SAP NetWeaver
Process Integration ..................................................... 243
332 Book.indb 5 11/3/09 10:21:31 AM
www.sap-press.com
7
Contents
Preface ......................................................................................... 11
1 Introduction ................................................................. 15
1.1 What Is ALE? ................................................................ 15
1.2 BAPIs and IDocs An Introduction ............................. 18
1.2.1 BAPIs ............................................................... 18
1.2.2 IDocs ............................................................... 19
1.3 Differentiation of ALE and EDI ...................................... 25
1.4 Summary ...................................................................... 27
2 Generating IDocs ........................................................ 29
2.1 Standard Methods for the IDoc Generation ................... 29
2.1.1 Shared Master Data Tool .................................. 29
2.1.2 Message Control .............................................. 43
2.1.3 Special Functions ............................................. 46
2.2 Use of Logical Systems in the Message Control ............. 49
2.3 Summary ...................................................................... 50
3 Test Tools ..................................................................... 51
3.1 Individual IDocs ............................................................ 52
3.2 Testing Processing of Multiple IDocs ............................ 57
3.2.1 Message Control .............................................. 57
3.2.2 Sending Ready-for-Dispatch IDocs .................... 58
3.2.3 Files ................................................................. 59
3.3 Processing Status Files .................................................. 61
3.4 Summary ...................................................................... 66
4 Changes to IDocs ........................................................ 67
4.1 Customizing .................................................................. 67
4.1.1 Filtering Using Filter Objects ............................ 67
332 Book.indb 7 11/3/09 10:21:31 AM
www.sap-press.com
8

4.1.2 Custom Filter Objects ....................................... 73
4.1.3 Filtering Segments ............................................ 76
4.1.4 Reducing IDocs Through Views ........................ 77
4.1.5 Rules ................................................................ 80
4.1.6 Version Conversion ........................................... 84
4.1.7 Special Conversions in SAP ERP Financials ........ 85
4.2 Adapting Existing IDoc Types ........................................ 89
4.2.1 Different Exit Types on the Basis of the
Material Master Example ................................. 90
4.2.2 General Exits .................................................... 119
4.2.3 Custom Segments ............................................. 122
4.2.4 Special Requirements for Master Data .............. 134
4.3 Custom Function Modules for File Generation
in File Ports ................................................................... 138
4.4 Custom IDocs .............................................................. 141
4.4.1 Creating Custom IDoc Types and
Message Types ................................................. 143
4.4.2 Generating an IDoc .......................................... 153
4.4.3 Updating an IDoc ............................................. 161
4.4.4 Generating IDoc Function Modules .................. 172
4.4.5 Error Workfow for Custom IDocs ..................... 175
4.4.6 Useful Function Modules .................................. 184
4.5 Summary ...................................................................... 186
5 Confrmations .............................................................. 187
5.1 ALEAUD IDocs ........................................................... 187
5.2 STATUS IDocs ............................................................ 190
5.3 Summary ...................................................................... 192
6 Serializing IDocs ......................................................... 193
6.1 Serialization Using Groups ............................................ 193
6.2 Serialization Using Timestamps ..................................... 198
6.3 Serialization Using Business Objects .............................. 200
6.4 Serialization Using qRFC ............................................... 205
6.5 Summary ...................................................................... 209
332 Book.indb 8 11/3/09 10:21:31 AM
www.sap-press.com
9

7 Administration ............................................................. 211
7.1 IDoc Links .................................................................... 211
7.2 Regular Jobs ................................................................. 216
7.3 Transaction Code Overview ........................................... 217
7.4 Archiving ...................................................................... 224
7.5 Status Conversion ......................................................... 230
7.6 Summary ...................................................................... 242
8 IDocs in Conjunction with SAP NetWeaver
Process Integration ...................................................... 243
8.1 Conversion of Logical Systems to Business Systems ....... 243
8.2 Conversion of IDoc Partner Roles .................................. 244
8.3 Header Mapping ........................................................... 245
8.4 Handling the Control Record in SAP NetWeaver PI ....... 246
8.5 Updating IDocs Directly in SAP NetWeaver PI .............. 248
8.6 Summary ...................................................................... 248
The Author .................................................................................. 249
Index ............................................................................................. 251
332 Book.indb 9 11/3/09 10:21:31 AM
www.sap-press.com
S a b i n e Ma i s e l
Practical Guide to IDoc
Development for SAP'
Galileo Press
Preface
IDocs r e p r e s e n t a s t a n d a r d i n t e r f a c e t o SAP s y s t e ms . The y ar e al ways
a s y n c h r o n o u s , so t h e s ys t e m s h o u l d b e d e s i g n e d f o r c h a n g i n g a n d cr e a t
i ng d a t a i n t h e d a t a b a s e . The e r r o r h a n d l i n g , wh i c h can b e ca r r i ed o u t
wi t h a t i me d e l a y i n a s y n c h r o n o u s c o mmu n i c a t i o n , is a l wa ys h a n d l e d
w h e r e t h e e r r o r occur s i n c o n t r a s t t o t h e n o r ma l RFC c o mmu n i c a t i o n
w h e r e t he e r r o r is a l wa ys not i f i ed t o t h e s e nde r .
Al t h o u g h mo r e r e c e n t SAP r el eases al so have o t h e r non- SAP- pr opr i e t ar y
c o mmu n i c a t i o n o p t i o n s (such as SOAP, HTTP, a n d pr oxi es) , t h e i m p o r
t a n c e o f IDocs is u n d i mi n i s h e d : Thi s is b e c a u s e o f t h e h i g h n u m b e r in
w h i c h t h e y ar e avai l abl e, as wel l as t h e m u l t i t u d e o f s o f t wa r e s ol ut i ons
t h a t w o r k w i t h SAP a n d al r e a dy s u p p o r t t hi s f o r ma t . IDocs as s t a nda r d
i nt er f aces t o SAP s y s t e ms a r e u s e d b o t h f o r EDI s c e na r i os b e t w e e n d i f
f e r e nt e n t e r p r i s e s a n d f o r ALE s ce nar i os wi t h i n e nt er pr i s es .
Like all s t a n d a r d i nt er f a ces , t h e IDocs r e f e r t o t h e p a r t o f t h e SAP s ys t em
t h a t is d e l i ve r e d b y SAP. In m o s t bus i ne s s e s , ho we v e r , i t ' s nec es s ar y to
br e ak a d a p t a t i o n s t h a t we r e ma d e i n t h e bus i ne s s p a r t o f t h e SAP s ys t em
d o w n t o t h e i nt er f a ces . Thi s t as k is c a r r i e d o u t by ABAP de ve l ope r s . This
b o o k is par t i c ul a r l y i n t e n d e d f o r t h e m, a n d t h e t asks r e l a t i ng t o t h e s e
a d a p t a t i o n s ar e di s c u s s e d i n det ai l . The s y s t e m a d mi n i s t r a t o r s usual l y
h a n d l e t h e c o mmu n i c a t i o n s e t t i n g s s o t h e s e s e t t i ngs a r e o n l y m e n t i o n e d
i f t h e y ar e di r ec t l y r e l a t e d t o t h e d e v e l o p m e n t wor k.
Content of This Book
Thi s b o o k de s c r i be s t h i n g s i n t he s e q u e n c e i n w h i c h t h e y a pp e a r . It st art s
w i t h t h e c r e a t i o n o f I Docs a n d c o n c l u d e s w i t h t h e r e g u l a r t asks. The
a d a p t a t i o n o f I Docs t o c u s t o m e r r e q u i r e m e n t s s t a r t s w i t h t h e l o we s t
ef fort , t h a t is, t h e o p t i o n s o f Cus t omi zi ng, a n d p r o c e e d s s t e p b y s t e p to
11
Preface
t he t ask t h a t r e q u i r e s t h e h i g h e s t ef f or t : t he c o mp l e t e c u s t o m p r o g r a m
mi ng o f IDocs.
Ch a p t e r 1, Introduction, d i f f e r e n t i a t e s ALE a n d EDI a n d d e s c r i b e s t he
basi c pr i nc i pl e s o f IDocs. Ch a p t e r 2, Generating IDocs, o u t l i n e s t h e d i f
f e r e n t o p t i o n s f o r g e n e r a t i n g IDocs. C h a p t e r 3, Test Tools, di s cus s es h o w
y o u can t e s t IDocs f o r t h e d a t a e x c h a n g e e v e n w i t h o u t t h e c o mmu n i c a
t i on pa r t ne r .
Af t e r t h e g e n e r a t i o n o f s t a n d a r d I Docs h a s b e e n f ul l y o u t l i n e d , t hi s
c h a p t e r det ai l s t h e c u s t o m e r a d a p t a t i o n s . Here, I Docs a r e c o n n e c t e d to
t he d i f f e r e n t e n h a n c e m e n t t e c h n o l o g i e s o f SAP. So me o p t i o n s o f IDoc
ma n i p u l a t i o n al r e a dy a r i s e i n Cus t omi zi ng, wh i l e o t h e r s r e q u i r e c u s t o m
d e v e l o p me n t s o r t h e e n h a n c e m e n t o f t h e s t a n d a r d IDoc f unc t i on m o d
ul es. The r e a r e al so speci al d e v e l o p m e n t o b j e c t s t h a t ar e o n l y u s e d i n
c o mb i n a t i o n wi t h IDocs. So Ch a p t e r 4, Changes to IDocs, de s c r i be s p a r
t i cul ar l y wi t h r e gar d t o IDocs h o w y o u m u s t h a n d l e e n h a n c e m e n t s a n d
w h a t y o u n e e d t o cons i der . The focus is o n t h e e n h a n c e m e n t t e c h n o l o
gi es r e l e va nt f o r IDocs. Th o s e e n h a n c e m e n t s t h a t ar e u s e d f or all IDoc
t ypes ar c di s cus s ed i n det ai l . Thi s c h a p t e r al s o de s c r i be s t he speci f i c fea
t ur e s i n t h e c o n t e x t o f e n h a n c e m e n t s o r c u s t o m- d e v e l o p e d IDocs, such
as t h e wo r k f l o w c onn e c t i o n .
Ch a p t e r 5, Confirmations, t h e n di s cus s es t h e l i ve o p e r a t i o n a n d s h o ws
h o w y o u can l ear n f r om y o u r c o mmu n i c a t i o n p a r t n e r s w h a t h a p p e n e d
t o t h e IDoc d e s p i t e t h e a s y n c h r o n o u s p r o c e d u r e . C h a p t e r 6, Serializing
IDocs, o u t l i n e s t h e d i f f e r e n t o p t i o n s t o k e e p a speci f i c s e q u e n c e f o r p r o
cessi ng IDocs, as we l l as t h e ava i l a bi l i t y o f t h e s e o p t i o n s . C h a p t e r 7,
Admi ni s t rati on, d e s c r i b e s n e c e s s a r y r e g u l a r t asks i n det ai l . Final ly, in
Ch a p t e r 8, IDocs in Conjunction with SAP NetWeaver Process Integration,
t h o s e w h o w o r k w i t h SAP Ne t We a v e r PI ( f o r me r l y SAP Ne t We a v e r XI)
l ear n h o w t h e y ca n i mp l e me n t t asks t h a t a r e o n l y r e q u i r e d i n t h e cont e xt
o f IDocs, speci f i cal l y i n t h e c o mmu n i c a t i o n wi t h SAP Ne t We a v e r PI.
12
Preface
Acknowledgments
Ab o v e al l , I w o u l d l i ke t o l h a n k my h u s b a n d Ma n f r e d . Thi s b o o k c o n
s u m e d a l o t o f o u r t i me, a n d w i t h o u t hi s s u p p o r t a n d all t he wo r k h e di d,
I w o u l d n ' t have b e e n a bl e t o w r i t e it.
I w o u l d a l s o l i ke t o t h a n k Ma i k e Lubbe r s , St ef an Pr oksch, a n d Me g
Du n k e r l e y o f Gal i l eo Press w i t h o u t t h e i r e n c o u r a g e m e n t a n d s u p
por t , I m i g h t have b e e n a bl e t o fi ni sh t h i s b o ok, b u t i t wo u l d def i ni t el y
have c o n t a i n e d ma n y e r r or s .
S a b i n e Ma i s e l
13
This chapter introduces t h e i n t erf a ce types used by S A P in ALE
scenarios. You'll learn a b o u t t h e characteristics o f t h e di f fe rent
techniques a n d w h y d i f f e r e n t areas need d i f f e r e n t i n t erf a ce types.
Youl l also review t erminology used t h ro u g h o u t t h e book.
1 Introduction
You' r e c e r t a i n l y f a mi l i a r w i t h t h e t opi c o f e l e c t r o n i c d a t a e x c h a n g e
b e t w e e n d i f f e r e n t e n t e r p r i s e s . But e v e n w i t h i n e n t e r p r i s e s , i ndi vi dua l
pr ocess s t e ps c a n t b e ca r r i ed o u t o n t he s a m e ma c h i n e ( o r i n t h e s a me
dat aba s e) us i ng t h e s a me s of t wa r e. SAP me e t s t hi s r e q u i r e m e n t by p r o
v i d i n g s t a n d a r d i nt e r f a c e s f or l oc a t i ons w h e r e t hi s k i n d o f s e p a r a t i o n is
c o mmo n . Standard interfaces a p p l y speci f i c n o r ms t o act ual da t a t r ans f er
t o p r o v i d e y o u w i t h a c e r t a i n r e l e as e securi t y.
1.1 What Is ALE?
An e x a mp l e o f h o w y o u c a n s t r u c t u r e t h e c o m m u n i c a t i o n ac c or di ng
t o p r oc e s s s t e p s is t h e s e p a r a t i o n o f h u m a n r e s our c e m a n a g e m e n t a n d
a c count i ng, wh i c h y o u can fi nd i n ma n y c o mp a n i e s . All d a t a g e n e r a t e d in
HR o n bus i ne s s t r i ps , f o r e x a mp l e t h a t al so n e e d s t o be t r a ns f e r r e d
t o a c c o u n t i n g can be p o s t e d i n t h e SAP s ys t e m b o t h l ocal l y o r r emot el y.
Because o f t hi s, i t is a t t h e s ol e d i s c r e t i o n o f a c o m p a n y w h e t h e r t o use
o n e o r sever al s ys t ems . SAP r e f e r s t o t h i s s e p a r a t i o n o f pr oc es s es wi t h i n
a n e n t e r p r i s e as Application Link Enabling (ALE); pr oc es s es t h a t cont a i n
t h e r e l e v a n t i nt er f aces a r e cal l ed ALE business processes o r ALE scenarios.
An i n t e r f a c e g e n e r a l l y a l l o ws y o u t o s e n d d a t a f r o m a c e r t a i n po i n t
w i t h i n t h e p r oc e s s ( o u t b o u n d i nt er f ace) o r t o r ecei ve d a t a a t a specific
p o i n t ( i n b o u n d i nt er f a ce) . A p r e r e q u i s i t e f or t h e us ef ul e m p l o y m e n t o f
S t r u c t u r i n g
c o m m u n i c a t i o n
I n t e r f a c e s
15
1 Introduction
Technical
d e s c r i p t i o n
Se m a n ti c
d e s c r i p t i o n
R e m o t e F u n c t i o n
Call
P r o t o c o l
Syn ch r o no u s
c o m m u n i c a t i o n
a n i n t e r f a c e is t h a t b o t h a t ec hni c a l a n d s e m a n t i c d e s c r i p t i o n o f t hat
i nt er f a ce ar c avai l abl e.
The technical description speci f i es wh i c h d a t a is s u p p l i e d o r e x p e c t e d in
w h i c h f o r m a t a n d i n w h i c h s e q u e n c e . Thi s d e s c r i p t i o n is r e q u i r e d t o
u n p a c k t h e dat a.
The semantic description c o n t a i n s all o f t h e r e q u i r e d b u s i n e s s i n f o r m a
t i on c o n c e r n i n g t h e us e o f t h e i nt er f a ce, f o r i ns t a nc e , w h e t h e r t h e dat a
is r e a d - o n l y o r c a n be e d i t e d . Thi s d e s c r i p t i o n is r e q u i r e d t o i n t e r p r e t
t h e i n c o mi n g dat a.
Technical and Semantic Descriptions of an Interface
Consider an interface t hat we all use very often in our daily life: transferring
sent ences by t el ephone. Here, t he semantic description corresponds t o the
knowl edge t hat t he last sent ence is usually a farewell; t he technical descrip
tion, on t he ot her hand, corresponds t o t he knowl edge of how t o structure a
farewell not e in English.
O f c our s e , i n a d d i t i o n t o t h e de s c r i pt i ons , t h e phys i cal t r a n s f e r o f dat a
is n e c e s s a i y as we l l vi a a pr ot ocol . SAP s u p p o r t s i t s o w n RFC pr ot ocol
(Remote Function Call) in all rel eases, wh e r e a s n e w e r r el eases al so s u p p o r t
HTTP (Hypertext Transfer Protocol) a n d SOAP ( wh i c h or i gi nal l y s t o o d f or
Simple Object Access Protocol). Because ALE bus i ne s s pr oc es s es r e p r e s e n t
a sl i ght l y o l d e r t e c hnol ogy, t h e y us e o n l y s t a n d a r d i nt er f aces b a s e d on
RFC a n d d o n ' t s u p p o r t t h e n e w p r o x y i nt e r f a c e s y e t , wh i c h a r c bas e d
on SOAP.
Protocol of an Interface
Let's get back t o our tel ephone analogy: The phone line basically allows you
t o transfer dat a via fax or language. However, before you do t hat , you must
agree with your partner on which of t he t wo opt i ons you want t o use. This
corresponds t o selecting t he protocol, t hat is. t he transfer type.
W h e n d e s i g n i n g an i nt er f a ce, y o u h a v e t h e f ol l owi ng opt i ons :
S y n c h r o n o u s i n t e r f a c e s
Sy n c h r o n o u s i nt e r f a c e s c o n s i s t o f a request a n d a response. Du r i n g t hi s
pr oc es s , t h e c o n n e c t i o n b e t w e e n t h e s y s t e ms is ke p t al i ve. Consc-
1 6
W h a t Is ALE | 1.1
que n t l y , s y n c h r o n o u s i nt e r f a c e s i mme d i a t e l y p r o v i d e a resul t . This
me a n s t h a t y o u t h e u s e r o f t hi s t y p e o f i n t e r f a c e c a n wa i t f o r t he
r e s p o n s e . Th e a d v a n t a g e o f a s y n c h r o n o u s i nt er f a ce is t h a t y o u r ecei ve
a di r e c t c o n f i r ma t i o n as t o w h e t h e r y o u r o r d e r wa s p r o c e s s e d o r not .
I t ' s y o u r r e s p o n s i b i l i t y t o t r i gge r t h e e x e c u t i o n o f t h e t ask. Th e d i s a d
va n t a g e o f t hi s t y p e o f i nt e r f a c e is t h a t y o u c a n t c o n t i n u e t o wor k
unt i l t h e o t h e r s y s t e m pr oc es s es t h e r e q u e s t o r w h e n t h e o t h e r s ys t em
i s n ' t avai l abl e. In a d d i t i o n t o t hat , l o n g r u n t i me s can r e q u i r e y o u to
r e p e a t t h e s a me o p e r a t i o n i f y o u t hi nk a n e r r o r ha s oc c ur r e d.
Example: Synchronous Interface
Y o u w a n t t o b u y a b o o k a b o u t A L E a n d I D o c s a n d c a l l y o u r l o c a l b o o k s h o p t o
o b t a i n i n f o r m a t i o n o n a v a i l a b l e b o o k s a n d t h e r e s p e c t i v e p r i c e s . I t d e p e n d s
o n t h e r e s p o n s e y o u g e t w h e t h e r y o u l l a c t u a l l y m a k e t h e p u r c h a s e o r n o t . If
a t e c h n i c a l f a i l u r e t e r m i n a t e s t h e p h o n e c a l l p r e m a t u r e l y , y o u l l c a l l b a c k o n l y
i f y o u h a v e n ' t r e c e i v e d a n y r e s p o n s e y e t .
A s y n c h r o n o u s i n t e r f a c e s
As y n c h r o n o u s i nt er f aces s e n d t h e r e q u i r e d da t a t o t h e o t h e r sys t em
i n v o l v e d a n d d o n ' t r ecei ve an i mme d i a t e r e s p o n s e . Thi s me a n s t hat
o n l y a r e q u e s t is s e nt . As a pr e r equi s i t e, no r e s p o n s e is n e e d e d f or this
pr ocess. Cons e que nt l y, y o u c a n c o n t i n u e wo r k i n g i r r e s pect i ve o f t he
o t h e r s ys t em. Howe ver , bec aus e y o u w o n ' t r ecei ve a n i mme d i a t e
r esul t , i n a n a s y n c h r o n o u s c o mmu n i c a t i o n pr ocess, i t mu s t b e e ns u r e d
w i t h o u t y o u r i n t e r f e r e n c e t h a t t h e r e q u e s t ar r i ves i n t h e o t h e r s ys t e m
a n d o n l y o n c e . Th e fact t h a t an ac t i on is ca r r i ed o u t o n l y o n c e is
r e f e r r e d t o as transaction security.
Example: Transaction Security
Y o u w a n t t o b u y m y b o o k a n d s e n d a f a x c o n t a i n i n g t h e p u r c h a s e o r d e r d a t a
t o t h e b o o k s h o p . T h e b o o k s e l l e r d o e s n ' t r e s p o n d t o y o u r f a x . H o w e v e r , t h e
t r a n s m i s s i o n r e p o r t o f y o u r f a x m a c h i n e t e l l s y o u t h a t t h e b o o k s h o p h a s r e
c e i v e d t h e p u r c h a s e o r d e r e x a c t l y o n c e .
ALE s c e na r i os can c o n s i s t o f a n y n u m b e r o f s y n c h r o n o u s a n d a s y n c h r o
n o u s i nt er f a ces . SAP us e s s y n c h r o n o u s i nt er f aces e v e r y t i me d a t a fr om
t h e d a t a b a s e is s u p p o s e d t o b e di s p l a y e d ; a s y n c h r o n o u s i nt er f a ces , in
t ur n, ar e u s e d e v e i y t i me y o u w a n t t o c r e a t e o r c h a n g e d a t a i n t h e dat a-
A s y n c h r o n o u s
c o m m u n i c a t i o n
I n t e r f a c e s i n ALE
scenarios
17
base. I n t h e l a t t e r case, t h e t r a ns a c t i on s e c u r i t y is par t i c ul a r l y i mp o r t a n t
t o ma i n t a i n da t a b a s e consi st ency.
1.2 BAPIs and IDocs An Introduction
BAPis T h e m e d i u m f o r s y n c h r o n o u s i nt e r f a c e s i n ALE s c e n a r i o s is t h e Busi
ness Application Programming Interface (BAPI). Th e t e r m Application Pro
gramming Interface (API) is g e n e r a l l y u s e d i n t h e IT e n v i r o n m e n t . SAP
e x t e n d e d it b y t h e a d d i t i o n "Busi ness" t o i n d i c a t e t h a t t h e p r oc e s s n o t
o n l y i nvol ves a p u r e l y t echni cal d a t a t r ansf er , b u t a s t ep wi t h i n a busi
ness pr oc es s . In t hi s c o n t e x t , t h e i ndi vi dua l s t e ps t h a t ma k e u p t h e p r o
cess can o c c u r i n d i f f e r e n t syst ems.
I D o c s As y n c h r o n o u s i nt er f aces i n ALE s ce nar i os ar c i mp l e me n t e d u s i n g Inter
mediate Documents (IDocs). I n a d d i t i o n t o t h e b u s i n e s s d o c u m e n t s t h a t
ar e c r e a t e d i n t h e d i f f e r e n t s y s t e ms i n v o l v e d , a s y n c h r o n o u s pr oc es s es
a l s o g e n e r a t e a d a t a d o c u m e n t t h a t e n s u r e s t r a ns a c t i on s ecur i t y. Because
t hi s d o c u m e n t i s n ' t p a r t o f t h e act ual b u s i n e s s pr ocess b u t is r a t h e r an
i n t e r me d i a t e d o c u me n t , i t ha s b e e n a s s i gned t h e c o r r e s p o n d i n g name.
The f ol l owi ng s e c t i o n s p r o v i d e a b r i e f i n t r o d u c t i o n t o t h e t opi c o f BAPIs
a n d IDocs. You' ll l ear n h o w t h e s e d i f f e r e n t m e t h o d s wo r k a n d w h y t wo
d i f f e r e n t t ypes o f i nt er f a ce exi s t w i t h i n ALE scenar i os.
1.2.1 BAPis
A BAPI is a r e m o t e - e n a b l e d f u n c t i o n m o d u l e , t h a t is, a m o d u l e t h a t
can be e x e c u t e d b y a n o t h e r p r ogr a m. In t hi s c o nt e xt , it i s n ' t i mp o r t a n t
w h e t h e r t h a t p r o g r a m calls t h e f u n c t i o n mo d u l e l ocal l y o r f r o m w i t h i n a
di f f e r ent s y s t e m. BAPis di f f e r f r o m r e g u l a r RFC-enabled f u n c t i o n modules
(RFM) i n t h e f o l l o wi n g aspect s:
b a p i r e q u i r e m e n t s As a me t h o d , a BAPI is p a r t o f a bus i ne s s o b j e c t t y p e f r o m t h e Business
Object Repository (BOR). Fo r all r e l e v a n t o b j e c t s i n t h e SAP s ys t em,
SAP pr o v i d e s a c o r r e s p o n d i n g e l e m e n t i n t h e BOR. I n t h e BOR, y o u
can fi nd i n f o r ma t i o n r e g a r d i n g wh i c h t abl es p e r t a i n t o a n o b j e c t a n d
w h a t y o u c a n do wi t h t h e m. It ' s al so t h e basi s f o r t h e business work
f l o w . So, i t ma k e s mu c h s e n s e t o al so s t or e i n t h e BOR i n f o r ma t i o n
1 | Introduction
1 8
BAPIs and IDocs An Introduction | 1 . 2
a b o u t w h i c h pr ocess s t e ps i n ALE s c e na r i os y o u c a n c a r r y o u t w i t h t he
r e s pe c t i ve obj ect s.
BAPIs a r e r e l e as ed, h a v e a f r ozen s i gnat ur e, a n d t hus p r o v i d e rel ease
securi t y.
T h e y t ypi cal l y u s e an u p d a t e t e c h n i q u e f o r pos t i ngs i n s t e a d o f pos t i ng
di rect l y. Mo r e o v e r , t h e y d o n ' t c o n t a i n a n y C o m m i t o r R o l l b a c k s t a t e
me n t s . (The few, mo s t l y v e r y ol d e x c e p t i o n s ar e speci fi cal l y d o c u
m e n t e d by SAP.)
Th e act ual p o s t i n g p r oc e s s is t r i gge r e d by t h e speci al B A P I _ T R A N S A C -
T I O N . C O M M I T BAPl o r is u n d o n e vi a B A P I _ T R A N $ A C T I O N _ R O LL B A C K .
BAPIs us ual l y d o n t di s pl ay t h e r e s ul t s b e c a u s e i t ' s unl i ke l y t h a t t h e
cal l er ha s a GUI (graphical user interface) avai l abl e. BAPIs t h a t we r e
speci fi cal l y d e v e l o p e d f o r an SAP/ SAP c o mmu n i c a t i o n ar e an e x c e p
t i o n t o t hat . Howe ve r , t h e s e BAPIs a r e n ' t r e l e v a n t f o r i nt er f aces to
e xt e r na l syst ems.
Like all r e mo t e - e n a b l e d f u n c t i o n mo d u l e s , BAPIs ca n g e ne r a l l y be call ed
us i ng a synchronous RFC (sRFC) o r a transactional RFC (tRFC). The t r a n s
ac t i ona l call is a s y n c h r o n o u s a n d ma k e s s u r e t h a t t h e call is e x e c u t e d
exact l y onc e . Howe ve r , n o t e t h a t b o t h t h e s y n c h r o n o u s a n d t he t r ans a c
t i onal call no t i f y o n l y t h e cal l i ng s ys t e m i n case o f p o t e n t i a l e r r o r s , eve n
i f t h a t s ys t e m c a n t r e mo v e t h e e r r o r . Th a t ' s w h y BAPIs a r e g e ne r a l l y
us e d o n l y f or s y n c h r o n o u s calls i n ALE s ce nar i os . I n a s y n c h r o n o u s cases,
er r or s s h o u l d pr e f e r a bl y be r e p o r t e d di r e c t l y t o t h e recei ver , p r o v i d e d
t h e s e e r r o r s a r e bus i ne s s - r e l a t e d. BAPIs a r e n ' t i n t e n d e d f o r t h i s p u r p o s e .
Th e f o l l o wi n g s e c t i o n d e s c r i b e s h o w t h e s e p a r a t i o n by e r r o r t y p e s is
i mp l e me n t e d by me a n s o f IDocs.
1. 2. 2 I DOCS
SAP d e v e l o p e d IDocs speci f i cal l y t o e n a b l e t h e a s y n c h r o n o u s me s s a ge
e x c ha nge b e t w e e n mu l t i p l e SAP a n d / o r non- SAP s ys t ems . Th e a d v a n
tages o v e r a n o r ma l , a s y n c h r o n o u s l y (t r ansact i onal l y) cal l ed RFM i ncl ude
an i m p r o v e d e r r o r - h a n d l i n g p r o c e s s as we l l as a speci f i c m o n i t o r i n g
l a ye r m a d e avai l abl e t o I Docs. Because e r r o r pr oc e s s i ng vi a IDocs affects
t h e s t r u c t u r e o f IDoc i nt e r f a c e s , w e ll l o o k a t i t first i n t h e f ol l owi ng
sect i ons .
C a l l i n g BAPIs
v i a RFC
19
1 Introduction
E r r o r t y p e s
Errors i n s e n d i n g
a n d r e c e i v i n g
systems
Error Handling w i t h IDocs
You can g e n e r a l l y di s t i ngui s h b e t w e e n t w o d i f f e r e n t t y p e s o f er r or :
Te c h n i c a l e r r o r s
Techni cal e r r o r s o b v i a t e t h e c o mmu n i c a t i o n w i t h t h e p a r t n e r s ys t em.
The y occur , f o r e xa mpl e , i f t h e p a r t n e r s y s t e m i s n t avai l abl e, t he
d a t a b a s e i n t h a t s ys t e m c a n ' t a c cept a n y a d d i t i o n a l r e que s t s , o r t he
speci f i ed p a s s wo r d is i ncor r ect .
B u s i n e s s - r e l a t e d e r r o r s
Bus i nes s - r el at ed e r r or s o c c u r i f t h e p a r t n e r s ys t e m g e ne r a l l y r e s p o n d s
t o r e q u e s t s b u t c a n ' t pr ocess y o u r speci f i c r e que s t . Mi s s i n g a u t h o r i z a
t i ons, mi s si ng Cus t omi zi ng, o r t h e l i ke can c a u s e t hi s t y p e o f er r or .
I n t h e c o n t e x t o f RFCs, t h i s d i s t i n c t i o n i s n t ma d e . I n a RFC, t h e us e r
di r ec t l y r ecei ves a n e r r o r me s s a ge a n d mu s t ma k e s u r e t h a t t h e r e ques t
wi l l b e r e p e a t e d a t a l at er p o i n t i n t i me . Because calls c o n t a i n i n g er r or s
c a n ' t be r e p e a t e d a u t oma t i c a l l y a n d d o n ' t have t o be l ogged, t h e d i s t i n c
t i o n b e t we e n e r r o r t y p e s w o u l d n ' t ma k e s e n s e her e.
In tRFCs, each call t h a t c o n t a i n s a n e r r o r is wr i t t e n t o a t abl e i n t h e s e n d
i ng s y s t e m a n d c a n be r e s t a r t e d us i ng a speci f i c t r ans a ct i on. I n t hi s case,
it d o e s ma k e s e n s e t o d i s t i n g u i s h b e t w e e n t h e t y p e s o f e r r or . I n t h a t
case, t echni cal e r r or s wo u l d be l ogged i n t h e s e n d i n g s ys t em, a n d t he call
w o u l d b e r e p e a t e d , i f neces s ai y, wh i l e bus i n e s s - r e l a t e d e r r o r s wo u l d be
l ogge d a n d p r o c e s s e d i n t h e r e cei vi ng s y s t e m. Thi s o p t i o n t o d i s t i ngui s h
b e t we e n d i f f e r e n t t y p e s o f er r or s is a speci f i c f e a t u r e o f IDocs a n d i s n t
p r o v i d e d by RFCs t h e i r self. In a ddi t i on, y o u can al so c h a n g e t h e c o n
t ent s o f I Docs r e t r oact i vel y i n case o f e r r o r s , wh i c h i snt pos s i bl e e i t h e r
wi t h s t a n d a r d RFCs.
To d i s t i ngui s h b e t w e e n t echni cal e r r o r s a n d bus i ne s s - r e l a t e d e r r or s , t he
p r o c e s s i n g o f t h e r e s pe c t i ve pr oc es s es m u s t b e d i v i d e d i n t o t w o s t e p s as
wel l . The fi rst s t ep is r e s p o n s i b l e f o r p u r e l y t r a n s f e r r i n g t h e r e q u e s t t o
t he da t a b a s e o f t h e r e cei vi ng s ys t em. Thi s s t e p d o e s n t d e p e n d on t he
t y p e o f da t a t h a t is t r a n s f e r r e d . Fo r e xa mpl e , i t d o e s n t ma k e a n y di f f e r
e n c e w h e t h e r y o u w a n t t o c r e a t e ma t e r i a l s o r cancel a sal es o r d e r . To
c a r t y o u t t h e t r a n s f e r i n t h e s a me m a n n e r f o r all ki nds o f dat a, y o u use
a n e u t r a l f or ma t : t h e IDoc f or ma t .
20
BAPIs and IDocs An Introduction | 1 . 2
The s e c ond s t e p is ca r r i ed o u t local l y i n t h e r ecei vi ng s ys t e m a n d i nvol ves
po s t i n g t h e r e l e v a n t d o c u m e n t . Thi s s t e p c a n v a r y d e p e n d i n g o n t he
bus i ne s s o b j e c t t o b e pr oc es s ed.
Technical Description o f t h e IDoc Format
An IDoc c o n s i s t s o f a header record, a n y n u m b e r o f l i nes o f a ppl i ca t i on
d a t a (application records), a n d a n y n u m b e r o f st at us records p e r IDoc.
Header
The h e a d e r c o n t a i n s ge ne r a l i n f o r ma t i o n a b o u t wh i c h d a t a is s u p
p o s e d t o be t r a n s f e r r e d , wh o is t he s e n d e r , a n d w h o is t h e recei ver.
Thi s me a n s t h a t t h e r e c e i v e r c a n l e a r n f r o m t h e h e a d e r r e c o r d wh i c h
d a t a ha s b e e n r e cei ved a n d b a s e d o n t h i s i n f o r ma t i o n deci de
h o w t o p r oc e s s t hi s dat a.
Data records
The d a t a r e c o r d s c o n t a i n bus i ne s s - r e l a t e d i n f o r ma t i o n . To ma k e sur e
t h e t echni cal f o r ma t is i n d e p e n d e n t o f t h e bus i ne s s o b j e c t a n d can
al so b e u n d e r s t o o d by non- SAP s ys t ems , t h e c o n t e n t o f each d a t a
r e c o r d is s t o r e d as a s t r i n g o f 1 0 0 0 cha r ac t e r s . Thi s c h a r a c t e r s t r i n g is
p r e c e d e d b y a c o n t r o l a r e a c o n t a i n i n g i n f o r ma t i o n a b o u t h o w t o i n t e r
p r e t t h e 1000 char act er s.
Status records
St at us r e c or ds c o n t a i n i n f o r ma t i o n a b o u t t h e pr e v i o u s s t a t u s e s o f t he
IDoc, s u c h as "successf ul l y c r e a t e d " o r "successf ul l y pos t e d. " Stat us
r e c or ds a r e n ' t t r a ns f e r r e d; t h a t is, b o t h t h e s e n d e r a n d r e c e i ve r kee p
t h e i r o w n s t a t us recor ds.
Fr om a t echni cal p o i n t o f vi ew, t h e s e t h r e e t ypes o f r e cor d h a v e t h e s a me
s t r u c t u r e . Co n s e q u e n t l y , t h e s t r u c t u r e d o e s n ' t p r o v i d e a n y c l ue as t o
w h i c h k i n d o f bus i n e s s - r e l a t e d i n f o r ma t i o n y o u ' r e dea l i ng wi t h.
Fi gur e 1. 1 c o n t a i n s a t he or e t i c a l i l l us t r a t i on o f h o w t he d i f f e r e n t t ypes
o f r e c o r d s c a n b e us ed. Not e t h a t y o u c a n us e an u n l i mi t e d n u m b e r o f
d a t a r e c or ds a n d s t a t us r e cor ds . Thi s is d e s c r i b e d i n g r e a t e r de t a i l i n t he
f o l l o wi n g s ect i on.
I D o c as a n e u t r a l
f o r m a t
H e a d e r r e c o r d /
c o n t r o l record
D a t a rec or ds
St a t u s rec or ds
21
1 Introduction
C o n t r o l Record I D o c N u m b e r
Sender an d Receiver
Message Type a n d I D o c Type
External Structure
D a t a Records
Co ntrol Section w it h
I D o c Number
Ap pli cat io n Data
Segment Type etc.
M a t e r i a l Nu mb er, D a t e et c. as Character String
( L e n g t h : 1 0 0 0 )
S t a t u s R ec ords I D o c Number
Status I n fo rm a t i o n (e.g .. 5 3 : P o s t e d Successfu lly)
F i g u r e 1.1 S t r u c t u r e o f an I Doc
To pr ocess i h e IDoc, t he r ecei ver nee ds meta information, t hat is, i n f o r ma
t i o n c o n c c mi n g t he ma n n e r i n wh i c h t he da t a is s uppos e d t o b e processed.
The met a i nf or ma t i on t h a t des c r i bes an IDoc consi st s o f t hr e e parts:
M e s s a g e t y p e Me s s a g e t y p e
T h e me s s a ge t y p e pr o v i d e s a s e ma n t i c d e s c r i p t i o n o f t he d a t a t o be
p r oc e s s e d. For e xa mpl e , me s s a ge t y p e MATMAS i ndi c a t e s t h a t mat er i al
m a s t e r da t a is s u p p o s e d t o be e x c h a n g e d . Th e me s s a ge t y p e is also
r e s p o n s i b l e f o r t h e wa y a me s s a ge wi l l b e pr oc es s ed. Wh e n y o u c r e
at e o r c h a n g e a sal es or de r , f o r e xa mpl e , t h e act ual i n f o r ma t i o n is
i dent i cal , b u t t h e p r o c e s s i n g is di f f e r e nt , w h i c h is w h y t h e c r e at i on o f
t h e o r d e r is a s s i gned t h e ORDERS me s s a ge t y p e , wh i l e me s s a ge t ype
OROCHG is as s i gned t o t h e c h a n g e acti vi t y. The n a me s o f me s s a ge t ypes
ar e b a s e d o n t h e n a me s o f t h e UN/ EDIFACT s t a n d a r d ( United Nations
Electronic Data Interchange f o r Administration, Commerce a n d Transport),
b u t a p a r t f r o m t h e n a me s , t h e r e ar e n o o t h e r s i mi l ar i t i es b e t w e e n t he
I Doc a n d EDIFACT f or ma t s .
I D o c t y p e I Doc t y p e
T h e IDoc t y p e r e p r e s e n t s t h e t echni cal de s c r i p t i o n o f t h e dat a. It tells
y o u wh i c h fi el ds o f wh i c h b u s i n e s s obj ect s ar e s u p p o s e d t o be filled
22
BAPIs and IDocs An Introduction | 1 . 2
wi t h wh i c h val ues. Thi s me a n s t h a t t h e IDoc t y p e de s c r i be s h o w to
i n t e r p r e t t h e 1 0 0 0 cha r ac t e r s i n t h e d a t a record.
S e g m e n t t y p e Segment type
Fo r e a c h possi bl e v a r i a n t o f t h e s e 1 0 0 0 char act er s, t h e r e is o n e s e g
m e n t t ype. Fo r e x a mp l e , s e g m e n t t y p e E1MARAM i ndi c a t e s t h a t mat er i al
m a s t e r d a t a f r o m Tabl e MARA is g o i n g t o fol l ow. I n e a c h SAP s ys t em,
i n f o r ma t i o n is s t o r e d as t o whi c h IDoc t y p e can h a v e wh i c h s e g me n t s ,
h o w of t en, a n d i n wh i c h s e que nc e .
You c a n e x p o r t t h i s da t a t o e x t e r n a l s y s t e ms t o avoi d h a vi ng t o m a i n
t ai n al l s t r u c t u r e s manual l y. SAP s u p p o r t s t h e t r a n s f e r o f d a t a vi a t r a n s
p o r t IDocs, C files, DTD (Document Type Description), o r HTML (Hypertext
Mark up Language). I f y o u w a n t t o us e t r a n s p o r t IDocs, y o u m u s t e n s u r e
t h a t y o u r p a r t n e r can g e ne r a l l y r e c e i ve IDocs f r om y o u , wh i c h means
t h a t y o u r SAP s ys t e m m u s t k n o w t h e p a r t n e r as a logical syst em.
The IDoc, wh i c h exi st s as a s e t o f d a t a r e cor ds , is t h e n t r a n s f e r r e d f r om
t h e s e n d e r t o t h e recei ver . T h e m o s t c o m m o n l y u s e d t y p e o f t r a n s f e r is
t h e tRFC. The t r a n s f e r is ca r r i ed o u t i n s uch a wa y t h a t t h e s e n d i n g s ys
t e m calls t h e f u n c t i o n mo d u l e ID0C_INB0UND_ASYNCHR0N0US i n t h e recei v
i ng s y s t e m. Thi s f u n c t i o n mo d u l e r ecei ves t h e d a t a a n d pos t s t h e h e a d e r
a n d d a t a r e c or ds t o t h e as s oc i a t e d d a t a b a s e t a bl e s EDIOC a n d EDID4, a n d
t h e s t a t us o f t h e IDoc t o ED I OS. Af t e r t h a t ha s b e e n d o n e , t h e t echni cal
p a r t is f i ni s hed. I f p r o b l e ms o c c u r d u r i n g t h i s pr oc es s , t h e s e n d e r wi l l be
not i f i ed a n d mu s t r e s e n d t h e da t a a t a l a t e r p o i n t i n t i me.
O t h e r t y p e s o f t r ansf er , s u c h as f i l e (flat file), XML (file i n XML f or ma t ) , IDoc as file
o r HTTP c a n al so be u s e d bec aus e o f t h e s e p a r a t i o n o f d a t a t r a n s f e r a n d
d a t a pr oc es s i ng. Fi gur e 1. 2 s h o ws t h e fi rst p a r t o f a smal l ma t e r i a l ma s t e r
I Doc as a file, o p e n e d i n Not e pa d.
i
:DI_DC40_U8000000000000760764 700 3012 MATMftSOS
2HABA*007 800000000000076076400000100000002005SH-100
2KABA1001 800000000000076076400000200000103/
2MAKTM001 8000000000000760764 000003 00000103005CWM a n o l
E2HAKTM001 8000000000000760764 000004 00000103 005 EMet han ol
E2KAKTM001 8000000000000760764 000005 00000103005rMet han ol
E2HAKTM001 800000000000076076400000600000103005J r f s y - *
E2MAKTM001 8000000000000760764 00000700000103005 Pwet a n o l
1 9 9 51005/
ZSM1
/
Figure 1.2 IDoc in Notepad Editor
23
1 Introduction
You c a n s pec i f y t h e t y p e o f t r a n s f e r t o b e u s e d f o r t r a ns f e r r i ng IDocs to
t h e p a r t n e r s ys t e m vi a t he outbound partner projile (Tr ansact i on WE20) .
Af t e r t h e IDoc ha s a r r i v e d i n t he r e cei vi ng s y s t e m, t he bus i nes s - r e l at ed
p o s t i n g p r oc e s s be gi ns . Typically, t hi s is al so c a r r i e d o u t by me a n s o f a
f u n c t i o n modul e .
The inbound p a r t n e r projile (also Tr a ns act i on WE20) speci f i es t h e pr ocess
code t o b e us ed. For each pos s i bl e c o m b i n a t i o n o f s e n d e r a n d mes s age
t ype, y o u can d e f i n e wh i c h f u n c t i o n m o d u l e wi l l be us ed. SAP pr ovi des
all n e c e s s a i y f u n c t i o n mo d u l e s f o r al l ALE s c e na r i os avai l abl e. No t e t h a t
y o u can c u s t o mi z e t h e s e f u n c t i o n mo d u l e s o r e v e n r epl ace t h e m wi t h
y o u r o w n . Ch a p t e r 4, Changes t o IDocs, p r o v i d e s m o r e de t ai l ed i nf or
ma t i o n o n this.
IDoc tracking I f a n e r r o r occur s d u r i n g t h e bus i nes s - r e l at ed pos t i ng, t h e e r r o r wi l l be
d o c u me n t e d i n t h e s u b s e q u e n t s t a t us r e cor d o f t he IDoc, a n d y o u can
r est ar t t h e pos t i ng pr ocess later. SAP pr o v i d e s a s e pa r a t e t r ans a ct i on for
posi ng an I Doc af t e r a pr ocessi ng er r or : Transact i on BD87. This t r ansact i on
can r e s e nd IDocs t h a t c o n t a i n e d er r or s i n t he s e n d i n g sys t em d u r i n g t he
first a t t e mp t a n d can r e-process e r r o n e o u s IDocs i n t he recei vi ng syst em,
i f necessai y. Af t er t h e r epr ocess, e v e r y t h i n g is f i ni s hed. The p o s t i n g o f t he
IDoc cr eat es t he busi ness Doc ume nt , o r changes it. Thi s is o n l y d o n e once.
Onc e it is successful l y cr e a t e d o r cha nged, t h e Business Do c u me n t is not
t o u c h e d agai n. I f b o t h s ys t ems ar e SAP syst ems, y o u can e v e n use t he IDoc
tracking f unct i on f r om wi t h i n t h e s e n d i n g sys t em t o o b t a i n i nf or ma t i on on
t he c u r r e n t st at us o f t he r espect i ve IDoc in t he recei vi ng s ys t em. You can
st ar t IDoc t racki ng fr om wi t h i n t h e I Doc m o n i t o r (Transact i on BD87). Thi s
f unct i on uses t h e f unct i on mo d u l e I D0C_DATE_T IME_GET vi a sRFC t o read
t he I Doc n u m b e r a n d its s t a t us i n t he r ecei vi ng syst em.
BAPIs and IDocs in ALE Scenarios
D u e t o t h e t r a n s a c t i o n s e c u r i t y e n a b l e d b y t h e u p d a t i n g o f e r r o n e o u s c o n
n e c t i o n s a n d b e c a u s e o f t a r g e t - o r i e n t e d e r r o r - h a n d l i n g p r o c e d u r e s , t h e A L E
i n t e g r a t i o n s c e n a r i o s p r o v i d e d b y S A P a l w a y s u s e B A P I s f o r s y n c h r o n o u s , r e
q u e s t i n g a c c e ss , a n d I D o c s f o r a s y n c h r o n o u s , c h a n g i n g a c c e s s . I f i t ' s p o s s i b l e
t o t r a n s f e r d a t a i n b o t h w a y s , t h a t i s , s y n c h r o n o u s l y a n d a s y n c h r o n o u s l y ( e . g . ,
i n a f i r s t , s y n c h r o n o u s t e s t r u n , a n d t h e n t h e a c t u a l p o s t i n g a s y n c h r o n o u s l y ) ,
b o t h a B A P I a n d a m a t c h i n g I D o c a r e n e e d e d . T h e I D o c t h e r e f o r e c a n b e c r e
a t e d v i a T r a n s a c t i o n B D B G , w h i c h is a l s o a v a i l a b l e t o c u s t o m e r s .
24
D i f f e r e n t i a t i o n o f ALE a n d EDI | 1.3
1.3 Differentiation of ALE and EDI
T h e c o n c e p t o f ALE c o m p r i s e s c o m m u n i c a t i o n w i t h i n a n e n t e r p r i s e .
Howe ve r , w i t h i n a n e n t e r p r i s e , d i f f e r e n t p r o c e s s e s ar e c a r r i e d o u t in
phys i cal l y d i f f e r e n t IT s y s t e ms , w h i c h m e a n s t h a t i n d i v i d u a l pr ocess
s t e ps c a n i n v o l v e d i f f e r e n t s y s t e ms . As y o u ' v e a l r e a d y l e a r ne d, t h e s e
s t e ps c a n b e c a r r i e d o u t i n a s y n c h r o n o u s pr ocess vi a BAPIs as wel l as in
a n a s y n c h r o n o u s p r oc e s s i nvol vi ng IDocs.
I n t hi s c o nt e xt , t h e c o mmu n i c a t i o n i t s e l f is c a r r i e d o u t b e t w e e n t h e l ogi
cal s y s t e ms (LSs). Each LS r e p r e s e n t s a c o m b i n a t i o n o f h a r d w a r e a n d
s o f t wa r e i nst al l ed o n t h a t s y s t e m. In a n SAP s ys t em, a c l i ent c o r r e s p o n d s
t o a LS. The LS is a s s i g n e d t o t h e c l i e n t a n d pr o v i d e s i n f o r ma t i o n as to
w h e t h e r a d o c u m e n t wa s c r e a t e d o n t h a t SAP c l i e nt o r w h e t h e r i t was
a d o p t e d by me a n s o f c ons ol i da t i on pr ocesses ( t he ma j or i t y o f d o c u me n t s
c ont a i n t h e or i gi nal s ys t e m i n a specific field i n t he dat abas e) . The as s i gn
m e n t o f t h e LS is p a r t o f t h e pos t - i ns t a l l a t i on pr o c e d u r e s . A s ys t e m mu s t
k n o w i t s o w n s ys t e m n a me as wel l as t h e n a me s o f all LSs it c o m m u n i
cat es wi t h.
The LSs m u s t b e u n i q u e a c r os s t h e e n t i r e e n t e r p r i s e ( act ual l y a c r os s t he
e nt i r e r a n g e o f c o mmu n i c a t i o n ) . Mo r e o v e r , t h e LSs f o r non-SAP s ys t ems
w i t h wh i c h a c o mmu n i c a t i o n is e s t a b l i s h e d mu s t al s o be k n o w n . You
can a s s i gn t h e LS f or y o u r o w n c l i e nt as wel l as ma k e s y s t e ms k n o wn
w i t h wh i c h mes s age s wi l l b e e x c h a n g e d vi a ALE- Cust omi zi ng, wh i c h can
be r e a c h e d us i ng Tr a ns act i on SALE. Fi gur e 1. 3 s h o ws t he Cust omi zi ng
f u n c t i o n s , De f i ne Logical Sys t e m a n d Assi gn Logical Sys t e m t o Cl i ent .
Tr a ns act i on BD54 e n a b l e s y o u t o assi gn n a me s t o LSs. In a d d i t i o n t o t he
n a me f o r t h e LS, y o u s h o u l d a l s o e n t e r a b r i e f des c r i pt i on.
Structure
^ I D o c l i ^ r f a c e V
Basic Settings
[ I Doc Administration
Q ( > I nbound SOAP for IDoc: R e g is te r Service
Perform Automatic Workflow Customizing
Q Activate eve nt receiver linka ge for IDoc i nbound
1:7 Logical Systems
De fi ne Logical System
As sig n Logical Sy ste m to Client____________________|
Figure 1.3 Setting Up Logical Systems
L ogic al sy s t em
U n i q u e n e s s o f
l o g i c a l s y stems
1 Introduction
C u s t o m e r
d i s t r i b u t i o n m o d e l
EDI
EDI s t a n d a r d s
The customer distribution model (Tr ansact i on BD64) a l l ows y o u t o def i ne
wh i c h BAPIs a n d IDocs wi l l b e e x c h a n g e d b e t w e e n wh i c h s ys t ems . In
t hi s c ont e xt , e a c h s y s t e m can f u n c t i o n as t h e s e n d e r o r recei ver . I n o u r
e xa mpl e (see Fi gure 1. 4), t h e LS T 9 0 CLNT0 9 0 s e n d s t h e IDoc MATMAS to
t h e LS SA LES, wh i l e t h e IDoc MATFET is s e n t i n t h e o p p o s i t e di r e c t i on.
In a d d i t i o n , t wo BAPIs ar e e x c h a n g e d . Th e M a t e r i a 1 . G e t D e t a i 1 BAPI is
s e n t f r o m T 9 0 C LNT 0 9 0 t o SALES, wh i l e t h e M a t e r i a l . A v a i l i b i 1 i t y BAPI
is s e n t i n t h e o p p o s i t e di r e c t i on.
Distribution Model | De s c r i p t i o n / t e c h n i c a l na m e
^ Model views
^ g g Z S M I ZSM1
^ 0 X D O c l ien t 8 0 0 T 9 0 C L N T 0 9 0
^ @ S a l e s sys tem (cli ent 810 ) SALES
V f a MATMAS Materi al m a s t e r
$ St andardMaterl al. GetDetail
^ @ S a l e s sys tem (cli ent 810 )
D e te r m i n e d e t a i l s on material
SALES
^ 0 XDO client 8 0 0 T 9 0 C L N T 0 9 0
f a MATFET R e q u e s t material
$ StandardMaterialAvailability AT P information
F i g u r e 1.4 D i s t r i b u t i o n M o d e l w i t h Ex am ple f o r I D o c a n d BAPI
In c o n t r a s t t o ALE as a me a n s o f e n t e r p r i s e - i n t e r n a l c o mmu n i c a t i o n , EDI
(Electronic Data Interchange) c o mp r i s e s t h e t r a n s f e r o f d a t a b e t we e n d i f
f e r e n t e n t e r p r i s e s , f o r e xa mpl e , b e t w e e n c u s t o me r s a n d s uppl i er s . Each
c o mp a n y ha s i t s o wn pr oc e s s fl ows. Howe ve r , a t c e r t a i n p o i n t s w i t h i n a
pr oc es s , t h e p a r t n e r m u s t b e i n f o r me d . To p r e v e n t t h e p a r t n e r f r o m h a v
i ng t o e n t e r speci f i c i n f o r ma t i o n ma nua l l y i nt o t h e s ys t em, t h e r e l e va nt
i n f o r ma t i o n m u s t be t r a n s mi t t e d t o t h e p a r t n e r el ect roni cal l y.
EDI is al ways a n a s y n c h r o n o u s pr oc es s . Wi t h r e gar d t o SAP s ys t ems , t hi s
me a n s t h a t IDocs a r c al so u s e d f or EDI c o mmu n i c a t i o n . Howe ve r , no t e
t h a t EDI c o mmu n i c a t i o n is al ways ca r r i ed o u t w i t h o u t t h e d i s t r i b u t i o n
mo d e l a n d LSs. Wi t h i n t he s ys t em, t h e r e l e v a n t s e n d e r s a n d r ecei ver s
o f mes s age s ar e al so r e f er r ed t o as partners, c u s t o me r s a n d s u p p l i e r s are
o n e e x a mp l e h e r e . No t e t h a t t h e y m u s t be ma i n t a i n e d as c u s t o me r s a n d
s u p p l i e r s i n t h e SAP s ys t em. No n e w, IDoc-specifi c ma s t e r da t a is ne e d e d
i n t hi s c o nt e xt .
Because d i f f e r e n t c o mp a n i e s us e d i f f e r e n t IT s ys t ems , speci f i c EDI s t a n
dar ds exi s t t o f aci l i t at e da t a t r ans f er s . In Eur o p e a n c o u n t r i e s , t h e EDI-
2 6
Sum mar y | 1 . 4
FACT s t a n d a r d is pr i ma r i l y us ed, wh e r e a s i n t he Uni t e d St at es, ANSI ASC
X I 2 {American National Standards Inst i t ute Accredited Standards Committee
X I 2) is t h e p r e d o m i n a n t s t a n d a r d . EDIFACT assi gns n a me s t o messages,
w h i l e ANSI us e s n u mb e r s . Fo r e xa mpl e , ac cor di ng t o t h e EDIFACT s t a n
dar d, t h e me s s a ge ORDERS r e p r e s e n t s a p u r c h a s e or d e r ; a c c o r d i n g t o t h e
ANSI s t a n d a r d , t h e s a me me s s a ge is cal l ed 8 5 0 . Wi t h r e gar d t o mes s age
t ypes , SAP ha s b a s e d i t s n a mi n g c o n v e n t i o n s o n t h e EDIFACT s t a nda r d;
h o we v e r , t h e s t r u c t u r e o f t h e me s s a ge s d i f f e r s s u b s t a n t i a l l y f r o m t hat
s t a n d a r d . ( Ch a p t e r 2, Ge n e r a t i n g IDocs, de s c r i be s t h e s t r u c t u r e o f IDocs
i n g r e a t e r det ai l . ) In SAP s y s t e ms , IDocs ar e u s e d f or a s y n c h r o n o u s dat a
t r ans f er s b o t h i n EDI a n d ALE pr oces s es , wh i c h is w h y t h e p r oc e dur e s
d e s c r i b e d i n t h e c o u r s e o f t hi s b o o k c a n al ways b e a p p l i e d t o b o t h ways
o f c o mmu n i c a t i o n .
The f o l l o wi n g c h a p t e r s wi l l f oc us e n t i r e l y o n u s i n g IDocs. As f ar as t h e
u s e o f BAPIs is c o n c e r n e d , i t ' s s i mi l a r t o u s i n g f u n c t i o n mo d u l e s . Con
s equent l y, d e v e l o p e r s w h o ar e f a mi l i ar w i t h f u n c t i o n mo d u l e s can c a r i y
o u t all d e v e l o p m e n t t asks r e l a t e d t o BAPIs w i t h o u t a p r o b l e m. IDocs,
on t h e o t h e r h a n d , c o n t a i n s o me speci f i c f e a t u r e s t h a t a r e n t us ual l y
d e s c r i b e d i n d e v e l o p e r ma nua l s . The s e speci f i c f e a t u r e s ar e d e s c r i b e d in
t hi s book.
1.4 Summary
I n t hi s c ha pt e r , w e di s cus s ed t h e r e a s ons f o r us i ng i nt e r f a c e s i n gene r al ,
as we l l as t h e t y p e s o f i nt e r f a c e s p r o v i d e d f r o m SAP. You l e a r n e d t hat
Cus t omi z i ng a n d p r o g r a mmi n g w i t h IDocs is v e i y i mp o r t a n t .
I n t h e n e x t c ha pt e r , w e ll t a ke a d e e p e r l ook a t IDocs, by s t a r t i n g a t t he
v e i y b e g i n n i n g - t h e d i f f e r e n t pos s i bi l i t i es t o c r e a t e IDocs f or s e n d i n g
t h e m t o o u r LSs o r pa r t ne r s .
27
I n t h e sending system, i t ' s necessary to gen e ra te IDocs so t h a t
t hey can be s e n t to t h e receiving system. How t h i s is done depends
on t h e type o f d a t a a n d t h e application. This chapter describes
t h e d i f f e r e n t generation options a n d t h e i r use.
2 Generating IDocs
SAP has p r o v i d e d t ool s f o r t h e g e n e r a t i o n o f I Docs i n all l oc a t i ons w h e r e
t h e y ar e u s e d i n ALE s c e na r i os o r cl assi c EDI, a n d t h e y c a n us ual l y be
a c t i va t e d u s i n g t h e Cus t omi z i ng s e t t i n g s . Howe ve r , t h e r e a r e d i f f e r e n t
me t h o d s o f IDoc g e n e r a t i o n d e p e n d i n g on t he t y p e o f da t a a n d t h e l oca
t i on w h e r e t h e IDoc wi l l be g e n e r a t e d . Thi s c h a p t e r p r e s e n t s t h e mo s t
c o m m o n me t h o d s o f IDoc g e n e r a t i o n . Usual l y t h e IDoc a d mi n i s t r a t o r
n o t t h e d e v e l o p e r i mp l e me n t s t h e set t i ngs r e q u i r e d f o r c r e a t i ng t he
p a r t n e r prof i l es, f o r i ns t ance , so t h e y ar e o u t l i n e d o n l y bri efly, a n d mor e
i mp o r t a n c e is a t t a c h e d t o t h e f unc t i ona l pr ocess flow.
2.1 Standard Methods for the IDoc Generation
Initially, y o u m u s t d i s t i ngui s h b e t we e n t he g e n e r a t i o n o f ma s t e r d a t a a n d
t h e g e n e r a t i o n o f t r a n s a c t i o n da t a b e c a u s e t h e r e ar e d i f f e r e n t r e q u i r e
me n t s o n t he g e n e r a t i o n pr ocess o r t he g e n e r a t i o n f r e q u e n c y d e p e n d i n g
o n t h e t y p e o f dat a. A speci al t ool is avai l abl e t o g e n e r a t e ma s t e r dat a,
cal l ed t h e Shared M a s t e r Data Tool (SMD). Tr a ns a c t i on d a t a I Docs are
g e n e r a t e d vi a t h e al r e ady- e xi s t i ng me s s a ge c o n t r o l . The r e a r e al so s o me
speci al f unc t i ons f or I Docs t h a t ar c di r ec t l y g e n e r a t e d i n a pr ocess.
2.1.1 Shared Master Data Tool
The SMD is a speci al t ool f or s e n d i n g ma s t e r d a t a vi a IDoc. M a s t e r da t a
is cha r ac t e r i zed by a r el at i vel y l o n g r e t e n t i o n p e r i o d i n t h e s ys t e m d u r i n g
M a s t e r d a t a
i n t h e I D o c
29
2 | Generating IDocs
A u t o m a t i o n and
c o n t r o l v i a v i e w s
Change p o i n t e r
W r i t i n g t h e h i s t o r y
i n t h e a p p l i c a t i o n
wh i c h t h e da t a is c h a n g e d rarely. Ma s t e r d a t a usual l y cons i s t s o f mul t i pl e
vi e ws t h a t a r e n o t u s e d all t h e t i me . You c a n o m i t vi ews , i n c l udi ng t hose
t h a t c o n t a i n ma n d a t o r y fi el ds, b e c a u s e t h e che c k o f w h e t h e r all ma nda -
t o i y fields ar e p o p u l a t e d is o n l y ca r r i ed o u t i f t h e v i e w is act ual l y us ed.
Thi s e n a b l e s y o u t o s e l e c t f r o m t h e w e a l t h o f i n f o r ma t i o n t h a t is of f er ed
f or a speci f i c o b j e c t a n d us e e xa ct l y t h e d a t a t h a t is a c t ua l l y r e q u i r e d
w i t h i n y o u r e n t e r pr i s e .
To d i s t r i b u t e d a t a u s i n g I Docs, a n a u t o m a t e d pr oc e s s is de s i r a bl e t h a t
r e s p o n d s t o t h e c r e at i on a n d mo di f i c a t i on o f ma s t e r d a t a w i t h o u t r e q u i r
i ng f u r t h e r u s e r i n t e r v e n t i o n s . Al so, e m p t y vi e ws ar e n o t s u p p o s e d to
be t r ans f er r e d.
The SMD t akes t h e s e r e q u i r e me n t s i n t o a c c o u n t . T h e t ec hni c a l i m p l e
me n t a t i o n o f a u t o m a t i o n a n d c o n t r o l vi a vi e ws ent ai l s t h a t al ready-exi st -
i ng p r o c e d u r e s c a n b e u s e d f o r b o t h f u n c t i o n s . Fo r a u t o m a t i o n , y o u
r e ve r t t o r e c o r d i n g changes, wh i c h is i mp l e me n t e d by def aul t ; f o r c o n
t r o l vi a vi ews , y o u us e t h e o p t i o n ( wh i c h o r i g i n a t e d f r o m b a t c h i nput
pr oc es s i ng) t o c o n t r o l i r r e l e v a n t fields u s i n g a N0_DATA char act er . Then,
t he IDocs ar e r egul ar l y g e n e r a t e d vi a b a c k g r o u n d j o b s .
Addi t i onal l y, f or a l mo s t all obj ect s, y o u al so have t h e o p t i o n t o expl i ci t l y
g e n e r a t e IDocs o r t o r e q u e s t IDocs. You can us e t h i s o p t i o n i f wa i t i n g f or
pe r i odi c al l y s c h e d u l e d j o b s is i mpos si bl e.
Recording Changes
For c o n s i s t e n c y r e as ons , c h a n g e s t o t h e m a s t e r d a t a ar e u p d a t e d i n d e
p e n d e n t l y o f t h e us e o f ALE i n SAP s ys t ems . For each i ndi vi dua l d a t a
e l e m e n t o f t h e t abl es c o n c e r n e d , SAP ha s s t i p u l a t e d w h e t h e r a cha nge
s h o u l d be l ogged o r not . Fi gur e 2. 1 s h o ws t h e C h a n g e D o c u m e n t F l a g ,
wh i c h is ac t i vat ed i n t hi s case as an e x a mp l e o f BISMT ( Old Material Num
ber) f r om t h e MARA t a b l e .
For u p d a t i n g t h e changes, y o u al ways call t h e CHANGEDOCUMENT.OPEN f u n c
t i on m o d u l e , wh i c h p r e p a r e s t h e wr i t i n g o f t h e c h a n g e hi st or y. Then,
all c h a n g e s t o b e w r i t t e n a r e col l ec t e d, a n d t h e p r o c e s s is c o n c l u d e d
u s i n g t h e CHANGEDOCUMENT.CLOSE f u n c t i o n mo d u l e . Because IDocs are
30
Standard Methods for the I Doc Generation | 2 . 1
s u p p o s e d t o be g e n e r a t e d w h e r e v e r c h a n g e s ar e u p d a t e d b y de f aul t , t he
CHANGEDOCUMENT_CLOSE f u n c t i o n m o d u l e ha s a n ALE s h a r e i n a d d i t i o n
t o i t s s t a n d a r d f u n c t i o n . Thi s e n a b l e s y o u t o g e n e r a t e change pointers
f or ALE f o r t h e d e s i r e d me s s a ge t ypes . In all Un i c o d e - e n a b l e d r el eases,
t hi s is d o n e u s i n g t h e CHANGE_POINTERS_CREATE_LONG f u n c t i o n modul e;
i n ol d r el eases, t hi s is d o n e u s i n g t h e CHANGE_POINTERS_CREATE f unc t i on
modul e .
Dictionary: Display Data Element
ssiMMMiMMfisisMSMTsiasHi
Data element BISHT Active
Short Description Old material number
Attributes Data Type PAifi i.abei________
Search Help
Name
Parameters
Parameter ID
Default Component Name OLD_HM_HO
Figure 2.1 C h a ra ct e r i st i c s o f D a t a Elements
You al so have t h e CHANGE_POINTERS_CREATE_DIRECT f u n c t i o n mo d u l e as
a s e c o n d o p t i o n t o g e n e r a t e c h a n g e p o i n t e r s . Thi s f u n c t i o n mo d u l e is
cal l ed by a p p l i c a t i o n s t h a t a r e n o t c o n n e c t e d t o t h e p r e v i o u s l y des c r i bed
c h a n g e m a n a g e m e n t f o r d o c u me n t s .
In b o t h cases, c h a n g e p o i n t e r s ar e o n l y wr i t t e n i f y o u us e t h e SMD f or
p e r f o r ma n c e r e as ons . I n t he ALE Cus t omi zi ng, y o u can s pec i f y w h e t h e r
t hi s is t h e case a n d f or wh i c h ma s t e r d a t a y o u r e q u i r e c h a n g e poi nt e r s .
The r e is a s e p a r a t e Tr a ns act i on c o d e SALE f o r t h e ALE Cus t omi z i ng t hat
t akes y o u di r e c t l y t o t h e cor r ec t p o s i t i o n i n t h e me n u t r ee . Fi gur e 2. 2
s h o ws t h e me n u p a t h i n Cus t omi z i ng i n wh i c h y o u ma k e t h e ne c e s s a r y
set t i ngs.
G e n e r a t i n g change
p o i n t e r s d i r e c t l y
31
2 | Generating I Docs
A c t i v a t i n g change
p o i n t e r s
A c t i v a t i n g change
p o i n t e r s f o r o b j e c t
Structure ___________________________________________________________________________
^.Interface
P Basic Settings
P Communication
^ Modelling a n d Implement ing Bu s in e s s Proc esses
P G lobal Organizational Units
Maintain Distnbution Model a n d Distribute Views
t> Configure Predefined ALE B u s i n e s s Proc esses
________ ^ M ast er D a t a Distnbution
^ Re pli cat ion o f Modified Data
B ( > Activate C h a n g e Po in t e r s - Generally
_____________________________Activate C h a n g e Po in t e r s for M e s s a g e Types______________
F i g u r e 2.2 A c t i v a t i n g Change Po i n te r s f o r t h e SMD
Ini t i al l y, y o u a c t i va t e t h e g e n e r a t i o n o f c h a n g e p o i n t e r s gener al l y. As
a r esul t , t h e s ha r e o f t h e CHANGEDOCUNENT_CLOSE f u n c t i o n mo d u l e t h a t
has n o t b e e n us e d u p t o n o w a n d t h a t is r e s pons i bl e f or t h e SMD is r un
t h r o u g h . Thi s mu s t be s e t o n c e o n l y f o r all ma s t e r da t a . Fi gur e 2. 3 s hows
t he a p p r o p r i a t e funct i onal i t y.
Activate Change Pointers Generally
Activation s i a t u s /
p ] Change pointers activated - general^
F i g u r e 2.3 A c t i v a t e Change Pointers Generally
I f t h e c ha nge p o i n t e r s ar e act i vat ed general l y, y o u ca n speci f y i n a s ec ond
s t e p f o r wh i c h mes s age t y p e y o u r e qui r e t h e g e n e r a t i o n o f cha nge p o i n t
ers. Thi s is d o n e i n t h e s e c o n d me n u s u b i t e m (Act ivat e Change Poi nt ers
f or Mes s a ge Types) a n d has b e e n i mp l e me n t e d f o r t h e me s s age t ypes,
MATMAS a n d MATMAS_WMS (see Fi gur e 2. 4) . No c h a n g e p o i n t e r s a r e wr i t t e n
f or MATCOR a nd m a t m a s . G D S , wh i c h h a v e n o t b e e n act i vat ed.
In t h i s c o n t e x t , i t s i m p o r t a n t t h a t a c h a n g e p o i n t e r i s n ' t wr i t t e n f or
each c h a n g e d field because t h e r e ar e fi el ds w h o s e val ues ar e n o t si gni fi
ca nt f o r t h e d o w n s t r e a m s ys t e m. By me a ns o f Tr ansact i on BD52, SAP
pr ovi de s fields f or each mes s age t ype c o n n e c t e d t o t h e SMD, wh i c h are
r e l e v a n t f or c ha nge s f r om SAP' s p o i n t o f vi ew. For t h e mat er i a l mast er,
t h e DMAKT-SPRAS field is i mp o r t a n t , f o r e xa mpl e . In t h e t r ansact i on,
y o u e n t e r t h e fi el ds t h a t ar e u s e d wi t h i n y o u r e n t e r p r i s e . I f y o u ' v e ma de
32
Standard Methods for the IDoc Generation | 2 . 1
c ha nges t o t h e c o r r e s p o n d i n g ma s t e r d a t a t abl es vi a t h e SAP e n h a n c e
m e n t c o n c e p t a n d us e cus t omer - s peci f i c fi el ds, y o u can a l s o s e t t h e c us
t omer - s pe ci f i c fi el ds h e r e . Refer t o Ch a p t e r 4, Cha nge s t o IDocs, t o l ear n
h o w t o p r o v i d e t h e s e fields.
Change View "Activate Change poi nters f o r Message Type":
^ N e w E r f r . e s | S |
Activate Change pointers for Message Type
MessgType active | d
MATMAS
0
MATMAS_6DS 0
MATHASJMS
0
MATQM
1
F i g u r e 2 . 4 A c t i v a t e Change Po nt ers f o r Message Type
Change View "Change document items f o r message type" : Overview
^ New Entries Q . Q
Messaae Type MATMAS
Chanae document items for messaae froe
T
Object [fable Name fFieiC Name
MATERIAL D6ESV KEY
MATERIAL D6ESV KOVBM
MATERIAL D6ESV VBWRT
MATERIAL DMAKT KEY
MATERIAL DMAKT flAKTX
___
MATERIAL
m T F P l 1 1
|DMAKT___________________________
r M t P N
[SPRAS |
R R P I T A I C l M AL
MATERIAL
U n A n n
DMARM
o n e 1 1
BR6EW
MATERIAL pHARH EAN11
MATERIAL DMARM GE WEI
1ATERIAL DMARM GTIN_VARIAMT
MATERIAL DMARM HOEHE
MATERIAL DMARM KEY
F i g u r e 2.5 Change-Rel ev ant Fiel ds i n Transaction BD52
Fi gur e 2. 5 s h o ws a s e c t i on o f t h e fiel ds f o r t h e MATMAS mes s age t ype,
w h i c h a r e p r o v i d e d b y SAP as c h a n g e - r e l e v a n t . Th e me s s a g e t y p e is
di r ect l y r e f e r e nc e d t o fields a n d t abl es o f t h e mat er i a l ma s t e r e x c e p t f or
t h e KEY fi el d. Thi s field i s n t p a r t o f t h e r espect i ve t abl e b u t a s s u me s a
v e i y i mp o r t a n t , a dd i t i o n a l c ont r ol rol e: It e n s u r e s t h a t t h e c r e a t i o n o f a
C h a n g e - r e l e v a n t
f i e l d s
33
2 | Generating IDocs
A s s i g n i n g c h a n g e
r e l e v a n t f i e l d s
E v a l u a t i n g change
p o i n t e r s
t abl e e n t r y can b e s e n t vi a IDoc. I f t h e KEY field is s peci f i ed in Transac
t i on BD52, a c h a n g e p o i n t e r is w r i t t e n d u r i n g t h e c r e a t i on o f t h e c o r r e
s p o n d i n g obj ect , f or e xa mpl e , d u r i n g t h e i ni t i al c r e a t i o n o f t h e mat er i al
f or t h e MARA-KEY d u m m y field o r d u r i n g t h e c r e a t i o n o f a t ext i n a n e w
l a n g u a g e f or t h e MAKT-KEY d u m m y field. I ma g i n e t h a t t h e k e y val ue
o f t h e t abl e c o n c e r n e d is c h a n g e d f r om " e mpt y" t o t h e n e w va l ue . As a
resul t , all fi el ds o f t h i s t a bl e ar e t r ans f er r e d.
Addi t i onal l y, f or each o f t h e c h a n g e - r e l e v a n t fi el ds, y o u mu s t speci f y to
wh i c h fi el d i n wh i c h s e g me n t o f t h e I Doc t y p e it bel ongs . Thi s is d o n e
i n Tr a ns act i on BD66, wh i c h is s h o w n i n Fi gur e 2. 6. The DMAKT-SPRAS
s a mp l e fi el d f r o m Tr a ns act i on BD52 b e l o n g s t o t h e E1MAKTM I Doc s e g
m e n t a n d t o t h e field t h a t is al so cal l ed "SPRAS." Fo r y o u r o w n fields,
y o u mu s t speci f y t h i s us i ng t h e N e w Ent r i es b u t t o n .
Change View "Segment Field - Change Document Field : Overview
*
N e wEntnes
Message Type MATMAS
Segment Field - Change Document Field
Segment type Field Na me Object Table Name : ieid Na me j
1MAKTM MATERIAL DNAKT k e y m
1MAKTM MAKTX MATERIAL DMAKT MAKTX W
1MAKTM SPRAS MATERIAL DMAKT SPRAS I ]
1MARAM MATERIAL MARA KEY
1MARAM AENAM MATERIAL MARA AENAM
1MARAM AESZN MATERIAL MARA AESZN
1MARAM 8E6RU MATERIAL MARA 8E6RU
1MARAM BEHVO MATERIAL MARA 8EHV0
1MARAM 8ISMT MATERIAL MARA 8ISMT
1MARAM 8LANZ MATERIAL MARA 8LANZ
tMARAM 8LATT MATERIAL MARA 8LATT
1MARAM 8MATN MATERIAL MARA 8MATN
F i g u r e 2 . 6 A s s i g n m e n t o f I D o c Fiel ds t o Ch a n g e- R e l e v a n t Fields
The c h a n g e p o i n t e r s ar e t h e n e v a l u a t e d . It j u s t d e p e n d s o n t h e o b j e c t
c o n c e r n e d wh i c h f u n c t i o n m o d u l e is u s e d her e. Wh e n y o u call Transac
t i o n BD60, y o u can v i e w t h e s e f u n c t i o n mo d u l e s a n d r e pl a c e t h e m wi t h
y o u r o w n f u n c t i o n mo d u l e s i f y o u w a n t t o ma k e s o ma n y c h a n g e s t o t he
34
Standard Methods for the IDoc Generation | 2 . 1
s t a nda r d f unc t i ona l i t y t h a t y o u d o n t w a n t t o e n h a n c e o r mo d i f y t h e SAP
or i gi nal . Fi gure 2 . 7 s h o ws a n o t h e r e x a mp l e o f t h e ma t e r i a l ma s t e r dat a.
Ther e, t h e f unc t i on mo d u l e t h a t uses c h a n g e p o i n t e r s t o g e n e r a t e IDocs
is cal l ed MASTER I DOC_CREATE_SMD_MATMAS.
C h a n g e V i e w " A d d i t i o n a l Data f o r M e s s a g e T y p e " : O v e r v i e w
^ Q N e w E n t r . e s
Additional D a t a for M e s s a g e Type
M e s s g T y p e R e f m s g . F u n d Mod T a b l e E j
-
h a t h a s Im a t h a s HASTERIDOC_CREATE_SMD_HATMAS HARA
nATHASJMS |MATHAS NASTERIDOC_CREATE_SMD_MATMAS URA
F i g u r e 2.7 F u n c t i o n M o d u l e s t o Evaluate Change Pointer s
The RBDMI DOC r e p o r t , wh i c h m u s t b e s c h e d u l e d a t r e g u l a r i nt er val s, mu s t
t h e n us e t h e s e f u n c t i o n m o d u l e s t o g e n e r a t e I Docs f r o m t h e c h a n g e
p o i n t e r s a n d u p d a t e wh i c h c h a n g e p o i n t e r s h a v e b e e n p r oc e s s e d. As
a t r a n s f e r val ue, y o u can s pec i f y f o r wh i c h me s s a ge t y p e y o u w a n t to
i m p l e m e n t t h e eva l ua t i on. For t hi s p u r p o s e , y o u s pec i f y t h e a p p r o p r i a t e
t y p e ( her e: m a t m a S ) i n t h e Me s s a g e Type field i n t h e i ni t i al s c r e e n o f t he
RBDMI DOC r e p o r t . Thi s is i l l us t r a t e d i n Fi gur e 2. 8.
C r e a t i n g IDoc T y p e f r o m C h a n g e P o i n t e r s
M e s s a g e type MATMAS| E>
F i g u r e 2 . 8 I n i t i a l Screen o f t h e " R B D M I D O C " Re p o rt
Fo r s e n d i n g I Docs u s i n g t h e SMD a n d f o r c h a n g e p o i n t e r s , t he a ppl i c a
t i on a n d t h e ALE c o mmu n i c a t i o n l a ye r i nt e r a c t closely. Fi gure 2 . 9 s c h e
mat i cal l y s h o ws t h e p r oc e s s f l ow o f IDoc g e n e r a t i o n . Th e e n t i r e process
o f w r i t i n g c h a n g e p o i n t e r s t akes pl ace i n t h e a ppl i ca t i on; t h e e va l ua t i on
o f t h e c h a n g e p o i n t e r a n d t h e g e n e r a t i o n o f I Docs ar e ca r r i ed o u t b y t he
ALE c o mmu n i c a t i o n layer.
" R B D M I D O C
b a c k g r o u n d j o b
Changes i n t h e
SM D
35
2 | Generating IDocs
D i s t r i b u t i o n l o c k
A p p l i c a t i o n
1 . W r i t e n o r m a l h i s t o r y
2 . C h e c k i f c h a n g e p o i n t e r s a r e g e n e r a l l y s u p p o s e d t o b e w r i t t e n
3 . C h e c k i f c h a n g e p o i n t e r s a r e s u p p o s e d t o b e w r i t t e n f o r t h e
o b j e c t i n q u e s t i o n
4 . W r i t e c h a n g e p o i n t e r s
A p p l i c a t i o n
D o c u m e n t Change
P o i n t e r s
C h a n g e
D o c u m e n t
R B D M I D O C
1 . R e a d c h a n g e p o i n t e r s
2 . W r i t e I D o c
3 . M a r k c h a n g e p o i n t e r s as
pr o c e s s e d
F i g u r e 2 . 9 ID o c G e n e r a t i o n Using t h e S M D
Not e t h a t wh e n y o u s e n d IDocs vi a c h a n g e poi nt e r s , y o u o n l y s e n d t hose
vi e ws i n wh i c h c h a n g e s have act ual l y b e e n made. I f a n e w v i e w ha s b e e n
cr eat ed, all i t s fi el ds ar e t r a ns f e r r e d; i f a v i e w ha s b e e n c h a n g e d , o n l y
t h e c h a n g e d fi el ds ar e t r a n s f e r r e d t o i nc r e a s e p e r f o r ma n c e . Ch a p t e r 4,
Changes t o IDocs, us e s t h e e x a mp l e o f t h e ma t e r i a l ma s t e r t o des cr i be
h o w y o u c a n c h a n g e t hi s d e f a u l t b e h a v i o r u s i n g a m i n o r modi f i cat i on.
You c a n f i nd t h e c h a n g e p o i n t e r s i n t h e BDCP t abl e a n d t h e c o r r e s p o n d
i ng s t a t us r e c or ds i n t h e BDCPS t abl e. As o f SAP Ne t We a v e r Appl i cat i on
Ser ver 6 . 2 0 (SAP Ne t We a v e r AS), pr oc e s s i ng w i t h h i g h e r p e r f o r ma n c e
is pos s i bl e vi a a s h a r e d t a bl e cal l ed BDCP2. Howe ver , t hi s n e w p r o c e d u r e
i s n ' t s u p p o r t e d f or all me s s a ge t ypes . Wh e t h e r i t ' s a p p l i c a b l e f o r y o u r
me s s a ge t y p e is i ndi c a t e d i n t h e det ai l v i e w o f Tr a ns act i on BD60. As o f
Rel ease 7. 1, o n l y t h e n e w pr oc e s s i ng u s i n g Tabl e 8DCP2 is avai l abl e f or
all me s s a ge t ypes.
For t h e d i s t r i b u t i o n vi a t h e SMD, y o u m u s t c o n s i d e r s o m e speci fi cs f or
s o me ma s t e r d a t a . You c a n s e t a d i s t r i b u t i o n l ock f o r t h e ma t e r i a l mas
t e r t o g e ne r a l l y p r e v e n t t h e s e n d i n g o f a mat er i a l . Fo r t h i s p u r p o s e , y o u
36
Standard Methods for the IDoc Generation | 2 . 1
mu s t ma k e a s h o r t d e t o u r . In t h e d e s i g n d a t a o f t he mat er i al i n t h e m a r a
t abl e, t h e r e is a c r os s - pl a nt ma t e r i a l s t a t u s (MARA-MSTAE fi el d). Thi s
s t a t u s r ef er s t o an exi s t i ng e n t r y i n t h e T 1 4 l t abl e. H e r e , y o u can assi gn
addi t i ona l p r o p e r t i e s f o r e a c h s t a t us va l ue . I f t h e DLOCK field p r o v i d e d
he r e is s el ect ed, t h e d i s t r i b u t i o n l ock is set.
Fo r cont r a c t s (BLAORD me s s a ge t ype) , o n l y r el eas ed cont r a c t s ar e t r a n s
f e r r e d u s i n g t h e SMD.
Reducing Messages
The s e c o n d r e q u i r e m e n t o n t h e d i s t r i b u t i o n o f ma s t e r d a t a ar i ses fr om
t h e d i s t r i b u t i o n o f all ma s t e r d a t a t o i ndi vi dua l vi e ws a n d t h e o p t i o n to
def i ne, i n Cus t omi zi ng, wh i c h fi el ds o f a v i e w ar e a c t ua l l y s u p p o s e d to
be us ed. Thi s is scal abl e f o r t h e IDoc t r a n s f e r by us i ng t h e r e d u c e d me s
sage t ypes.
A r e d u c e d me s s a ge t y p e al ways r el at es t o a n e x i s t i n g me s s a ge t y p e b u t
t r a n s f e r s l ess d a t a . The r e d u c t i o n i s n ' t p o s s i b l e f o r al l me s s a g e t ypes ;
s o t h e d e v e l o p e r o f t h e me s s a ge t y p e m u s t expl i ci t l y d e f i n e it as r e d u c
i bl e. All v i e ws a n d fi el ds t h a t m u s t b e t r a n s f e r r e d as a m i n i m u m arc
p r e d e f i n e d he r e ; all o t h e r v i e ws a n d fi el ds c a n be s e l e c t e d a d d i t i o n a l l y i f
r e q u i r e d . Tr ansact i on BD60 i n t h e de t a i l v i e w f o r a mes s age t y p e is t he
t r a ns a c t i on f or de f i ni ng a me s s a ge t y p e as r e duci bl e. By cal l i ng Tr ansac
t i on B D 6 5 , y o u d e f i n e t h e m a n d a t o i y fields.
Fo r e a c h d e l i v e r e d me s s a ge t y p e , SAP speci f i cs w h e t h e r i t s r educi bl e.
Because t hi s i nvol ves f unc t i ons i n t h e g e n e r a t i o n a n d u p d a t e mo d u l e for
t h e c o r r e s p o n d i n g IDoc, c u s t o m e r s c a n ' t s i mp l y s e t t h e me s s a ge t y p e
t o r e duc i bl e r et r oact i vel y. The ma n d a t o r y fi el ds t h a t SAP pr o v i d e s wi t h
Tr a ns act i on BD65 c o r r e s p o n d t o t h e Cus t omi z i ng t h a t SAP p r o v i d e s f or
t r a n s a c t i o n s t h a t ar e u s e d t o ma i n t a i n ma s t e r dat a, f o r i ns t ance , Tr ans
ac t i on MAT1 f o r ma i n t a i n i n g t h e mat er i al mas t er . I f y o u ma k e changes
t o t h e ma n d a t o r y fi el ds i n t h e a p p l i c a t i o n ' s Cus t omi zi ng, y o u al so ada pt
t h e m i n Tr a ns act i on BD65 so t h a t c u s t o m- d e v e l o p e d m a n d a t o i y fields
ar e al so ma n d a t o r y f or r e d u c i n g i n t h e IDoc. Fi gur e 2 . 1 0 s h o ws a s ec t i on
o f t h e da t a f o r t h e MATMAS me s s a ge t ype.
Reduced message
t y p e
37
G e n e r a t i n g IDocs
C h a n g e V i e w " A d d i t i o n a l D a t a f o r M e s s a g e T y p e " : D e t a i l s
B D 6 0 - D e t a i l
S A P d e f i n e s m e s s a g e t y p e
as r e d u c i b l e
B D 6 5
D e f i n e m a n d a t o r y f i e l d s
( b o t h S A P a n d y o u )
\ N*wEntn*$ ] 12 i>
T y p e "ATIUS
AaomonM O a t a t a M e s s a g e l i o e
Additional o,u
R e f e r e n c e M e s s a g e Type
f o r m * Function Modulo
a y
Change V i e w " M a n d a t o r y F i e l d s o f M es s a g e T y p e " : O v e rv i e w
N e w E n t r i e s Q E i B D
Mno io rv f n i a t o ' w s g t d *
IHAKTH r um E
1HMIH HS6FX I*
i h a . th SPftAS
i h a r m i 6 0 E S
1 1 1 * 6 * " VOS"
i h a ( U T K l
IHMM l U l l t f t
1HMU1 H8RSH
1HAH f i n s
i h a * k
i h a h h HTAR1
INARM P S I A t
i h a s h SPAR I
F i g u r e 2.10 B a s i c M a i n t e n a n c e f o r R e d u c i b l e M e s s a g e T y p e s
R e d u c t i o n i n You t h e n c r e a t e y o u r o w n r e d u c e d me s s a ge t y p e s i n Cu s t o mi z i n g o f
C u s t o m i z i n g Tr a ns act i on SALE. U n d e r t h e Cr eat e Re duc e d Me s s a g e Type m e n u i t em
o r vi a Tr a ns act i on BD53 y o u can fi nd t h e i ni t i al s c r e e n as s h o w n i n Fig
u r e 2. 11.
Structure
^ Df 5.f P ! 1.':? P.^P.!?.9.
I BasicSettnos
I Communication
^ Modelling and implementing Business Processes
P Q < Global Organizational Units
<J> Maintain Distribution Model and Distribute Views
I' Q t Configure Predefined A i E Business Processes
Q . Master Data Distribution
l> Replication of Modified Data
^ Senalizaton for Sending and Receiving Data
v ^ Scope of Data for Distnbution
v [ Message Reduction
Q < Create Reduced Message Type
Q Generate Transport Request for Message Type
Figure 2.11 Create Reduced Message Type
Standard Methods for the IDoc Generation | 2 . 1
Wh e n y o u speci f y t he n a me o f t h e n e w r e d u c e d me s s a ge t y p e (see Fi gure R e d u c t i o n steps
2 . 12) , y o u mu s t c o n s i d e r t h e n a mi n g r ul e s f or y o u r o w n o b j e c t s ( t he
n a me mu s t s t a r t w i t h Y o r Z o r y o u r o wn names pa ce) .
I D o c R e d u c t i o n M a i n t e n a n c e : I n i t i a l S c r e e n
[0 ] \0 \ 1 [ a ] 11A C K W Chan g e pan t m ] C * t t l V i ( M j l POrtt'S
R e d u c e d m e s s a g e ?S1
& S w e c t n o ' M e s t a ? e T . s e a s ntfifencetc*** Redu c o o n B .
Red u c e d m o s s a go t*te
Wo ieWnn
ZSM I
IUTIU$
S t e p 1:
4 A s s i g n name
and d e s c r i p t i o n
I D o c R e d u c t i o n M a i n t e n a n c e : I n i t i a l S c r e e n
0 ? > - 0 * i ~ j t e c h a n g e p o . - * * - * o e a < t r - a * e o m i e ' S
Poduce<lmestjetipe Z$ P 1
( nler Dest X f i o n (' Reilne- 1 n e ^ < *;* Vp e
B o d u c e a m e s s a g e tipe Z S M I
Dosircdon Sae<nes B o d u i e o Matonal
M e s s a g e Sine reference M T U * S
DoscrOon Material mastei
*
"TP i S D l Cu t to
u J 1" K >8

1 1
I P A U P
1 HAKCB
1 Ml
E E
1 nur.nn
1 HBCM"
imam
1 P V K "
1 Ml 11.1
1 PT 1 HJ1
Fie l d Distribution
() Pas t e r u t e r 11 1 g e n e n l dat a (PARA)
() Additional f i e l d * t or { i p a k a k
() Discrete Industries Fields
I*) Past e r i t e r u l sho r t tei t s ( P M I )
() Raster eaten al C segeent (PABC)
() Past e r eaterial uni t s of M a t u r e (IMS*)
() It ast e r e a t e n a l eateriil valua t i o n (PBC)
(.) Paster eatenal eatenal data p e r earehouse nueeer (Pi6 ti
() Patt e r e a t e n a l sal e s dat a (PVIC)
( -) Paster eaten el t . cla ssif icat ion (PiA*)
() Past e r e a t e n a l lo n g teit
l a - S e ^ n e M i F.eiflt
Step 2 :
Selec t r e l e v a n t
s e g me n t s
Field Text
PSfiFK () Function
HATXfi () "atertal Kuabcr
() Haa e of Por s o n e ho Croa t e d th e Ob)ect
<-) Dat e of la s t Change
P S I A 1
IVOR" () Fla g Paterial fo r Dele t i o n at C H n t level
TRI () "aterial Type
PBBSH (*) Industry sector
eisnr (-) O ld alterll nuaber
PE I US () Bas e Uni t of "easure
----------------- L L f r r c W e Ord e r U n y t . o p e . s u r o ______________________
St e p 3 :
4 S e l e c t r e l e v a n t f i e l d s
p e r s e g m e n t
F i g u r e 2.12 C r e at in g a Reduced Message Type
Se g me n t s a n d f i el ds t h a t ar e g r e e n i n t h e SAP s y s t e m a n d d i s p l a y e d wi t h
an * b e h i n d t h e n a me ar e ma n d a t o r y a n d c a n t be r e d u c e d . Fiel ds a n d
s e g me n t s t h a t a r c r e d o r ma r k e d wi t h - ar c o p t i o n a l a n d n o t sel ect ed;
s e g m e n t s o r fi el ds t h a t ar e w h i t e o r ma r k e d w i t h + ar e o p t i o n a l a n d
s e l ec t ed i n t h e r e s pect i ve r e d u c e d me s s a ge t ype. You n o w s pec i f y wh i c h
39
2 | Generating IDocs
Change p o i n t e r s
f o r r ed u c e d
message t y p e s
Sending
m a s t e r d a t a
s e g me n t s y o u w a n t t o h a v e i n a d d i t i o n t o t h e m a n d a t o r y s e g me n t s by
s e l e c t i ng t h e s e g m e n t a n d cl i cki ng Sel ect . As s o o n as y o u ' v e a c t i va t e d a
s e g me n t , y o u c a n sel ect t h e fields wi t h i n t h e s e g me n t y o u w a n t t o have
i n a d d i t i o n t o t h e m a n d a t o i y fi el ds, a n d t h e n cl i ck Sel ect agai n.
I f y o u w a n t t o g e n e r a t e c h a n g e p o i n t e r s f or c u s t o m r e d u c e d mes s age
t ypes , y o u c a n ac t i va t e t h e g e n e r a t i o n i n Tr a ns a c t i on BD53 u s i n g t he
Act i vat e Ch a n g e Poi nt e r s b u t t o n . O f c our s e , y o u c a n al so ac t i va t e t he
cha nge p o i n t e r s f or t h e r e d u c e d me s s a ge t y p e i n Cus t omi zi ng o f Transac
t i o n SALE. Her e, y o u mu s t ma k e s ur e t h a t y o u n o t o n l y set t h e fl ags f or
g e n e r a t i n g c h a n g e p o i n t e r s b u t al so c o p y all s t a n d a r d fi el d a s s i g n me n t s
a n d m a n d a t o i y field a s s i g n me n t s , wh i c h is a u t oma t i c a l l y d o n e i n Tr ans
ac t i on BD53. In Tr ansact i on BD53, y o u c a n a l s o di s abl e t h e wr i t i n g o f
c h a n g e p o i n t e r s us i ng t h e Deact i vat e Cha nge Poi nt e r s b u t t o n (see Fi gure
2. 13) .
IDoc Reduction Maintenance: Initial Screen
* a l l
Activate ch a n g e pointers Deactivate ch a n g e pointers
R e d u c e d m e s s a g e type [ZSM G )
F i g u r e 2.13 A c t i v a t e t h e Change P o i n t e r f o r Reduced Message Types
Directly Generating or Requesting Master Data
I f y o u w a n t t o p u b l i s h t h e c r e a t i o n o r c h a n g e o f ma t e r i a l ma s t e r da t a
w i t h o u t wa i t i n g f o r IDocs t h a t a r e g e n e r a t e d f r o m c h a n g e p o i n t e r s , y o u
can us e Tr a ns act i on BD10. I n Tabl e 7 . 5 o f C h a p t e r 7, Sect i on 7. 3, Tr a ns
ac t i on Code Ove r vi e w, y o u can al so f i nd t h e t r a ns a c t i ons t h a t b e l o n g to
o t h e r m a s t e r dat a.
Because ma s t e r d a t a usual l y of f er s t h e o p t i o n o f r e d u c t i o n , t h e s e t r ans a c
t i o n s " e xpec t " y o u t o e n t e r t h e me s s a ge t y p e y o u w a n t t o us e f o r s e ndi ng
a n d t h e logi cal t a r ge t s y s t e m s y o u w a n t t o s e n d t o. Addi t i onal l y, y o u can
s e l e c t t h e obj ect s y o u w a n t t o g e n e r a t e IDocs for. Howe ver , t hi s is o n l y
pos s i bl e vi a t he mat er i al n u m b e r s o r t h e cl ass m e m b e r s h i p o f t h e o b j e c t
(see Fi gur e 2. 14) .
40
Standard Methods for the IDoc Generation | 2 . 1
Send Material
& o
Material
Cl ass
M essag e Type (Standard)
Logical system
Se nd material in full
Pa ra ll el processing
Server group
N u m b e r o f material s p e r proces
F i g u r e 2.14 Targeted Sending o f M a t e r i a l M a s t e r IDocs
I f y o u a c t i va t e d t h e Send Ma t e r i a l i n Full flag a n d al so s e t t h e d i s t r i b u
t i o n o f cl assi f i cat i on I Docs t o t h e s a m e p a r t n e r , t h e s y s t e m g e n e r a t e s
t h e cl assi f i cat i on IDoc t h a t b e l ongs t o t h e ma t e r i a l a d d i t i o n a l l y t o t he
ma t e r i a l IDoc itself. The spec i f i c at i ons f o r t h e par al l el pr oc e s s i ng hel p
y o u i nc r e a s e t h e p e r f o r ma n c e i f y o u s e n d a h i g h q u a n t i t y o f dat a, f or
i ns t ance , f o r ini ti al d a t a l oad. I f y o u l eave t h e Logical Syst em field e mpt y,
t h e d a t a is s e n t t o all p a r t n e r s t h a t ar e avai l abl e i n Tr a ns act i on BD64. I f a
sel e c t i on is ma d e , Tr a ns act i on BD64 c he c ks w h e t h e r t h e s e l ec t ed logical
s y s t e m is p e r mi t t e d as a r e c e i ve r o f t h e mat er i al ma s t e r IDocs. I f t h e r e is
a pos i t i ve r esul t , t h e s y s t e m s e n d s t h e IDoc.
I f y o u ar e t h e r e c e i ve r o f ma s t e r d a t a IDocs a n d k n o w t h a t t h e s e n d i n g
s ys t e m ha s c h a n g e d o r has n e wl y cr e a t e d dat a, y o u c a n r e q u e s t a c o r r e
s p o n d i n g ma s t e r da t a IDoc. The n a me o f t h e a p p r o p r i a t e me s s a ge t y p e
st ar t s l i ke t h e ma s t e r d a t a I Doc b u t uses a n o t h e r a b b r e v i a t i o n a t t h e end,
t h a t is, FET ( f or "fet ch") i ns t ead o f MAS. For e x a mp l e , t h e n a me is MATMAS
f or t h e me s s a ge t y p e o f t h e ma t e r i a l ma s t e r I Docs a n d m a t FET f or t he
fet ch IDoc.
The s e f e t c h IDocs m u s t be ma i n t a i n e d as usual i n t h e d i s t r i b u t i o n model
( see Fi gur e 1 . 4 i n Ch a p t e r 1, Sect i on 1. 3, Di f f e r e n t i a t i o n o f ALE a n d
EDI) j u s t i n t h e o t h e r d i r e c t i o n ; h e r e , t h e p a r t n e r t h a t r ecei ves t he
ma s t e r d a t a I Doc s e n d s t h e f et ch IDoc. Fet ch IDocs al ways t r a n s f e r t he
S e n d i n g t h e
m a t e r i a l
Fetch I D o c
41
2 | Generating IDocs
ALEREQOr
obj ect k e y f or wh i c h ma s t e r da t a I Docs a r e r e q u e s t e d a n d t h e mes s age
t y p e t h a t is s u p p o s e d t o b e u s e d t o s e n d t h e dat a. You c a n us e Transac
t i on BD11 t o "get " ma t e r i a l ma s t e r s (see Fi gure 2. 15) .
Get Material
Material
--------------------------
= i
C l a s s to
M e s s a g e type 2SM11
0
F i g u r e 2.15 Req u e sti ng t h e M a t e r i a l M a s t e r I Doc
I Doc The s a me ALEREQ01 IDoc t y p e is a s s i g n e d t o all f e t c h me s s a ge t ypes . It
tyPe c o n t a i n s t he s e g me n t s s h o w n i n Fi gur e 2. 16.
I T "
L - O E1AIER1
6enera1 r equest - Basis lOoc t y p e
Ba sic t y p e Released O Released f r o a Release 30* Di s p l a y f o r Release 46C
V e rs i o n 3 o f IDoc r e c o r d t y p e s IDoc r e c o r d t y p e s f o r SAP Release 4 0
A l t r equest IDoc header segaent
Segaent d e f i n i t i o n E2AIER100I Released f r o a Release 40A
a n d a t o r y a l n / a a x . O0OOOOO0O1/OOOOOOM99
3 Seoaent f i e l d s
--------- nST>P
'--------- HESIYP4Q
o o L o g i c a l aessage t y p e
I n t e r n a l l e n g t h 000006 Ex t e r n a l l e n g t h 000006 O f f s e t 000063
Data t y p e CHAR Data e l e a e n t E01J1ES1P3
o o nessage type
I n t e r n a l l e n g t h 000030 Ex t e r n a l l e n g t h 000030 O f f s e t 000069
Data t y p e CHAR Data e l e a e n t E0IJ1ES1YP
E1ALE01 AIE Request IDoc I t e a Segaent
Segaent d e f i n i t i o n E2AIEG1 Released f r
a andatory a m . / t a x . 0000000001.
tse 30A
Segaent f i e l d s
---------0BJVALUE
-SI6M
---------OPTION
-HISH
o o Object v a l u e ( e i t h o l d l e n g t h o f 40)
I n t e r n a l l e n g t h 000040 E x t e r n a l l e n g t h 000040 O f f s e t 000063
Data t y p e CHAR Data e l e a e n t F08JV01D
o 0 ABAP: ID: l / E ( i n c l u d e / e x c l u d e v al ue* )
I n t e r n a l l e n g t h 000001 E x t e r n a l l e n g t h 000001 O f f s e t 000103
Data t y p e CHAR Data e l e a e n t TVARV_SISN
o o ABAP: S e l e c t i o n o p t i o n (E0/BT/CP/.. . )
I n t e r n a l l e n g t h 000002 E x t e r n a l l e n g t h 000002 O f f s e t 000104
Data t y p e CHAR Data e l e a e n t TVARV.OPTI
o o Character f i e l d o f l e n g t h 40
I n t e r n a l l e n g t h 000040 E x t e r n a l l e n g t h 000040 O f f s e t 000106
Data t y p e CHAR Data e l e a e n t CHAR40
o o Character f i e l d o f l e n g t h 40
I n t e r n a l l e n g t h 000040 E x t e r n a l l e n g t h 000040 O f f s e t 000146
Data t y p e CHAR Data e l e a o n t CHAR40
F i g u r e 2.16 'A L E R E Q 0 1 " I D o c Type
42
Standard Methods for the IDoc Generation | 2 . 1
Th e a c t ua l l y s e n t f et ch me s s a g e c o n t a i n s i n f o r ma t i o n on t h e mes s age
t y p e t h a t is e x p e c t e d as t h e r e s p o n s e , t h e s h o r t a n d t h e l o n g n a me
( be f or e o r a f t e r Rel ease 4. 0), a n d t he keys o f e l e m e n t s t h a t ar e s u p p o s e d
t o b e s e n t as a r e s p o n s e . Fi gur e 2 . 1 7 s h o ws a MATFET IDoc t h a t r e q u e s t
t h e ZSM1 mat er i a l . For t h e MATMAS IDoc, b o t h t h e l o n g a n d t h e s h o r t n a me
is "MATMAS" b e c a u s e t hi s is a v e r y ol d me s s a ge t ype.
4E STYP L o g i c a l m e s s a g e type MATMAS
M E S T Y P 4 0 M e s s a g e Typ e MATMAS
S E G N U M S e g m e n t N u m b e r 0 0 0 0 0 2
S E G N A M S e g m e n t N a m e E 1 A L E 0 1
OBJV ALU E O b j e c t v a l u e (wi th ol d l e n g t h M AT N R
S I G N AB AP I D: l/E ( in c l u d e / e x c l u d e 1
O P T I O N A 8 A P S e l e c t i o n o p t i o n ( E O / B T / EO
L O W C h a r a c t e r f i e l d o f le n g t h 4 0 ZSM1
F i g u r e 2.17 MATFET I Doc
Because ma s t e r d a t a is us ual l y e x c h a n g e d b e t we e n d i f f e r e n t s y s t e ms o f
t h e s a me e n t e r p r i s e , l ogi cal s y s t e ms ar c u s e d as p a r t n e r s l i ke t h e y ar e
us e d i n ALE.
2.1.2 Message Control
The me s s a g e c o n t r o l is a s t a n d a r d f u n c t i o n o f SAP, wh i c h t r i gger s a d a t a
t r a n s f e r f o r all t r a ns a c t i on d a t a t h a t is s u p p o s e d t o be r e cei ved by o t h e r
en t e r p r i s e s , t oo. Thi s c a n b e d o n e u s i n g a p r i n t e r , fax, o r an IDoc. For
pr oc e s s i ng us i n g IDocs, y o u ca n u s e transmission medium 6 f o r pr oces s i ng
us i ng p a r t n e r f u n c t i o n s , a n d y o u c a n us e transmission medium A f o r p r o
cessi ng us i ng l ogi cal s ys t ems . All t h e r e q u i r e d s e t t i n g s f o r t h e mes s age
cont r ol a r e i n Tr a ns act i on NACE.
You u s e t h e condition technique t o s pec i f y w h e n y o u g e n e r a t e wh i c h
mes s age s i n wh i c h way. Th e key f o r t h e c o n d i t i o n s is c o m p o s e d o f t he
a pp l i c a t i o n y o u ' r e i n (e. g. , EF" f o r p ur c ha s i ng) , t h e o u t p u t t y p e y o u
w a n t t o g e n e r a t e (e.g. , "NEU" f o r a p u r c h a s e or de r ) , a n d t h e p a r t n e r r ol e
e v e r y t h i n g wi l l b e s e n t t o (e. g. , p a r t n e r " v e n d o r " i n i t s r ol e as goods
v e n d o r ) .
Ex am ple o f
" M A T F E T I Doc
M e s s a g e c o n t r o l
43
2 | Generating I Docs
EDI_
PROCESSING"
f u n c t i o n
O u t b o u n d p a r t n e r
p r o f i l e
Process code
M es s a g e codes
and message
f u n c t i o n s
I n message determinat i on, t h e act ual me s s a g e is g e n e r a t e d u s i n g t he
RSNASTOO r e p o r t . The E D I _ P R 0 C E S S I NG f unc t i on t h a t is u s e d h e r e t r ansf er s
t he mes s age as a n EDI mes s age us i ng t h e IDoc; it b e l ongs t o t r ans mi s s i on
m e d i u m 6. De p e n d i n g o n t h e s y s t e m s et t i ng, y o u can call t h e RSNASTOO
r e p o r t d i r e c t l y u p o n s a v i n g t h e d o c u m e n t o r a t r e g u l a r i n t e r v a l s as a
bat ch j o b .
In message control, an EDI c o mmu n i c a t i o n is us ual l y a s s u me d so t h a t y o u
w o r k w i t h p a r t n e r s a n d n o t w i t h l ogi cal syst ems.
The i n f o r ma t i o n on h o w a n IDoc is s e n t t o t h e r e c e i ve r (e.g. , vi a RFC o r
file) a n d w h e t h e r a n EDI s u b s y s t e m is s u p p o s e d t o be u s e d i f necessary,
is s e t i n t h e outbound p a r t n e r profile i n Tr a ns act i on WE 2 0 b o t h f o r t he
c o mmu n i c a t i o n w i t h p a r t n e r s a n d f or t h e c o mm u n i c a t i o n w i t h l ogical
syst ems.
Here, y o u a l s o speci f y wh i c h IDoc t y p e is s u p p o s e d t o be us ed. I f y o u
w o r k w i t h t h e me s s a ge cont r ol , i n t h e o u t b o u n d p a r t n e r prof i l e u n d e r
t h e Me s s a g e Cont r ol t ab, y o u s pec i f y wh i c h p r oc e s s c o d e ( a n d whi c h
u n d e r l y i n g f unc t i on mo d u l e ) wi l l be u s e d t o p o p u l a t e t he I Doc dat a. You
c a n f i nd t h e val i d p r oc e s s code s f or t h e r e s pect i ve o u t p u t t y p e i n Tr ansac
t i on WE41 (Fi gure 2. 18) .
^ OulDound process code
QLOflical message
Pr&cOiS (000 HE 10 ORDERS PurcMS* (Xdor
Assignment to logical message
ORDERS
types
Message code
C Alcodes
Message unc*or>
:CMfcinc*>ns
Purchase order/ order
F i g u r e 2.18 A s s i g n m e n t o f t h e Process Code t o t h e Message Type
You c a n al so s pec i f y t h e o p t i o n a l message codes a n d message f u n c t i o n s ,
wh i c h y o u k n o w f r om t h e p a r t n e r prof i l es, t o b e a bl e t o us e d i f f e r e n t
pr ocess code s f o r u p d a t i n g t h e IDocs. Me s s a g e c o d e s a n d f u n c t i o n s are
44
Standard Methods for the IDoc Generation | 2 . 1
f r eel y s el ec t abl e, a n d y o u d o n ' t n e e d t o a d h e r e t o n a mi n g r ul es. Ho w
ever, t hi s al so me a n s t h a t no i n p u t he l p is p r o v i d e d i n Tr ansact i on WE20,
s o y o u mu s t e n s u r e t h e c o r r e c t s pel l i ng o f t he n a me s y o u r s e l f . In t he
det ai l s o f t h e s a mp l e p r oc e s s c o d e f or t h e ORDERS g e n e r a t i o n , wh i c h is
s h o w n i n Fi gur e 2. 19, y o u can v i e w t h e l i nk t o t h e a s s oc i a t e d f unc t i on
modul e .
Structure
: Q OutDound processco de
CD Logical message
Process code
Description
Function module
HE10
ORDERS Purchase order
1PQC QUTPUI TOPERS
Option ALE-Servcelinb.procg
Processi ng w i t h ALE service
Processi ng W o ALE service
Processi ng w. trigger (inbound)
Version of function module
Processi ng w i t h function modul e version 3.0
Processi ng w i t h function modul e version 2.2
F i g u r e 2.19 A s s i g n m e n t o f t h e Process Code t o t h e F u n c t i o n M o d u l e
U n d e r O p t i o n ALE- Ser vi ce/ I nb. Procg, y o u c a n s e l e c t w h e t h e r t h e ALE
ser vi ces a r e s u p p o s e d t o be u s e d o r n ot . The ALE s er vi c es r e p r e s e n t
op t i o n s o f IDoc ma n i p u l a t i o n u s i n g fi l t ers a n d rul es. Ch a p t e r 4, Sect i on
4 . 1 , Cus t omi zi ng, di s cus s es t h e ALE ser vi ces t opi c i n mo r e det ai l .
Because y o u of t e n r e q u i r e a l ot o f p a r t n e r pr of i l es especi al l y i f y o u
w o r k wi t h p a r t n e r s - y o u h a v e t h e o p t i o n t o c r e a t e t e mp l a t e s t o save
s o me t i me . The p a r t n e r pr of i l e f r o m Tr a ns act i on WE 2 0 can b e cr e a t e d
f r om t hi s t e mp l a t e , so y o u d o n ' t n e e d t o c r e a t e i t manual l y. Tr ansact i on
WE2 4 is t h e t r a ns a c t i on f or t h e t e mp l a t e i n t h e o u t b o u n d pr oc e s s i ng (see
Fi gur e 2. 20) . Tr a ns act i on VVE27 is t h e c o r r e s p o n d i n g t r a n s a c t i o n f o r t h e
i n b o u n d pr ocessi ng.
ALE s e rvi ces
D e f a u l t values
45
2 | Generating IDocs
W a r e h o u s e
m a n a g e m e n t
e x a m p le
Change View "Proposal f o r outbound par tner p r o fi l e s " : Details
*2 ? N e w Entries ^ s i a a a
Parln Type L I Vendor
Direction l ]
Message Type 0RDCH6
Partner Role
Message code
Message function
------------ 1=1
0 Collect IDocs
Start subsystem
Receiver port SUBSYSTEM Port fur ein EDI-Subsystem via Dateischnittstelle
Basic type DELF0R01 Delivery scheduleAJIT schedule
Extension
View
Recipient type 0 Organizational unit
Recipient 500 10120 EDI Department
Message control parameter
Application
Output type
Process code (out)
EF
NEU
ME 11
H C h a n g e message
ORDCHG: Purchase order change
F i g u r e 2.20 D e f a u l t Values f o r O u t b o u n d Partner Profiles
2.1.3 Special Functions
I n s o m e cases, a speci f i c b u s i n e s s p r oc e s s c a n b e i m p l e m e n t e d c o m
pl et el y l ocal l y on an SAP s y s t e m o r d i s t r i b u t e d a c r os s mul t i pl e SAP o r
non-SAP s ys t ems . IDocs a r e o n l y g e n e r a t e d w h e n p r o c e s s e s ar e d i s t r i b
ut e d acr oss mul t i pl e s ys t ems , a n d t h e g e n e r a t i o n can be ac t i va t e d vi a t he
Cus t omi zi ng f unc t i ons o f t h e r e s pect i ve a ppl i c a t i on. Wa r e h o u s e ma n a g e
m e n t is a n e x a mp l e o f t hi s d i r e c t IDoc g e n e r a t i o n . Th e d e f a u l t s e t t i ng
o f w a r e h o u s e m a n a g e m e n t a s s u me s t h a t y o u r w a r e h o u s e is ma n a g e d by
y o u r SAP s ys t em. I f t hi s i s n t t h e case, y o u can ac t i va t e t h e c o n n e c t i o n o f
y o u r w a r e h o u s e s y s t e m vi a ALE i n Cus t omi zi ng. Thi s c o n n e c t i o n causes
a WMTORD IDoc t o b e g e n e r a t e d di r e c t l y w h e n y o u c r e a t e a w a r e h o u s e
t r a n s p o r t r e q u e s t t o no t i f y t he e xt e r na l w a r e h o u s e o f w h a t is s u p p o s e d
4 6
Standard Methods for the IDoc Generation | 2 . 1
t o be t r a n s p o r t e d . Ho we v e r , t h e s e speci al cases c a n t b e d e s c r i b e d in
gene r a l b u t i n s t e a d m u s t b e n a me d a n d s e t u p i n c o o p e r a t i o n w i t h t he
i ndi vi dua l e nd- us er . Because all t r a n s a c t i o n s t h a t ar e r e q u i r e d f o r s uch a
speci al case a r e modul e- speci f i c, t h e y ar e n o t di s cus s ed f u r t h e r h e r e , b u t
j u s t be a wa r e t h a t s u c h speci al cases exi st .
Wi t h i n t h e s c o p e o f ALE s c e n a r i o s , t h e r e c a n a l s o b e cas es i n wh i c h
s a mp l e pos t i ngs ar e i mp l e me n t e d s y n c h r o n o u s l y vi a BAPI, a n d t h e actual
pos t i ngs ar e i m p l e m e n t e d a s y n c h r o n o u s l y vi a IDoc. Th e n , t h e BAPI is
c r e a t e d o n t h e d e v e l o p m e n t si de, a n d t h e a p p r o p r i a t e IDoc is g e n e r a t e d
us i ng Tr a ns act i on BDBG. You can al so us e t hi s t r a n s a c t i o n i f SAP d o e s n ' t
p r o v i d e a n IDoc f o r a BAPI a n d y o u still r e q u i r e i t f o r a d i s t r i b u t i o n s ce
n a r i o t h a t i s n ' t p r o v i d e d f o r b y SAP. Agai n i n t hi s case, y o u m u s t obs e r v e
t h e n a mi n g r ul e s f o r c u s t o m e r obj ect s.
Fi gur e 2. 21 s h o ws a n I Doc g e n e r a t e d by SAP i n t h e SAP n a me s p a c e . In
t h e IDoc I nt e r f a c e t ab, y o u c a n v i e w t h e n a m e s f o r t h e me s s a g e t ype
a n d t h e IDoc t ype ; i n t h e ALE O u t b o u n d Processi ng t ab, y o u c a n vi ew
t h e f unc t i on g r o u p i n wh i c h t he IDoc mo d u l e s ar e l ocat e d as well as t he
n a me o f t h e m o d u l e t h a t g e n e r a t e s t h e IDoc; a n d i n t h e ALE I n b o u n d
Pr oce s si ng t ab, y o u can v i e w t h e n a m e o f t h e mo d u l e t h a t ext r a ct s t he
I Doc i n t h e r e cei vi ng s y s t e m a n d t r i gger s t h e upd a t e .
The pr ocess o f g e n e r a t i n g an I Doc f r om a BAPI is as fol l ows:
1. Th e s e n d i n g s y s t e m wa n t s t o call t h e BAPI a n d checks w h e t h e r t hi s is
s u p p o s e d t o be c a r r i e d o u t l ocal l y o r r emot el y.
2. I f t h e call is r e m o t e a n d is s u p p o s e d t o be ca r r i ed o u t t r ansact i onal l y,
t h e f u n c t i o n mo d u l e t h a t is g e n e r a t e d i n Tr a ns act i on BDBG is call ed
i n t h e s e n d i n g s ys t em. Thi s f u n c t i o n mo d u l e t r ans f er s t h e t r a n s f e r
p a r a me t e r s o f t h e BAPI t o t h e I Doc f or ma t .
3. Af t er y o u ve ma d e t h e s e t t i ngs i n t h e c u s t o m e r d i s t r i b u t i o n mo d e l
a n d i n Tr a ns act i on WE20, t hi s g e n e r a t e d I Doc is t r a n s f e r r e d t o t he
r e cei vi ng syst em.
4. I n t h e r e cei vi ng s y s t e m, t h e B A P I _ I D0 C _ I NPUT1 f u n c t i o n mo d u l e is
cal l ed u s i n g t h e B A P I pr oc e s s c o d e o r B A P I _ I D0 C _ I N P U T P u s i n g t he
BAPP pr ocess c o d e ; t hi s d e p e n d s o n w h e t h e r o n e o r mo r e d a t a r ecor ds
ar e r e cei ved s i mul t a ne ous l y. The s e f unc t i on mo d u l e s call t he i n b o u n d
f u n c t i o n m o d u l e t h a t is g e n e r a t e d i n Tr a ns act i on BDBG, w h i c h ext r act s
I D o c - BAPI
i n t e r f a c e
BAPI p r o c e s s i n g
47
2 | Generating IDocs
A s y n c h r o n o u s
BAPIs
D e t e r m i n i n g t h e
t a r g e t s y s t e m f o r
s y n c h r o n o u s BAPIs
( he IDoc a n d uses t h e t r a n s f e r r e d d a t a t o call t h e or i gi nal BAPI t hat
car r i es o u t t h e act ual upd a t e .
G e n e r a t e A L E I n t e r f a c e f o r B A P I
# 9 q o Check interface 6? Display interface 4 ^ Display available interfaces
ObiecVlnterface Type
Method
Category
BUS6006
POST
-Enter Interface Par
Message Type
IDoc type
Package
ACC_EHP10YEE_PAY
ACC_EMPL0YEE_PAY02
ACID_IF
ALE Outbound Processing
Function Module
Function group
AIE_ACC_EHP10YEE_PAY_P0ST
ACAS
0 Data FiRenng Allowed
ALE Inbound Processing /
Function Module
Funcbon group
ID0C_t HPUT_ACC_EHP10YEE_PAY
ACC4
0 Cali in update Task
0 Packet Processing Allowed
F i g u r e 2.21 I D o c I n t e r f a c e t o a BAPI
Because b o t h cases r e p r e s e n t an ALE s c e n a r i o , y o u ma i n t a i n t h e c us
t o m e r d i s t r i b u t i o n mo d e l f or BAPIs a n d I Docs. For t h e BAPIs, y o u e n t e r
t he m e t h o d s t h a t m u s t be p r o c e s s e d b o t h s y n c h r o n o u s l y a n d asynchr o-
nous l y vi a IDocs. Addi t i onal l y, y o u r e q u i r e p a r t n e r pr of i l es f or t h e t r a ns
act i onal case as us ual . I f y o u h a v e t h e s e p a r t n e r pr of i l es g e n e r a t e d f r om
t he d i s t r i b u t i o n mo d e l , t he s y s t e m a u t oma t i c a l l y k n o ws f or w h i c h BAPIs
t h e r e a r c me s s a ge t y p e s a n d t h u s f o r wh i c h it r e q u i r e s a p a r t n e r profi l e.
Use Tr a ns act i on BD97 t o ma i n t a i n t h e d e s t i n a t i o n f o r t h e s y n c h r o n o u s
BAPI call i n a r e m o t e s y s t e m. Thi s c a n b e d o n e b o t h g e n e r a l l y f o r all
m e t h o d cal l s a n d o n l y f or speci al BAPIs a n d f o r di al og calls. You n e e d
t h e di al og calls i f y o u w a n t t o wo r k w i t h t h e I Doc t r ac i ng i n Tr ansac
t i on BD87. The d i s t i n c t i o n w i t h r e gar d t o di al ogs is ma d e f or secur i t y
r easons.
4 8
Use of Logical Systems in the Message Control | 2 .2
Becausc a d i a l o g u s e r m u s t b e u s e d i n t h e RFC d e s t i n a t i o n , t h i s us e r
s h o u l d h a v e o n l y a f e w a u t hor i z a t i ons .
Fi gur e 2. 22 s h o ws an e x a mp l e f o r each o f t h e t h r e e cases.
A s s i g n RF C D e s t i n a t i o n s f o r S y n c h r o n o u s M e t h o d C a l l s
& 9 ^ & Standaid BAPi destination Q Standard dialog destnabon Q Special memod destination
1090 * 0 0 c l i e n t 800
-AHRCLNT000 AHR (HR system) c l i e n t 000
-AHRCLNT003 AHR (HR system) C l i e n t 003
-AHRCLHT006 AHR CATTS c l i e n t 006
-AHRCLNT026 AHR CAIIS C l i e n t 026
-A1I_00_800 AM S y s t e * c l i e n t 800
"AIN1 AutO ID Node 1
-A1N2 Auto ID Node 2
-AIN_800 Auto ID Node 2 . 1 c l i e n t 800
-AIN_8O0NBI Auto ID Node c l i e n t 800 NB I
-AIRCLNT000 ALR C l i e n t 000 ( )
-ALRCLHT006 a i r na n d t 006
-ALRCLNT062 ALR flandant 062
-AP0CLNT100 APOCLNTIOO
AP0CLNI8JP APOCLNT8O0
Gj Standard RFC d e s t i n a t i o n f o r BAPI c a l l s
AP0CLNI800 /
Standard RFC d e s t i n a t i o n f o r d i a l o g c a l l s
AIEHAHU l e s t ALE c o m u M c a t i o n * i t h n a n u g i s t i e s
3 RFC d e s t i n a t i o n s f o r s p e c i a l et hod c a l l s
L - O Acct ngEplyeePaybl*s cneck A c co unti ng Check Vendor Acct As$ignent f o r HR P o s t i n g (0A6: LOAD PAYABLE)
I----------BACKEND
F i g u r e 2.22 C u s t o m i z i n g f o r S y n c h r o no u s BAPI Calls i n ALE Scenarios
The s t a n d a r d d e s t i n a t i o n f o r BAPI calls f o r t h e APOCLNTSOO logi cal s ys
t e m is APOCLNTSOO, t h e d e s t i n a t i o n f o r t h e di al og calls is cal l ed ALEMANU,
a n d t h e BACKEND d e s t i n a t i o n is us e d f o r t h e A c c t n g E m p l y e e P a y b l e s . C h e c k
m e t h o d onl y.
2.2 Use of Logical Systems in the Message Control
Tr a ns act i on d a t a ma y b e e x c h a n g e d w i t h i n ALE s ce nar i os . For e xa mpl e , "ALE_
t hi s c o u l d be t h e s c e na r i o o f ce nt r al s a l e s / d e c e n t r a l i z e d s h i p p i n g . Her e, PROCESSING
p u r c h a s e o r d e r s , del i ver i es, a n d i nvoi ces ar e e x c h a n g e d b e t w e e n pl a n t s subroutme
o f t h e s a me e n t e r p r i s e . Fo r t hi s case, i n me s s a ge cont r ol , y o u s i mp l y use
t h e c u s t o me r o r v e n d o r as t h e p a r t n e r . I n s t e a d o f "6" f or t h e EDI pro-
49
2 | Generating I Docs
M e s s a g e c o n t r o l
and ALE
U n i q u e n e s s o f t h e
a s s i g n m e n t
cessi ng, h o we v e r , y o u e n t e r "A" f o r t h e ALE pr oc e s s i ng as t he t r a ns mi s
s i on m e d i u m f o r t h e f o u n d mes s age . As a r esul t , t h e s y s t e m n o l o n g e r
uses t h e EDI _P ROCESS I NG s u b r o u t i n e a n d i n s t e a d uses t he ALE_PROCESS-
ING s u b r o u t i n e .
You t h e n ma i n t a i n a c u s t o m e r d i s t r i b u t i o n mo d e l as us ual a n d us e a
logical s y s t e m as t h e s e n d e r a n d a l ogi cal s y s t e m as t he r e c e i ve r o f t he
mes s age . Af t e r t h e me s s a ge c o n t r o l wi t h i n t h e appl i c a t i on, t h e t r a n s mi s
s i on m e d i u m A r e a d s t h e c u s t o m e r d i s t r i b u t i o n mo d e l a n d r epl aces t he
p a r t n e r f o u n d i n t h e me s s a ge c o n t r o l w i t h t h e l ogi cal s y s t e m f o u n d in
t he mo d e l . For t hi s p u r p o s e , y o u n e e d t h e a s s i g n me n t o f o u t p u t t y p e s to
me s s a ge t ypes . T h e y a r e avai l abl e i n t h e pr ocess code s i n t h e o u t b o u n d
pr oces s i ng i n Tr ansact i on WE41 a n d i n t h e s et t i ngs t h a t y o u ma d e f or t he
me s s a ge c o n t r o l i n t h e o u t b o u n d p a r t n e r pr of i l e i n Tr a ns act i on WE20.
T h e d a t a f r o m Tr a ns a c t i on WE2 0 is e v a l u a t e d i n t h e A L E . P R O C E S S I N G
s u b r o u t i n e . Because t h e s u b s e q u e n t r e c e i v e r i s n ' t y e t d e t e r m i n e d i n t hi s
f i r st st ep, t h e s y s t e m s e a r c he s us i ng t h e Logical Sys t e m" p a r t n e r t ype
a n d t h e o u t p u t t y p e onl y. I f mo r e t h a n o n e e n t r y is f o u n d i n Tr ansact i on
WE2 0 , f o r e xa mpl e , NEU - ORDERS, wh i c h wo u l d be t h e s t a n d a r d , a n d
NEU - ZSMORD f o r a s e l f - p r o g r a mme d mes s age t ype, ALE_PROCESSING c a n
cels w i t h a n e r r or . You est abl i sh t he r e q u i r e d u n i q u e n e s s by us i ng y o u r
o wn o u t p u t t ypes f or y o u r o w n me s s a ge t ypes.
The s ea r ch vi a t h e "Logical Syst em" p a r t n e r t y p e a n d t h e p a r t n e r t ype
r esul t s i n t h e b e n e f i t o f a r e d u c e d n u m b e r o f p a r t n e r prof i l es. T h e n y o u
can j u s t h a v e a p a r t n e r pr of i l e f or t h e l ogical s y s t e m i n s t e a d o f a p a r t n e r
prof i l e f o r e a c h v e n d o r o r c us t ome r .
2.3 Summary
I n t h i s cha pt e r , we ' v e t a k e n a cl os er l o o k a t t h e c r e a t i on o f IDocs. Youve
l e a r n e d wh i c h m e t h o d s f or c r e a t i o n exi s t a n d h o w t h e y ar e r e l a t e d to
t he d i f f e r e n t n e e d s o f d i f f e r e n t pr oc es s es o r da t a t ypes . The de c i s i on as
t o wh i c h o n e s h o u l d be u s e d is ma d e b y SAP.
N o w l e t s t a ke i t a s t e p f u r t h e r r e g a r d i n g o u r w o r k wi t h I Docs. The
ne x t c h a p t e r wi l l t each y o u h o w t o t e s t t h e c r e a t i o n a n d t h e p o s t i n g o f
IDocs.
50
"Anything t h a t can go wrong w i ll go wrong." (M u rp h y 's Law)
To ensure t h a t as l i t t l e as possible goes wrong in y o u r production
system, SAP provides a variety o f t e s t tools, each o f which are
described in t h i s chapter.
3 Test Tools
A b u s i n e s s p r oc e s s t h a t s p a n s sever al s y s t e ms c a n ' t be ful l y t e s t e d a n d
ac cept ed u n l e s s all o f t h e p a r t n e r s t e s t t h e pr oc es s . Howe ver , basi c s e t
t i ngs us ual l y u n d e r g o a p r e l i mi n a r y t est , w i t h o u t a n y i n v o l v e m e n t by
y o u r p a r t n e r . Du r i n g t h e d e f i n i t i o n p ha s e , i t ma y al s o be n e c e s s a r y f or
y o u t o d e t e r m i n e exact l y wh i c h f i el ds ar e c o n t a i n e d i n a n IDoc, a n d o f
t h e s e fi el ds, wh i c h ar e n e e d e d f or a p a r t i c u l a r s ce nar i o. For t hi s basi c
test , SAP has d e l i ve r e d a t e s t e n v i r o n m e n t i n w h i c h s y s t e ms can ge ne r a t e
a n d p o s t IDocs w i t h o u t h a v i n g a s u i t a b l e SAP s ys t e m g r o u p . The s e IDocs
can t h e n b e u s e d as s a mp l e IDocs o r t e mp l a t e s f o r t h e pa r t ne r .
You c a n ma n u a l l y c r e a t e IDocs a n d p o s t t h e m t o y o u r o w n SAP s ys t em,
as we l l as ma k e I Docs avai l abl e f o r o u t b o u n d pr oc es s i ng. All o f t h e t est
t ool s ar e s t o r e d u n d e r t h e a r e a m e n u i n Tr a ns act i on WEDI . Fi gur e 3. 1
s h o ws t h e s e v e n t e s t t r a ns a c t i ons p r o v i d e d t here.
S A P E a s y A c c e s s I D o c a n d EDI B a s i s
I | l A Otwrmenu 11 | 0 E I f Q Create rote |
CD Favorites
Q SAP menu
.......<$WE02- Display IDoc
I- AdminisVatfon
^ < 3 T#*t
^ V * E 1 9 -Test tool
5 -Outbound from MC
0 V*E14- Outbound Processing from lOoc
0 VE18 - Generate Status File
0 WEI 7- Process Status File
0 WE12 - Inbound procg of moOifled ou file
0 V<E16 - Inbound procg oforigjnb.flle
l> Q Documentaon
t> Development
t> Q Control______________________________________________________
Figure 3.1 Test Transactions in the Area Menu of Transaction WEDI
T e s t i n g w i t h o u t a
p a r t n e r
I n b o u n d and
o u t b o u n d
p r o c e s s i n g
51
3 | Test Tools
T r a n s a c t i o n W E 19
I D o c t e m p l a t e
M a n u a l t e s t I D o c
Pari o f t h e s e t r a ns a c t i ons is al so avai l abl e i n t h e m e n u s o f t h o s e a ppl i c a
t i o n s t h a t f r e q u e n t l y w o r k w i t h IDocs. Howe ve r , t h i s c h a p t e r wi l l pr i
ma r i l y f ocus o n us i ng i ndi vi dua l t r ans a c t i ons , r a t h e r t h a n s h o w i n g t h e m
i n a speci f i c mo d u l e . Not e t h a t mo s t val ues e n t e r e d f o r t e s t p u r p o s e s are
case-sensi t i ve.
3.1 Individual IDocs
Tr a ns act i on W E I 9 is t h e t e s t t ool f o r i ndi vi dua l IDocs. You c a n choos e
w h e t h e r y o u w a n t t o us e a f i ni s hed IDoc as a t e mp l a t e o r w h e t h e r y o u
w a n t t o c r e a t e a c o mp l e t e l y n e w I Doc b a s e d o n a me s s a ge t y p e o r IDoc
t ype. You can al s o us e a n exi s t i ng file. In t hi s case, h o we v e r , y o u mu s t
us e a flat file b e c a u s e XML files a r e n t s u p p o r t e d .
Tr a ns act i on WE I 9 is par t i c ul a r l y hel pf ul i f it' s n o t y e t cl e a r wh i c h IDoc
f i el ds m u s t be fi l l ed a n d wh i c h val ues m u s t be s pec i f i e d. You can r un
t h r o u g h s eve r al var i a nt s unt i l y o u ' v e d e t e r m i n e d t h e field i n f o r ma t i o n
r e l e vant f o r y o u r s e t o f t asks. Fi gur e 3. 2 p r o v i d e s an o v e r v i e w o f t h e i ni
tial s cr een as we l l as t h e s e l e c t i o n o p t i o n s avai l abl e i n t hi s t r ans a ct i on.
Test t o o l f o r IDoc processing
si
Template foi t e s t /
<> Existing IDoc
O BasicTyp
withEnhancement
O V i a m e s s a g e type
O File as template
O w f o template
F i g u r e 3.2 Test T o o l f o r I n d i v i d u a l IDocs
Af t er y o u ' v e cal l ed a n IDoc, y o u can s t r u c t u r e i t s o t h a t i t fulfills y o u r t e s t
r e q u i r e me n t s . Each s e g m e n t c a n b e e d i t e d separ at el y. Wh i l e y o u re i n
edi t mo d e , y o u a l s o c a n cl ear l y s e e wh i c h fi el d y o u re wo r k i n g i n w i t h
o u t h a vi ng t o c o u n t t h e fi el ds. You can al so a d d mo r e s e g me n t s . I f y o u re
52
I n d i v i d u a l I Docs | 3.1
us i ng t he t e mp l a t e o p t i o n , t h e s y s t e m checks s o me ( unf o r t u n a t e l y , n o t
all) o f t h e r e q u i r e d p r o p e r t i e s o f t h e IDoc t y p e o r me s s a g e t y p e t h a t
y o u ' v e s el ect ed. All o f t h e var i a nt s ar e c h e c k e d t o d e t e r m i n e w h e t h e r
m a n d a t o i y s e g me n t s ar e mi s s i n g o r w h e t h e r t he s e g m e n t i n us e exi st s in
t h e s e g m e n t d e f i n i t i o n i n t h e SAP s ys t em. Fi gur e 3. 3 s h o ws t h e s e gme nt s
o f a n e x a mp l e IDoc i n Tr ansact i on WE19.
E0I0C 8000000000000768745700 03 1 SALES LSSAIES
1
010 HUHBEft PCE
E1HAKTH
---------El MARCH
--------El HARM
---------El HARM
--------E1HYKEH
OOSESatnnes 0eo (later i si
0053000*
OOSCT 6 1
OOSPCEt 1
005360001 X 000009000 000
EH
0 0
0 000
0 000
0.80B
HO 00
0 080
0 080
0
0 800
800
0 .0 80
0 ooo
0 ooo
0.080
0 000 0.808
0 080 0 800
0 000 0 OOO
XCRH
---------El HIAMU 0050S UIXJ1
F i g u r e 3.3 V i e w o f an I D o c i n T ransact ion W E 19
You can n o w e d i t b o t h t h e c o n t r o l r e c o r d a n d t h e d a t a r e c or ds a n d , f o r E d i t i n g t h e
e xa mpl e , s e n d a n IDoc t o a r e c e i v e r o t h e r t h a n t h e or i gi nal r ecei ver . As c o n t r o l record
y o u c a n s e e i n Fi gur e 3. 4, o n l y t h e mo s t i mp o r t a n t fi el ds i n t h e cont r ol
r e cor d a r e di s p l a y e d initi al l y. Howe ve r , i f y o u al so w a n t t o v i e w o r edi t
t h e o t h e r fi el ds, s i mp l y c h o o s e All Fiel ds.
1 7 1
Receiver
P o r t
Part ner No
P a r i Type
Part ner Role
L o g i c a l M e s s a g e Type
Message Type
Message Variant
Message Function
T e s t Flag
Se nder
P o r t
Part ner No
Part Type
Part ner Role
Figure 3 . 4 Editing the Control Record
53
3 | Test Tools
Test flag The test f a g pl ays a speci al rol e i f y o u act ual l y s e n d t est IDocs t o o t h e r
s ys t ems . Fo r e v e i y s i n g l e p a r t n e r prof i l e w i t h i n i n b o u n d p r o c e s s i n g in
SAP s y s t e ms , y o u can d e t e r m i n e w h e t h e r t he Test Flag will a p p l y t o real
o r t e s t I Docs. I f y o u s e t t he Test Flag, y o u c a n r ecei ve t h e IDoc, s a v e i t to
t h e d a t a b a s e , a n d v i e w i t s c o n t e n t s i n Tr a ns act i on BD87, b u t y o u c a n ' t
pos t it. O t h e r s y s t e ms t h a t e x c ha nge IDocs o r EDI mes s age s us ual l y have
s i mi l a r bui l t - i n s ec ur i t y me c h a n i s ms f o r t e s t p u r p o s e s .
Each t i me y o u doubl e- c l i c k a d a t a r ecor d, y o u get a l i st o f all possi bl e
f i el ds f o r t hi s s e g me n t . You al so c a n scr ol l d o w n t h r o u g h t h e e n t i r e dat a
r e cor d (see Fi gur e 3. 5). I f y o u re n o t w o r k i n g w i t h a t e mp l a t e , y o u e n t e r
t h e fi el d c o n t e n t s t h a t y o u r e q u i r e her e. I f y o u ' r e wo r k i n g wi t h a t e m
pl at e, t h e val ues o f t h e t e mp l a t e IDoc a r e pr efi l l ed, a n d y o u c a n cha nge
t h e m as r equi r ed.
Change Data Record
MSGFN 005
MATNR ZSM1
ERSDA 20081006
ERNAM _ [ m a i s e l s a
LAE DA 20081006
AENAM MAISELSA
PSTAT KVE
LVORM
P I
MTART f e r t ]
MBRSH h]
MATKL 00107
X
F i g u r e 3 . 5 E d i t i n g a D a t a Record
Processing the N o w t h a t y o u ve c r e a t e d y o u r c o m p l e t e I Doc, i t c a n be p r o c e s s e d . In
t est IDoc o t h e r wo r d s , i t c a n be t e s t e d w i t h t h e r e l e v a n t s t a n d a r d s e t t i n g s f or
i n b o u n d a n d o u t b o u n d pr oc es s i ng. For i n b o u n d pr oc es s i ng, a ddi t i ona l
t e s t o p t i o n s a r e avai l abl e, e i t h e r di r ec t l y b y e n t e r i n g a f u n c t i o n mo d u l e
o r i ndi r e c t l y b y u s i n g a file ( we ' l l d e s c r i be t hi s i n g r e a t e r de t a i l later).
Fi gure 3 . 6 s h o ws standard inbound processing. All o f t h e d a t a is o b t a i n e d
f r om a p a r t n e r profi l e, a n d i t c a n t b e c h a nge d. I f n o p a r t n e r prof i l e is
f o und, y o u can cr eat e a n IDoc, b u t y o u c a n t p o s t it.
54
I n d i v i d u a l I Docs | 3.1
[ & T e s i in b o u n d IDoc u s i n g part ner profile
C C O P a f w ' e r ' p r o f i ) ^
Part ner N o ZSM2
Part Type LS Logical syst em
Part ner Role
Log ical Message Type
Message MATNAS Material m a s t e r
Message Variant
Msg Function
Pr ocessi ng De tai ls
P r o c e s s code MATH MATMAS Material m a s t e r data
Functi on n a m e ID0CJNPUTJ1ATMAS01
P I ALE Service
^ X
F i g u r e 3 . 6 T es t i n g S t a n d a r d I n b o u n d Processing
Wh e n y o u use t h e Test Usi ng a F u n c t i o n Mo d u l e o p t i o n , i t s pos s i bl e to
di r ec t l y speci f y a f u n c t i o n m o d u l e f o r IDoc pr oc e s s i ng (see Fi gur e 3. 7).
The t e s t I Doc is t h e n pr oc e s s e d w i t h t hi s f unc t i on mo d u l e , i r r espect i ve o f
w h e t h e r o r n o t a s u i t a b l e p a r t n e r prof i l e exi st s. Thi s ena bl e s t e s t i ng t o be
c o mp l e t e d p r i o r t o t h e fi nal s et t i ngs , wh i c h ar e s o me t i me s i mp l e me n t e d
by o t h e r s . You can al so t est y o u r o w n d e v e l o p me n t s he r e a n d navi gat e
di r ec t l y t o d e b u g g i n g , i f necessar y. I f t he r e ar e sever al pr oc e s s code s a n d
sever al f u n c t i o n mo d u l e s f o r t h e s a me me s s a ge t ype, y o u can al so r un
t h r o u g h all o f t h e m her e. You can t h e n us e t h e r esul t s t o d e t e r m i n e t he
mo s t r e l e v a n t pr oc e s s c o d e f o r y o u r pur pos e s .
S T e s t in b o u n d IDoc u s i n g a functi on modul e

Functi on Module [lD0C_INPUT_MATHAS01 g )


Ca ll i n de b u g g i n g mo d e
C a l l tran sacti on p r o c e s s i n g /
In Background
O In foreground
O In fore gro und al ter er ro r
X
Figure 3 . 7 Extended Test in Inbound Processing
Test u s i n g a
f u n c t i o n m o d u l e
55
3 | Test Tools
Test I D o c as a file
T e s t i n g i n b o u n d
proces sing
S t a t u s v a l u e s o f
t h e t e s t I Doc
The t wo s c e na r i os d e s c r i b e d pr e vi ous l y a t e s t u s i n g t h e s t a n d a r d set
t i ngs o r a t est us i ng a f u n c t i o n mo d u l e wo r k di r ec t l y i n t h e SAP s ys
t em. Fr equent l y, h o we v e r , y o u al so have t o i mp o r t p a r t n e r files i nt o y o u r
bus i ne s s pr oces s es . To p r e v e n t e r r o r s f r o m occur r i ng, y o u r p a r t n e r will
mo s t l i kel y a pp r e c i a t e a sample f i l e wh o s e s t r u c t u r e c a n be u s e d dur i ng
l i ve i mp l e me n t a t i o n . By u s i n g a file t o t e s t i n b o u n d pr oc es s i ng, y o u can
wr i t e s u c h a file w i t h s eve r al IDocs a n d t h e n pr oc e s s i t di rect ly.
Wr i t i ng a file w i t h a r e p e a t f a c t or i n a p p e n d mo d e can al so be u s e d as t he
basi s f o r mas s t es t s f o r p e r f o r ma n c e a na l ys i s p u r p o s e s . Cons e que nt l y,
IDocs ar e g e n e r a t e d f r om y o u r d a t a as of t e n as p e r mi t t e d by t h e r e peat
f a c t or a n d t h e n pl a c e d i n a l ar ge s h a r e d file. To us e t hi s f u n c t i o n , y o u
mu s t e n t e r a val i d file p o r t f o r wh i c h y o u can a c t i va t e o r de a c t i va t e Un i
code (see Fi gur e 3. 8). Howe ver , y o u mu s t speci f y t h e file pa t h y o u r s e l f
b e c a u s e it c a n ' t be o b t a i n e d f r o m t h e p o r t i n f o r ma t i o n .
E T e s t inbound IDoc usi ng tile [ * ] /
Fi le n a m e f liocalhosVdemofoiderfdemofiie
3 Start IDoc i nbound p r oce ssin g of file i m m e d i a t e ^
No . o f I Docs to wri t e in f ile (repetition factor)_____________________________ |1
F i l e m o d e / ~
Overwrite file
O A p pend IDoc to file
i nbound processing
Pori SNFI LE S a b i n e s Te s tp o rt for Files
[ B E _______________________________________________________
F i g u r e 3 . 8 Testing I n b o u n d Processing Using a File
No m a t t e r wh i c h o f t h e s e t h r e e t e s t m e t h o d s y o u us e t o c r e a t e an
i n b o u n d IDoc, t h e IDoc is s t o r e d wi t h a n a d d i t i o n a l s t a t u s r e cor d t hat
al ways i ndi c a t e s t h a t t hi s IDoc wa s n o t r eal l y cr e a t e d b u t r a t h e r cr e a t e d
u s i n g t e s t Tr a ns act i on WE19. Howe ve r , t h e real c h a n g e s ar e wr i t t e n t o
56
Testing Processing of Mul tipl e IDocs | 3 - 2
( he d a t a b a s e , so y o u m u s t car ef ul l y c o n s i d e r w h e t h e r y o u w a n t t o p e r
mi t t h e us e o f t hi s t e s t t r a ns a c t i on i n a p r o d u c t i o n s y s t e m. Fi gur e 3. 14
i n Sect i on 3. 3, Processi ng St at us Files, s h o w s t h e s t a t us val ues o f an IDoc
c r e a t e d us i ng t est Tr a ns act i on W E I 9. I n o u t b o u n d pr oc es s i ng, t he t est
st at us v a l u e is 42: IDoc was created by test transaction.
W h e n t e s t i ng o u t b o u n d pr oc es s i ng, y o u c a n al so s e n d sever al IDocs at
onc e . Ho we v e r , y o u d o n ' t h a v e t h e p r e v i o u s l y m e n t i o n e d a d d i t i o n a l
o p t i o n s o f d e b u g g i n g o r wo r k i n g w i t h o u t sui t abl e p a r t n e r pr of i l es her e.
You c a n o n l y us e s t a n d a r d o u t b o u n d pr ocessi ng. As y o u can s e e i n Fi gure
3. 9, all o f t h e i n f o r ma t i o n y o u r e q u i r e ( a pa r t f r o m t h e r e p e a t fact or) is
o b t a i n e d f r o m t h e p a r t n e r prof i l es. The s e set t i ngs a r e t h e n u s e d t o s end
a n IDoc t o a par t ner .
| Q ? Outbound p r oce ssin g o f lD oc 0 /
0 Sl a r l IDoc outbound procg o f file i mm e d .
No . o f I Docs to b e gen erate d ( r e p e a t factor) 1
Re cei ver port SAPSM1
PortType t R F C P o r t
Log.destination; DEST_SM1
F i g u r e 3 . 9 T es t i n g Standard O u t b o u n d Processing
3.2 Testing Processing of Mu l ti p le IDocs
Onl y o n e I Doc wa s cr e a t e d w h e n w e us ed t h e t est m e t h o d s des c r i bed
i n t h e p r e v i o u s s e c t i on. Howe ve r , y o u a l s o have t h e o p t i o n o f c r e at i ng
mu l t i p l e IDocs a t once . We ll n o w d e s c r i b e t hi s o p t i o n i n det ai l .
3.2.1 Message Control
I f me s s a ge c o n t r o l is u s e d t o g e n e r a t e IDocs, t h e a p p l i c a t i o n f r e q u e n t l y
conf i gur es t h e p a r a m e t e r s e t t i ngs t h e r e . The act ual IDocs a r e fi rst g e n
e r a t e d u s i n g a s c h e d u l e d r e p o r t ( a n d n o t as s o o n as t h e d o c u m e n t is
T e s t i n g o u t b o u n d
p r o c e s s i n g
Test t r a n s a c t i o n
W E 15 a n d r e p o r t
"RSNASTOO"
57
3 | Test Tools
A d v a n c e d d i s p a t c h
o f f i n i s h e d I Docs
pos t ed) . Fr equent l y, t hi s pr ocess c a n t b e a d a p t e d f or t est p u r p o s e s , and,
as a r esul t , y o u mu s t ma n u a l l y s t a r t t h e r e l e v a n t r e p o r t e a c h t i me y o u
w a n t t o t e s t an IDoc. To ma k e life a l i t t l e ea s i e r f o r y o u , Tr a ns act i on
WE I 5 is avai l abl e f o r g e n e r a t i n g I Docs f r o m me s s a ge c o n t r o l recor ds.
Thi s t r a ns a c t i on d i r e c t l y r e f er e nces t h e r e p o r t RSNASTOO, a n d i t s l i s t e d in
y o u r EDI o v e r v i e w me n u WEDI . Fi gur e 3 . 1 0 s h o ws a p u r c h a s i n g e x a m
p l e t h a t uses t h e s t a n d a r d me s s a ge t y p e d e l i v e r e d by SAP.
S e l e c t i o n P r o g r a m f o r I s s u i n g O u t p u t
; - & n
Se lect i on p a r a m e t e r
Output application
Object key
Output type
T r a n s m i s s i o n medi um
Se nd again
Sort
4500017125
to
to
to
P a r a m e t e r fo r c a l li n g up th e p r oce ssin g programs
Printer default
Spool: Suffix 2
F i g u r e 3.10 Test T rans act ion f o r Message C o n t r o l
The ma i n di f f e r enc e b e t w e e n t hi s t e s t t r ans a ct i on a n d all o t h e r t e s t t r a ns
ac t i ons is t h a t a n IDoc t h a t wa s a c t ua l l y g e n e r a t e d by an a pp l i c a t i o n is
s e n t e a r l i e r t h a n p l a n n e d , i n s t e a d o f wa i t i n g f o r t he s y s t e m t o execut e
t he r e p o r t RSNASTOO by def aul t . A n e w I Doc i s n ' t g e n e r a t e d ( t he or i gi nal
j o b s c h e d u l e d l a t e r d o e s n t g e n e r a t e t h i s I Doc agai n) . I n s t a t u s m o n i t o r
i ng, y o u c a n t s e e h o w t hi s IDoc wa s g e n e r a t e d b e c a u s e i t s i mp l y st art s
as n o r ma l w i t h s t a t us 01: IDoc generated.
3.2.2 Sending Ready-for-Dispatch IDocs
Tr a ns act i on W E I 4 is t he o n l y t r a ns a c t i on t h a t c a n be u s e d t o ant i ci pat e
a j o b t h a t is o t h e r w i s e s c h e d u l e d o n a r e g u l a r basi s. Her e, r eady- f or -
di s pa t c h IDocs ( s t a t us 30) ar e d i s p a t c h e d b e f o r e t h e r e g u l a r dat e, " i f
58
Testing Processing of Mul tipl e IDocs | 3 - 2
y o u d o n t w a n t t o w a i t unt i l t h e n . Howe ve r , y o u can al so set t h e t e s t flag
her e, so t h a t y o u r p a r t n e r k n o ws t h a t he s h o u l d n o t pr ocess t h e IDoc.
Fi gur e 3. 11 s h o ws h o w y o u can us e Tr a ns act i on WE 1 4 t o s pec i f y wh i c h
IDocs y o u w a n t t o cr eat e.
Simi l arl y, t hi s t r a n s a c t i o n d o e s n ' t g e n e r a t e a n e w IDoc. Cons e que nt l y,
i n Tr a ns act i on BD87 ( I Doc Mo n i t o r ) , y o u c a n t i d e n t i f y a di f f e r e nc e to
t h e I Docs t h a t a r e d i s p a t c h e d r e gul a r l y vi a a b a c k g r o u n d j o b bec aus e
Tr a ns a c t i on W E I 4 al s o p r o v i d e s spec i a l access t o t h e s t a n d a r d r e p o r t
RSEOUTOO.
Process Ali Selected IDocs (EDI)
Doc Number
i . 0
Basle Type
Q u e u e N a m e
S e n d completely1?
Pott o f Receiver
Partner Type o f Receiver
Partner Function of Receiver
Partner N u m b e r o f Receiver
Logical M essag e
L a s t C h a n g e d On
L a s t C h a n g e d At
Output Mode
T e s t Option
Maxi mum N u m b e r o f IDocs
F i g u r e 3.11 S e l e c t i o n o f I D o c s t o Be Sent
3.2.3 Files
In a d d i t i o n t o t e s t i ng i ndi vi dua l I Docs, y o u c a n a l s o p r oc e s s c o mp l e t e
files w i t h IDoc dat a. You can c r e a t e t h e s e files o r t h e y ca n be t r a ns f e r r e d
f r o m a pa r t ne r . Her e, we ' l l a s s u me t h a t all o f t h e da t a i n t h e p a r t n e r file is
S t a n d a r d r e p o r t
"RSEOUTOO"
59
3 | Test Tools
E d i t i n g t h e
c o n t r o l r eco r d
C h a n g i n g t h e
s e n d er
c o r r e c t a n d s i mpl y n e e d s t o b e i mp o r t e d . Thi s is d o n e u s i n g Tr ansact i on
W E I 6. On c e agai n, y o u o n l y have t o e n t e r t h e file n a me , file p a t h , a n d
p or t , as wel l as s e t t h e Un i c o d e flag o n t h e i n p u t scr een.
I n t h e case o f files t h a t y o u cr eat e your s e l f , y o u c a n e i t h e r c r e a t e a file
i n a n e d i t o r , wh i c h is a v e r y l a bor i ous t ask, o r y o u c a n us e a t est t ool
i n o u t b o u n d p r o c e s s i n g t o c r e a t e a file t h a t wi l l c o n t a i n t h e d a t a y o u
r e qui r e . I n t h e l a t t e r s c e n a r i o , ho we v e r , y o u r l ogi cal s y s t e m is speci f i ed
as t h e s e n d e r ( a n d n o t t h e r ecei ver ) i n t h e c o n t r o l r ecor d. The r e f or e , t he
c o n t r o l r e cor d c a n ' t b e u s e d f o r y o u r p u r p o s e s . SAP pr o v i d e s Transact i on
WE I 2 her e, wh i c h y o u c a n us e t o o b t a i n t h e bus i ne s s d a t a f r om t h e file
s peci f i ed as wel l as ma n u a l l y e n t e r t h e c o n t r o l r e cor d dat a. The r esul t i ng
file is t h e n t e mp o r a r i l y s t o r e d agai n.
You can, f o r e xa mpl e , ma k e t hi s file avai l abl e t o a p a r t n e r as a t e mp l a t e .
Fi gure 3. 12 s h o w s p a r t o n e o f t h e r e q u i r e d i n f o r ma t i o n o n t h e S e n d e r
t ab page.
Modification of Outbound File Triggering Inbound Procg
Source
Directory file
\usrVsap\SMHSYS\gl0baftSMFILE_OUT8OUND
Target
Directory file
lusr\sap'SM1lSYS\global\SMFiLE_iNBOUND
Recipient
Partner number ZSH2
Partner Type LS
Partner Role
mi n u s Message type
vananl
Function O T e s t
Port SHFlLfl
Figure 3.12 Transfer Data in Sending System
6 0
Processing Status Files | 3 . 3
On t h e Reci pi ent t ab page, y o u e n t e r par t t wo o f t h e i n f o r ma t i o n r e qui r e d
t o o v e r r i d e t h e c o n t r o l r e cor d (sec Fi gur e 3. 13) . I Docs g e n e r a t e d us i ng
Tr a ns act i on WF. 12 al s o o b t a i n t h e val ue 74: Inbound IDoc f r o m test trans
action as t h e i r f i r st s t at us , s o t h a t i t ' s a l wa ys cl ear t h a t t h e y a r e f or t est
p u r p o s e s onl y.
Modification o f Outbound File T ri ggering Inbound Procg
Directory * file
lusr\$ap\SMHSYSlfllObanSMFILE_OUT0OUND
Target
Di rectory * t i l e
\usr\sapXSMUSYSlglobanSMFlLE_lNBOUND
Port Sf t p s m ] g )
F i g u r e 3.13 Transfer D a t a i n Receiving System
You n o w k n o w all o f t h e o p t i o n s avai l abl e f o r g e n e r a t i n g IDocs f r o m test
t r ans a c t i ons . In t h e n e x t s e c t i on, we ' l l t u r n o u r a t t e n t i o n t o s t a t us files,
wh i c h a l s o h a v e s o m e g o o d t e s t o p t i o n s .
3.3 Processing Status Files
I Doc p r o c e s s i n g is a l wa y s a n a s y n c h r o n o u s pr oc e s s , w h i c h me a n s
t ha t , i f n o f u r t h e r a c t i o n is t a k e n , y o u d o n ' t r e c e i ve a n y i n f o r ma t i o n
C h a n g i n g t h e
r ec eiv er
6 1
3 | Test Tools
a b o u t w h e t h e r o r n o t t h e p a r t n e r has successf ul l y pr oc e s s e d y o u r IDoc.
Howe ver , b e c a u s e t hi s i n f o r ma t i o n is f r e q u e n t l y r e q u i r e d , t h e r e ar c var i
ou s wa ys i n whi c h y o u r p a r t n e r can ma k e t hi s i n f o r ma t i o n avai l abl e to
y o u .
" s t a t u s " a n d On e o f t h e s e o p t i o n s , wh i c h is f r e q u e n t l y u s e d b y EDI s u b s y s t e ms ,
"SYSTAT01" i nvol ve s r e s e n d i n g an I Doc w i t h me s s a ge t y p e STATUS a n d IDoc t y p e
SY STAT01 a l o n g wi t h an IDoc s t a t us file. Nor mal l y, t h e s e n d e r d o e s n t
k n o w i f t h e r e c e i ve r was a bl e t o successf ul l y pr oc e s s i t s IDoc. Howe ver ,
t he r e c e i ve r c a n us e a s t a t us file o r s t a t u s IDoc t o ma k e t hi s i n f o r ma t i o n
avai l abl e t o t h e s e nde r . Th e s t a t us IDoc wi l l be d e s c r i b e d in g r e a t e r det ai l
i n C h a p t e r 5, Sect i on 5. 2, STATUS IDocs. Test i ng c o n c e r n s t h e s t a t us file
only.
Fi gur e 3 . 1 4 s h o ws t h e s t a t us val ues o f a n IDoc t h a t ha s al r e a dy b e e n d i s
p a t c h e d . Thi s IDoc wi l l be o u r s t a r t i ng p o i n t f or t e s t i ng s t a t us files. The
s t a t us val ues 01: IDoc generated, 30: IDoc ready f o r dispatch (ALE service),
a n d 03: Data passed to port OK ar e t h e s t a t us val ues t h a t a n IDoc mu s t
r ecei ve a t l east o n c e so t h a t i t can b e d i s p a t c h e d successful l y. In a d d i
t i on, s t a t us 42 speci f i cs t h a t t h e t e s t t r a ns a c t i on ha s s ucc es s f ul l y cr e a t e d
t he IDoc. Because IDocs can a l s o b e v i e we d b y a u d i t i n g a u t h o r i t i e s , i f
r e q u i r e d , i t mu s t be c l e a r t h a t a n IDoc is e i t h e r "real " o r has b e e n c r e
a t e d f o r t e s t p u r p o s e s . SAP us e s s t a t us val ue 42 t o t ake t hi s s i t u a t i o n i nt o
a c count .
I Doc display_______________________
* i ( U IDoc 0 0 0 0 0 0 0 0 0 0 7 6 8 7 5 9
0 Control Rec
D a t a records
C 3 St at us records
l> [ 3 03
30
01
P Q 42
To t a l number: 0 0 0 0 0 8
D a t a p a s s e d to port OK
I Doc ready for di spatch (ALE service)
I Doc generate d
I Doc w a s creat ed by te s t transaction
T e c hnic a l s h o r l info
Di r ect io n 1 Outbox
Cu rr en t stat us 0 3 C C O
B a s i c type h a t m a s o s
Extension
M e s s a g e type HATMAS
P a rt n e r N o . _ ZS M
P a r t n T y p e LS
P o rt SAPSN1
F i g u r e 3.14 St a t u s Values o f an I D o c C r eat ed U s i n g T rans act ion W E 19
62
Processing Status Files | 3 . 3
Wh e n t es t i ng a s t a t u s file, t h e first s t e p is t o cr eat e a s t a t u s file i n Tr ans
ac t i on WE1 8 . The s y s t e m p r o p o s e s c e r t a i n d e f a u l t val ues t h a t ar e us ed
w h e n c r e a t i n g a s t a t us file, f o r e xa mpl e , 05: Error During Translation (see
Fi gur e 3. 15) . You c a n e d i t t h e s e s t a t us val ues a n d a d d n e w val ues, i f
r equi r ed.
Generate test status file for outbound IDocs
q <*
I D o c n u m b e r 7 6 8 7 4 5
P a r t n e r N u m b e r SALES S a l e s s y s t e m ( c l i e n t 8 1 0 )
P a rt n . T y p e LS L o g i c a l s y s t e m
P a r t n e r R o l e
M e s s a g e type MATMAS| M a t e r i a l m a s t e r
M e s s a g e V a r i a n t
M e s s funct io n T e s t i n di cato r
S t a t u sTDate T i m e D o c n u m b e r S t a t u s text
05 [08/ 17/ 2008 [2 0 : 27: 50 0000000000768745 E r r o r D u r i n g T r a n s l a t i o n
06 |08/ 17/2008 2 0 : 27: 58 0000000000768745 T r a n s l a t i o n O K
09 08/ 17/2008 2 0 : 27: 50 0000000000768745 E r r o r dur i n g i n t e r c h a n g e h a n d l i n g
10 08/ 17/2008 2 0 : 27: 50 0000000000768745 n t e r c h a n g e h a n d l i n g O K
11 j08/ 17/ 2008 |2 0 : 2 7 : 50 0000000000768745 E r r o r dur i n g d i s p a t c h
12 08/ 17/ 2008 2 0 : 27: 50 0000000000768745 D i s p a t c h O K
F i g u r e 3.15 C r e a t i n g a Status File
T h e s t a t u s val ues t h e m s e l v e s a r e ma d e ava i l a bl e vi a t h e i n p u t hel p,
w h i c h c o n t a i n s al l o f t h e s t a t us val ues t h a t a r e pos s i bl e h e r e f r o m SAP's
p e r s pe c t i ve , n a me l y all val ues t h a t b e l o n g t o p r o c e s s i n g l a ye r S = e x t e r
nal s ys t e m/ EDI s u b s y s t e m. A l i st o f pos s i bl e s t a t us val ues is p r o v i d e d in
Tr a ns act i on WE47, St at us M a i n t e n a n c e ( see Fi gur e 3. 16) . Unf or t unat el y,
t h e d e s c r i pt i ve s h o r t t e x t c a n ' t b e t r a n s f e r r e d a t p r e s e n t . The r e is al so no
s e p a r a t e hel p, wh i c h me a n s t h a t y o u m u s t ma n u a l l y e n t e r t h e s h o r t t ext
i n t est Tr a ns act i on W E I 8.
C r e a t i n g a
s t a t u s f i l e
Pos s i b l e s t a t u s
values
63
3 | Test Tools
S t a t u s file
a c c o r d i n g t o y o u r
s p e c i f i c a t i o n s
Stu
"
n n d i [ 3 E 0E E E ] [ in
Stat (Description
04 Error w it h i n control information o f E D I subsystem
05 Error Du ri ng Translation
06 Trans lat ion OK
07 Error during syntax check
08 Syntax che ck OK
09 Error during interchange handling
10 nt erchan ge han dli ng OK
11 Error during dispatch
12 Dispatch OK
13 R e t r a n s m i s s i o n OK
14 nt erchan ge Ac k now le d ge m e nt positive
15 nt erchan ge Ac k now le d ge m e nt negalive
16 Functional Ac k now le d ge m e nt positive
17 Functional Ac k now le d ge m e nt negative
22 Dispatch O K a c k n o w l e d g e m e n t still due
23 Error during r etransmission
24 Control information o f E D I s u b syst em O K
36 Electronic si g n a t u r e n o t per f or med (timeout)
F i g u r e 3.16 Possible Status Values f o r t h e Status File
In t h e n e x t s t e p (see Fi gur e 3. 17) , y o u us e t h e Di r e ct or y + file fi el d to
s pec i f y w h e r e y o u w a n t t o s ave t h e n e w file, a n d y o u us e t h e St a r t Stat us
Processi ng I mme d i a t e l y flag t o speci f y w h e t h e r y o u w a n t t h e file t o be
pr oc e s s e d i mme di a t e l y. The s y s t e m t h e n cr eat es a s t a t us file accor di ng
t o y o u r s peci f i cat i ons. Your p a r t n e r c a n n o w us e t hi s file as a t e mp l a t e
f or c r e at i ng s u c h files.
S _____
G e n e r a t e te s t st at us f ile for outbound IDocs
Port
SHFI LE
Unicode____________
D i r e c t o r y * file
\usrtsap\SM2lSYSXglobal\Status_sabme_demo
s t a r t st at us processing immed iat el y
Figure 3.17 Input Values for Saving the Status File
6 4
Processing Status Files | 3 . 3
You can n o w us e Tr a ns act i on WE1 7 t o i mp o r t a s t a t us file ( t h a t y o u ' v e
c r e a t e d y o u r s e l f o r t r a n s f e r r e d f r o m a p a r t n e r ) i n t o y o u r s y s t e m. The
pa t h a n d p o r t spec i f i c at i ons c o r r e s p o n d t o t h o s e s peci f i ed i n t h e t r a n s
ac t i on s h o w n p r e v i o u s l y ( WEI 9). For t e s t p u r p o s e s , it d o e s n ' t ma t t e r i f
y o u ' v e c r e a t e d t h e file y o u r s e l f o r i f t h e file ha s b e e n t r a n s f e r r e d f r o m a
pa r t n e r . In a d d i t i o n t o y o u r pr e v i o u s s t a t us val ues, t h e IDoc a l s o ge t s t he
n e w s t a t u s val ues f r o m t h e s t a t us file. Fi gur e 3 . 1 8 s h o ws t h e o u t c o me
wh e n y o u us e t he d a t a e n t e r e d i n Tr a ns act i on WE18.
IDoc di spl ay |
^ d I Doc 0 0 0 0 0 0 0 0 0 0 7 6 8 7 5 9
Control Rec.
P D a t a records
^ < 3 St at us records
Total n u m b e r 0 0 0 0 0 8
( H 12 D i spa tch O K
11 Error during dispatch
0 10 Interchange han dli ng OK
Q 09 Error during Inte rc hange handling
06 Trans lat ion OK
GD 05 Error During Trans lat ion
p GD 03 D a t a p a s s e d to port OK
0 30 I Doc ready for di spatch (ALE service)
Q 01 I Doc gen erate d
P 0 42 I Doc w a s creat ed by t e s t transaction
F i g u r e 3.18 St a t u s Values o f I D o c A f t e r I m p o r t i n g t h e Status File
As y o u c a n see, t h e s t a t u s val ues i n Fi gur e 3 . 1 8 ar e s uccess a n d fail ure
st a t us va l ue s . No t e t h a t , i n t h e case o f e r r o r me s s age s , y o u can t r i g
g e r e r r o r wo r k f l o ws ( e r r o r Tr a ns act i on EDIS) agai n, a n d t h e IDoc ma y
g e t a s t a t us t h a t makes i t r e a dy- f or - di s pat ch agai n. The l ast or i gi nal s t a
t us ( 03: Da t a p a s s e d t o p o r t OK) is a s t a t u s v a l u e t h a t d o e s n t a l l o w
t h e IDoc t o b e d i s p a t c h e d agai n. T h e o p t i o n o f u s i n g t h e n e w s t a t us
va l u e t o r e s c h e d u l e a n I Doc is o f t e n t h e r e a s o n w h y s u c h s t a t u s val
ue s ar e e x c h a n g e d w i t h a n EDI s u b s y s t e m o r a n o t h e r p a r t n e r . As far
as t h e SAP s y s t e m is c o n c e r n e d , t h e r e ar e n o p r o b l e ms o n c e an IDoc is
d i s p a t c h e d successful l y. Con s e q u e n t l y , t h e r e is no n e e d t o di s pa t c h t he
IDoc agai n. I f t h e r e cei vi ng s y s t e m e x p e r i e n c e s s e r i o u s e r r or s a n d nee ds
t h e I Doc agai n, i t mu s t i n f o r m t h e s e n d i n g s ys t em. Wi t h o u t t h e us e o f
st a t us IDocs o r s t a t u s files, i t w o u l d n o t b e p o s s i b l e t o s u b s e q u e n t l y
assi gn a n e w s t a t us t o IDocs t h a t h a v e b e e n successf ul l y pr oc e s s e d i n t he
SAP s ys t em.
I m p o r t i n g t h e
s t a t u s f i l e
Response t o
s t a t u s values
65
3 | Test Tools
3.4 Summary
In t hi s cha pt e r , y o u l e a r n e d a b o u t t est t ool s. Now, y o u s h o u l d be a bl e to
t est t h e IDoc c o n n e c t i o n s t h a t y o u wo u l d l i ke t o us e wi t h y o u r p a r t n e r s
w i t h o u t h a vi ng t o i nvol ve t h e p a r t n e r s . De p e n d i n g o n t he d i r e c t i o n o f
t h e I Doc ( i n b o u n d o r o u t b o u n d ) , y o u ca n fi gure o u t t h e t e s t t ool t h a t fits
y o u r n e e d s best . You al so l e a r n e d h o w s t a t us h a n d l i n g c a n b e t e s t e d as
n e e d e d . By k n o wi n g t h a t t h e s t a n d a r d pr ocess wo r k s as necessar y, we
can mo v e o n t o t h e a d o p t i o n o f spec i a l n e e d s t o t h e SAP S t a n d a r d IDocs,
i n C h a p t e r 4.
6 6
So f a r , t h i s book has described t h e use o f SAP-provided IDocs. In
this chapter, y o u ' l l learn h o w y o u can customize these IDocs with
options ranging f r o m s l i g h t Customizing a d j u s t m e n t s to complex
custom developments integrated i n t o exits.
4 Changes to IDocs
The SAP- pr ovi ded s t a n d a r d IDoc t ypes ( whi ch ar e al so cal l ed basi c t ypes)
c o n s i d e r fi el ds t h a t ar e i n c l u d e d i n t h e SAP s t a n d a r d a n d r e l e v a n t f o r t h e
c o r r e s p o n d i n g s c e n a r i o . Thi s ma y n o t b e suf f i ci ent f o r t h e pr ocess y o u
w a n t t o p r o v i d e , p a r t i c u l a r l y i f c us t ome r - s pe c i f i c e n h a n c e m e n t s have
b e e n i m p l e m e n t e d i n t h e a p p l i c a t i o n t r a n s a c t i o n s , wh i c h a r c c o r r e
s p o n d i n g t o t h e IDoc t ypes . Cons e que nt l y, t h e r e ar e va r i ous o p t i o n s for
cha ngi ng IDocs t h a t a p p l y t o b o t h t h e d a t a v o l u me a n d t h e da t a c o n t e n t .
You can e v e n c o mp l e t e l y s u p p r e s s t h e g e n e r a t i o n o f IDocs u n d e r ce r t ai n
ci r c umst a nces . Th e c h a n g e s c a n be ma d e vi a Cus t omi z i ng as wel l as by
us i ng t h e e n t i r e r a n g e o f e n h a n c e m e n t t e c h n o l o g i e s p r o v i d e d by SAP,
wh i c h ar e i n t r o d u c e d i n t hi s c ha pt e r . Let' s s t a r t w i t h t h e Cus t omi zi ng,
wh i c h r e q u i r e s t h e l eas t i nt e r f e r e nc e .
4.1 Customizing
Cus t omi z i ng p r o v i d e s s eve r al o p t i o n s f o r s u p p r e s s i n g pa r t s o f IDocs o r
e n t i r e IDocs a n d pr oc e s s i ng c o n t e n t o f IDocs u s i n g r ul es. Cus t omi zi ng
t h r o u g h f i l t eri ng a n d c o n v e r s i o n is u s e d mo s t o f t e n a n d can be i mp l e
m e n t e d r e l a t i ve l y easily, wh i c h is w h y it' s i n t r o d u c e d first.
4.1.1 Filtering Using Filter Objects
You can c onf i gur e f i l t eri ng wi t h f i l t e r objects i n Tr a ns act i on BD64 i n t he
c u s t o me r d i s t r i b u t i o n mo d e l . I f SAP p r o v i d e s t hes e, y o u can s e l e c t fi l t er
obj ect s a n d assi gn val ues t o t h e m f o r a n y o b j e c t t h a t is avai l abl e i n a c us
t o m e r d i s t r i b u t i o n mo d e l vi ew. Each f i l t er o b j e c t c o r r e s p o n d s t o a field.
Changes t o t h e
s t a n d a r d v e r s i o n
F i l t e r o b j e c t s
67
4 | Changes to IDocs
F i l t e r g r o u p s
P o s i t i v e f i l t e r i n g
S u p p r e s s i n g I Docs
u s i n g f i l t e r s
You c a n al so c o m b i n e f i l t er obj ect s. In t hi s case, AND as wel l as OR l i nks
o f mu l t i p l e fi el ds ar c feasi bl e. The d i s t r i b u t i o n mo d e l d i r e c t l y i ndi cat es
i f a mes s age t y p e c o n t a i n s f i l t er obj ect s (see Fi gur e 4. 1).
C h a n g e D i s t r i b u t i o n M o d el
Sy ste m Vi e w ^ Filter m o d e l di spl ay Cr e a te m o d e l view
Distribution Model | De s c r i p t i o n / t e c h n i c a l n am e
^ Model views
^ S z s m _ v e w ZSM_VIEW
^ 0 S a b i n e s D e m o Sy ste m 1 ZSMt
^ 0 S a b i n e s D e m o Sy ste m 2 ZSM2
^ 0 MATMAS Materi al m a s t e r
N o filter set
F i g u r e 4.1 D i s t r i b u t i o n M o d e l W i t h o u t F i l t e r i n g
I f fi l t er obj ect s a r c avai l abl e, y o u can cr eat e f i l t e r groups f o r t h e r espect i ve
me s s a ge t ype. Your s et t i ngs al ways r e f e r t o a c o mb i n a t i o n o f s e n d e r a n d
recei ver , so y o u c a n d e c i d e f o r each s e n d i n g o r r ecei vi ng s ys t e m i f fi l t er
i ng wi l l be i m p l e m e n t e d o r not . Fi gur e 4 . 2 s h o ws a n e x a mp l e w i t h t wo
fi l t er g r o u p s , w h e r e each fi l t er g r o u p i ncl udes t w o f i l t er obj ect s (Mat eri al
Gr o u p a n d Pl a n t as wel l as Ma t e r i a l Gr o u p a n d Di vi si on) t h a t cont a i n
t wo v a l u e i ns t a nc e s each. The l i nk is d e s i g n e d so t h a t t h e c o n d i t i o n s o f
o n e or t h e o t h e r f i l t er g r o u p m u s t be me t . I f c o n d i t i o n s f o r mu l t i p l e fi l t er
obj ect s ar e speci f i ed wi t h i n t h e f i l t er gr oup, all c o n d i t i o n s mu s t b e met .
Wi t h i n a f i l t er o bj ect , o n e c o n d i t i o n mu s t b e met .
I f a f i l t er o b j e c t b e l o n g s t o an o p t i o n a l s e g m e n t o f a n IDoc, t h e sys t em
ge n e r a t e s t hi s s e g me n t i f t h e f i l t er val ue is me t ; t he s ys t e m d o e s n ' t g e n e r
at e t h e s e g m e n t i f t h e f i l t er v a l u e i s n ' t me t . In t h e e x a mp l e f r om Fi gure
4 . 2 wi t h pl ant s 1 000, 2 0 0 0 , 3 0 0 0 , a n d 4 0 0 0 a s s i g n e d t o a mat er i a l , t he
s y s t e m w o u l d g e n e r a t e t wo E1MARCM s e g me n t s f or t h e fi rst fi l t er gr oup,
t h a t is, t h e s e g me n t s w i t h p l a nt s 1 0 0 0 a n d 2 0 0 0 , a n d w o u l d s up p r e s s
t he o t h e r t w o s e g me n t s .
I f a fi l t er o b j e c t b e l o n g s t o a field i n a m a n d a t o i y s e g me n t , t h e s ys t e m
s u p p r e s s e s t he e n t i r e IDoc i f i t c a n ' t g e n e r a t e t h e s e g me n t . In o u r e x a m
pl e, t h e s ys t e m w o u l d g e n e r a t e IDocs f o r ma t e r i a l s w i t h t h e FERT a n d
h a w a ma t e r i a l t ypes; f or t h e h a l b ma t e r i a l t ype, it w o u l d s u p p r e s s t he
IDoc c ompl et el y. Fo r a ma t e r i a l ( i n d e p e n d e n t o f t h e ma t e r i a l t y p e a n d
6 8
C u s t o m i z i n g | 4 . 1
pl ant ) t h a t b e l o n g s t o t he 002 o r 001 ma t e r i a l g r o u p a n d 01 o r 10 di vi
s i o n , t h e s y s t e m w o u l d g e n e r a t e a c o mp l e t e IDoc ac cor di ng t o t h e rul es
o f t h e s e c o n d fi l t er g r oup.
Display Distribution Model
0 | | - h Q System Vi e w V Filter model display
Distribution Model [Description/technical name
^ Model views
" ZSM_V1EW ZS M_Y EW
0 Sabines Demo System 1 ZSM1
^ @ Sa bine s De m o System 2 ZSM2
^ MATMAS Material master
S } Data filter active
^ l ^ | Filter group
^ Q ) Material Group Material Group
( U f e r t No short text maintained
[ 3-H AWA No short text maintained
^ Q ) Plant Plant
^ 1 0 0 0 W e r k Hamburg
[S' 2000 H e a th ro w / H a y e s
^ ! Filter group
^ Q j Material Group Material Group
S ' 001 Metal processing
S 002 Electronics
^ Q ) Division DMsion
U O I No short text maintained
1 0 No short text maintained
F i g u r e 4 . 2 D i s t r i b u t i o n M o d e l w i t h F i l t e r i n g Using Standard F i l t e r O b je c t s
Fo r me s s a ge t y p e s t h a t b e l o n g t o a n o b j e c t t y p e t h a t a l l ows f o r classifica- F i l t e r o b j e c t " c l a s s
t i o n . y o u can al so f i l t er by cl ass me mb e r s h i p . W h e t h e r t h i s is pos s i bl e is
d e s c r i b e d i n Tr a ns act i on BD60, wh i c h y o u al r e a dy k n o w f r om Ch a p t e r
2, Sect i on 2 . 1 . 1 , Sha r e d M a s t e r Da t a Tool. Fi gur e 4 . 3 di spl ays a p a r t o f
Tr a ns act i on BD60 s h o wi n g t he s e t t i ngs f o r t h e MATMAS mat er i al ma s t e r
me s s a ge t ype. The s e s e t t i ngs a r e i m p l e m e n t e d by t h e d e v e l o p e r o f t he
me s s a ge t y p e b e c a u s e t hi s is t h e o n l y p e r s o n w h o k n o w s i f a n a p p r o p r i
at e cl assi fi cat i on o b j e c t is avai l abl e.
C l a s s i f i a b l e Object
A L E Object Type
F i g u r e 4- 3 T rans act ion BD60
6 9
4 | Changes to IDocs
I f f i l t eri ng by cl assi fi cat i on is pos s i bl e , t hi s is i ndi c a t e d i n t h e fi l t er g r o u p
as a speci f i c f i l t er o bj ect , na me l y, D e p e n d e n t o n Cl ass M e m b e r s h i p (see
Fi gur e 4. 4) . Howe ve r , t h e c o r r e s p o n d i n g f i l t er me c h a n i s m is o n l y act i
v a t e d h e r e . For a c t ua l l y u s i n g t h e fi l t er i ng, f u r t h e r s t e p s n e e d t o be
p e r f o r me d .
D i s p l a y D i s t r i b u t i o n M o d e l
' y Q * System view ] ^ Fine* model display [ ~
[Dlslnbulion Model |Descrtpt>onr technical name (Business object
Model
^ ZSM_VEW ZSM_V)EW
^ @ Sabines Demo System 1 ZSMt
" g j Sabines Demo System 2 ZSM2
~ matmas Material master
v ^ Data (liter active
^ I Filter group
f f f l Dependent on class membership Requires classes l o be def ned in the sending system p ) Dependent on class membership
F i g u r e 4 . 4 F i l t e r i n g b y Class M e m b e r s h i p
In gene r al , y o u can ma i n t a i n t h e c u s t o m e r d i s t r i b u t i o n mo d e l i n b o t h
t he s e n d i n g a n d t h e r e cei vi ng s y s t e m. All s e t t i ngs t h a t ar e ne c e s s a r y f or
f i l t er i ng, h o we v e r , m u s t b e ma d e i n t h e s e n d i n g s y s t e m b e c a u s e t hi s
s ys t e m is n o t s u p p o s e d t o s e n d u n w a n t e d I Docs at all.
D i s t r i b u t i o n Fi r st o f all, y o u m u s t c r e a t e an a p p r o p r i a t e cl ass t y p e . You c a n d o t hi s
class t y p e u s i ng Tr a ns a c t i on 0 1 CL. You h a v e t o as s i gn t h e cl ass t y p e t o t h e c o r
r e s p o n d i n g t abl e i n Tr a ns act i on BD60. In o u r ma t e r i a l m a s t e r e xa mpl e ,
t hi s wo u l d b e Tabl e MARA. F u r t h e r mo r e , y o u m u s t i d e n t i f y t h e cl ass t ype
as a d i s t r i b u t i o n cl ass t y p e us i ng t h e Di s t r i b u t i o n Class Type che ckbox
i n t h e F u n c t i o n s t a b. The r e mu s t b e o n l y o n e d i s t r i b u t i o n cl ass t y p e f or
each cl assi fi abl e obj ect , wh i c h s h o u l d n ' t b e t h e s t a n d a r d cl ass t y p e . The
s ys t e m al ways p r o p o s e s t h e s t a n d a r d cl ass t y p e i f a cl ass is u s e d f o r t hi s
obj ect . Howe ve r , t hi s d i s t r i b u t i o n cl ass t y p e is l ess o f t e n u s e d t h a n t he
class t y p e s f o r fi ndi ng obj ect s by cl assi fi cat ion, so, y o u s h o u l d n ' t def i ne it
as t h e s t a n d a r d cl ass t y p e . You c a n m a i n t a i n t h e r e ma i n i n g fi el ds a c c o r d
i ng t o y o u r c o m m o n e n t e r p r i s e r e gul at i ons; t h e s e fields a r e n t r e l e va nt
f o r t h e d i s t r i b u t i o n , a n d s o me o f t h e m c a n t be s e l ec t ed anyway. Fi gure
4 . 5 s h o ws a n e x a mp l e o f t he i nput .
70
Customizing | 4 . 1
Change View "Class Types": Details
^ C ] Object Table
^ Q Class Types
Q Objects
Q Class Status
C ] Organizational Areas
D T e r t Types
Classification Status
C ] Functions/Filters for Finding Ob)ects
Class Type
Object /
Table
ZSH Us t s for material distnbution (ALE)
Screens / Functions /
E Keywords Standard Cl a s s Type
C Characteristics 0 Multiple classification
C Documents Cl ass, in master rec
C Texts V a r i a n t c la s s ftpe
C Standards data Multiple obi s allowed
Cl a s s node
Ciassificatons / 0 D i s t r class type
C E C H f l i m e ) Hierarchy allowed
C ECH (parameter) Generated tables
C Change Docs
F i g u r e 4 . 5 Pr o p e rt i e s o f t h e D i s t r i b u t i o n Class Type
Fo r e a c h cl ass t ype, y o u c a n s pec i f y d i f f e r e n t s t a t us val ues, w h i c h t h e Status values
classes o f t hi s cl ass t y p e can a d o p t (see Fi gur e 4. 6). Fo r t h e me r e di s t r i bu- of classes
t i on, t h e 1: Rel eased s t a t us is r equi r ed. W h e t h e r y o u n e e d t o assi gn f u r
t h e r st at us d e p e n d s o n y o u r e n t e r p r i s e r egul at i ons . The 1: Rel eased st at us
is nec es s ar y t o us e a cl ass as a c r i t e r i o n f o r d i s t r i b u t i o n . Fi gure 4 . 6 di s
pl ays t wo a ddi t i ona l s t a t us val ues t h a t ar c f r e q u e n t l y us ed: 0: In cr cat i on
a n d 2: Bl ocked. Because b o t h d o n ' t al l ow f o r a s s i g n me n t s o f obj ect s, y o u
d o n t use t h e m f or di s t r i b u t i o n cl asses. SAP pr ovi des t h e m f or t he ma t e
rial ma s t e r d i s t r i b u t i o n class t ype, so t h e y ar e di s pl ayed he r e as well.
Change View "Class Status": Overview
Dialog Structure
Q ] Object Table
Ty
2SH
S iTert
lin creation
Q Obiects
Q j Class Status
-
zsn
Released
Blocked
C ] T e i l Types
C l Classification Slatus
Q Functi ons^liters for Finding Objects
Figure 4.6 Status Values of the Distribution Class Type
71
4 | Changes to IDocs
Same c l a s s i f i c a t i o n
A s s i g n i n g t o
t h e p a r t n e r
Due t o t h e pr e v i o u s wo r k , y o u c a n n o w c r e a t e a cl ass i n a r el eas ed st a
t us t h a t b e l o n g s t o t h e d i s t r i b u t i o n cl ass t y p e u s i n g Tr a ns act i on CL02.
You mu s t sel ect t he D o N o r C h e c k o p t i o n f o r Sa m e C l a s s i f i c a t i o n (see
Fi gur e 4. 7) . The che c k act ual l y e n s u r e s t h a t t wo obj ect s w i t h t h e s a me
v a l u e s a s s i g n e d t o t h e i r cha r a c t e r i s t i c s c a n t b e a s s i g n e d t o t h e s a me
class. Howe ver , bec aus e d i s t r i b u t i o n cl asses d o n t i nvol ve char act er i s t i c
v a l u e a s s i g n me n t s , t h e s e c o n d a s s i g n e d o b j e c t al r e a dy e nt a i l s mul t i pl e
cl assi fi cat i on ( t wo obj ect s wi t h exact l y t h e s a me pr ope r t i e s ) , so a check
i s n t w a n t e d her e.
5*3] Cr eat e Cl ass:
1 Change Language
Class
Class tn>e
Change Number
valid from
ZSHLISTIN6.ALE
ZSH Lists for material distribution (ALE)
E50 GJEE
08/ 17/ 2009 Validity
Keywords
Status
Class group
Organizational area
Valid From
Same classification / ~ Authorizationsf
Do not check Class maintenance
O w a r ni ng message Classification
O Check vrtth error Find object
F i gu r e 4.7 Cr e at i n g a D i s t r i b u t i o n Cl ass
You c a n n o w a s s i gn s u c h a d i s t r i b u t i o n cl ass t o a p a r t n e r u s i n g Transac
t i on BD68 (see Fi gure 4. 8). Def i ne t h e r e cei vi ng s ys t e m as t he Logical
Syst em. In t h e PoP field, a l wa y s e n t e r "2" f o r p u s h b e c a u s e y o u w a n t t o
s e n d obj ect s. Now, i t ' s n o l o n g e r pos s i bl e t o s e n d o b j e c t s t o t h e p a r t
ne r s t hat h a v e n ' t b e e n a s s i gned t o t he c o r r e s p o n d i n g cl ass i n Transact i on
CL20N. The IDoc f or an o b j e c t t h a t h a s n ' t b e e n a s s i g n e d t o a cl ass (e.g. ,
mat er i al ) is s u p p r e s s e d c o mp l e t e l y a n d wi l l n e v e r be d i s p l a y e d i n Tr ans
ac t i on BD87, IDoc mo n i t o r i n g .
72
Customizing | 4 . 1
You can al so assi gn mu l t i p l e cl asses t o t h e s a me r e cei vi ng s y s t e m. No
set t i ngs h a v e t o b e ma d e o n t h e r e c e i ve r s i d e i n t hi s case. The pul l f u n c
t i ona l i t y ("1") i s n ' t u s e d f o r ALE c o mmu n i c a t i o n .
Change View "Classes in Logical System": Overview
V New Entries] f c 5 | ^ | B B
Logical System ZSH2
Classes in Logical System
message Type Class |PoP I E
HATHAS ZSMIISTING.AIE 2 0
I S
^ F u n c t i o n o n h s l "Push* o r ' P u i r (4) 2 Entrie D E I /
1 o 1 8 0 1 3 6 1 H 1 I Q -
>ush<PuH S h o r t Descript.
Function Puir
Function "Push-
Fi g u r e 4 - 8 As s i g n i n g t h e D i s t r i b u t i o n Cl ass t o t h e Par t ner Syst em
Thi s f i l t eri ng e n a b l e s y o u t o s e n d t he da t a t o t h e p a r t n e r s ys t em. De p e n d
i ng o n t h e s y s t e m' s f un c t i o n , t hi s d a t a is r e l e v a n t t h e r e . Fo r e xa mpl e , i f
y o u have a speci al d i s t r i b u t i o n ce nt e r , y o u p r o b a b l y o n l y w a n t t o s end
t r adi ng g o o d s (HAWA mat er i al t ype) t o t h e c o r r e s p o n d i n g w a r e h o u s e m a n
a g e m e n t s ys t e m; i f y o u w o r k wi t h a c e n t r a l ma s t e r d a t a s y s t e m, a n d
eve r y pl a nt uses its o w n SAP s y s t e m, each s y s t e m s h o u l d b e p r o v i d e d
wi t h t h e ma t e r i a l d a t a f or i t s p l a n t onl y.
4.1.2 Custom Filter Objects
The f i l t eri ng o p t i o n s de s c r i b e d so f a r ar c d e l i v e r e d by SAP. I f y o u have
addi t i ona l r e q u i r e me n t s , y o u can a l s o c r e a t e c u s t o m fi l t er obj e c t s . This
can be d o n e n o t o n l y f or s t a n d a r d SAP fields a n d s e g me n t s b u t a l s o for
fi el ds i n c u s t o m t abl es, f o r t abl e a p p e n d s , o r f o r c u s t o m s e g me n t s . Fil t er
i ng by fi l t er obj ect s is an ALE ser vi ce.
You i mp l e me n t t h e ne c e s s a r y s e t t i n g s i n Tr a ns act i on BD95. First, assi gn
a n a me t o t h e f i l t er o b j e c t . Thi s n a m e m u s t m e e t t h e c o m m o n c us
t o m e r n a me s p a c e r ul es , t h a t is, b e g i n wi t h Z o r Y o r y o u r o w n c u s t o me r
na me s p a c e . In o u r e xa mpl e , t h e n a me is ZBI SMAT (see Fi gur e 4. 9) . Assi gn
t h e t a bl e (MARA) a n d t h e field i n t h e da t a b a s e ( BI SMT) t o t hi s name.
A s s i g n i n g m u l t i p l e
cl asses
C r e a t i n g f i l t e r
o b j e c t s
73
4 | Changes to IDocs
ALE O bjec t Type
I a l E O bjec t Type j T a b i e N a m e i F iel d nam e
jZBISMAT IhARA I b i s h t
Fi g u r e 4 . 9 Cr e at i n g a Cu s t o m F i l t er Ob j e c t
To i m p l e m e n t t h a t y o u r fi l t er o b j e c t is act ual l y u s e d i n t h e ALE ser vi ces,
y o u m u s t d e f i n e i n whi c h s e g me n t s o f wh i c h me s s a ge t y p e s it c a n be
us ed. Fo r t hi s p u r p o s e , fi rst s e l e c t a me s s a ge t y p e as t h e wo r k a r e a in
Tr a ns act i on BD59. Fi gur e 4 . 1 0 s h o ws t hi s f o r t h e mat er i al ma s t e r e x a m
ple, t h a t is, f o r t h e MATMAS me s s a ge t y p e as t h e wo r k area.
Maintain Table Views: Initial Screen
( * ] Find M ain ten ance Dialog
S ' D e te r m i n e Wo r k Axea: Entry
0 /
W o r k Area
M e s s a g e Type MATMAS
0
< s ? \ [ Further s e l e c t cond. A p pend ^
Fi g u r e 4.10 As s i g n i n g t h e Cu s t o m F i l t er O b j e c t t o t h e Mes s age Type St ep 1
Then, s e l e c t t h e s e g m e n t o f t h e me s s a ge t y p e i n wh i c h y o u w a n t t o carry
o u t t h e f i l t eri ng (see Fi gur e 4. 11) . I n o u r e x a mp l e , t hi s is t h e E1MARAM
s e g me n t . You c a n n o w a d d r e s s all fi el ds o f t hi s s e g m e n t t o g e n e r a t e y o u r
p e r s ona l fi l t er obj ect .
New Entries: Overview of Added Entries
i *
S i l l
M e s s a g e Typ e MATMAS
As s i g n m e n t o f Object Typ e to M e s s a g e
ALE O bjec t Typ e ( s e g m t y p e [n o :ieid | o i t s e t (intLength
ZBISMAT E1NARAM |1 6I SMT

Figure 4.11 Assigning the Custom Filter Object to the Message Type Step 2
74
Customizing | 4 . 1
Wh e n as s i gni ng t h e fi l t er obj ect , t h e s y s t e m a u t oma t i c a l l y d e t e r mi n e s
w h e r e i n t h e d a t a r e c o r d w i t h i n t h e s e g m e n t t h e r e s p e c t i v e fi el d is
l oc a t e d. Thi s l eads t o t he Of f set ; i n o u r e x a mp l e , t h e val ue is "91. " If
y o u ' v e cr e a t e d t h e s e g m e n t t h a t c o n t a i n s t h e fi l t er o b j e c t your s e l f , a n d i f
y o u mo d i f y it so t h a t t h e po s i t i o n o f t h e c o r r e s p o n d i n g field cha nge s , t he
s ys t e m d o e s n ' t c o p y t h e n e w of f set t o y o u r f i l t er o b j e c t aut omat i cal l y. In
t hi s case, y o u have t o u p d a t e t h e n e w i n f o r ma t i o n your s e l f .
To d o t hi s, first d e t e r m i n e t he n e w of f s e t val ue, f or exa mpl e , us i ng Tr ans
ac t i on WE60, t h e IDoc d o c u m e n t a t i o n . Th e n , sel ect y o u r fi l t er obj ect ,
a n d c h o o s e E d i t C h a n g e F i e l d C o n t e n t i n t h e me n u . Th r e e s e t t i ng
op t i o n s a r e avai l abl e:
Fi el d Na me
I n t e r n a l Lengt h
Tabl e Posi t i on
First, sel ect Tabl e Posi t i on, a n d sel ect t h e p r e v i o u s l y d e t e r m i n e d of f set
va l ue . I f t h e l e n g t h o f t h e fi l t er fi el ds ha s c h a n g e d , t oo, y o u can a d a p t
t h e c o r r e s p o n d i n g val ues i n t h e s a me wa y vi a I nt er nal Lengt h. I f t he field
n a me ha s c h a n g e d , t h e s y s t e m fi nds t h e n e w v a l u e aut omat i cal l y.
Af t e r y o u ' v e i mp l e me n t e d t h e s e s et t i ngs , t h e s y s t e m p r o v i d e s y o u r cr e
a t e d f i l t er o b j e c t i n t h e c u s t o me r d i s t r i b u t i o n mo d e l wh i c h can b e seen
i n Fi gur e 4 . 1 2 . You can us e i t l i ke a s t a n d a r d SAP f i l t er obj ect . O f cour s e,
y o u can a l s o us e t h e s a me f i l t er o b j e c t f o r mul t i pl e me s s a ge t ypes.
Display Distribution Model
^ [ 0 1 1 5 1 ^ 1 3 B l f ^ O Sy ste m V i e w ^ Filler model display del
Model | Descripti on/ techni cal nam e
^ Model views
^ $ g Z S M _ V I E W
^ 0 Sa bine s D e m o System 1
^ @ Sa bine s D e m o Sy ste m 2
^ ( Q MATMAS
^ ^ D a i a fiiler active
^ ^ Filter group
Z S M . V I E W
ZSM1
ZSM2
Material master
Q | Old material number Old m a t e n a l number
f g SABINES OLD MATERIALNUMBER N o short text maintained
Figure 4.12 Customer Distribution Model with Filtering Using Custom Filter Objects
A s s i g n i n g t h e f i l t e r
o b j e c t t o t h e I Doc
f i el d
Cu s t o mi z i n g
t h e o f f s e t
F i l t e r i n g i n t he
c u s t o m e r
d i s t r i b u t i o n mo d e l
75
4 | Changes to IDocs
C u s t o m e r s e g me n t
f o r s u p p r e s s i n g
I Docs
It ma k e s s e n s e t o p r o v i d e an i n p u t he l p f o r t h e field ( t h e SAP s ys t e m
o u t p u t s a w a r n i n g i f y o u r e f e r t o a fi el d w i t h o u t a check t a bl e f o r a fi l t er
obj ect ) .
Suppressing an IDoc
I f a f i l t er c o n d i t i o n f o r a field i s n t m e t i n a m a n d a t o r y s e g me n t , t h e sys
t e m d o e s n ' t g e n e r a t e t h e e n t i r e IDoc. You c a n i m p l e m e n t t h i s b e h a v i o r
a l s o f o r fi el ds i n o p t i o n a l s e g me n t s by c r e at i ng a c u s t o m e r s e g m e n t as
a m a n d a t o r y s e g me n t , u s i n g t h e s a me fi el d i n t hi s c u s t o m e r s e g me n t ,
a n d g e n e r a t i n g a speci f i c fi l t er o b j e c t f or it. Fo r e xa mpl e , i f y o u w a n t t he
s ys t e m t o s e n d a ma t e r i a l ma s t e r IDoc t o a p a r t i c u l a r r e c e i v e r o n l y i f a
speci f i c p l a n t is avai l abl e, y o u can i m p l e m e n t t hi s by s peci f yi ng t h e pl ant
a n d t h e n f i l t er i ng b y p l a n t i n a c u s t o m e r s e g m e n t t h a t is d e f i n e d as a
ma n d a t o r y s e g me n t a n d di r ec t l y b e l ongs t o t h e E I MA RAM s e g m e n t t ype.
The SAP s t a n d a r d f or t h e " p l a n t " f i l t er o b j e c t , i n t u r n , i nvol ve s s u p
p r e s s i ng i n a p p r o p r i a t e p l a n t s e g me n t s b u t still s e n d i n g t h e E1 MARAM s e g
m e n t t y p e a n d E 1 MAKTM s e gme nt s . Howe ver , t hi s d o e s n ' t al ways me e t t he
c u s t o m e r r e q u i r e me n t s . Sect i on 4 . 2 . 3 , Cus t om Se gme nt s , de s c r i be s h o w
y o u c a n d e f i n e c u s t o m s egment s .
Overview o f Various IDoc Filters
W h e n f i l t er i ng an I Doc u s i n g f i l t er obj e c t s , y o u c a n d e p e n d i n g on
t h e c o n t e n t o f t h e IDocs s e n d o n l y speci f i c s e g me n t s o r e v e n e nt i r e
IDocs. Th e f i l t er i ng is pos i t i ve her e: You d e f i n e w h i c h e l e me n t s c a n pass.
Wh e n r e d u c i n g IDocs, y o u can a l s o c o mpl e t e l y o m i t e n t i r e s e g me n t s a n d
s u p p r e s s i ndi vi dua l fi el ds i n t h e r e ma i n i n g s e g me n t s . Howe ve r , y o u can
usual l y r e duc e IDocs f o r ma s t e r d a t a onl y. I f y o u d o n t w a n t t o s e n d s e g
me n t s f or n o n - ma s t e r da t a f or p e r f o r ma n c e r e as ons , y o u c a n s up p r e s s
t h e m u s i n g s e g m e n t f i l t eri ng o r vi e ws . Bot h a p p r o a c h e s ar e e x p l a i n e d in
t he f ol l owi ng s ect i on.
4.1.3 Filtering Segments
W h e n s e g me n t s ar e u s e d f o r f i l t eri ng, t h e s y s t e m c o mp l e t e l y s uppr e s s e s
t h e g e n e r a t i o n o f a speci f i c s e g m e n t f o r a p a r t i c u l a r c o m b i n a t i o n o f
s e n d e r , r ecei ver , a n d me s s a ge t y p e . The c o n t e n t o f t h e s e g m e n t i s n ' t
76
Customizing | 4 . 1
r e l e v a n t h e r e . For e xa mpl e , i f y o u d o n t w a n t t o s e n d a n y p l a n t da t a o f
a ma t e r i a l t o t h e d o w n s t r e a m s y s t e m, y o u m u s t c onf i gur e t hi s vi a s e g
m e n t fi l t eri ng.
The f i l t eri ng t akes pl ace i n Cus t omi zi ng. I n Tr ansact i on B D 5 6 , y o u def i ne
t h e c o mb i n a t i o n t h a t y o u w a n t t o s u p p r e s s (see Fi gur e 4. 13) . Fo r t hi s
p u r p o s e , e n t e r "LS" f o r l ogi cal s y s t e m i n t h e t w o Type fi el ds, speci f y
t h e logical s y s t e m n a m e o f y o u r s e n d i n g s ys t e m i n t h e S e n d e r field, a n d
s peci f y t h e l ogi cal s ys t e m n a m e o f t h e r e cei vi ng s ys t e m i n t h e Recei ver
field. I n t h e case o f EDI c o mmu n i c a t i o n , t h e s peci f i cat i on i n t h e Type
field is KU" f o r c u s t o m e r o r "LI f or v e n d o r . In t hi s case, y o u m u s t also
ma i n t a i n t h e p a r t n e r rol e w h o s e v a l u e c a n be "AG f o r s o l d - t o par t y, f or
e xa mpl e . Th e S e g me n t Type field i ndi cat es t h e n a me o f t h e s e g m e n t y o u
w a n t t o s u p p r e s s . In c o n t r a s t t o r e d u c i n g IDocs a n d u s i n g fi l t er obj ect s
i n t h e c u s t o m e r d i s t r i b u t i o n mo d e l , wh i c h a l wa ys t akes pl ace i n t h e
s e n d i n g s ys t em, t h e f i l t eri ng c a n al so be i mp l e me n t e d i n t h e recei vi ng
s ys t em. Th a t me a n s t h e I Doc is t r a n s f e r r e d c o mp l e t e l y b u t n o t u p d a t e d
compl et el y. For p e r f o r ma n c e r e as ons , y o u s h o u l d o n l y conf i gur e fi l t eri ng
by s e g me n t s i n t he recei vi ng s ys t e m i f t h e s e n d i n g s ys t e m is an e xt e r na l
s ys t e m t h a t c a n t s u p p r e s s s e g me n t s itself. Th e f i l t er i ng o f s e g me n t s is
al so an ALE service.
Change View "Segment Filters": Overview
N e w Entries . [ i [5^ Q .
M e s s a g e Type MATMAS
S e g m e n t Filters
ry. Sender Func. ry [ Receiver Role ( S e g m e n t type
LS ZSH1 LS ZSM2 |E1 MARCH
1 .
Fi g u r e 4.13 F i l t er i ng a Segment
4.1.4 Reducing IDocs Through Views
Cr eat i ng a n d us i ng vi e ws is pos s i bl e f or all IDoc t ypes, b u t d o e s n ' t p r o
v i d e as m a n y f u n c t i o n s as r e d u c e d IDocs. Here, y o u c a n s e l e c t a t s e g
m e n t l evel wh i c h obj ect s y o u w a n t t o s e n d ; ho we v e r , y o u c a n n o l onger
F i l t e r i n g s e g ment s
i n t h e C u s t o mi z i n g
I D o c v i e w s
77
4 | Changes to IDocs
s u p p r e s s speci f i c fi el ds w i t h i n a s e g me n t as p r o v i d e d f o r t h e r e d u c t i o n .
The t r ans a ct i on t h a t e n a b l e s y o u t o d e f i n e t h e vi e ws is Tr ansact i on WE32.
The e x a mp l e de l i be r a t e l y c o mb i n e s a n o n - r e d u c i b l e me s s a ge t ype, t h a t
is, ORDERS, wi t h t h e ORDERS05 I Doc t y p e . For IDocs t h a t a l l o w f o r r e d u c
t i on, t hi s is us ual l y t h e m o r e p o we r f u l m e t h o d f o r c u s t o mi z i n g IDocs.
Fi gure 4 . 1 4 s h o ws t h e i ni t i al s c r e e n o f t hi s t r ans a ct i on.
Create view: ZSM1
S EDI*! U S
E1EDK01 IDoc Document h e a d e r g e n e r a l d a t a
E1EDK14 IDoc Document Header O r g a n i z a t i o n a l Data
E1EDK93 IDoc Document h e a d e r d a t e segnent
E1EDK84 IDoc Oocuent h e a d e r t a x e s
E1EDK05 IDoc Document h e a d e r c o n d i t i o n s
i n E1E0KA1 IDoc Docuent Header P a r t n e r I n f o r a a t l o n
E1EDK02 IDoc Document h e a d e r r e f e r e n c e d a t a
E1EDK17 IDoc Document Header T e r a s o f D e l i v e r y
E1EDKI8 IDoc: Document Header T e r a s o f Paynent
E1EDK35 IDoc: Document Header A d d i t i o n a l D a t a
E1E0K36 IDOC: D o c . h e a d e r payment c a r d s
i c E1E0KT1 IDoc Document Header T e x t I d e n t i f i c a t i o n
1C E1E0P01 IDoc Document I t e G ener al D a t a
U) E1CUCFG CU: C o n f i g u r a t i o n d a t a
10 E1EDL37 H a n d l i n g u n i t header
E1EDS01 IDoc Su anar y s e g a e n t g e n e r a l
Fi g u r e 4 1 4 I n i t i a l Scr een f o r Vi e ws
M a n d a t o r y Thi s m e t h o d a l s o i nvol ves s e g m e n t s t h a t ar e n e c e s s a r y f r o m t h e SAP
s e g me n t s i n v i e w s p e r s p e c t i v e a n d n e e d t o b e p a r t o f t h e vi ew. The t op- l evel o r root seg
ment ( her e: E1 EDK0 1 ) is i n d i s p e n s a b l e . You a l r e a d y k n o w t he r e a s o n f or
t hi s f r o m t he f i l t eri ng a n d r e d u c t i o n pr ocesses: I f y o u s ki p t h e t op-l evel
i t em, t h e e n t i r e IDoc d i s a p p e a r s . You c a n n o w d e f i n e wh i c h s e g me n t s
y o u w a n t t o a d d t o t h e s e g m e n t t h a t is r e q u i r e d as a m i n i m u m . Fi gure
4 . 1 5 di spl ays a c o mp l e t e vi ew.
Thi s fi gure al so s h o ws t h e a t t r i b u t e s o f t h e vi ew, i t s n a me , f o r e xa mpl e .
W h e n y o u ve d e f i n e d a s e g m e n t as r e l e v a n t f o r y o u r v i e w u s i n g t h e
me n u t h a t o p e n s w h e n y o u ri ght -cl i ck o n t h e s e g me n t , y o u can e x p a n d
i t a n d s e l e c t t h e s e g me n t s l i st ed u n d e r n e a t h t h a t y o u w a n t t o i n c l u d e in
y o u r vi ew.
78
Customizing | 4 . 1
D i s p l a y v i e w : Z S M 1
S a b i n e s ORDERS V1e
E1EDK01
-E1EDK14
E1EDK03
E1EDK04
E1EDK05
E1E0KA1
E1EDKA3
E1E0K02
E1E0K17
E1EDK18
E1E0K35
E1EDK36
m E1E0KT1
E1EDP01
-----------E1E0P02
-----------E1CUREF
-----------E l ADO!1
-----------E1EDP03
-----------E1EDP04
03 E1EDP05
-----------E1EDP20
t Q E1EDPA1
-----------E1EDP19
E1EDPA0
E1EDP17
E1EDP18
E1E0P35
E1EDPT1
E1EDC01
t f i E1CUCFG
f f) E1EDL37
---------- E1EDS01
I Do c : Document h e a d e r g e n e r a l d a t a
I Do c : Document Header O r g a n i z a t i o n a l Data
I Do c : Document h e a d e r d a t e segment
I Do c : Document h e a d e r t a x e s
I Do c : Document h e a d e r c o n d i t i o n s
I Do c : Document Header P a r t n e r I n f o r m a t i o n
IDoc: Document Header P a r t n e r I n f o r m a t i o n A d d i t i o n a l Data
I Do c : Document h e a d e r r e f e r e n c e d a t a
I Do c : Document Header Terms o f D e l i v e r y
I Do c : Document Header Terms o f Payment
I Do c : Document Header A d d i t i o n a l Data
IDOC: Do c . h e a d e r payment c a r d s
I Do c : Document Header T e x t I d e n t i f i c a t i o n
I Do c : Document I t e m G e n e r a l Data
E * Attributes fo iv ie w Z S M i
0 /
Attributes
BasicTyp
Extension
Logical Message
QRDERS05
ORDERS

Description Sabines ORDERS View


Technical Attributes
Pckg JThP
I0 H
Fi gu r e 4.15 Exampl e o f a Cu s t o m- D e f i n e d V i e w
In c o n t r a s t t o r e d u c e d IDocs wh e r e y o u g e n e r a t e a speci f i c mes s age t ype, v i e w s i n t he
y o u c o n t i n u e t o us e s t a n d a r d me s s a ge s h e r e . Con s e q u e n t l y , y o u mu s t p a r t n e r p r o f i l e
al so s pec i f y i n t h e p a r t n e r profi l es i n Tr a ns act i on WE 2 0 i f y o u w a n t to
w o r k wi t h a v i e w a n d wh i c h v i e w y o u w a n t t o us e (see Fi gur e 4. 16) .
As usual , o u r e x a mp l e us e s t h e ORDERS me s s a ge t y p e f or t h e p a r t n e r p r o
file. I n t h e de t a i l s ( O u t b o u n d O p t i o n s I D o c T y p e ) i n t h e IDoc Type
area, y o u t h e n s pec i f y ZSM1 i n t h e Vi e w f i e l d i n a d d i t i o n t o ORDERS05 in
t h e Basic Type field.
79
4 | Changes to IDocs
C h a n g i n g t he
c o n t e n t
Partner profiles: Outbound parameters
Partner No. zsm Sa bine s D e m o System 1
Partn.Type LS Logical system
Partner Role___________
M e ssag e Type ORDERS P u rc h a s e order / order
M e s s a g e code
M e s s a g e function Test
M e s s a g e Conlrol P o s t Processing Permitted Agent Tele
Receiver port
Output Mode
O Transfer IDoc Immed
Co ll ect IDocs
SHF1LE g ) File S a b i n e s Testport for F lies
O Start subsystem
Do not start subsystem
Output Mode 4
I Doc Type
m i B m Basic type
Extension
v i e w z s m
0 Ca n c e l Pr oc essi ng Alter Syntax Error
Seg. r e l e a s e in IDoc type
Purchasing/Sales
S a b i n e s O R D E R S V i e w
S e g m e n t Appl Rel
Fi g u r e 4. 16 Usi ng t h e V i e w i n t h e Par t ner Pr of i l e
Fi l t er i ng by vi e ws i s n ' t a n ALE ser vi ce, so i t c a n al so be us ed f o r IDoc
mo d u l e s f o r wh i c h ALE ser vi ces a r e dea ct i vat ed.
4.1.5 Rules
All pr e v i o u s c h a n g e s t o t h e IDocs a i m a t r e d u c i n g t h e s c o p e o f t he dat a
t h a t is s u p p o s e d t o b e t r a n s f e r r e d . Thi s is us ual l y d o n e f o r p e r f o r ma n c e
r e a s ons a n d t o r e d u c e t h e d a t a v o l u me o n t h e da t a b a s e i f t h e p a r t n e r
d o e s n ' t n e e d t h e dat a.
Of t en, h o we v e r , y o u a l s o n e e d t o c h a n g e t he act ual c o n t e n t o f an IDoc
t o e n a b l e t h e r e s pe c t i ve c o mmu n i c a t i o n p a r t n e r t o p r o c e s s it. Typical
e x a mp l e s a r c d i f f e r e n t field l e n g t h s o r a b b r e v i a t i o n s , s u c h as a d d i n g /
de l et i ng l ea di ng z e r o s o r u s i n g d i f f e r e n t c o m p a n y code s o r wa r e h o u s e
n u mb e r s . You c a n h a n d l e t h i s w i t h o u t d e v e l o p m e n t wo r k u s i n g a r ul e if
8 0
Customizing | 4 . 1
s i mpl e c o n v e r s i o n l ogi c is us ed. Fi gur e 4 . 1 7 s h o ws h o w y o u c r e a t e t he
r ul e i n Tr a ns act i on BD62 by as s i gni ng a n a m e t o i t first.
Maintain conversion rules
Conversion rule__________ {Description_________
POSTNET PostNel
ZSM1 Old Materialnumber
F i gu r e 41 7 N a m i n g t h e Rul e
W h e n as s i gni ng a n a me t o t h e r ul e, y o u al so def i ne t o wh i c h s e g me n t t he
r ul e appl i es, s o t h e s y s t e m lists all fi el ds o f t hi s s e g m e n t i f y o u ma i n t a i n
t h e act ual r ul e i n Tr a ns act i on BD79. T h e Cr eat e Pr oposal f o r Rule f u n c
t i on e n a b l e s y o u t o p r e d e f i n e t h e MOVE r ul e f o r all fi el ds, wh i c h des c r i bes
t h e pr ocess o f s i mpl y copyi ng t h e field c o n t e n t . MOVE is t h e d e f a u l t set t i ng
anyway. Fi gur e 4 . 1 8 s h o ws t h e i ni t i al s c r e e n o f t h e r ul e ma i n t e n a n c e .
ALE IDoc Segment s : Maintain Conver s i on Rul es for ZSMI
Q bi* 9 ICll Create proposal for rule
?ec field |Descripl Type Length (Ch ISenderfld Sender (Id val Constant
MSGFN Function C 3 jflSGFN
MATNR Malerial C 18 HATNR
ERSDA Created On C 8 D ERSDA
ERfJAM Created By c 12 ERNAH
LAE DA
AENAM
__L a s t Change
Changed by
c
c
8
12
LAEPA I___________ __________
AENAH
PSTAT Maint status c 15 PSTAT
-
LVORM OF client level c
c _
3
|_
LYORfl
MBRSH Industry sector 1 "BRSH
MATKL Malerial Group c 9 "ATKL
BISMT Otd matl number
c
18
D
*LE .MATERIAL
MEINS Base Unit c 3 HEINS
BSTME Older unit 0 3 n BsrnE
Fi gu r e 4.18 Rul e Ma i n t e n a n c e Ov e r v i e w
For e a c h field, y o u c a n d e f i n e h o w i t s d e t e r m i n e d f r o m t h e s o u r c e field.
Fi gur e 4 . 1 9 di s pl a ys t h e m a i n t e n a n c e m e n u u s i n g t h e MATKL field as
an exa mpl e .
I D O C s e g m e n t nam e
E1FIHDR
E1HARAM
C r e a t i n g a r ul e
81
4 | Changes to IDocs
ALE IDoc Segments: Maintain Conversion Rules for ZSM1
9 | f w ] f < l [ I W R * l f M o v e general rules
Recerver field MATKL Material Oroup
Select a rul e type
Copy se n d e r field
O Set constant
O S e t variable
O Convert sender fields
OConv erVcopy
O U s e general rule
R u l e details
Rule type Copy se n d e r field
S e n d e r Fi eld to be Transferred
Sender field
Offset
Length
Special conversion routine
S e n d e r f i el ds for conditions
S e n d e r fid [Offset fLngth JC o n J
0
E
W h a t happens with th e nonassigned/non-converted field
S e t at initial value
O Classify a s error
O Set constant
O Copy se n d e r field
Field wil l b e s e t to initial val ue (bla nk o r 0*)
Special conversion routine
U s e rule defined h er e a s general rule
General rule
Fi g u r e 4. 19 Rul e Ma i n t e n a n c e Da t a f o r a Fi el d
Rul e t y p e s T h e f o l l o wi n g r ul e t y p e s c a n b e sel ect ed:
Copy Sender Field
Th e Copy S e n d e r Fi el d r u l e t y p e is t h e MOVE copy r u l e a n d t h u s c o r
r e s p o n d s t o t h e d e f a u l t set t i ng. In t h e de t a i l s m e n u i n t h e l o w e r t r a n s
ac t i on ar ea, h o we v e r , y o u can d e p l o y o n l y a p a r t o f t h e s e n d e r field
u s i n g t h e of f set a n d l engt h.
Set Constant
I f y o u s e t a c on s t a n t , t h e s ys t e m al ways o v e r wr i t e s a n exi s t i ng val ue
wi t h t h e s a me n e w val ue.
82
Customizing | 4 . 1
Set Variable
Her e, y o u can us e a p r e d e f i n e d va r i a bl e as t h e t a r ge t val ue. I f t h e IDoc
is copi e d f r om a file i n t he i ni t i al scr een, y o u can s pec i f y t hi s var i abl e
s e pa r a t e l y f or e v e i y t r a n s f e r o f I Docs. I f y o u d o n t w o r k wi t h files,
y o u c a n us e t h e KKCD0001 SAP e n h a n c e m e n t t o s e t t h e var i abl es.
Convert Sender Fields
To c o n v e r t fields, s pec i f y a n e w v a l u e w i t h r e gar d t o t h e i ni t i al val ue
o f t h e field. Her e, i ndi vi dua l field val ues o r i nt er va l s can be copi e d t o
a t a r g e t va l ue . You c a n de f i ne , f o r e xa mpl e , t h a t t h e v a l u e 10"
b e c o me s val ue " 100" o r t h a t e v e r y v a l u e f r o m " 20" t o " 40" be c ome s
val ue 200" .
Convert/Copy
Thi s is a c o mb i n a t i o n o f t h e t wo r ul e t ypes , Co p y S e n d e r Fi el d a n d
Conver t S e n d e r Fiel d, wh i c h we r e al r e a dy des c r i be d. You c a n def i ne
c o n d i t i o n s f or t h e c o p y a n d f o r t h e c o n v e r s i o n . Pr evi ous rel eases
d i d n ' t i n c l u d e t hi s r ul e t y p e . You h a d t o use a c o n v e r s i o n r ul e in
wh i c h t h e n e w val ue wa s i dent i cal t o t h e o l d val ue i n s o me fields.
Use General Rule
The general rule a l l ows f o r s peci f yi ng r e c u r r i n g r ul es o n l y o n c e a n d
r e f e r r i n g t o t hi s speci f i cat i on f or o t h e r fi el ds. You can d e f i n e e v e i y
r u l e i n t h e m e n u as a gene r a l r ul e b y a s s i g n i n g a u n i q u e n a m e t o it.
Fo r o t h e r fi el ds, t h e Use Ge ner al Rul e r ul e t y p e is a p p l i e d t o us e t he
p r e v i o u s l y de f i ne d g e n e r a l rul e.
In a d d i t i o n t o t he act ual r ul e , t h e r e is r e c ur r i ng i n f o r ma t i o n , wh i c h is
d i s p l a y e d i n t h e b o t t o m a r e a o f t h e d y n p r o i n Fi gur e 4 . 1 9 . Thi s i ncl udes
t h e Speci al Co n v e r s i o n Rout i ne , wh i c h r ef er s t o t h e conversion exit. C o n
v e r s i o n exi t s f o r ma t da t a f o r t h e s c r e e n. The y us ual l y s u p p r e s s l eadi ng
z e r os . A c o n v e r s i o n e x i t a l wa y s c o n t a i n s t h e n a me o f t h e c o n v e r s i o n
r out i ne , f o r exa mpl e , ALPHA. For fi el ds t h a t can c o n s i s t o f b o t h n u mb e r s
a n d t ext , t h e ALPHA exi t ma p s n u m b e r s as r i ght al i gne d a n d t ext as left
al i gned. Each exi t al so ha s t w o f u n c t i o n mo d u l e s wh o s e n a me s al ways
f ol l ow t h e C ONV E RSI ON_ EX I T _ < NAME> _ < F UNC T I ON> p a t t e r n , f o r e xa mpl e ,
CONVERSI ON_E X I T _ A L P H A _ O U T P U T f o r t h e m a p p i n g o n a d y n p r o i n o u r
alpha s a mp l e exi t .
Co n v e r s i o n e x i t s
83
4 | Changes to IDocs
A s s i g n i n g t h e r ul e
Co n v e r s i o n t o
o l d e r s e g m e n t
v er s i ons
In a d d i t i o n , f or all rul es, y o u c a n d e f i n e t h e b e h a v i o r i f fi el ds c a n ' t be
a s s i gned. You c a n c i t h e r c o p y a c o n s t a n t o r a s e n d e r field o r al t er nat i ve l y
t r i gger an er r or .
You d e c i d e w h e t h e r a r ul e is act ual l y u s e d vi a Tr ansact i on BD55, whi c h
e n a b l e s y o u t o assi gn t he r ul e t o a pa r t ne r . Fi gure 4 . 2 0 s h o ws h o w y o u
d e f i n e f o r e a c h c o mb i n a t i o n o f s e n d e r a n d r e c e i ve r i f a r ul e is u s e d a n d
wh i c h r ul e is us ed. The us e o f c o n v e r s i o n r ul es is al so an ALE ser vi ce.
Message Type MATMAS
Conversion Rul e
Ty | S e n a e r iFunc |Ty | Receiver ( Ro l e I s e g m e n t t y p e Co nversi on rule
i s zsm Ls zsn2 E1MARAM ZSM1
Fi g u r e 4 . 2 0 As s i g n i n g t h e Rul e t o t h e Mes s age Ty pe and Par t ner
Restrictions f or SAP ERP HCM
Y o u c a n ' t u s e c o n v e r s i o n r u l e s i n SAP ERP H C M . T h i s d e p e n d s o n t h e c o m
m o n p r o c e s s i n g m e t h o d f o r i n f o t y p e s h e r e . B e c a u s e t h e a c t u a l v a l u e s c a n ' t be
a d d r e s s e d d i r e c t l y b u t o n l y v i a i n f o t y p e s f o r s e c u r i t y r e a s o n s , t h e m e c h a n i s m s
u s e d i n t h e c o n v e r s i o n r u l e s d o n t t a k e e f f e c t b e c a u s e t h e p r o p e r i n f o t y p e s
a r e n t k n o w n a t e x e c u t i o n .
4.1.6 Version Conversion
IDocs ar e a l s o s u p p o s e d t o e x c ha nge i n f o r ma t i o n b e t w e e n t w o s ys t ems
wi t h d i f f e r e n t r e l e as e ver s i ons . To a d a p t t h e IDocs accor di ngl y, y o u can
use t h e version conversion o p t i o n (see al s o Sect i on 4. 2. 2, Ge ner al Exits).
For t hi s p u r p o s e , y o u can e n t e r a n IDoc t y p e o f a n o l d e r r e l e as e i n t he
p a r t n e r o u t b o u n d p r oc e s s i ng, wh i c h r e mo v e s all s e g me n t s t h a t d i d n ' t
exi s t i n t h e r e s pe c t i ve r el ease. You can al so speci f y a n o l d e r r e l e as e v e r
s i on w i t h i n a segment version a n d c o n s e q u e n t l y e n s u r e t h a t t he sys t em
g e n e r a t e s t h e i ndi vi dua l s e g me n t s b a s e d on t h i s r el ease. By de f aul t , no
speci f i cat i on is ma d e i n t h e s e g me n t ve r s i on; s o t h e s ys t e m g e n e r a t e s t he
mo s t r e c e n t r e l e as e v e r s i o n o f t h e i n d i v i d u a l s e g me n t s f o r o l d e r IDoc
t ypes. Th e ve r s i on c o n v e r s i o n is al so a n ALE ser vi ce.
8 4
Customizing | 4 . 1
Changes and ALE Services
I n t h e c o n t e x t o f t h e I D o c f u n c t i o n m o d u l e C u s t o m i z i n g , y o u l e a r n e d t h a t
y o u c a n d e f i n e f o r e v e r y f u n c t i o n m o d u l e w h e t h e r A L E s e r v i c e s a r e a v a i l a b l e
o r n o t . F r o m t h e p r e v i o u s l y d e s c r i b e d c h a n g e o p t i o n s , t h e f o l l o w i n g a r e ALE
s e r v i c e s :
F i l t e r i n g b y f i l t e r o b j e c t s ( o u t b o u n d o n l y )
S e g m e n t f i l t e r i n g
F i e l d c o n v e r s i o n u s i n g r u l e s
V e r s i o n c o n v e r s i o n
Y o u c o n f i g u r e t h e v e r s i o n c o n v e r s i o n i n t h e p a r t n e r p r o f i l e , a n d a l l o t h e r
o p t i o n s a r e s e t v i a C u s t o m i z i n g . F i l t e r i n g b y f i l t e r o b j e c t s i s p o s s i b l e i n t h e
s e n d i n g s y s t e m ( o u t b o u n d ) o n l y ; a l l o t h e r o p t i o n s a r e a l s o a v a i l a b l e o n t h e
r e c e i v e r s i d e ( i n b o u n d ) . Y o u r s e t t i n g s a r e o n l y u s e d , h o w e v e r , i f t h e c o r r e
s p o n d i n g f u n c t i o n m o d u l e s u p p o r t s A L E s e r v i c e s ( w h i c h f o r t u n a t e l y h o l d s
t r u e f o r m o s t o f t h e m ) .
4.1.7 Special Conversions in SAP ERP Financials
Fi nanci al Ac c ount i ng i nc l ude s c o m p a n y code s a n d bus i ne s s ar eas, wh i c h
c o v e r speci f i c c o nt r ol l i ng f u n c t i o n s . It ' s par t i c ul a r l y cri t i cal t h a t d a t a is
d e l i v e r e d t o t h e a p p r o p r i a t e a r e a w h e n b e i n g t r a n s f e r r e d . Of t e n, t h e
v a r i o u s s y s t e ms us e t h e s a me o r g a n i z a t i o n a l u n i t s (e. g. , t h e SAP-pro-
v i d e d c o m p a n y code, 0001) w i t h a d i f f e r e n t me a n i n g . For t h e r e s ul t i ng
c o n v e r s i o n s t h a t ar e f r e q u e n t l y r e q u i r e d , SAP ha s d e v e l o p e d a specific
appr oa c h: cross-system company codes o r cross-system business areas. You can
access t h e s e s e t t i n g s vi a t he ALE Cus t omi z i ng o n l y b u t n o t vi a a n y t r a n s
ac t i on c ode . Fi gur e 4. 21 s h o ws t hi s us i ng Tr a ns act i on SALE i n SAP ERP.
Display IMG
Existing BC Se ts BC Sets for Activity Actuated BC Se ts for Ac twit/
Structure_____________________________________________________
I Doc interface/Application Link Enabling (ALE)
I- Basic Settings
l> Communication
Modelling and Implementing Business Processes
3*
Global Organizational Units
Q ( 5 Cross-System Company Codes
( ^ Cross-System Business Areas
Figure 4-21 Menu Path for Global Organizational Units
Gl oba l
o r g a n i z a t i o n a l
u n i t s
85
4 | Changes to IDocs
Cr o s s - s y s t e m
c o mp a n y c o d e
Ch a r t o f a c c o u n t
a s s i g n me n t
The I Doc I n t e r f a c e / A p p l i c a t i o n Li n k E n a b l i n g ( A L E ) M o d e l i n g a n d
Im p l e m e n t i n g Bu s i n e s s P r o c e s s e s G l o b a l O r g a n i z a t i o n a l U n i t s pat h
e n a b l e s y o u t o c onf i gur e cr os s- s ys t em c o m p a n y code s a n d cr os s- s ys t em
bus i ne s s ar eas . Fi gur e 4 . 2 2 di spl ays t h e s t e p s t h a t y o u n e e d t o p e r f o r m
f or c r e a t i n g a cr os s- s ys t em c o m p a n y code : c r e a t i ng cr os s- s ys t e m u n i q u e
c o m p a n y c ode s , as s i gni ng a cr os s- s ys t e m c o m p a n y c o d e t o t h e c h a r t o f
a c c ount s , a n d as s i gni ng t h e l ocal c o m p a n y c o d e t o t h e cr os s- s ys t em c o m
p a n y code.
Activities
Perf ' l a m e o f Activity
C r o s s - S y s t e a Co npany Codes
A s s i g n C r o s s - S y s t e n Conpany Code t o C h a r t o f A c c o u n t s
A s s i g n Co npany Code t o C r o s s - S y s t e n Conpany Code
Fi g u r e 4-22 Se t t i n g s f or Cr o s s - Sys t e m C o mp a n y Co d e s
Each c r os s - s ys t e m c o m p a n y c o d e is a s s i g n e d w i t h a u n i q u e n a me . It
c a n c o n t a i n six c ha r a c t e r s a n d can be l o n g e r t h a n t h e n o r ma l c o mp a n y
c o d e ( f o u r cha r ac t e r s ) so t h a t a d d i n g t h e pr ef i x "GL" f or gl obal ' ' makes
s e n s e h e r e . Th e r e ar e n o r ul e s f or n a me s o f gl obal c o m p a n y codes, h o w
ever . Fi gure 4 . 2 3 s h o ws an e x a mp l e f or t h e s t r u c t u r e o f t h e n a me o f a
gl obal c o m p a n y code . I t cons i s t s o f t h e prefi x "GL," t h e l e t t e r "Z," t he
c o d e SM, " a n d t h e di gi t 1. Th e fi nanci al d e p a r t m e n t o f y o u r e n t e r
pr i s e is r e s p o n s i b l e f o r p u b l i s h i n g t h e r e q u i r e d i n f o r ma t i o n o n char t s o f
a c c ount s , c o m p a n y codes, a n d gl obal c o m p a n y code s t h a t ma y h a v e t o
be u s e d . You s h o u l d n o t ma k e t hi s d e c i s i o n y o u r s e l f bec aus e i t can affect
o p e r a t i o n s t h a t ar e r e l e v a n t t o t h e fi nanci al s t a t e me n t .
New Entries: Overview o f Added Entries
Global CoCde
GIZSM1
Fi g u r e 4. 23 Cr e a t i n g a Gl o ba l C o mp a n y Co d e
You m u s t assi gn a c h a r t o f a c c o u n t t o e v e r y gl obal c o m p a n y c ode . This
c h a r t o f a c c o u n t is t h e n u s e d w h e n t he I Docs ar e u p d a t e d . Th e char t s
8 6
Customizing | 4 . 1
o f a c c o u n t s i n t h e s e n d i n g a n d r e cei vi ng s y s t e ms mu s t c o r r e s p o n d wi t h
r e gar d t o t h e i r a c c o u n t s . In t h e e x a mp l e , t h e t a r g e t c h a r t o f ac count ,
INT, has b e e n a s s i g n e d t o t he gl obal c o m p a n y c ode , GLZSM1 ( s e e Figure
4. 24) .
Change View "Assign cross-system co.cde -> c h r t o f ac c ts " : Overview
B E I B H I I
Global CoCde |Tar.chrtfacct$ E
6LZSH1 I N I E
EJ
Fi g u r e 4 2 4 Assigning the Chart of Accounts to the Cross-System Company Code
Now, y o u as s i gn t hi s gl obal c o m p a n y c o d e t o o n e o f t h e l ocal c o m p a n y Assigning the
c ode s i n y o u r cl i ent . The s e n d i n g s y s t e m t h e n g e n e r a t e s t h e gl obal com- Slobal company
p a n y c o d e e v e i y w h e r e i n t h e IDoc w h e r e t h e a s s i g n e d l ocal c o mp a n y
c o d e wo u l d b e s peci f i ed; t h e r e cei vi ng s y s t e m, i n t ur n, r e pl a c e s each
gl obal c o m p a n y c o d e i n t h e IDoc wi t h t h e a s s i g n e d l ocal c o m p a n y code.
Because t hi s r e p l a c e me n t m u s t wo r k o n b o t h si des , each gl obal obj ect
m u s t be a s s i g n e d t o exact l y o n e l ocal o b j e c t onl y. In t h e e x a mp l e i n
Fi gur e 4 . 2 5 , t h e gl obal c o m p a n y code, GLZSM1, w o u l d c o n s e q u e n t l y be
as s i gned t o t he CPFO c o m p a n y c o d e o f C o mp a n y Good Food.
Change View "Assign company code -> Cross-system company code*
a f M f c i b
3
; o ICompanyName Icity
:PF0 Oood Food____________________ Chicago
Global CoCde
GLZSN1
Fi g u r e 4 . 2 5 As s i gni ng t h e Cr o s s - Sy s t e m C o mp a n y C o d e t o t h e C o mp a n y Co d e
In a s i mi l a r way, y o u c a n f ol l ow t h e I Do c I n t e r f a c e / A p p l i c a t i o n Li nk Cr o s s - s y s t e m
E n a b l i n g ( A L E ) M o d e l i n g a n d Im p l e m e n t i n g Bu s i n e s s P r o c e s s e s b u s i n e s s a r e a s
G l o b a l O r g a n i z a t i o n a l U n i t s m e n u pa t h i n Tr a ns act i on SALE t o c o n
fi gure cr os s- s ys t em b u s i n e s s ar eas. Fi gur e 4 . 2 6 s h o w s t h e t wo s t e ps t hat
y o u n e e d t o p e r f o r m f o r t hi s p u r p o s e . As wi t h t h e c o m p a n y c ode , t he
fi rst s t e p is t o s pec i f y t h e n a me o f t h e cr os s- s ys t e m bus i ne s s ar ea. Then
y o u m u s t as s i gn it t o t h e bus i ne s s a r e a in t h e cl i ent .
8 7
4 | Changes to IDocs
Cr e a t i n g t h e
c r o s s - s y s t e m
b u s i n e s s a r e a
Display IMG
E l
OE
E x i s t i n g B C Sel S~| | - . B C S e t s l o r A t l r . f r |
Activities
Perf j N a m e o f Activity
C r o s s - s y s t e m b u s i n e s s a r e a s
As sig n Bu sin ess Ar ea t o C r o s s - S y s t e n Bu sin ess Area
Fi g u r e 4 . 2 6 Co nf i gur i ng Cr o s s - Sys t e m Bu s i n e s s Ar e a s
I n c o n t r a s t t o t h e c r os s - s ys t e m c o m p a n y c ode , t h e n a m e o f t h e c r os s
s y s t e m b u s i n e s s a r e a cons i s t s o n l y o f f o u r cha r a c t e r s ( he r e : GLZS, see
Fi gure 4. 27) . I n t hi s case, t oo, o n l y t h e c r o s s - c o mmu n i c a t i o n u n i q u e n e s s
is crit i cal, a n d n o n a mi n g r ul e s appl y.
New Entri es: Overview o f Added Entries
S B E B H
X-syst business area
GLZS Sabines Global Bus A/ e a S I
Fi g u r e 4 . 2 7 Cr e a t i n g a Cr o s s - Sy s t e m Bus i ne s s Ar e a
Af t e r wa r d , y o u m u s t a s s i gn t h e c r os s - s ys t e m b u s i n e s s a r e a t o a local
bus i ne s s ar ea. I n o u r e xa mpl e , t he cr os s- s ys t em bus i ne s s ar ea, GLZS, is
as s i gned t o t h e l ocal b u s i n e s s ar ea, 0001 (see Fi gur e 4. 28) . Her e, t oo,
e v e i y gl obal o b j e c t mu s t b e as s i gned t o e xa ct l y o n e l ocal obj ect .
Change View "Assign Business Area to Cross-System Business Area'
Bus Area [Description- Description
Business area 0001 GLZS________ Business area 1
Fi g u r e 4*28 As s i gn i ng t h e Cr o s s - Sys t e m Bus i ne s s Ar e a t o t h e Loca l Bus i ne s s Ar e a
The s e t t i n g s d e s c r i b e d pr e vi ous l y f or m t h e p r e r e q u i s i t e f o r c o n v e r t i n g
gl obal o r ga ni z a t i ona l u ni t s . Th e act ual e x e c u t i o n , ho we v e r , d e p e n d s on
t h e c o mmu n i c a t i o n p a r t n e r s a n d o n t h e me s s a ge t y p e s us ed. Fo r e x a m
pl e , y o u can o n l y us e t h e l ocal c o m p a n y c o d e i f y o u s e n d d a t a t o y o u r
o wn wa r e h o u s e , a n d y o u can o n l y us e t h e gl obal c o m p a n y c o d e i f y o u
s e n d da t a t o a FI (Fi nanci al Ac c ount i ng) c o n s o l i d a t i o n s ys t em.
8 8
Adapting Existing IDoc Types | 4-2
Fi gur e 4 . 2 9 s h o ws h o w Tr a ns act i on BD58 c onve r t s t h e c o m p a n y c o d e Ac t i v a t i n g f or e a c h
a n d t h e bus i ne s s a r e a i n all i n v o l v e d s e g me n t s f or t h e FI DCMT me s s a ge s e g m e n t a n d fi el d
t ype. For t hi s pr ocess, i t s cri t i cal t h a t y o u s pec i f y t h e field in Field Na me
t h a t y o u w a n t t o c o n v e r t b e c a u s e an I Doc c a n c o n t a i n s eve r al a p p r o p r i
at e fi el ds. T h e FI DCMT IDoc t r ans f er s l i ne i t e ms f or t h e ge ne r a l l e d g e r in
SAP ERP Fi nanci al s.
Change View "Conversion of Organizational Units into IDocs": Overview
*
Ne wEnn.es 3 ^ ' i 3 Q
Message Type F1DCHIT
Conversion o f Organizational Units into IDocs

Segment type :ield Name jDomain |Offset ntLength

E1FIHDR 8UKRS 8UKRS 0


A
E1FIP0S 6SBER 6SBER [7
E1FIP0S PARGB GSBER f i i
E1FITAX GSBER GSBER 0
Fi g u r e 4 . 2 9 Ac t i v a t i n g t h e Gl o b a l Co n v e r s i o n f or Ea ch Me s s a g e Type
4.2 Adapti ng Exi sti ng IDoc Types
Cu s t o me r s w h o have i m p l e m e n t e d t h e i r o w n d e v e l o p me n t s wi t h i n t he
SAP s y s t e m o f t e n a l s o w a n t t o us e t h e s e modi f i c a t i ons f o r t h e IDocs
t h a t b e l o n g t o t he mo d i f i e d obj e c t s . As wi t h i n t h e mo d u l e s , SAP me e t s
t hi s r e q u i r e me n t by p r o v i d i n g an e n h a n c e m e n t c o n c e p t . In a d d i t i o n to
a d a p t i n g I Docs t o t h e c o m m o n e n h a n c e m e n t t e c h n o l o g i e s , y o u mu s t
al so a d a p t t h e m t o y o u r o w n d e v e l o p m e n t s by s pec i f yi ng wh i c h a d d i
t i ona l fi el ds a n d s e g me n t s a r e r equi r ed.
Th e f ol l owi ng s e c t i o n fi rst i n t r o d u c e s t he d i f f e r e n t t y p e s o f exi t s pr o- A d a p t i n g t h r o u g h
vi d e d by SAP a n d t h e n uses t h e ma t e r i a l ma s t e r as an e x a mp l e bec aus e i t p r o g r a mmi n g
cont a i ns a l o t o f exi t s. You' ll al so l e a r n m o r e a b o u t t h e speci f i c exi t s t h a t
a p p l y t o all IDocs. The s e c t i o n c o n c l u d e s b y d e s c r i b i n g I Doc- i ndepen-
d e n t e n h a n c e m e n t s o f I Doc t ypes , wh i c h is i n t e r e s t i n g b e c a u s e i mp l e
me n t i n g c h a n g e s t o t h e s e n d o r u p d a t e p r oc e s s f or IDocs us ual l y also
i nvol ves a r e q u i r e m e n t f o r speci f i c fields.
8 9
4 | Changes to IDocs
4 .2.1 D i f f e r e n t E x i t Types on t h e Basis o f t h e M a t e r i a l
M a s t e r Example
SAP di s t i ngui s he s b e t w e e n d i f f e r e n t t y p e s o f sys t em a d a p t a t i o n . Cus t om
i zi ng a n d p e r s o n a l i z a t i o n ar e c u s t ome r - s pe c i f i c o r us er - s peci f i c a d j u s t
me n t s . For e xa mpl e , y o u d e f i n e i n Cus t omi z i ng h o w ma n y a n d whi c h
pl ant s y o u use i n y o u r SAP s ys t e m as wel l as t h e i r pr o p e r t i e s . The p e r s o n
al i zat i on a d j u s t me n t c o mp r i s e s s peci f i cat i ons o n t h e d e f a u l t p r i n t e r a n d
t h e l i ke. Such s y s t e m a d j u s t me n t s d o n ' t i nvol ve p r o g r a mmi n g wo r k .
Exits Ho we v e r , y o u c a n a l s o c h a n g e t h e SAP c o d e , w h i c h e n a b l e s y o u t o
c h a n g e s e t t i n g s di r ec t l y i n t h e or i gi nal SAP p r o g r a m. The s e modifications
can l e a d t o ma j o r p r o b l e ms i n t h e case o f r e l e as e cha nge s , so t h e y are
f r o wn e d u p o n a n d m u s t be ma d e k n o w n t o SAP vi a t h e On l i n e Servi ce
Syst em. Ma n y e n t e r p r i s e s d o n t a l l o w f or modi f i cat i ons a t all f or t hese
r easons.
Properties of exits To a v o i d t h e mo di f i c a t i on p r o b l e m, SAP p r o v i d e s exi t s i n pl aces t h a t are
s u p p o s e d t o be u s e d w i t h c h a n g e s c o mp a r e d t o t h e s t a n d a r d . For such
an exi t , SAP is r e s p o n s i b l e f or a c t ua l l y p r o v i d i n g a n exi t i n a s t a n d a r d
SAP p r o g r a m by de f i ni ng w h e t h e r an e n h a n c e m e n t i n t he p r o g r a m exi st s
a n d w h e r e i t s cal l ed. SAP al so d e t e r mi n e s w h i c h da t a is p r o v i d e d f o r t he
c u s t o me r wi t h i n t h e e x i t a n d w h e t h e r t h e c u s t o m e r is a l l o we d t o cha nge
a n d w r i t e bac k c e r t a i n dat a.
The s e c o n d s t e p is i mp l e me n t e d o n t h e c u s t o m e r si de. Here, t h e exi t s
t h a t w e r e d e l i ve r e d e m p t y can be fi l l ed w i t h y o u r o w n c ode . SAP p r o
v i d e s d i f f e r e n t t y p e s o f exits:
Exit types Customer exits
Cu s t o me r exi t s h a v e b e e n p r o v i d e d s i n c e Rel ease 3. 0. The y can be
us e d o n l y onc e , ar e u s e d cr oss- cl i ent , a n d ar e d e l i v e r e d b y SAP i n an
e n h a n c e m e n t a n d i mp l e me n t e d a n d a c t i va t e d b y c u s t o me r s i n an
e n h a n c e m e n t pr oj ec t . Af t e r a c h a n g e o f rel ease, t h e y h a v e t o be r e a c
t i vat ed.
Business t ra n s a c t i o n events
Busi ness t r a ns a c t i on e v e n t s (BTE) h a v e b e e n d e l i v e r e d si nce Rel ease
4. 0. Ori gi nal l y, t h e y we r e j u s t u s e d i n FI; n o w, ma n y o t h e r a ppl i c a
t i ons al so c o n t a i n BTEs in t h e s t a n d a r d SAP pr o g r a ms . You can use
9 0
Adapting Existing IDoc Types | 4-2
BTEs cl i ent -speci fi cal l y. A d i s t i n c t i o n is ma d e b e t w e e n t w o t y p e s o f
BTEs:
Publish&Subscribe interfaces
Publ i s h&Subs c r i be o r P/S i n t e r f a c e s ar e s u p p o s e d t o i nf or m
c o mp o n e n t s o t h e r t h a n t h o s e in wh i c h y o u r p r oc e s s is c u r r e n t l y
e x e c u t e d t h a t a par t i c ul a r pr ocess ha s b e e n c a r r i e d o u t i n t h e SAP
s y s t e m a n d t r a n s f e r d a t a t o t h e s e c o m p o n e n t s . A r e t u r n t r a n s p o r t
o f d a t a i s n ' t p r o v i d e d for . P/S i nt e r f a c e s can t h e r e f o r e h a v e several
act i ve i mp l e me n t a t i o n s a t t h e s a me t i me .
Process interfaces
Process i nt e r f a c e s r e pl a c e s t a n d a r d pr oces s es . Da t a is t r a n s f e r r e d to
a n d r e t u r n e d f r o m t h e pr ocess mo d u l e t h a t is e x e c u t e d i n s t e a d o f
t h e s t a n d a r d . Process i nt e r f a c e s c a n o n l y have o n e act i ve i mp l e
me n t a t i o n .
BAdls (Business Add-Ins)
BAdls h a v e b e e n p r o v i d e d s i n c e Rel ease 4 . 6 i n t h e c o m m o n var i ant ;
t h e y h a v e al so b e e n d e l i v e r e d in a n e w v e r s i o n b o u n d t o enhancements
si nce SAP Ne t We a v e r 7. 0. BAdl s a r c o b j e c t - o r i e n t e d e n h a n c e me n t s .
SAP pr o v i d e s a BAdl i nt er f a ce, a n d t h e c u s t o m e r g e n e r a t e s t h e c o r r e
s p o n d i n g i mp l e me n t a t i o n . Th e SAP d e v e l o p e r w h o del i ver s t h e BAdl
c a n d e c i d e i f i t c a n b e u s e d mu l t i p l e t i me s a n d i f i t wi l l be filter-
d e p e n d e n t .
Enhancements
E n h a n c e me n t s ar e t h e n e w c o n c e p t t h a t ha s b e e n r e c e n t l y a d d e d to
SAP Ne t We a v e r 7. 0. You ca n w o r k w i t h expl i ci t e n h a n c e me n t s , wh i c h
ar e p r o v i d e d b y SAP t h r o u g h enhancement spots; h o we v e r , i mpl i ci t
e n h a n c e m e n t s ar e al so avai l abl e, wh i c h can be i mp l e me n t e d a t s p e
cific l oc a t i ons o f e v e r y p r o g r a m t h a t d o e s n ' t di r e c t l y b e l ong t o t he
SAP Basis w i t h o u t a n y i n t e r f e r e n c e o f t h e SAP deve l ope r .
Tr ansact i on SE84 (see Fi gur e 4. 30) pr o v i d e s a n o v e r v i e w o f exi s t i ng exi t s
a n d p o t e n t i a l l y exi s t i ng i n f o r ma t i o n .
Wh e n i m p l e me n t i n g a n y o f t h e s e exi t t e c hnol ogi es , y o u mu s t c o n s i d e r
speci f i c as pe ct s b e c a u s e t h e gene r a l p r o g r a m f l o w m u s t n ' t b e c h a n g e d
by t h e exi t .
D e v e l o p m e n t
e n v i r o n me n t
91
4 | Changes to IDocs
H ' 1 A
5 r i n
w M
ABAP DEVELOPMENT
WORKBENCH
Ob j e c t Na v i g a t o r
^11HWlW eoitooiert]
5tRpo$itwi tformtbonSysww
g|^|Qo*1/chr- | n |
Objects
~ C J Repository inlo< maoon System
I CD D o e t o p m o n t Coordination
I- CD B u s i n e s s E n ^ n e e n n g
l> CD ABAP Ditonary
I- CD P r o l a n librar y
I CD C l a s s Library
II C D w e o C w p r o
P CD B SP Library
CD E ra e rp n s o S e r o c e s
^ CD E nha nc e m e nt s
^ [ 3 B u s i n e s s Add-ins
0 Oe*nitons
0 Implementa aons
*=* C3 Cus tome r Exits
0 E n h a n c e m e n t s
0 Projects
0 E n h a n c e m e n t iroplementaoons
0 C ompos ite E n h Impaemenution
0 E nhanc ement Spots
0 C ompos ite E n h a n c e m e n t Spots
Fi g u r e 4- 30 Exi t s i n t h e Re p o s i t o r y I n f o r ma t i o n Sys t e m
Programming Guidelines f o r Exits
An y t h i n g t h a t af fcct s t h e f l ow o f t h e or i gi nal p r o g r a m i s n t a l l o we d in
exi t s. In o t h e r wo r d s , y o u m u s t n ' t c r e a t e e v e n t s , s u b r o u t i n e s ( FORM) ,
o r mo d u l e s ( MODULE) h e r e . I ns t e a d, y o u m u s t c r e a t e t h e m i n s e pa r a t e
i ncl udes . Da t a d e c l a r a t i o n s t h a t h a v e b e e n agr e e d u p o n wi t h t h e DATA
s t a t e m e n t a p p l y locally.
C o n s i s t e n c y For c ons i s t e nc y r e as ons , y o u mu s t al so e n s u r e t hat t h e c u s t o m e r da t a is
o n l y u p d a t e d o r r e s et i f t h e s a me is d o n e w i t h t h e SAP dat a. St a t ement s ,
s u c h as COMMI T o r ROLLBACK, a r e t h e r e f o r e n o t p e r mi t t e d . Pos t i ngs can
o n l y b e i m p l e m e n t e d wi t h u p d a t e t e c hnol ogi e s a n d ar e t h e n pr oc e s s e d
b y t h e COMMI T o r ROLLBACK o p e r a t i o n o f t h e SAP p r ogr a m.
Co n s i d e r i n g t h e det ai l s , t h e d i f f e r e n t e n h a n c e m e n t t e c h n o l o g i e s t hi s
c h a p t e r i n t r o d u c e s r e q u i r e d i f f e r e n t a p p r o a c h e s f o r g e n e r a t i n g y o u r
o w n code, s o t h e s e t e c hnol ogi e s a r e de s c r i b e d in g r e a t e r det ai l u s i n g t he
ma t e r i a l ma s t e r as a n e x a mp l e . The d e s c r i p t i o n s o n l y r e f e r t o t h e exi t
t ypes t h a t y o u can a c t ua l l y us e i n IDocs. Wh e r e s cr een a n d m e n u exi t s
ar e pos s i bl e , no d e s c r i p t i o n is p r o v i d e d bec aus e IDocs n e v e r wo r k wi t h
me n u s o r dy n p r o s .
92
Adapting Existing IDoc Types | 4-2
Thi s s e c t i o n al so d o e s n ' t i n c l u d e c ode . Code r a t h e r d e p e n d s on w h e t h e r
y o u w a n t t o s e n d o r r ecei ve IDocs a n d n o t o n t h e t y p e o f t h e exi t . The
code is di s cus s ed s e pa r a t e l y f r om t h e d e s c r i b e d p r o p e r t i e s o f t h e var i ous
exi t s i n Sect i ons 4 . 2 . 2 , Ge n e r a l Exi t s, a n d 4 . 2 . 3 , Cus t om Segment s .
Customer Exits
SAP c r e a t e s c u s t o m e r exi t s i n Tr a ns act i on SMOD; t h a t is, y o u can use
t hi s t r a ns a c t i on t o o b t a i n i n f o r ma t i o n o n whi c h c u s t o m e r exi t s a r e avai l
abl e. Here, sever al exi t s c a n be c o m b i n e d i n o n e e n h a n c e m e n t . I n t he
IDoc ar ea, t h e exi t s f o r g e n e r a t i n g IDocs i n o u t b o u n d pr oc e s s i ng a n d f or
u p d a t i n g t h e s a me me s s a ge t ypes i n i n b o u n d pr oc e s s i ng o f t e n b e l o n g to
t h e s a me e n h a n c e m e n t .
The SAP p r o g r a m calls a c u s t o me r e x i t u s i n g t h e CALL CUSTOMER- FUNC
TI ON n n n c o mma n d . Th e " n n n " a d d i t i o n is a n y t hr e e - di gi t n u m b e r t h a t
is u n i q u e wi t h i n t h e e n h a n c e m e n t . So i f y o u w a n t t o k n o w w h e t h e r a
p r o g r a m pr o v i d e s a c u s t o m e r exi t , y o u can s ea r ch f o r CUSTOMER- FUNC
TI ON. Thi s i ndi cat es wh i c h exi t s a r e cal l ed, wh i c h s i g n a t u r e t h e u s e d exi t
f unc t i on mo d u l e s ha ve , a n d w h e r e i n t h e p r o g r a m t h e y a r e cal l ed.
I f y o u b r o w s e t h e a l r e a d y - k n o wn f u n c t i o n mo d u l e , MASTERI D0 C_ CRE -
ATE_MATMAS ( Fi gur e 4. 31) , y o u s e e t h a t an e x i t wi t h n u m b e r " 002" is
avai l abl e a n d t h a t i t ha s b e e n cal l ed sever al t i mes, namel y, e a c h t i me a
n e w s e g m e n t ha s b e e n g e n e r a t e d . You can al so s ee wh i c h da t a has bee n
t r a n s f e r r e d . I n f o r ma t i o n is p r o v i d e d o n t h e me s s a ge t y p e , t h e n a m e o f
t h e c u r r e n t l y g e n e r a t e d s e g me n t , a n d all pr e vi ous l y g e n e r a t e d IDoc dat a.
You can c h a n g e t h e u s e r d a t a a n d r e t u r n t h e r e f e r e nc e f o r y o u r e n h a n c e
m e n t o f t h e IDoc, CI MTYP. Sect i on 4 . 2 . 3 , Cus t om Se gme nt s , des c r i bes
t hi s i n mo r e det ai l .
W h e n y o u k n o w t h e cal l i ng p r o g r a m a n d t h e e x i t ID, y o u al so k n o w t h e
n a me o f t h e exi t mo d u l e , wh i c h f ol l ows t h e EXI T_< PROGRAMNAME> _ nn n
p a t t e r n . In o u r e xa mpl e , t h e exi t m o d u l e is cal l ed EXI T_ S AP LMV0 1 _ 0 0 2 .
Do u bl e - c l i c ki ng o n t h e t h r e e - d i g i t n u m b e r (002) o f t h e n a m e i n t h e
s ea r ch r e s ul t di r ec t l y navi gat e s y o u t o t h e f u n c t i o n mo d u l e (see Figure
4 . 3 7 l a t e r i n t hi s cha pt e r ) .
"CALL
CUSTOMER-
FUNCTI ON"
c o m m a n d
Ma t e r i a l ma s t e r
e x a mp l e
93
4 | Changes to IDocs
C u s t o me r
e n h a n c e m e n t
p r o j e c t
Global Search in Programs
0 @ 1 I H O 19 1B S B I S
P r o g r a n / E n h a n c e a e n t
LMV01U06 281 CALL CUSTOMER-FUNCTION
EXPORTING
MESSAGE TYPE
SEGMENT_NAME
F MARA
IMPORTING
ID0C_CIMTYPE
TABLES
I D0C_DAT A
334 CALL CUSTOMER-FUNCTION
EXPORTING
MESSAGE_TYPE
SE6MENT_NAME
F_MAKT
IMPORTING
IDOC.CIMTYPE
TABLES
----------------------------------------- l . D 0 C _ D A T A _
002*
= MESSA6 E.TYPE
= C_SE6NAM_E1MARAM
= MARA
= ID0C_CIMTYPE
= T_IDOC_OATA
002'
= MESSA6 E_TYPE
= C_SE6NAM_E1MAKTM
= MAKT
= IDOC_CIMTYPE
5-T_iP-QC-DATA.-----------
Fi g u r e 4. 31 Fu n c t i o n Mo d u l e Exi t s W h e n Ge n e r a t i n g MATMAS I Doc s
W h e n y o u k n o w wh i c h c x i t y o u wa n t t o i mp l e me n t , y o u ca n cr e a t e y o u r
o w n p r oj e c t usi ng Tr ansact i on CMOD (see Fi gur e 4. 32) . Use t he mat ch
i c on a t t h e left o f t h e t o o l b a r t o act i vat e t h e pr oj e c t a t t h e e n d o f y o u r
d e v e l o p me n t wor k. On l y t h e n wi l l y o u r exi t b e act ual l y ex e c u t e d . First,
a ssi gn a n a m e t o y o u r pr oj ect . Because SAP d o e s n t de l i ve r pr oj ect s, y o u
c a n t heor e t i c al l y us e t h e e n t i r e names pa ce.
Project Management o f SAP Enhancements
S f f l S * >
Project ZSM Create
Attributes
O Enhancement Assignment
0 Components
0 Documentation
Display i? Change
Figure 4.32 Creating a Customer Project
94
Adapting Existing IDoc Types | 4 . 2
Af t e r cl i cki ng t h e Cr eat e b u t t o n , y o u can d e f i n e t he a t t r i b u t e s o f y o u r
pr oj ec t . The f o l l o wi n g s a mp l e c u s t o m e r p r o j e c t (see Fi gur e 4 . 3 3 ) is a
ve r y c o m m o n d e v e l o p m e n t obj ect . As s uch, i t i nc l ude s all gene r a l dat a
o f d e v e l o p m e n t obj e c t s , f o r e x a mp l e , speci f i cat i ons o n t h e p e r s o n wh o
cr e a t e d t h e o b j e c t a n d w h e n it wa s c r e a t e d, as wel l as a package. You
ma n a g e t h e obj ect vi a a t r a n s p o r t r e que s t , wh i c h y o u ca n use t o t r a ns por t
it t o t h e l i ve s ys t em.
Attributes o f Enhancement Project ZSM
Enhancement assignments [Components
Project ZSM
Short text Sabines IDoc Enhancements)
Administration data
Package
Original language EN
Created by NAISELSA 0 8 / 1 7 / 2 0 0 9
Last changed on/by
Actuation
Protect Status
Changed
Fi g u r e 4 . 3 3 At t r i b u t e s o f t h e C u s t o me r Pr oj e c t
No w y o u can assi gn o n e o r s eve r al e n h a n c e me n t s t o y o u r c u s t o me r pr oj
ect us i ng t he E n h a n c e me n t As s i gnme nt s b u t t o n . Ever y e n h a n c e m e n t can
o n l y b e l ong t o o n e pr oj ec t . Fi n d i n g t h e e n h a n c e m e n t t h a t y o u w a n t to
i m p l e me n t t o c h a n g e t h e ma t e r i a l ma s t e r I Doc is ea s i e r he r e bec aus e y o u
can e n t e r t h e n a me o f t h e pr e vi ous l y i de nt i f i e d exi t mo d u l e t o d e t e r mi n e
t h e e n h a n c e m e n t i t b e l o n g s t o. As s h o w n i n Fi gur e 4 . 3 4 , t hi s i s n t p r o
v i d e d by SAP by d e f a u l t s o y o u n e e d t o s e l e c t t h e c o r r e s p o n d i n g o p t i o n s
i n t he Ad d i t i o n a l Sel ect i ons t ab first.
The e n h a n c e m e n t f o u n d i n t h e e x a mp l e is cal l ed MGV00001, a n d y o u can
n o w assi gn it t o y o u r c u s t o m e r e n h a n c e m e n t p r o j e c t b y s pec i f yi ng i t in
E n h a n c e m e n t ( Fi gur e 4. 35) .
As s i g n i n g t h e
e n h a n c e m e n t
E n h a n c e m e n t f or
ma t e r i a l ma s t e r
I Doc
95
4 | Changes to IDocs
S A P E n h a n c e m e n t s i n E n h a n c e m e n t P r o j e c t Z S M
l ^ j ^ l H Enhancement 1 Component
e :
0.
L a s t O b j e c t S e l e c t e d
E x i t
KKCD0001
IS
S A P - E I S : U s e r e x i t s f o r d a t a t r a n s f e r
3 f l i n f o r m a ti o n S y s t e m a"0 s a p A o o i i c a t o o s h i X
Standard selections
Exit n a m e
S h o r t text
P a c k a g e
A pp l i c a ti o n C o m p o n e n t
Adoiionai selections
S f m o d o l e e n t s E S c r e e n a r e a s 0 M e n u E n t n e s
C o m p o n e n t n a m e EXIT Sa p l h v o i 0 0 2
C r e a t e d by
C r e a t e d on
L a s t c h a n g e d by
C h a n g e d on
M a n m u m N o o f H its
Fi g u r e 4 . 3 4 Fi ndi ng t h e E n h a n c e me n t
SAP E n h a n c e m e n t s in E n h a n c e m e n t P r o j e c t ZSM
V a g
a U Enhancement Component s
Enhancement Text
M6V000O1
Material Master (Industry): ALE Distribution
Fi g u r e 4 . 3 5 As s i gn i ng t h e E n h a n c e me n t
MGV000 01 is an e n h a n c e m e n t t h a t a l r e a d y c o n t a i n s t wo f u n c t i o n exi t s.
You c a n a l s o i m p l e m e n t o n l y o n e o f t h e m i f y o u d o n ' t n e e d t h e ot her .
The c r o s s e d - o u t ci rcl es i n Fi gur e 4 . 3 6 i n d i c a t e t h a t t h e e n h a n c e m e n t
h a s n ' t b e e n a c t i va t e d y e t . The e m p t y c o l u mn i n f r o n t o f t he t wo exi t s
s h o ws t h a t t h e y al so h a v e n t b e e n i m p l e m e n t e d ye t .
The EX I T_SAPLMV0 1 _ 0 0 2 exi t n o w c o mp r i s e s t h e c o mp l e t e s i g n a t u r e , as
y o u can s e c i n Fi gur e 4 . 3 7 . Ne a r l y al l i m p o r t p a r a me t e r s ar e opt i onal ,
wh i c h is w h y o n l y v e r y f e w w e r e di s pl ayed d u r i n g t h e call.
9 6
Adapting Existing IDoc Types | 4-2
Display ZSM
Enhancement assignments D Enhancement
P r o j e c t ZSM Sa bine s IOoc Enhancements
Enhancement I i p l
1
Exp H6V00001 M a t e r i a l M ast er ( I n d u s t r y ) : ALE D i s t r i b u t i o n
F u n c t i o n e x i t EXIT_SAPLMV01_002
EX IT_SAPLMV02_002
F i g u r e 4 . 3 6 C o m p o n e n t s o f t h e En h a nc ement
Function Builder: Display EXIT_SAPLMV01_002
a I 3 9 l l k s ] 3 g i a [ Q
Function module EXIT_SAPLMVO1_O02 Active
Attributes Import Eiport Changing Tables Exceptions
r m m i a a
FUNCTION EXIT_SAPLHV01_0O2
L o k a l e S c h n i t t s t e l l e
IMPORTING
VALUE(HESSAGE.TYPE) LIKE EDMSG-HS6TYP
VALUE(SE6HENT_NAnE) LIKE EDIDD-SE6NAH
VALUE (F_MARA) LIKE HARA STRUCTURE HARA OPTIONAL
VALUE(FJ1AKT) LIKE HAKT STRUCTURE HAKT OPTIONAL
VALUE (F MARC) LIKE MARC STRUCTURE MARC OPTIONAL
VALUE(F_HAR0) LIKE MARD STRUCTURE HARD OPTIONAL
VALUE(F_MFHM) LIKE MFHfl STRUCTURE MFHH OPTIONAL
VALUE (FJ1PG0) LIKE MP6D STRUCTURE MPGD OPTIONAL
VALUE(FJ1P0P) LIKE HPOP STRUCTURE "POP OPTIONAL
VALUE(F_HPRW) LIKE MPRW STRUCTURE HPRW OPTIONAL
VALUE(FJ1VE6) LIKE MVEG STRUCTURE HVEG OPTIONAL
VALUE(FJ1VEU) LIKE MVEU STRUCTURE hveu OPTIONAL
VALUE(FJ1KAL) LIKE MKAL STRUCTURE HKAL OPTIONAL
VALUE(F_MARM) LIKE HARM STRUCTURE HARM OPTIONAL
VALUE(FJ1EAN) LIKE MEAN STRUCTURE MEAN OPTIONAL
VALUE(F_MBE) LIKE MBEW STRUCTURE M8EW OPTIONAL
VALUE(FJ1LGN) LIKE MLGN STRUCTURE HLGN OPTIONAL
VALUE(F_HVKE) LIKE MVKE STRUCTURE HVKE OPTIONAL
VALUE(F.MLAN) LIKE ULAN STRUCTURE HLAN OPTIONAL
VALUE (F HLGT) LIKE MLGT STRUCTURE HL6T OPTIONAL
EXPORTIN6
VALUE(IOOC_CIMTYPE) LIKE EDIDC-CIHTYP
TABLES
IDOC.DATA STRUCTURE EDIDD
ft
INCLUDE ZXM6VU03
tuntiinr.niui--------
F i g u r e 4 . 3 7 C o n t e n t o f t h e SAP Exi t s
The exi t b e l o n g s t o t h e SAP s ys t e m a n d is l ocat ed i n t h e SAP n a me s pa c e .
In a d d i t i o n , t h e c o n t e n t o f t he e x i t mo d u l e cons i s t s o f o n l y o n e i ncl ude
(ZXMGVU03). Thi s i ncl ude, i n t u r n , is l ocat ed i n t h e c u s t o me r na me s pa c e and
d o e s n ' t exi s t i n t h e SAP s ys t e m unt i l t h e exi t ha s b e e n i mp l e me n t e d .
C u s t o me r i n c l u d e s
i n t h e e x i t
97
4 | Changes to IDocs
C r e a t i n g t he
i nc l ude
I f y o u doubl e - c l i c k o n ( he i n c l u d e n a me , y o u c a n c r e a t e t h e i ncl ude
vi a f o r wa r d navi ga t i on, as s h o w n i n t h e Cr e a t e Obj e c t di al og i n Fi gure
4. 38.
Function Bui lder^ Display EXIT_SAPLMV01_002
w r a i i w i o i H i i i i i i g i F P i H g i i s i i a n i i i i B i i n ^ i i Bi
Function module EXIT_SAPLMVO1_O02 Active
Attributes Import Export Changing Tables Exceptions urce code
i i innsai i iai
FUNCTION EX IT SAPLMV01 002.
" L o k a l e S c h n i t t s t e l l e :
IMPORTING
VALUE (HESSAGE_TYPE)
VALUE(SEGMENT NAME)
LIKE EDMSG-MSGTYP
LIKE EPIDD-SE6NAM
're 0 /
Include ZXMGVU03 does not exist
Create Object
Yes II NO I X Cancel I
M l . . I I I V *
VALUk
VALUE (FJ1EAN)
VALUE(FJ1BEW)
VALUE(F_HL6N)
VALUE(F_HVKE)
VALUE (FJ1LAN)
VALUE(F MLGT)
EXP0RT1N6
VALUE(I00C_CIHTYPE)
TABLES
ID0C_DATA STRUCTURE
LIKE
LIKE
LIKE
LIKE
LIKE
LIKE
MEAN STRUCTURE
MBEW STRUCTURE
HLSN STRUCTURE
HVKE STRUCTURE
MLAN STRUCTURE
HLBT STRUCTURE
MEAN
MBEW
HL6N
HVKE
MLAN
ML6T
OPTIONAL
OPTIONAL
OPTIONAL
OPTIONAL
OPTIONAL
OPTIONAL
LIKE EDIDC-CIMTYP
E0I0D
INCLUDE ZXMGVU03.
ENDFUNCTION
F i g u r e 4 . 3 8 Cr e at i n g an I n c l u d e i n t h e Cu s t o me r Namespace
The s y s t e m t h e n p r o v i d e s t h e e m p t y i ncl ude (see Fi gur e 4 . 3 9 ) i n whi c h
y o u can i n s e r t y o u r o w n c ode . Ma k e s ur e y o u s a v e y o u r e n t r i e s al r eady
w h e n e d i t i n g t h e i nc l ude . I f y o u a c t i v a t e t h e i n c l u d e w i t h o u t havi ng
s a v e d y o u r e n t r i e s a n d a n e r r o r occur s, y o u ma y h a v e t o e n t e r t h e code
all o v e r agai n.
9 8
Adapting Existing IDoc Types | 4-2
ABAP Editor: Change Include ZXMGVU03
- @ *
Include Z1HGVU83
l i w n ' B l a l
n i a s i Pattern Pretfr Punter
Inactive (Revised)
ZXMGVU03
F i g u r e 4 . 3 9 I n c l u d e t o Be Fi l l ed
You ma y w a n t t o g r o u p y o u r c o d e f o r g r e a t e r cl ari ty. Thi s c a n be d o n e G r o u p i n g code
by c r e at i ng a ddi t i ona l i ncl udes . The i ncl udes t h e n begi n wi t h "Z"; t h a t is,
t h e y ar e l ocat e d i n t h e c u s t o m e r n a me s p a c e b u t still b e l o n g t o t h e SAP
exi t f u n c t i o n g r o u p t h a t al ways b e g i n s wi t h "X. SAP p r o p o s e s ZXMGVF01
f or i t s n a m e (see Fi gur e 4. 40).
ABAP Editor: Change Include ZXMGVU03
M l ^ l I IfrllttlB IIIl I P I 1 H T H B I fiS 1 8 1 Pattern | | Pretty Printer
ZXH6VU03 include Inactive (Revised)
Subroutine FILL.Z1MARA
INCLUDE Selection
ZXKGVF01 Ne* I n c l u d e
-
3
3
F i g u r e 4 4 0 Cu s t o me r I n c l u d e
Business Transaction Events
Busi ness t r a ns a c t i on e v e n t s (BTEs) ar e al so h a n d l e d vi a f unc t i on mo d u l e s
b u t i n a d i f f e r e n t wa y t h a n c u s t o m e r exi t s. For BTEs, SAP calls i n t h e
de l i ve r e d c o d i n g a f u n c t i o n mo d u l e u s i n g t h e CALL FUNCTI ON *0 P E N _ F I _
PERFORM_XXXXXXXX_E c o mma n d ; her e, XXXXXXXX is t h e event ID.
99
4 | Changes to IDocs
Determining bt es You c a n s ea r ch f o r 0 P E N_ F I * i n t h e d e s i r e d c o d e t o f i nd t he exi st i ng BTEs
(sec Fi gur e 4. 41) . The spec i f i c at i ons i n t h e r i ght fi el d i n d i c a t e i f a BTE
exi st s, wh e r e i t ' s cal l ed, a n d wh i c h s i gna t ur e it pr ovi des . The BTE f ound
he r e ha s ID MGV0 0 1 0 0 , is cal l ed o n l y onc e , a n d p r o v i d e s all IDoc d a t a
t o g e t h e r wi t h t h e c o n t r o l r ecor d.
Global Search in Programs
o n i F i r a a n a m m x m
Progra/Enhanceaent
------------------------------------------------------------------------------------------------------- P t ------------------------
LHV91UG6 2099 c a l l f u n c t i o n OPENJM.PERFORMJIGVOOIOO.E1
t a b l e s
i d o c _ d a t a = t _ i d o c _ d a t a
changing
i d o c _ h e a d e r = f _ i d o c _ h e a d e r
e x c e p t i o n s
o t h e r s = 1 .
Fi g u r e 4 4 1 finding BTEs
Sample function In Tr a ns a c t i o n BF01, y o u can f i nd t h e s a mp l e f u n c t i o n m o d u l e s t h a t
module bel ong t o P/S i nt erfaces. Tr ansact i on BF05 speci fi es t h e s a mp l e f unc t i on
mo d u l e s t h a t b e l o n g t o pr oc es s i nt er f aces. The s a mp l e f u n c t i o n m o d
u l e t h a t be l ongs t o t h e MGV0 0100 BTE is t h e SAMPLE_I NTERFACE_MGV00100
f unc t i on mo d u l e (see Fi gur e 4. 42). Al ways che ck b o t h BTE t ypes i f y o u
d o n ' t k n o w wh i c h t ype t h e d e v e l o p e r used.
Change View "Library of the Publish&Subscribe Business Transaction
ffifgflfNew Entries
Event |Tet Sample Function Module C

H6VO01O0 MATMAS : Outbound processing for ALE Distribn Unit


H6VO02O0 MATMAS : Inbound Processing for ALE Distribn Unit
SAflPlEJNTERFACEJievOOlOO 0
SAHPLEJNTERFACEJ16V00200 El
Fi g u r e 4. 4 2 Event with Sample Function Module in Transaction BF01
Creating your own The s a mpl e f unc t i on mo d u l e c o n t a i n s t h e s i gnat ur e exact l y i n a f or ma t
module for BTEs e xpe c t e d by t h e 0 P EN_ F I _ P ERF 0 RM ABAP s t a t e me n t o f t h e cal l i ng pr ogr am
so t h a t y o u can us e i t as a t e mpl a t e . Copy t hi s f u n c t i o n mo d u l e t o y o u r
o wn names pa ce, a nd i n s e r t t h e des i r e d c o d e ( i ndi ca t e d b y * My o wn c o d e
s t a r t s h e r e i n Fi gur e 4. 43).
1 0 0
Adapting Existing IDoc Types | 4 . 2
Function Bui lder: Change Z_EVENT_MGV0 0 1 0 0
F I R I W R I B I f S l I P l f f l H F f r l I B S m n i P l I M W I I I PrerPrinie7
FUNCTION Z_EVENT_H6VO0100.
" L o c a l I n t e r f a c e
TABLES
IDOC.DATA STRUCTURE EOIDD
CHANGING
REFERENCE( IDOC_HEADER) LIKE E01DC STRUCTURE EDIDC
EXCEPTIONS
ERROR
Ev ent r l s s e n by t h e ALE outbound p r o c e s s f o r HATHAS.
I t a l l o s t o n o d i f y t h e l d o c ' s c o n t r o l h e a d e r t h e i d o c d a t a a s e l l
as s e r i a l i z a t i o n i n f o r m a t i o n c r e a t e d by t h e s t a n d a r d SAP outbound
pr oc e s s .
R a i s i n g t h e EXCEPTION ERROR w i l l p r e v e n t t h e IDOC f r o * bei ng
s u b m i t t e d t o t h e ALE l a y e r .
BE CAREFUL WITH ANY CHANGES TO IDOC.CONTROL. I T HAY EFFECT YOUR WHOLE
ALE-SCENARIO
My on code s t a r t s h e r e
ENDFUNCTION.
F i g u r e 4 - 4 3 Co p y o f t h e Sampl e M o d u l e
To a c t ua l l y e x e c u t e t h e c o r r e s p o n d i n g f u n c t i o n m o d u l e , y o u have t o C u s t o m e r p r o d u c t
act i vat e i t . Howe ve r , t hi s is d o n e i n a c o mp l e t e l y d i f f e r e n t wa y t h a n for
c u s t o me r exi t s. The t r a ns a c t i on f or ma n a g i n g BTEs is Tr a ns act i on FIBF.
Fi r st o f al l , y o u have t o c r e a t e a c u s t o m e r m a n a g e m e n t ob j e c t by f ol l ow
i ng t h e Se t t i n g s P r o d u c t s . . . o f a c u s t o m e r m e n u p a t h (see Fi gure
Function module Z_EVENT_H6V00100 Active
Attributes Import Export Changing Tables Exceptions
Active
l m _ u s o m m
4 . 4 4 ) .
Events Edit Goto Settings Environment System Help
* . . . o f a partner
as m
SAP Busi ness I
P/S Modules ... of a customer
Process Modules *
F i g u r e 4 . 4 4 M e n u Pat h f o r t h e Cu s t o me r Pr oduc t
1 01
4 | Changes to IDocs
A c t i v a t i n g t he
c u s t o m e r p r o d u c t
f o r each c l i e n t
A s s i g n i n g an e v e n t
t o t h e p r o d u c t
The e n t r i e s f o r t h e p r o d u c t ma i nl y c o n s i s t o f t h e n a me (see Fi gur e 4. 45) .
Because SAP del i ver s p r o d u c t s f o r p a r t i c u l a r t asks, a n d SAP p a r t n e r s use
t h e s e BTEs i n s o me p r o d u c t s , y o u s h o u l d b e car ef ul w h e n as s i gni ng t he
names.
The l ast fi el d, w i t h "A" as t h e h e a d i n g , pl ays a par t i c ul a r l y crit i cal role
bec aus e i t s t h e ac t i va t i on c o l u mn . The c o r r e s p o n d i n g che c k b o x i ndi cat es
w h e t h e r t h e p r o d u c t i n t h e c u r r e n t c l i e nt is act i ve (BTEs c a n b e act i vat ed
c l i e n t - i n d e p e n d e n t l y ) so t hat t h e r e s pect i ve BTEs can be exe c ut e d.
Change View "Customer P ro du c t s " : Overview
y New Entries lj? S
i . i l l E
Product [Text RFC destination
A
ZSH1 IDocs
0
F i gu r e 4 - 4 5 Cr e at i n g a Cu s t o me r Pr oduc t
The RFC De st i na t i on field r e ma i n s e m p t y i f y o u r e ma i n i n t h e s a me s ys
t e m t h a t e xe c u t e s t h e cal l i ng p r ogr a m. I f y o u e n t e r a val i d d e s t i n a t i o n
f r o m Tr a ns act i on S M5 9 i n t hi s field, t h e e v e n t s t h a t ar c a s s i g n e d t o t hi s
p r o d u c t ar e e x e c u t e d on t h e s ys t e m t h a t b e l ongs t o t hi s d e s t i n a t i o n .
You a s s i gn y o u r e v e n t s t o t h e p r o d u c t ( c o mb i n e d a c c o r d i n g t o w h e t h e r
all o r n o n e o f t h e s e e v e n t s a r e act i ve) vi a t h e Se t t i n g s P / S M o d u l e s
o r P r o c e s s M o d u l e s m e n u p a t h . Fi gur e 4 . 4 6 d i s p l a y s al l r e q u i r e d
speci f i cat i ons.
Change View "Publish&Subscr ibe BTE: Customer Enhancements":
N e w Entries
Event IProduct jctr |Appl f u n c t i o n Module
n
H6VOO10OZSM1 |Z_EVENT_HGV00100
id
i d
n
F i gu r e 4.46 Ass i gni ng Event s t o Pr oduct s
De p e n d i n g o n t h e e n v i r o n me n t , y o u ca n us e t h e e n t r i e s ma d e f o r coun-
t i y (Ctr) a n d a pp l i c a t i o n (Appl . ) as t h e fi l t er cr i t er i a; f o r IDocs, howe ver ,
t h e s e r e s t r i c t i o n s d o n t h a v e a n y effect, so t he fi el ds r e ma i n empt y.
1 0 2
Adapting Existing IDoc Types | 4 . 2
Classic BAdls
Classic BAdl s a r e h a n d l e d vi a a h a n d l e r class. The n a m e o f t hi s cl ass is
CL. EXI THANDLER, a n d i t s cl ass m e t h o d , GET. I NS TANCE, is cal l ed o n c e f or
e ach BAdl . I f y o u w a n t t o k n o w i n a p r o g r a m i f y o u c a n us e a BAdI,
sear ch f o r "CL. EXITHANDLER. " You can fi nd t h e r e q u e s t e d BAdI i n t he
EX I T_NAME e x p o r t var i abl e. A c o r r e s p o n d i n g i n s t a n c e va r i a bl e cal l ed LF_
EXIT is s peci f i ed h e r e (see Fi gur e 4. 47).
G l o b a l S e a r c h i n P r o g r a m s
*W . S a * F 1 1- D-
invotuee 2674 CLASS Cl.EXITHANOlER DEFINITION 10A0
2080 CALL REIMODcl_exUhan<Jlerr>oet_1nstance
EXPORTING
EXIT_NANE 'B*t>t_NATI1AS_AlE_CR
INPORTIN6
ACT_1NP_EX1STIK6 i IF_EXII_AKT
CHANGING
tnstance = IF.EXIT
F i g u r e 4 - 4 7 I d e n t i f y i n g a Cl assi c BAdI
The n a me o f t h e i n s t a n c e v a r i a bl e n o w e n a b l e s y o u t o d e t e r m i n e wh i c h
m e t h o d s o f t h e BAdI ar e cal l ed a n d w h e r e t h e y ar e cal l ed. Here as wel l ,
SAP def i ne s wh i c h d a t a is t r a n s f e r r e d , wh i c h me a n s t h e CHANGE_MATMAS
m e t h o d is cal l ed onc e , t r ans f er s all IDoc da t a a n d t h e c o n t r o l r e c or d, a n d
b o t h can be c h a n g e d . Fi gur e 4 . 4 8 s h o ws t h e c o d e p r o v i d e d by SAP f or
cal l i ng t h e cl assi c BAdI.
BAdl s have t o be d e l i v e r e d b y SAP, so SAP cr eat es t h e BAdI a n d t he
me t h o d s wi t h y o u r s i gna t ur e a n d calls t h e m i n t he SAP p r ogr a m. Co n s e
quent l y, y o u o n l y have t o de f i n e w h a t is s u p p o s e d t o be d o n e i n t h e BAdI.
The BAdI is cr e a t e d i n Tr ansact i on SE18. You c a n us e Tr a ns act i on SE19 to
c r eat e a n i mp l e me n t a t i o n f or t h e BAdI w h e r e y o u d e f i n e w h a t y o u wa n t
t o do wi t h t h e p r o v i d e d da t a w i t h i n t h e m e t h o d . Fi gur e 4 . 4 9 di spl ays t he
i ni ti al s cr een o f t h e t r a ns a c t i on in SAP Ne t We a ve r 7. 0. In o l d e r rel eases,
t h e Ne w BAdI o p t i o n wa s mi ssi ng; e v e r y t h i n g el se st ays t h e s ame.
Ca l l i n g t h e BAdI
C r e a t i n g a BAdI
i m p l e m e n t a t i o n
1 03
4 | Changes to IDocs
Function Builder: Display MASTERIDOC_CREATE_MATMAS
Pattern
f f l l Z E E
Function module MASTERIDOC_CREATE_MATMAS Active
Attributes import Export Changing Tables Exceptions,
m loal | j a j
HATMAS-IDOCS s e n a en: sss=i == :s= i: i= =s==s s==: =
1 I n s t a n z v a n a b l e zuneisen
CLASS CL.EXITHANDLER DEFINITION LOAD
STATICS LF_EXIT TYPE REF TO IF_EX_BADI_HATMAS_ALE_CR
STATICS: LF_EXIT_AKT( 1 ) TYPE C VALUE # \
' 2 I n s t a n z e r o t f n e n
I F l f . e x l t IS I NITIAL
CALL METHOD c l _ e x i t h a n d l e r > g e t inst ance
EXP0RTIN6
EXIT_NAHE = 'BADI_MATnAS_ALE_CR'
IHPORTINS
ACT IMP EXISTING = LF EXIT AKT
CHAN6IN6
i n s t a n c e = LF. EXIT.
e n d l f .
' 3 S t a r t e n
I F NOT LF_EXIT_AKT IS I NITIAL
CALL METHOD LF_EXIT >CHAK6E_MATHAS
CHAN6IN6
T_I00C_DATA = T_IDOC_DATA[]
F_I00C_HEADER = F_!DOC_HEADER
ENDIF.
=========baoI nathas-IDOCs s e n d e n - - - - - - -
s s s s s s s s s s s s s
F i g u r e 4 4 8 Cal l i ng t h e Cl assi c BAdl
BAdl Builder: Initial Screen f o r Implementations
d
Edil implementation
<$ New BAdl
Enhancement Implementation
O Classic 8Adi
Implementation
O New BAdl
Classic BAdl
BAdl Name
Create Imp! ]
Figure 4.49 Initial Screen for Creating an Implementation
1 0 4
Adapting Existing IDoc Types | 4 . 2
Speci fy y o u r cl assi c BAdl i n t h e Cr eat e I mp l e me n t a t i o n t ab, a n d click on
t h e Cr e a t e I mp l e me n t a t i o n b u t t o n t o na vi ga t e t o t h e ne x t i n p u t scr een.
First, y o u n e e d a n a me f or y o u r i mp l e me n t a t i o n (see Fi gure 4. 50) . The
us ual n a mi n g r ul e s (Z, Y, o r c u s t o m e r n a me s p a c e as a prefi x) appl y. In
a ddi t i on, y o u s h o u l d n a m e t h e i mp l e me n t a t i o n l i ke a cl ass, f o r exa mpl e ,
ZCL_SM_IMP1, b e c a u s e i t ' s al so d i s p l a y e d i n t h e cl ass l i br a r y i n Tr ansac
t i o n SE24. Techni cal l y, i t s j u s t t h e i m p l e me n t i n g cl ass o f an i nt er f ace
wi t h SAP c r e at i ng t h e i nt e r f a c e a n d y o u c r e at i ng t h e i mp l e me n t a t i o n .
Her e, i t s a l s o i n d i c a t e d w h e t h e r t h e BAdl is o r i s n t F i l t e r - De p e n d e n t
o r i n t e n d e d f o r Mu l t i p l e us e (see Fi gur e 4. 50, A t t r i b u t e s Typo). The
classic BAdl s h o w n h e r e (BADI_MATMAS_ALE_C R) ha s b e e n mi g r a t e d i n t o a
n e w BAdl i n t h e m e a n t i m e s o t h a t i t wo u l d no l o n g e r b e u s e d i n a n e w
r el ease. As an e x a mp l e , i t ' s as g o o d as a n y o t h e r , so we ' l l st i ck t o t he
ma t e r i a l m a s t e r f o r t h e sake o f clarity. Use t h e ma t c h i c o n ( wh i c h is lit
t hi s t i me) t o a c t i va t e t he BAdl a t t h e e n d o f y o u r d e v e l o p m e n t wor k.
Business Add-In Builder: Change Implementation ZCL_SM_IMP1
R U D B I OWtntionOocumenta Documentatton |
implementation Name
Implementation Short Text
Definition Name
interface
zcL _sr ij nP i Inactive
SaDines 8 adi Implementation
BADIJMTHAS_ALE_CR
General Data
Package
Language EN English
Last changed by
Last change 00 00 00
TVpe
F Multiple use
C Fiiter-Depen<
BAdl migrates to enhancement spot BAD I _MAT MAS_AL E _C R
F i gu r e 4 - 5 0 Cr eat i ng t h e I m p l e m e n t a t i o n - Det ai l s
A t t r i b u t e s o f t h e
i m p l e m e n t a t i o n
105
4 | Changes to IDocs
M e t h o d s o f
t h e BAdl
The I nt e r f a c e s t ab (see Fi gur e 4 . 5 1 ) pr o v i d e s i n f o r ma t i o n o n t h e m e t h
od s o f t h e BAdl. Doubl e- cl i cki ng o n a m e t h o d t akes y o u t o t h e l ocat i on
w h e r e y o u c a n c r e a t e y o u r o w n c o d e (see Fi gure 4. 52) .
Business Add-In Builder: Change Implementation ZCL_SM_IMP1
*1? ao ; a oBo S O Definition Documenta Documentation
Implementation Name ZCL_SH_IMP1 Inactrve
Implementation Short Text Sabines m a t mas BASl implementation
Definition Name BADI HATHAS ALE_CR
Attributes
interface name 1F_EX_BADI_HATHAS_ALE_CR
Name of implementing class: ZCL_[_CL_SH_i m p i
Method mpiementation rp iDescnption

CHANGEJ1ATHAS ABAPABAPCode 3 Base Method


I

3
a
*1
m :
a
F i gu r e 4.51 M e t h o d V i e w o f t h e I m p l e m e n t a t i o n
Class BuildenClass ZCL_IM _CL_SM J M P 1[Change
0 @ IB168 IS I@0 IEOB I I
Method IF_EX_BADI_HATHAS_ALE_CR~CHAK6E_HATHAS InaclNe
~nwi amj leiai______________________
e t h O d 1 F _ E X _ B A D I J 1 A T I U S _ A I E _ C R - C H A N 6 E J 1 A T H A S
e n d i e t h c d
F i gu r e 4- 52 D e v e l o p i n g a Cu s t o m M e t h o d
Not e t h a t y o u mu s t e n a b l e y o u r c o d e her e. To act ual l y e x e c ut e t h e exi t ,
y o u h a v e t o a c t i va t e t h e i m p l e me n t a t i o n i n t h e ma i n s cr een o f Tr ansac
t i on SE19.
The BAdl is cr oss- cl i ent ; t h a t is, y o u r c h a n g e s t a ke ef f ect i n t h e e n t i r e
SAP syst em.
1 0 6
E xpl icit Enhancements as o f SAP ERP 6.0 w i t h Basis 7.0
Si nce SAP Ne t We a v e r Rel ease 7 . 0 , y o u c a n us e a n e w e n h a n c e m e n t
t e c hnol ogy. Let ' s have a l o o k a t t h e explicit enhancements fi rst ( i mpl i ci t
e n h a n c e me n t s ar e d e s c r i b e d l a t e r i n t h e s ec t i on t i t l e d I mpl i ci t E n h a n c e
me n t s as o f SAP ERP Cent r al C o m p o n e n t 6 . 0 wi t h Basis 7. 0) . SAP p r o
v i d e s t h e s e e n h a n c e m e n t s a t speci f i c l oc a t i ons i n t h e c o d e so t h a t y o u
can u s e t he m.
Expl i ci t e n h a n c e m e n t s ar e c o m b i n e d i n enhancement spots. Enhancement E n h a n c e me n t s p o t
points a n d enhancement sections ar e al so avai l abl e. The r e is n o d e f a u l t code
f or e n h a n c e m e n t poi nt s . You s i mp l y i ns e r t y o u r d e s i r e d a d d i t i o n s wh e r e
t h e e n h a n c e m e n t p o i n t is l ocat ed. Fo r e n h a n c e m e n t s ect i ons , SAP de l i v
er s a c o d e t h a t is e x e c u t e d as l o n g as y o u d o n ' t c r e a t e a n i m p l e m e n t a
t i on; h o we v e r , y o u can r e pl a c e it w i t h y o u r o wn i mp l e me n t a t i o n .
You can easi l y f i nd e xpl i c i t e n h a n c e m e n t s by s e a r c h i n g f o r t h e t e r m Se a r c h i n g f or
" e n h a n c e me n t - . " T h e h y p h e n is i mp o r t a n t ; o t h e r wi s e , t h e sear ch r esul t s e n h a n c e me n t s
w o u l d al so c o n t a i n i m p l e me n t a t i o n s b e c a u s e SAP o f t e n a l r e a d y de l i v
er s i mp l e me n t a t i o n s , f or e x a mp l e , f o r i n d u s t r y s o l u t i o n s . Fi gur e 4. 53
di spl ays t h e s ea r ch r e s u l t f o r t h e e n h a n c e me n t s o f t h e MASTERI DOC_CRE-
ATEJ- 1ATMAS f u n c t i o n modul e .
Adapting Existing IDoc Types | 4-2
Global Search in Programs
P r o g r a i / E n h a n c e i e n t
L M Y 0 1 U 0 6 1 2 2 E N H A N C E M E N T POI N T M A S T E R I D O C _ C R E A T E _ M A T M A S _ 0 1 S P O T S ES_SAPLMV01
2 7 9 E N H A N C E M E N T - P O I N T M A S T E R 1 D 0 C _ C R E A T E _ M A T M A S _ 0 9 S P O T S E S _ S A P L H V 0 1 .
2 9 1 E N H A N C E M E N T . P O I N T M A S T E R I O O C _ C R E A T E _ M A T M A S _ 0 2 S P O T S ES.SAPIMV01
2 9 3 E N H A N C E M E N T - P O I N T E H P _ M A S T E R I D 0 C _ C R E A T E _ M A T M A _ 0 1 S P O T S E S . S A P L M V 0 1
2 9 7 E N H A N C E M E N T - P O I N T M A S T E R I O O C _ C R E A T E _ M A T M A S 0 1 S P O T S ES.SAPLMVOI
4 7 3 E N H A N C E M E N T . P O I N T M A S T E R I D O C _ C R E A T E _ M A T M A S _ 0 3 S P O T S ES_SAPIMV01
4 7 5 E N H A N C E M E N T - P O I N T M A S T E R I D 0 C _ C R E A T E _ M A T H A S 0 2 S P O T S ES.SAPIMVOI
4 7 7 E N H A N C E M E N T . P O I N T M A S T E R I D 0 C _ C R E A T E _ M A T M A S _ 0 6 S P O T S ES_SAPLNV01
6 3 2 E N H A N C E M E N T . P O I N T M A S T E R I O O C _ C R E A T E _ M A T M A S _ 1 0 S P O T S ES.SAPLMV01
1111 E N H A N C E M E N T - P O I N T M A S T E R I D 0 C _ C R E A T E _ M A T H A S _ 1 1 S P O T S ES_SAPLMV01
1 1 5 6 E N H A N C E M E N T - P O I N T E H P _ M A S T E R I D 0 C _ C R E A T E _ H A T M A _ 0 2 S P O T S ES_SAPIMV01
1 4 4 5 E N H A N C E M E N T . P O I N T M A S T E R I D O C J C R E A T E _ M A T H A S _ 0 4 S P O T S ES_SAPLMV01
1 6 7 5 E N H A N C E M E N T . P O I N T M A S T E R 1 0 0 C _ C R E A T E _ M A T M A S _ 1 2 S P O T S ES_SAPLNV01
1 6 8 7 E N H A N C E M E N T - P O I N T M A S T E R I D O C _ C R E A T E _ M A T M A S _ 0 7 S P O T S ES_SAPIMV01
2 0 4 4 E N H A N C E M E N T . P O I N T M A S T E R I O O C _ C R E A T E _ M A T M A S _ 0 5 S P O T S ES_SAPLMV01
2 0 4 6 E N H A N C E M E N T . P O I N T M A S T E R I O O C _ C R E A T E _ M A T M A S _ 0 8 S P O T S ES_SAPLMV01
2 0 5 6 E N H A N C E M E N T . P O I N T M A S T E R 1 0 0 C _ C R E A T E _ M A T M A S _ 1 3 S P O T S ES.SAPLHV01
2 1 0 9 E N H A N C E M E N T . P O I N T M A S T E R 1 0 0 C C R E A T E _ M A T M A S _ 6 2 S P O T S ES_SAPLMV01
Figure 4.53 Finding Explicit Enhancements
107
4 | Changes to IDocs
C a l l i n g t h e BAdl
Enhanc ement s :
a c t i v a t i n g t he
e d i t i n g f u n c t i o n
E n h a n c e me n t
f u n c t i o n s
The c o d e i t s e l f i n d i c a t e s t h e ca l l i ng p o i n t a n d t h e n a me o f t h e c o r r e
s p o n d i n g e n h a n c e m e n t p o i n t ( sec Fi gur e 4. 54) . E n h a n c e me n t p o i n t s a n d
e n h a n c e m e n t s e c t i o n s d o n ' t h a v e a s i g n a t u r e f o r t h e t r a n s f e r o f dat a.
That me a n s y o u can access all var i abl es w i t h i n t h e e n h a n c e m e n t t h a t are
avai l abl e a t t hi s l oc a t i on i n t h e c o d e o f t he cal l i ng p r o g r a m. Flowever,
t hi s al so me a n s t h a t i t can be c o mp l i c a t e d t o d e t e r m i n e t h e n a me s o f t he
r e s pect i ve var i abl es a n d wh i c h d a t a is avai l abl e.
Function Bui lder: Display MASTERIDOC_CREATE_MATMAS
sun in wmn ^ isai
Insert
Function module (1ASTERID0C_CREATE_HATHAS Active
Attributes Import Export Changing Tables Exceptions,
i m m r iai
f ENHAMCEHENT-P01NT MASTER ID0C_CREATE_MATHAS_62 SPOTS ES_SAPLHV81
F i gu r e 4.54 En h a n c e me n t i n t h e Sour c e Code
I f y o u n o w w a n t t o i mp l e me n t an expl i ci t e n h a n c e me n t , y o u c a n t use t he
s t a n d a r d e d i t i n g f un c t i o n . You have t o i n f o r m t h e s ys t e m t h a t y o u d o n t
w a n t t o e d i t t h e or i gi nal b u t i ns t ead w a n t t o e d i t y o u r o w n i m p l e m e n t a
t i on. Fi gur e 4 . 5 5 s h o ws t h e i con t h a t y o u c a n us e f o r t hi s p u r p o s e .
Function Bui lder: Display MASTERIDOC_CREATE_MATMAS
Function module MASTERIDOC_CREATE_HATHAS Active
Attributes Import Export Changing Tables Exceptions
F i gu r e 4.55 A c t i v a t i n g t h e En h a n c e me n t Ed i t i n g Fu n c t i o n
Af t er ena bl i ng t h e edi t i ng o f e n h a n c e me n t s , y o u c a n s e t t h e mo u s e p o i n t e r
t o " e n h a n c e me n t " i n t h e c o d e a n d o p e n t h e c o n t e x t me n u by r i ght -cl i ck
i ng on it. Now, y o u can cr eat e, c ha nge, o r u n d o i mp l e me n t a t i o n s usi ng
t he E n h a n c e me n t I mp l e me n t a t i o n me n u i t em (see Fi gure 4. 56).
Fol l ow t he E n h a n c e m e n t I m p l e m e n t a t i o n C r e a t e me n u pat h. Because
SAP a l s o i m p l e m e n t s e n h a n c e m e n t s p o t s , i t ' s p o s s i b l e t h a t t h e SAP
n a me s p a c e a l r e a d y d i s p l a y s i m p l e m e n t a t i o n s ( Fi gur e 4 . 5 7 ) . Fo r t h e
1 0 8
Adapting Existing IDoc Types | 4-2
n a me s o f t h e i mp l e me n t a t i o n s , t h e r ul e t h a t t h e y m u s t begi n wi t h Z,"
"Y," o r t h e c u s t o m e r n a me s p a c e a p p l i e s agai n.
UIUities(M) Environment System Help
a 0 8
Function Builder: Change Enhancements MASTERIDOC_CREATE_MATMAS
H I I 3 G i
& 0 P l S Pattern Pretty Printer Function Module Documentation
Function module________ MASTER I OOC_CREATE_MAThAS | Active
Attributes Import Export Changing Tables Exceptions
CO
"lal
D i s t r i b u t e IOOC
ENHANCEMENT-POINT MASTERIDOCi
S S - S t a r t : MASTERIDOC_CREAT|
ENHANCEMENT 25 MGVJJENERATE;
{ALE B e g i n } g e n e r a t i o n h t t p
Do n o t change c o d i n g b e t e d
CALL FUNCTION 'M6 V_ALE_ADD_E|
TABLES
i d o c _ d a t a = T_IDOq
CHANGIN6
i d o c _ h e a d e r = F J D O d
{ALE End} g e n e r a t i o n
ENDENHANCEMENT.
S * $ - E n d : MASTERIDOC_CREAT
CALL FUNCTION MASTER_IDOC;
EXPORT I N6
Goto line
Next identical structure level
Previous identical structure level
BlocWButfer
h 13
Fi gu r e 4.56 En h a n c e me n t I m p l e m e n t a t i o n ( Co n t e x t M e n u )

/SAPHT/DRM_LOTMGMT_SAPLMV01
aCk
/SAPHT/DRM_LOTMGMT
/NFM/CA.SAPLMVG1 /NFM/CA
/SAPMP/MATMASTER_DRUM_SAPLMVG1 /SAPMP/MATMASTER.DRUH
DIMP_GENERAL_SAPLMV01 OIMP.GENERAL
ISM.SAPLMVOI JMDGEHJ10DIF
I MI
Use this enhancement implementation without query in future
*
l l * 0 /
Enhancement Implementation ZSM1
Short Text ZSM1
Composite Enhancement Implementation
1
Figure 4-57 Creating an Implementation
1 0 9
4 | Changes to IDocs
BAd i E n t e r t h e n a me ( he r e : "ZSM1") i n t h e E n h a n c e m e n t I mp l e me n t a t i o n
implementation fic l d as we l l as a d e s c r i p t i o n i n t h e S h o r t Text fi el d, a n d c o n f i r m y o u r
i n p u t . Af t e r t h e i mp l e me n t a t i o n has b e e n c r e a t e d, y o u c a n e n t e r code
w i t h i n a de f i ne d a r e a (Fi gure 4. 58) .
Funct i on Builder: En h a n c e me n t ZSM2 C
* y n m a a
F u n c t i o n m o d u l e NASTERIDOC_CREATE_MATHAS Ac
At t r i b u t e s i m o o r t E x o o r t C h a n a i n a T a b l e s
h a nge MASTERIDOC_CREATE_MATMAS
S P a t t e r n P i e t t y P n n : e r F u n c t i o n M o d u l e D o c u m e n t a t i o n
tive
F x c e s i ' . m n s

i _ L . I : s a l l a i

I
ENHANCEMENT 3 7 ZSN2 a c t i v e v e r s i o n
b r e a k a a i s e l s a
ENOENHANCEHENT
F i gu r e 4 - 5 8 Ed i t i n g an En h a n c e me n t I mp l e m e n t a t i o n
i m p l e m e n t a t i o n Bear i n mi n d t h a t t h e act i va t i on i con s h o w n he r e o n l y act i vat es y o u r part
c o d e 0 f t h c coc| c> x h e breakpoint, wh i c h wa s e n t e r e d as t h e o n l y c o m m a n d in
t h e e x a mp l e , h e l p s y o u d e t e r m i n e wh i c h var i abl es ar e avai l abl e, b u t it
s h o u l d a l wa y s be r e mo v e d o r r e pl a c e d by t h e d e s i r e d p r o g r a m b e h a v i o r
as s o o n as possi bl e.
New BAdls as o f SAP ERP 6.0 w i t h Basis 7.0
The b e n e f i t o f n e w BAdl s, wh i c h h a v e b e e n p r o v i d e d s i n c e SAP ERP 6. 0,
is t h a t t h e y h a v e a h i g h e r p e r f o r ma n c e t h a n cl assi c BAdls a n d t h a t t h e y
ar e c o n n e c t e d t o e n h a n c e m e n t s pot s . Th e i r s t r uc t ur e , h o we v e r , is s o m e
w h a t d i f f e r e n t f r o m t h e s t r u c t u r e o f cl assi c BAdl s. The r e a r e t w o o p t i o n s
f or u s i n g n e w BAdl s. The fi rst o p t i o n wa s i l l us t r a t e d i n t h e ma t e r i a l ma s
t e r exa mpl e : A n e w BAdi was ma d e f r o m mi g r a t i n g a classic BAdi. I n t hi s
case, t h e cl assi c BAdi calls t h e n e w BAdi dynami cal l y. You can n o l o n
g e r fi nd t h e BAdi n a m e b y b r o ws i n g t h e s our c e code . The classic BAdi,
h o we v e r , i ndi c a t e s t h e n a m e o f t h e n e w BAdi ne x t t o BAdi Mi g r a t e s to
E n h a n c e me n t Spot (see Fi gur e 4. 50) . Co n s i d e r i n g t hi s n e w n a me , navi
ga t e t o Tr a ns act i on SE19 t o i ni t i at e t h e act ual i mp l e me n t a t i o n .
i m p l e m e n t i n g The s e c o n d o p t i o n is t h a t t h e n e w BAdi ha s act ual l y b e e n c r e a t e d. You
n e w BAdls c a n fincj j t b y s e a r c h i n g f o r t h e GET*BADI c o mma n d . The n e w BAdi is also
i m p l e m e n t e d i n Tr a ns act i on SE19, b u t t h e n e x t s c r e e ns ar e c o n s i de r a bl y
d i f f e r e n t f r o m t h e s c r e e n s o f t h e i m p l e me n t a t i o n o f cl assi c BAdl s. Con-
1 1 0
Adapting Existing IDoc Types | 4 . 2
s eque nt l y, a n e x a mp l e o f t hi s is al so p r o v i d e d n e x t . It ' s cri t i cal t h a t y o u
s peci f y t h e n a me o f t h e e n h a n c e m e n t s p o t , a n d n o t t h e BAdI n a m e f or
n e w BAdl s (Fi gure 4. 59) .
BAdI Builder: Initial Sc r e e n f or Impl ement at i ons
is O i . B
E d i t i m p l e m e n t a t i o n
N e w BAdI
E n h a n c e m e n t i m p l e m e n t a t i o n
O C l a s s i c BAdi
I m p l e m e n t a t i o n
& D i s p l a y | # C h a n o e
C r e a t e i m p l e m e n t a t i o n
E n h a n c e m e n t S p o t
O C l a s s i c BAdi
BAdi N a m e
C r e a t e i m p i |
F i gu r e 4.59 I ni t i a l Scr een o f t h e BAd i B u i l d e r ( Tr ansac t i on SE19)
Next , e n t e r t h e n a me o f t h e e n h a n c e me n t i mp l e me n t a t i o n i n Transac
t i on SE19. Thi s n a me e na bl e s y o u t o al ways easi l y fi nd t he e n h a n c e me n t
i n Transact i on SE80, t h a t is, t he d e v e l o p me n t e n v i r o n me n t . Fi gur e 4. 60
s hows t h a t c ompos i t e e n h a n c e me n t i mp l e me n t a t i o n s ar e al so possi bl e i f
y o u wa n t t o c o mb i n e i ndi vi dual obj ect s. You can t h e n t r ans por t o r ena bl e
t hese compos i t e e n h a n c e me n t s t o g e t h e r i n SAP's swi t ch f r amewor k. You
wo u l d c o mb i n e i t ems t h a t ar e l ocat ed i n di f f e r ent SAP e n h a n c e me n t s but
bel ong t o o n e c u s t o me r de v e l o p me n t . They ar c sol el y classification items.
C r e a t e E n h a n c e m e n t I m p l e m e n t a t i o n
0 /
E n h a n c e m e n t I m p l e m e n t a t i o n ZSM_ENH1
S h o r t T e x t S a b i n e s I D o c E n h a n c e m e n t
C o m p o s i t e E n h a n c e m e n t i m p l e m e n t a t i o n
in
Figure 4. 60 Assigning a Name to the Implementation
N a me o f t h e
i m p l e m e n t a t i o n
4 | Changes to IDocs
implementing class For n e w BAdls, t oo, y o u m u s t first assi gn a n a m e t o t h e e n h a n c e me n t
i mp l e me n t a t i o n i n Tr ansact i on SE19. Usi ng t hi s n a me , y o u can al so m o d
ify y o u r e n h a n c e m e n t s i n t h i s t r a n s a c t i o n a t a l a t e r s t a g e ( he r e : ZSM_
I D0C_IMPJ1ATMAS). You a l s o n e e d t h e s peci f i cat i on f o r t h e i m p l e me n t a
t i on cl ass (ZCL_SM_IMP1), wh i c h s h o u l d c o r r e s p o n d t o t h e cl ass n a me
r ul es i f pos s i bl e (see Fi gur e 4. 61) .
^
C r e a t e BAdi I m p l e m e n t a t i o n s for EisDng BAdl De fi n it i o n s
> Adl i m p l e m e n t a t i o n [ i m p l e m e n t a t i o n C l a s s B a i Definition [ S h o r t T e i l
ZSM_I00C_MPJ1ATHAS |ZCl_SM_IMP1 BADI_HATHAS_AIE_CR 3 O a t e n M a t m a s - l d o c O e i m E r c e u g e n e i n e s l O O C s v e r a n d e r n
Figure 4 61 Name of the Implementing Class
Activating the The ne x t s cr een n o w di s pl a ys t h e p r o p e r t i e s o f y o u r n e w i mp l e me n t a -
implementation t j o n ( s e e Fi gur e 4 . 6 2 ) . I f e v e r y t h i n g is d o n e , y o u can e n a b l e it us i ng
t h e I m p l e m e n t a t i o n Is Act i ve c h e c k b o x . N e w BAdl s al so a l l o w y o u t o
fi rst c o mp l e t e t h e d e v e l o p m e n t wo r k a n d t h e n e n s u r e t h a t t he c o d e is
execut ed.
E n h a n c e me n t Impl ement at i on ZSM_ENH1 Cha nge
s a iM M M M M M s iM S S n iM M M S -
E n h a n c e m e n t i m p l e m e n t a t i o n ZSH_EMHl i n a c ti v e
P r o p e r t i e s H i s t o r y T e c h n i c a l D e t a i l s
B a d l i m p l e m e n t a t i o n ZSn_IOOC_lHP_HATHAS | [ 3 D o c u m e n t a t i o n |
0 B A d l I m p l e m e n t a t i o n s | D e s c r i p t i o n | D e s c n p t i o n ___ I m p l e m e n t a t i o n D a t e n M a t m a s - l d o c B e i m E r z e u g e n e r n e s i D O C s v e r a n d e i
I ' ZSM_iDOC_IMP_MAT> i m p i e m e n t a t i c D e f a u l t i m p l e m e n t a t i o n
E x a m p l e I m p l e m e n t a t i o n
' A c t * ' n o t s w i t c h a b l e t h r o u g h C u s t o m (IMG)
R u n t i m e B e h a v i o r 7~
K i m p l e m e n t a t i o n i s a c t iv e
E f f e c t i n C u r r e n t C l i e n t I m p l e m e n t a t i o n i s c a l l e d
P r o p e r t i e s o f B A d i De finition
BAdl D e f i n it i o n N a m e BAQj HAIHA$ A U CR
D e s c n p t i o n D a t e n M a t m a s - l d o c b e i m E r c e u g e n e r n e s i D O C s v e r a n d e r n
1 C l *1 * 1 1 1 *1
i n t e r f a c e L r _ L C Jl 11 n A i i i A ^ A L t 1 *
r Enh Implementation Elements
Figure 4 62 Properties of the Implementation
1 1 2
Adapting Existing IDoc Types | 4-2
To v i e w t h e i m p l e me n t i n g class, doubl e- c l i c k on I m p l e me n t i n g Cl ass M a i n t a i n i n g t he
(on t h e l eft i n Fi gur e 4. 63) . On t h e r i ght , t h e s y s t e m t h e n di spl ays t h e i m p l e m e n t i n g cl ass
i m p l e me n t i n g m e t h o d t h a t is c o p i e d by t h e BAdI i nt e r f a c e ( her e: IF_
EX_BADI_MATMAS_ALE_C R~CHANGE_MATMAS). Cl i cki ng t h e c h a n g e i con (pen)
t akes y o u t o t h e v i e w o f y o u r class.
Enhancement Implementation ZSM_ENH1 Change
H S I B S I H I I 0 D 1 - r A B B
E n h a r ^ ^ ^ n t Implementation ZSH_ENH1 inaclive
Properties History Technical D e t a i l s ^ E n h . i m p l e m e n t a t i o n E l e m e n t s
E^BAdl Implementations | Description "|
^ * ZSMJDOCJMP_MAT Impiementalic
implementing Clas
Implementing Class
interlace
Implementing Class
Mel
O i F _
I F X BAPI H A W S a l e CR
Method Short descnption
EX_BADI_MATMAS_ALE_CR'CHANGE_MATMAS Base Method
Fi gu r e 4.63 Na v i g a t i o n t o t h e I m p l e m e n t i n g Cl ass
Ne w BAdl s e n a b l e t h e d e v e l o p e r o f t h e BAdI 10 p r o v i d e a s a mp l e class.
Thi s way, h e c a n easi l y i n d i c a t e t h e i n t e n d e d usage o p t i o n s f o r his BAdI.
Thi s f u n c t i o n is opt i ona l ; t h a t is, i t i s n ' t p r o v i d e d b y all BAdl s. To i l l us
t r at e t hi s f u n c t i o n , t h e e x a mp l e i n Fi gur e 4 . 6 4 di spl ays t h e c o r r e s p o n d
i ng s c r e e n s h o t o f a d i f f e r e n t BAdI. Th e fi gure s h o ws t h e r e s pect i ve q u e r y
as we l l as t h e avai l abl e o p t i o n s . You can basi cal l y d e c i d e i f y o u w a n t to
us e an e m p t y class, us e t h e s a mp l e cl ass as a t e mp l a t e , o r have a class
i n h e r i t f r o m t h e s a mp l e class. The b e n e f i t o f h a vi ng y o u r BAdI i nhe r i t
f r om t h e s a mp l e cl ass is t h a t y o u re a u t oma t i c a l l y p r o v i d e d wi t h p o t e n
tial c h a n g e s i n r e c e n t rel eases.
Wh e t h e r y o u q u e r y t he s a mp l e m e t h o d o r n o t t h e n e x t s t e p al ways
t akes y o u t o t h e cl ass m a i n t e n a n c e ( see Fi gur e 4. 65) f r om w h e r e y o u can
navi gat e t o t h e s our c e c o d e o f y o u r m e t h o d b y doubl e- c l i c ki ng o n t he
m e t h o d i n t h e M e t h o d s tab.
Sa mp l e cl ass f or
n e w BAdl s
Sa mp l e m e t h o d f or
n e w BAdl s
113
4 | Changes to IDocs
Create Impleme 0 /
implementation example cl asses already exist
You have the following options:
Create a new empty class
Copy one of the example cl asses
nherrt from an example class not declared as "tinaf
implementation Example Cl asses
Cl ass Origin :mal viame j
CL_0NU7AW_BADI_IMPL_EXAHPLE BAdI O e f .

BAd! E x a a p l e l a p l e n e n t a t l o n C l a s s Q
S

E
0
<IMI
i l i
Empty Class Copy Sample C l a s s J I D inherit from Sample C l a s s J X
F i gu r e 4 64 O p t i o n a l Sa mp l e M e t h o d
Class B u i l d e r : Change Class ZCL_SM_IMP1
0 E H I S H E I I S U B I I S I S H D I M . Local Types Implemenlalion I E Macros^ Constructor
C l a s s interface ZCL_SM_IHP1
Properties Interfaces Fne nds Attributes
Implemented / Inactive
Events Types Aliases
P a r a m e t e r s ! E x c e p t i o n s p j j j ] l B | ^ | ^ | [ B j B | l X W I f f l [ M | M F T
Method |Level [visibility | m |Description
Filter
IF_EX_BADI_MATMAS_ALE_CR~CHANGE_HATNAS I n s t a n c e N e t r P u b l 1c B a s e Method
F i gu r e 4.65 Na v i g a t i o n t o t h e I m p l e m e n t i n g Cl ass
Class and method Fi gure 4 . 6 6 di spl ays a fi el d i n wh i c h y o u c a n e n t e r y o u r s o u r c e code, t hat
maintenance jS( t h e c o mp l e t e f unc t i ons , f or e xa mpl e , t o p o p u l a t e t h e c u s t o m s e g me n t
(in o u r e xa mpl e , o n l y a c o mme n t , * Your Implementation, wa s i ns er t ed
f o r t h e sake o f cl ari ty).
1 1 4
Adapting Existing IDoc Types | 4 . 2
Method I F EX 8 ADI HATMAS ALE CR-CHAN6 E HATHAS
r r i B i i 5 > m r m ' i i a a i ________________________________________________________
e t h o d IF_EX_BAD1_MATHAS_ALE_CR-CHANSE_HATHAS
Y o u r I n p l e n e n t a t i o n .
e ndnet hod.
Class Bui lder: Class ZCL_SM_IMP1 Change
F i gu r e 4.66 I m p l e m e n t i n g t h e B A d l M e t h o d
I m p l i c i t Enhancements as o f SAP ERP 6.0 w i t h Basis 7.0
In a d d i t i o n t o t h e e n h a n c e m e n t s d e s c r i b e d s o far, t he n e w e n h a n c e m e n t
o p t i o n s a l s o i n c l u d e implicit enhancements. The s e ar e e n h a n c e m e n t s t hat
a r e n ' t p r e d e f i n e d b y t h e SAP d e v e l o p e r . I ns t e a d, t h e y a r e avai l abl e at
specific l oc a t i ons i n all p r o g r a ms t h a t a r e n ' t p a r t o f t h e act ual SAP Basis.
For f u n c t i o n mo d u l e s a n d i nc l ude s as t h e y a r e p r o v i d e d i n I Doc pr oc e s s
ing, t h e s e a r e t h e f ol l owi ng l ocat i ons:
At t h e e n d o f an i nc l ude ( r e p o r t s ar e c o n s i d e r e d i nc l ude s as wel l )
I n t h e s i g n a t u r e o f f u n c t i o n mo d u l e s
At t h e e n d o f s t r u c t u r e t y p e d e f i n i t i o n s ( be f or e e n d o f )
At t h e b e g i n n i n g a n d e n d o f f or ms
The r e ar e s o me mo r e l ocat i ons , pa r t i c ul a r l y i n t h e c o n t e x t o f cl asses, but
t h e y a r e n ' t r e l e v a n t f or I Doc pr ocessi ng.
I mpl i ci t e n h a n c e m e n t s ar e ava i l a bl e i n e v e r y p r o g r a m a n d ar e h i d d e n
a t fi rst . On l y i f y o u i n f o r m t h e s y s t e m t h a t y o u w a n t t o u s e i mpl i ci t
e n h a n c e m e n t s d o e s t h e s ys t e m d i s p l a y t h e e n h a n c e m e n t s s o t h a t y o u
can e d i t t h e m. Fi rst , cl i ck t h e e n h a n c e m e n t i con HI. In t h e s c r e e n t hat
n o w o p e n s (see Fi gur e 4. 67) , f ol l ow t h e E d i t E n h a n c e m e n t O p e r a
t i o n s S n o w I m p l i c i t E n h a n c e m e n t O p t i o n s m e n u pa t h t o di s pl ay t he
i mpl i ci t e n h a n c e me n t s .
D i s p l a y i n g i m p l i c i t
e n h a n c e me n t s
1 1 5
4 | Changes to IDocs
Program Edit Goto Utilities(M) Environment System Help
a o a i
A B A P E
Pattern Ctrl*F6
Clipboard
m e n t s f o r R B D M I D O C
*
eport
Find/Replace Ctrl*F
nhancements a Q g 3 C!h G l Pattern Pretty Printer |
Find Next Ctrl*G
Active
I I I

F0
More functions *
Modification Operations
t o r t T4ne1
Enhancement Operations Create
d a t a : Da
Cancel F t 2 Undo
d a t a end o f t _ h e l p _ v a l u e .
Replace
d a t a b e q i n o f v a l u e s o c c u r s 0 . s t r i n .
Change
t h e l p . v a l u e - t a O n a n e = , E D I H S G \
h e l p . v a l u e - f i e l d n a n e = 'NESTYP'.
Show implicit Enhancement Options
Hide Implicit Enhancement Options
F i gu r e 4 - 6 7 Di s p l a y i n g I m p l i c i t Enhanc ement s
I m p l i c i t
e n h a n c e me n t s
i n t he
" R B D M I D O C "
r e p o r t
The p r o g r a m t e x t t h e n di s pl a ys a d d i t i o n a l l i nes t h a t c o n s i s t o f q u o t a t i o n
mar ks a n d na me s . These ar c t h e i mpl i ci t e n h a n c e me n t s . Because t h e y arc
avai l abl e i n all pr ogr ams , y o u n e e d t o g e n e r a t e t h e i r na me s . Th e i r names
al ways cons i s t o f a s e q u e n t i a l n u m b e r a n d a d e s c r i p t i o n t h a t i ndi cat es
t h e l o c a t i o n t o w h i c h t h e y b e l o n g (e. g. , a t t h e e n d o f a f or m) . Fi gure
4 . 6 8 di s pl a ys i mpl i ci t e n h a n c e m e n t b o t h a t t h e b e g i n n i n g a n d e n d o f
a f o r m a n d i n a d a t a s t a t e me n t as wel l as a t t h e e n d o f t h e i n c l u d e (t he
RBDMI DOC r e p o r t her e) . Thi s is i ndi c a t e d b y q u o t a t i o n mar ks , wh i c h r un
acr oss t h e e n t i r e li ne.
I m p l e m e n t i n g
an i m p l i c i t
e n h a n c e m e n t
An i mpl i ci t e n h a n c e m e n t is i mp l e me n t e d i n t h e s a me wa y as a n expl i ci t
e n h a n c e m e n t . An i m p l e m e n t a t i o n t h a t h a s a l r e a d y b e e n c a r r i e d o u t
r e ma i n s vi s i bl e ( see Fi gur e 4. 69) e v e n i f t h e di s pl ay o f i mpl i ci t e n h a n c e
me n t s is d i s a bl e d agai n, f o r e xa mpl e , a f t e r Tr a ns act i on SE38 ha s b e e n
r ecal l ed.
1 1 6
Adapting Existing IDoc Types | 4-2
A B A P E d i t o r : C h a n g e E n h a n c e m e n t s f o r R B D M I D O C
>*ISB | gqiy &*>ftMiw>MiWR^iBB33nPlllBW|pB"lF^
S S W I O O C jlrrt
I I I I I Ml I l a i
Mhip_ft>naae_cr*< t a e i e s t t M a e s t r u c t u r e t o o * *
c t t a oeo l n o ' t_r>elp_valu8 occu r s 6
incl u a e struc t u r e ne l p vain*
H U o i d o f t _ h * l p _ v a l u e
n i l Begin o f - i l u H oc c u r s 0, s t r i r > g ( K
n o of values
, -CDiHSC- * w i o m > * C D I $6- i t p
t _ r i p _ v a i u e - f i e i ^ w . H f $ T Y P
>> X' to t _ h * i p _ a i u s * l e c t f l a a
a p p e n d t.help.value
t (il p_ v al uo t ED I "661' fie l d t i t l e E O t f t S S T K S C S P
t .felp.val u e - f l e l d r i M e -DESCfiP
B O V * to t_hBlp_<alU'SBlBCtfI*3
a p p e n d t_help_va>ue
loo p at t_tt>0e
o v e t.tooa e - a e s t i p t o values
jppeno values
d e a r ediasgt
S1Ct Slnflle fre * d149t
Bh# r e es t p t _ t b d a e e s t p *< > lar g u a sy-1njj
iovo edlass t - o e s c r p t o valuBS
appond valuBS
c a l l f u n c t i o n -MUP_vlJS_0(T_y|TM_T>&r
l a p o r t i n B
s el*ct _ v l u * : aestyp
tallies
f ie l d s t_nelp_value
valuetafc values
F i gu r e 4.68 I m p l i c i t Enhanc ement s i n t h e " R B D M I D O C " Repor t
ABAP Editor: Change Enhancement ZSM1 _IMPL_ERW
f ^ l R I I f y | [ Acttve - Inactive | f c j | 1 [ f l l | # EnhancementTHj ] ^ ] 1 E j ] [ j I Pattern
Report RBDHIOOC Actr*
FORM F4HELP_FBNAME_CHECK
fora f4heip_fbnaae_check t a b l e s t _ t b d a e s t r u c t u r e tbde
d a t a : begin o f t _ h e l p _ v a l u e occurs 0
I n c l u d e s t r u c t u r e help_value
S ' J - S t a r t : ( 2 ) ................................................................................................
ENHANCEMENT 1 ZSM1_IHPL_ERW a c t i v e version
I can add F i e l d s t o S t r u c t u r e t _ h e l p _ v a l u e s f r o > here
8u t I have t o use an a d d i t i o n a l DATA coand
Oata: zsnvalue t y p e n a r a - e a t n r .
ENDENHANCEMENT
S'S-End ( 2 ) ................................................................................................
d at a: end o f t _ h e l p _ v a i u e
d at a: begin o f val ues occurs 0 . s t r 1 n g > 5 8 ) .
end o f values
Fi gu r e 4-69 I m p l e me n t e d I m p l i c i t Enhanc ement
The s a mp l e i mp l e me n t a t i o n o f an i mpl i ci t e n h a n c e me n t was de l i ber at el y Speci al as pec t s o f
s el ec t ed f or a s t r u c t u r e d e f i ni t i on her e. For i mpl i ci t e n h a n c e me n t s , t h e s t r u c t u r e s
1 1 7
4 | Changes to IDocs
E n h a n c e me n t i n
t h e r u n t i m e
e n v i r o n m e n t
or i gi nal SAP c o d e a n d y o u r e n h a n c e m e n t c o d e ar e avai l abl e as specific
p r o g r a mmi n g obj ect s a n d m u s t al so be val i d a n d c a n be act i vat ed as s pe
cific p r o g r a mmi n g obj ect s. Th e r u n t i m e e n v i r o n m e n t d o e s n t i n s e r t t hem
at t h e a p p r o p r i a t e l oc at i on u n t i l t h e ma i n p r o g r a m ha s b e e n exe c ut e d.
Because o f t hi s, t h e i m p l e me n t a t i o n r e q u i r e s a s e c o n d Data s t a t e me n t .
You ca n vi ew all e n h a n c e me n t s t h a t be l ong t o t h e n e w e n h a n c e m e n t t e c h
n o l ogy i n Tr a ns act i on SE80. Fi gur e 4 . 7 0 di spl ays o u r i mp l i c i t e n h a n c e
me n t , ZSM1_IMPL_ERW, w i t h r e f e r e nc e t o t h e r e p o r t n a me o r t h e i ncl ude
n a me i n t h e Pr ogr a m c o l u mn a n d t h e l oc a t i on o f t h e e n h a n c e m e n t s in
t h e c o d e ( i n t he E n h a n c e me n t Poi nt / Sect i on c ol umn) .
S t a t ic e n h a n c e m e n t s r e f e r t o c o d e f o r t h e d a t a d e c l a r a t i o n ; all o t h e r
e n h a n c e me n t s ar e dynamic.
E n h a n c e m e n t I m p l e m e n t a t i o n Z S M 1 D i s p l a y
> < y K- o u

2811 11*1 Ettl


i C3
A\m ' w
U K (* E W O W I N
i P o j r i m |o*rr-*fr |BjEr "y<fr nsco(
n e o n c o c Enhr<nint Po ft <P B R 8 D M O O C # 0 H H E L P _ ( B N A 4 E . . C M E C * f M _ H l P _ V l U E l S E E N W I
F i gu r e 4 - 7 En h a n c e me n t i n Tr ansact i on SE80
Speci al a s p e c t s o f
ALE ser vi ces i r r e s p e c t i v e o f t h e t e c h n o l o g y y o u i m p l e m e n t y o u r e n h a n c e m e n t s w i t h , n o t e
t h a t t h i s i s a l w a y s d o n e d u r i n g t h e g e n e r a t i o n o f t h e I D o c i n t h e o u t b o u n d
p r o c e s s i n g . I n g e n e r a l , a l l A L E s e r v i c e s a r e n t e x e c u t e d u n t i l t h e I D o c has
b e e n e n t i r e l y g e n e r a t e d , i n c l u d i n g y o u r e n h a n c e m e n t s , s o p o t e n t i a l f i l t e r
i n g p r o c e s s e s o r c h a n g e s a r e n t i m p l e m e n t e d u n t i l y o u r e n h a n c e m e n t s h a v e
b e e n c r e a t e d . T h e I D o c m a y s t i l l c o n t a i n v a r i o u s p l a n t s e g m e n t s d u r i n g t h e
r u n t i m e o f y o u r e x i t e v e n i f t h e s y s t e m d u e t o t h e o b j e c t f i l t e r i n g g e n e r
a t e s o n l y o n e p l a n t s e g m e n t o n t h e d a t a b a s e a t t h e e n d o f t h e I D o c c r e a t i o n .
C o n s i d e r t h i s w h e n i m p l e m e n t i n g y o u r e x i t s .
Enhancements and ALE Services
1 1 8
Adapting Existing IDoc Types | 4-2
4 .2 . 2 Gen e ra l Exits
Some o p e r a t i o n s a r e h a n d l e d i n t h e s a me wa y f or mo s t o f t h e IDocs.
Thi s al so appl i es t o t h e v e r s i o n c o nve r s i on, wh i c h can b e conf i gur e d in
Tr a ns act i on WE20. Fo r ma s t e r da t a IDocs, t h e s e o p e r a t i o n s al s o i ncl ude
t h e wr i t i n g o f c h a n g e p o i n t e r s . Th e n e x t s ec t i on i n t r o d u c e s t h e e n h a n c e
m e n t obj ect s t h a t SAP pr o v i d e s f o r t h i s p u r p o s e .
Version Conversion
De p e n d i n g o n t h e r e l e as e o f t h e SAP s y s t e m, t h e r e can be a speci f i c v e r
s i on f o r e a c h s e g me n t . For t h e c o mmu n i c a t i o n w i t h pr e v i o u s rel eases,
i t ma y b e ne c e s s a r y t o g e n e r a t e t he s e g me n t s w i t h a r e l e as e v e r s i o n t hat
y o u c a n f r eel y d e f i n e i n Tr a ns act i on WE 2 0 (see al so Sect i on 4 . 1 . 6 , Ver
s i o n Conve r s i on) . Thi s c a n be d o n e w i t h o u t a n y d e v e l o p m e n t w o r k . In
a d d i t i o n , h o w e v e r , SAP p r o v i d e s a n SAP e n h a n c e m e n t i n Tr a ns act i on
SMOD t o e n a b l e c u s t o me r s t o i m p l e m e n t t h e i r o w n f unct i onal i t y.
The EX I T _ S AP L B D1 1 _ 0 0 1 e x i t i n t h e A L E 0 0 0 0 1 e n h a n c e m e n t is c o n t i n u
ous l y e x e c u t e d e v e n i f n o ve r s i on c o n v e r s i o n is s peci f i ed i n Tr ansact i on
WE2 0 . It ' s o n e o f t h e f e w exi t s t h a t al so d e l i v e r h e a d e r a n d s t a t us da t a o f
t h e IDoc a n d c a n be c h a n g e d i f r e q u i r e d . Th e c u s t o m e r i n c l u d e i n wh i c h
y o u i n s e r t y o u r c o d e is cal l ed ZXSBDU01 a n d is an exi t i n a n SAP e n h a n c e
me n t . Th e s a mp l e c o d e s h o ws h o w y o u can d e t e r m i n e t h e c u s t o m e r ID
i n t h e SAP s ys t e m f r o m t h e ILN ( I n t e r n a t i o n a l Locat i on Nu mb e r ) i n t h e
I Doc (see Li st i ng 4. 1).
I n gener al , t hi s exi t c a n be e xe cut ed i n t h e i n b o u n d a n d o u t b o u n d process
i ng, wh i c h me a n s y o u have t o def i ne t he di r e c t i on o f t h e c o mmuni c a t i on
first. In t h e ne x t st ep, y o u can ma k e t h e r e qui r e d cha nges ( t o t h e cont r ol
r e cor d o r t h e IDoc dat a). Finally, y o u mu s t cha nge t h e f ol l owi ng fields:
i d o c _ c o n t r o l _ o u t - i d o c t p
i d o c _ c o n t r o l _ o u t - u p d d a t
i d o c _ c o n t r o l _ o u t - u p d t i m
T h e p r o g r a m t h a t cal l s t h e e x i t c he c ks w h e t h e r t h e s e fi el d h a v e b e e n
c h a nge d. On l y t h e n d o e s t h e s ys t e m c o p y t he ot her , p o t e n t i a l l y cha nge d
val ues f r om t h e i d o c _ c o n t r o l _ o u t s t r uc t ur e . It ' s suffi ci ent he r e t o addr ess
t h e fields; t h a t is, I DOCTP e n a b l e s y o u t o c o p y t h e i ni t i al val ue, wh i c h is
usual l y desi r ed.
" A L E 0 0 0 0 1 " SAP
e n h a n c e m e n t
Re t u r n changes
1 1 9
4 | Changes to IDocs
Sa mp l e c o d e * & ..............................................................................................................................................................................*
* & I n c l u d e ZXSBDU01
*&............................................................................................................................................ *
* C h e c k w h e t h e r I D o c i s r e c e i v e d , o t h e r w i s e d o n o t h i n g !
c h e c k i d o c _ c o n t r o l _ i n - d i r e c t e q * 2 ' .
* I f y e s , c h e c k w h i c h I D o c a n d c h a n g e
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* L o c a l v a r i a b l e s
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
d a t a : w a _ k u n n r t y p e k n a l - k u n n r .
DATA: w a _ i d o c _ d a t a t y p e e d i d d .
DATA: w a _ e l e d k a l t y p e e l e d k a l .
DATA: w a _ e l e d k l 4 t y p e e l e d k l 4 .
d a t a : w a _ v k o r g t y p e t v k o - v k o r g .
DATA: XBBBNR L I K E KNA1 - BBBNR .
DATA: XBBSNR L I K E KNA1 - BBSNR .
DATA: XBUBKZ L I K E KNA1 - BUBKZ .
C h e c k m e s s a g e t y p e
c a s e i d o c _ c o n t r o l _ i n - s t d m e s .
w h e n ' ORDE RS .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* F i l l v e n d o r n u m b e r a n d c u s t o m e r n u m b e r
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
F i l l v a l u e s
l o o p a t i d o c _ d a t a i n t o w a _ i d o c _ d a t a
w h e r e s e g n a m e q E 1 E D K A 1 .
w a _ E l E D K A l - w a _ i d o c _ d a t a - S D A T A .
i f w a _ e l e d k a l - p a r t n i s i n i t i a l . O n l y i f i t i s m i s s i n g
XBBBNR - w a _ E l E D K A l - 1 L NNR+ 0 ( 7 ) .
XBBSNR = w a _ E l E D K A l - I L N N R + 7 ( 5 ) .
XBUBKZ - w a _ E l E D K A l - 1 L N N R + 1 2 ( 1 ) .
CHECK: NOT XBBBNR I S I N I T I A L .
CHECK: XBBBNR NE SPACE .
SELECT k u n n r FROM KNA1 i n t o w a _ k u n n r
WHERE BBBNR EO XBBBNR
AND BBSNR EQ XBBSNR
AND UBKZ EO XBUBKZ .
E X I T .
ENDSELECT .
I F SY- SUBRC - 0 .
w a _ e l e d k a l - p a r t n = w a _ k u n n r .
1 2 0
Adapting Existing IDoc Types | 4-2
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* R e t u r n d a t a t o I D o c
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
R e t u r n t o I D o c
w a _ i d o c _ d a t a - s d a t a = w a _ e l e d k a l .
m o d i f y i d o c _ d a t a f r o m w a _ i d o c _ d a t a .
e n d i f .
e n d i f .
e n d l o o p .
wh e n ANYOTHERTYPE .
* W h a t e v e r y o u w a n t t o d o w i t h t h i s m e s s a g e t y p e ,
wh e n o t h e r s .
e n d c a s e .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* C h a n g e c o n t r o l r e c o r d s o t h a t t h e c h a n g e s
a r e i m p l e m e n t e d a f t e r t h e e x i t :
t h i s a p p l i e s t o a l l c h a n g e d s e g m e n t s
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
mo v e i d o c _ c o n t r o l _ i n t o i d o c _ c o n t r o l _ o u t .
i d o c _ c o n t r o l _ o u t - I D O C T P - i d o c _ c o n t r o l _ i n - I D O C T P .
i d o c _ c o n t r o l _ o u t - u p d d a t = s y - d a t u m .
i d o c _ c o n t r o l _ o u t - u p d t i m - s y - u z e i t .
L i s t i n g 4.1 Sampl e Code f o r t h e " A L E 0 0 0 0 1 " Enha n c e me n t
BAdl f o r t he Generation o f Change Pointers
As d e s c r i b e d i n C h a p t e r 2, S e c t i o n 2 . 1 . 1 , Sha r e d M a s t e r Da t a Tool,
c h a n g e p o i n t e r s ar e g e n e r a t e d i n t h e CHANGE_POI NTERS_CREATE_LONG o r
CHANGE_POI NTERS_CREATE_DI RECT f u n c t i o n mo d u l e . SAP a l s o p r o v i d e s an
exi t a cl assi c BAdl f o r t h e g e n e r a t i o n o f c h a n g e p o i n t e r s . The exi t
has o n l y b e e n avai l abl e as o f SAP Ne t We a v e r 6. 20.
The BDCP_BEFORE_WRI TE BAdl is a f i l t er - depende nt BAdl wi t h t h e mes s age "BDCP_BEFORE_
t ype as t he filter. The pr er equi si t es f o r us i ng t hi s exi t are t h a t cha nge poi nt - w r i t e " BAdl
ers ar e gener al l y enabl ed, t h a t t h e y ar e ena bl e d f or t he c or r e s pondi ng mes
sage t ype, a n d t hat t he fields t hat ar e s uppos e d t o be r el evant t o t he changes
are ma i nt a i ne d f or t he mes s age t ype. In t he s t a nda r d ver si on, t hese set t i ngs
e na bl e t he SAP sys t em t o cr eat e all r e qui r e d c h a n g e poi nt er s . The BAdl is
t h e n call ed bef or e it cr eat es t h e cha nge poi nt er s o n t he dat aba s e a n d al l ows
f or mor e r est r i ct i ons on t he g e n e r a t i o n o f cha nge poi nt er s t han t he Cus
t omi zi ng set t i ngs. The BAdl c ont a i ns s a mp l e code f or t wo cases:
1 2 1
4 | Changes to IDocs
" OBJ ECTI D f i el d
" C P I D E N T " f i el d
I n s e r t i n g d a t a
C u s t o me r
s e g ment s
Th e s y s t e m wi l l w r i t e c h a n g e p o i n t e r s f or p a r t i c u l a r mat er i a l s onl y.
Th e s y s t e m wi l l w r i t e c h a n g e p o i n t e r s f or p a r t i c u l a r user s onl y.
I f y o u w a n t t o us e t h i s BAdI, y o u can c o p y t h e s a mp l e c o d e a n d a d a p t
it t o y o u r r e q u i r e me n t s . Her e, y o u m u s t t ake i n t o a c c o u n t s o m e specific
aspect s.
First o f al l , t h e s a mp l e c o d e p r o v i d e d b y SAP a s s u me s t h a t t h e OBJ E C
TI D field c o n t a i n s t h e c l i ent a t t h e b e g i n n i n g 3 di gi t s. Thi s i s n ' t t h e case.
So pl eas e d o n ' t r e mo v e t h e t hr e e a d d i t i o n a l fi el ds f or t h e c l i e n t i n y o u r
i mp l e me n t a t i o n i f y o u w a n t t o fi l t er by o b j e c t IDs.
I n a d d i t i o n , t h e CP I DENT field d o e s n ' t c o n t a i n t h e n u m b e r t h a t it will
have i n t h e BDCP a n d BDCPS t abl es a t a l at er st age. I ns t ead, it o n l y cont ai ns
a t e mp o r a r y n u m b e r unt i l t h e s y s t e m assi gns t h e act ual n u m b e r dur i ng
t h e upd a t e .
I n t h e exi t hel p, SAP s t a t e s t h a t y o u c a n al so i ns er t c h a n g e poi nt er s ; t he
s a mp l e c ode , i n t u r n , says t h a t y o u c a n ' t us e t h e exi t f o r t hi s p u r p o s e .
Techni cal l y, h o we v e r , y o u ca n i n s e r t t h e m, b u t y o u m u s t e n s u r e t h a t t he
t e mp o r a r y CPI DENT field o f y o u r i n t e r n a l t a bl e c o n t a i n s s e q u e n t i a l n u m
be r s w i t h o u t d u p l i c a t e val ues; o t h e r w i s e , t h e u p d a t e is ca nc e l e d. You
s h o u l d be car ef ul w h e n i n s e r t i n g c h a n g e p o i n t e r s . I f y o u w a n t t o d e bug
y o u r exi t , u p d a t e d e b u g g i n g us ual l y n e e d s t o be e n a b l e d . Mo s t ma s t e r
d a t a pos t s i t s c h a n g e s u s i n g t h e u p d a t e t e c h n o l o g y o n t h e d a t a b a s e , so
wr i t i n g c h a n g e p o i n t e r s al so t akes pl ace d u r i n g u p d a t e pr ocesses.
4 .2 . 3 C u s t o m S egments
Bot h w h e n e n h a n c i n g e x i s t i n g I Doc t y p e s a n d w h e n c r e a t i n g c u s t o m
IDoc t ypes , a p r e r e q u i s i t e is t h e g e n e r a t i o n o f s e g me n t s t h a t c o n t a i n t he
a pp l i c a t i o n dat a. Such a s e g m e n t can i n c l u d e u p t o 1 , 0 0 0 a l p h a n u me r i c
cha r ac t e r s . All i n f o r ma t i o n on t h e g e n e r a t i o n o f c u s t o m s e g me n t s is d i s
cus s e d aga i n i n Sect i on 4 . 4 . 1 , Cr ea t i ng Cus t om IDocs.
Creating Segments
Befor e y o u c a n us e c u s t o m s e g me n t s , y o u us ual l y h a v e t o mo d i f y t he
b u s i n e s s dat a. Nor mal l y, y o u can e x p e c t t h a t t hi s h a s al r e a dy b e e n d e v e l
o p e d by y o u r col l eagues f r om t h e a pp l i c a t i o n d e p a r t m e n t . The f ol l ow
122
Adapting Existing IDoc Types | 4 . 2
i ng e x a mp l e , h o w e v e r , al so i n c l u d e s t h e d a t a i n t h e ma t e r i a l ma s t e r
t h a t wi l l be u s e d i n t h e e n h a n c e m e n t . Fi gure 4. 71 s h o ws h o w y o u can
a p p e n d a d d i t i o n a l c us t ome r - s pe c i f i c fi el ds t o t a bl e s ( her e: m a r a ) usi ng
t h e Ap p e n d St r uc t ur e b u t t o n ( on t h e t op r i g h t i n t h e fi gure) i n Tr ansac
t i on SE11. For t h i s p u r p o s e , assi gn a n a p p e n d n a m e first, wh i c h m u s t be
wi t h i n t h e c u s t o m e r n a me s p a c e ( her e: Z S M M A R A ) .
Dictionary: Display Table
0 0 i m m m i a s e i m m n m i
Transp Table KARA Active
^Technical Settings ] | indexes A p p e n d Structure
_ S.
e i Q i a n i
Object Name
IS H_MAPA_AP P
Status
IST_MAT_FIELDS
JPAMARA
OllMARA
New
New
New
New
| Short tea
is-h mm H o s p i ^ S p e d f i e Fields
IS-T: User-Specific Material Master Fields
| ISM Append to MflflA Media-Specific Fields
lS-OilA|pen|
Append Name
0
ZSHHARA
reated the Obiect
hanged Obiect
omplete material
Fi gu r e 4-71 Cr e at i n g an A p p e n d t o t h e " M A R A Tabl e
In t h e ne x t s t e p, y o u c a n as s h o w n i n Fi gure 4 . 7 2 speci f y i n t he
Co mp o n e n t s t ab wh i c h n e w fi el ds y o u w a n t t o use. The n a me s o f t hese
fi el ds s h o u l d al so c o r r e s p o n d t o t h e c u s t o m e r n a mi n g r ul e s b e c a u s e p r o
gr a ms t r e a t t h e m as fi el ds t h a t ar e di r ec t l y i nc l u d e d in t he m a r a t a bl e a n d
b e c a u s e y o u can n e v e r b e s ur e wh i c h fi el ds SAP wi l l add.
Dictionary: Maintain Append Structure
4. V O ; Hierarchy Display
Append Structure
Short Description
ZSHHAPA
Sabines Append to HftPA
Actwe
Entry help/check Currenctfquantity fields
t / 2
Short Description
ZSHFELD2
CHAR20
C-HAILt1
CHAP
CHAR
20 0 Char 20
1 0 8Character F leld Length = 1 0
F i gu r e 4.72 Cu s t o m Fi el ds
S e g me n t f i e l d s
123
4 | Changes to IDocs
Custom segment No w y o u c a r r y o u t t he fi rst I Doc - r e l e vant s t ep f o r e n h a n c i n g IDoc t ypes,
tyPes wh i c h is c r e a t i ng a c u s t o m s e g m e n t t ype. You c r e a t e s e g m e n t t y p e s in
Tr a ns act i on WE31. The y c a n h a v e n a me s wi t h u p t o 2 7 cha r ac t e r s b e g i n
n i n g w i t h "Z" o r "Y" o r / < NAMESPACE> / i f t h e y ar e c u s t o m e r s e gme nt s .
Thi s is f o l l o we d b y 1; t h e r e ma i n i n g p a r t o f t h e n a m e c a n be fr eel y
d e f i n e d by y o u (in o u r e x a mp l e , t h e n a me is Z 1 M A R A ) .
SAP s e g me n t s o f t e n have a n a me t h a t di r ec t l y r ef er s t o t h e da t a b a s e t abl e
f r om wh i c h t h e fi el ds ar e u s e d . But t hi s i s n ' t ma n d a t o r y . Fi gur e 4. 73
di s pl a ys o u r s a mp l e s e g me n t , wh i c h b e l o n g s t o t h e a p p e n d di s cus s ed
e a r l i e r f o r t h e m a r a t abl e.
Development segments: Display segment definition Z2MARA000
Segment type attributes
Segment type Z 1MARA Qualified segment
Short Description Z l m a r a
Segm definition Z2HARAO0 O | Released
Last Changed By MAISELSA
- ieid Name ) a t a element SO CO
m
ZZSHFEL01 CHAR20 20
i j
2 ZZSHFELD2 CHARI 0

0 Ld
F i gu r e 4.73 Cr e at i n g a Cu s t o m Se g me nt Type
W h e n c r e a t i n g t h e s e g me n t , t h e s ys t e m d e t e r m i n e s t h e l engt hs o f t he
fields f r o m t h e d a t a b a s e . I f y o u mo d i f y t h e field l e n g t h s a t a l a t e r st age,
y o u mu s t ma n u a l l y c h a n g e t h e m i n t h e s e gme nt .
You can v i e w t h e s e g m e n t t y p e i n Tr a ns act i on SE11, t h e Data Dictionary
(DDIC), w h e r e it' s d e f i n e d as a s t r u c t u r e . The s e g m e n t t y p e c o n t a i n s t he
i n f o r ma t i o n i n a SAP-specific f o r ma t i n wh i c h t h e da t a b a s e al so st or es
t h e fields.
The s ys t e m al so cr eat es a s e g m e n t d e f i n i t i o n f or e v e i y s e g me n t t y p e wi t h
t h e s a me n a me pa r t s as i n t h e or i gi nal n a me e x c e p t f o r t h e 1, wh i c h is
r e pl a ced by a 2 h e r e (e. g. , Z 2 M A R A ) . Thi s s e g me n t d e f i n i t i o n can be avai l
a bl e i n va r i ous ver s i ons , wh i c h is i n d i c a t e d b y a t hr e e - di gi t n u m b e r at
S e g me n t t y p e i n
Tr ans ac t i on SE11
1 2 4
Adapting Existing IDoc Types | 4-2
t h e e n d o f t h e n a me . Th e s e g me n t d e f i n i t i o n o f o u r e x a mp l e is t h e first
v e r s i o n , s o i t s a s s i g n e d t h e "OOO" a d d i t i o n : Z 2 M A R A 0 0 0 . Th e s e g m e n t
def i ni t i on i ndi c a t e s t h e e xt er nal f or ma t , t hat is, t h e f o r ma t t h a t is act ual ly
e x c h a n g e d w i t h t h e p a r t n e r a n d t h a t di f f er s f r om t h e i n t e r n a l f o r ma t o f
t h e SAP d a t a b a s e f o r s o me fields.
To d e l i v e r a n e u t r a l f o r ma t , y o u m u s t p r o v i d e al l i n f o r ma t i o n as a text .
The SAP da t a b a s e s t or e s n u mb e r s w i t h o u t dec i ma l s e pa r a t or s ; t h e de c
i mal s e p a r a t o r , h o we v e r , is a l wa ys t r a n s f e r r e d as a p o i n t . A pos s i bl e
mi n u s s i gn is t r a n s f e r r e d i n t h e l ast fi el d. Co mp a r e d t o t h e i n t e r n a l p r e
s e nt a t i on, t h e s e n u mb e r s al ways c o n t a i n t wo a ddi t i ona l pl aces. Dat es are
usual l y t r a n s f e r r e d as fol l ows: f o u r di gi t s f o r t h e y e a r , t w o di gi t s f o r t he
mo n t h , a n d t w o di gi t s f o r t h e day.
You m u s t rel ease t h e s e g m e n t b e f o r e y o u c a n us e i t . For t h i s p u r p o s e ,
f ol l ow t h e E d i t S e t r e l e a s e me n u pa t h (see Fi gur e 4. 74).
& b o
Segment Ed it Goto Ubli!ies(M) Environment System Help
Q Set release @ 0 3 0 3 3 ) \ 0 ) ) 0 0 W
Devel op
m m m
Segment type
Cancel release
Object directory entry
Cancel F1 2
Z1HARA
ial s c r e e n
Z1 mara
-
Segm definition
I s t l f c f c l J J J - J f i U I A J I " I
000 Z2HARAO00

30 0 8 / 1 8 / 2 0 0
E
F i gu r e 4.74 Rel easi ng a Segment
Af t e r t h e r el ease, e v e r y c h a n g e r esul t s i n a n e w v e r s i o n o f t h e s e gme nt .
I n t he Ver si on Co n v e r s i o n ALE s er vi c e (see Sect i on 4 . 2 . 2 , Ge ner al Exits),
y o u ca n e n s u r e t h a t t h e s y s t e m uses t h e a p p r o p r i a t e o l d e r v e r s i o n o f t he
s e g me n t def i ni t i on i f y o u r p a r t n e r uses a n o l d e r rel ease.
Creating an Enhancement Type
A f t e r y o u cr eat e all r e qui r e d s e g me n t s , y o u c a n cr eat e t h e act ual e n h a n c e
m e n t t ype. It al so f ol l ows t h e c o m m o n c u s t o m e r n a mi n g r ul e s a n d can
Ne u t r a l f o r m a t
Rel ease
C r e a t i n g an
e n h a n c e m e n t t y p e
125
4 | Changes to IDocs
Pr oper t i es o f t he
e n h a n c e m e n t t y p e
c o n t a i n u p t o 3 0 char act er s. Transact i on WE 3 0 is t h e c o r r e s p o n d i n g t r a ns
a c t i on. It ' s crit i cal t h a t y o u s e l e c t t h e Ext e ns i on c he c kbox (Fi gure 4. 75) in
t h e i ni t i al s cr een bec aus e t he d e f a u l t s e t t i ng is Basic Type, wh i c h is onl y
r e q u i r e d f or c o mp l e t e l y n e w IDoc t ypes.
Develop IDoc Types: Initial Screen
SW*? 0 Change Requests (Organizer)
Ob) Name ZSI1HARA
Development obiect
C Basic type
Extension
F i gu r e 4- 75 Cr eat i ng t h e En h a n c e me n t Type
I n t h e n e x t s t e p (see Fi gur e 4. 76) , d e f i n e w h i c h basi c t y p e y o u w a n t
y o u r e n h a n c e m e n t t y p e t o r e f er t o; i n o u r e x a mp l e , i t ' s t h e MATMAS05
ba s i c t y p e . You c a n al so c o p y a n d f u r t h e r p r o c e s s e x i s t i n g e n h a n c e
me n t s o r cr eat e a n e n h a n c e m e n t as t h e f ol l ow- up o b j e c t o f an exi st i ng
e n h a n c e me n t .
& Cr e a t e ext ensi on ZSMMARA 0.
N e w extensi on
Create new
O Create a s copy
O Create successor
Linked b a s i c type
Co py f ro m ext ensi on
Linked w i t h b a s i c type
Successor or extension
A d m i n i s t r a t i o n /
Person re s p o n s i b le MAISELSA
P r o c e s s i n g per son H m a i s e l s a
De scri pti on
S a b i n e s En h a n c e d Material
Figure 4 . 76 Necessary Specifications
1 2 6
Adapting Existing IDoc Types | 4 . 2
The ne x t s cr een di s pl a ys t h e basi c t y p e t h a t is d e f i n e d as a t e mp l a t e (see
Fi gur e 4. 77) . You c a n c h o o s e t h e s e g m e n t f o r w h i c h y o u w a n t t o creat e
y o u r chi l d s e g me n t s b y s el ect i ng t h e s e g m e n t a n d cl i cki ng o n t he Creat e
i con. Th e s y s t e m t h e n o u t p u t s a me s s a ge t h a t i ndi cat es t h a t c u s t o m s e g
me n t s a r e o n l y p e r mi t t e d as chi l d s e g m e n t t y p e s f o r e n h a n c e me n t s .
Create extension: ZSMMARA
E1MARAM
E1MARA1
E1MAKTM
m eiharcm
- 0 3 E1HARP1H
E1H6EM"
<D E1N16NF1
Eimvkem
eihlanh
03 E1MTXHH
- 0 3 E1CUCFG
-E1UPSL1NK
Sabines Enhanced M a t e r i a l
Master l a t e r l a l g e n e r a l d a t a (KARA)
A d d i t i o n a l F i e l d s f o r E1 MARAM
Master a t e r i a l s h o r t t e x t s (MAKT)
Master a a t e r t a l C segment (MARC)
M a s t e r M a t e r i a l u n i t s o f M e a s u r e (HARM)
Master M a t e r i a l M a t e r i a l v a l u a t i o n (MBEY)
M a s t e r M a t e r i a l M a t e r i a l d a t a p e r t a r e h o u s e n u M b e r (MLGH)
M a s t e r M a t e r i a l s a l e s d a t a (MVKE)
Master M a t e r i a l t a x c l a s s i f i c a t i o n (MLAH)
Master m a t e r i a l l o n g t e x t header
CU: C o n f i g u r a t i o n dat a
Reference TroM O b j e c t t o S u p e r i o r UPS
I E * Information 0 /
U Ertehsion segment ?Toe(s) w i i i be inserted as
child segment vpe(s) o f E1 MAPAM
F i gu r e 4.77 I ns er t i ng a Cu s t o m Segment
Next , y o u mu s t speci f y w h i c h s e g m e n t t y p e y o u w a n t t o us e ( s e e Fi gure
4 . 78) . F u r t h e r mo r e , y o u n e e d t o d e f i n e t h e o c c u r r e n c e o f t h e s e g me n t
w i t h i n t he IDoc; t h e m i n i m u m n u m b e r mu s t al ways be "1. " 0 wo u l d
be c o n s i d e r e d " bl a nk" her e, wh i c h j us t i f i e s t hi s u n c o m m o n e nt r y. The
s e g me n t t y p e o n l y b e c o me s a Ma n d a t o r y s e g m e n t i f y o u sel ect t he c o r
r e s p o n d i n g flag. In o u r e xa mpl e , t h e s e g m e n t is o p t i o n a l a n d can occ ur
o n l y o n c e . (The a p p e n d e n t i y i n t he ZSMMARA t abl e can be p r o v i d e d o n l y
o n c e f o r each mat er i al ; accor di ngl y, t h e ZI MARA s e g me n t c a n o c c u r o n l y
o n c e f o r each ma t e r i a l as well . )
1 2 7
E n h a n c e me n t o f
t h e M A T M A S "
basi c t y p e
Oc c u r r e n c e o f t h e
s e g me n t s
4 | Changes to IDocs
E n h a n c e me n t f o r
Z 1 M A R A "
Rel easi ng an
e n h a n c e m e n t
Creat e ext ensi on: ZSMMARA
]fc x > * a
Sabines Enhanced H a t e r i a l
E1MARAM
-------- E1HARA1
-------- E1MAKTH
B E1MARCH
CD E1HARHM
-------- E1M6CWI
- 0 3 E1W.6KH
-------- E1MVKEH
-------- E1HLANM
03 E1MTXHH
- 0 3 E1CUCF6
- E1UNIINK
Master a t e r i a l g e n e r a l d a t a (MARA)
c-Mamtain Attributes
Segmtyoe ZIMARA
Mandatory seg
Minimum number

Maximum number 1
Parent segmeni
Hieriei 0
^ Segmem editor U
u b e r (HLGN)
F i gu r e 4.78 Spec i f i cat i ons f o r a Cu s t o m Segment
The s y s t e m i ndi c a t e s t he c u s t o m e n h a n c e m e n t s e g me n t s i n w h i t e a n d
t h e i ni t i al s e g me n t s i n bl ue. Thi s e n a b l e s y o u t o di r ec t l y i d e n t i f y whi c h
s e g me n t s have b e e n a d d e d . Fi gur e 4 . 7 9 di spl ays t h e e n h a n c e m e n t result ,
t h a t is, t h e a d d e d ( whi t e ) s e g me n t , ZIMARA.
Create ext ensi on: ZSMMARA
; p , i i B g
| n a s t e r t a t e n a i gen era l d a t a (MARA)
Z l n a r a Z1HARA
I HARA1 A d d i t i o n a l F i e l d s Tor E1 MARAH
Haster a a t e r l a l s h o r t t e x t s (MAKT)
Master a a t e r l a l C seg>ent (MARC)
Master a a t e r l a l u n i t s o f measure (HARM)
Haster a a t e r l a l a a t e r l a l v a l u a t i o n (HBEW)
03
O)
-----
tMARCH
EtHARMH
1HBEYM
03 1HL6HM
E1HVKEM
Haster a a t e r l a l a a t e r i a l d a t a per warehouse n u i b e r (HL6H)
n a s t e r a a t e r l a l s a l e s d a t a (HVKE)
m
I M L A M U
1HTXHH
E1CUCF6
H a s t e r a a t e r l a l t a x c l a s s i f i c a t i o n (HUH)
Haster a a t e r l a l l o n g t e x t header
----------EIUPSIINK
F i gu r e 4.79 C o mp l e t e Enha n c e me n t
You m u s t al so r e l e a s e t h e e n h a n c e m e n t . Fo r t h i s p u r p o s e , f ol l ow t he
Edi t Set release m e n u p a t h (see Fi gur e 4. 80) . You c a n n o l o n g e r m o d
ify y o u r e n h a n c e m e n t a f t e r t h e r el ease.
1 2 8
Adapting Existing IDoc Types | 4-2
Develop IDoc Types: Initial Screen
i ? ^ 0 & a Change Requests (Organcer)
Obi Name zshhapa
Sabines Enhanced Material
Development oDiect
c Release/cancei release
0 /
Extension types cannot be changed alter being
released
Release extension?
Yes ~ I * No H Cancel |
F i gu r e 4.80 Rel easi ng t h e En h a nc ement
Now, y o u h a v e t o assi gn t h e r e l e a s e d e n h a n c e m e n t t o t he me s s a ge t ype
a n d t h e IDoc t y p e b e c a u s e y o u c a n o n l y us e i t w i t h t hi s c o mb i n a t i o n .
Fi gur e 4. 81 s h o ws h o w t hi s is d o n e f o r t h e s a mp l e e n h a n c e m e n t , ZSM-
MARA, i n Tr a ns act i on WE82.
New Entries: Overview of Added Entries
M M M M 1
Output Types and Assignment to IDoc Types
i
Message Type [Basic type (Extension jRelease
HATHAS HAIHAS05 jZSRHARA j70O
F i gu r e 4.81 Ass i gni ng t h e E n h a n c e me n t t o t h e Mes s age Type
I f y o u re n o t s ur e w h e t h e r y o u ' v e c o n s i d e r e d all ne c e s s a r y aspect s, y o u
can c h e c k y o u r e n h a n c e m e n t . Such che c k f unc t i ons ar e al s o p r o v i d e d for
s e g me n t t ypes, b u t i t makes mor e s e n s e t o car r y o u t t he check a f t e r eve r y
t h i n g ha s b e e n i mp l e me n t e d so t h a t t h e c hi l d e l e m e n t s ar e a l s o checked.
To check t h e e n h a n c e m e n t , us e t h e E n h a n c e m e n t C h e c k m e n u o r t he
scales i con, wh i c h y o u c a n s e e i n Fi gur e 4. 80, s h o w n earl i er.
Fi gur e 4 . 8 2 s h o ws w h a t is c h e c k e d a n d h o w t hi s is d i s p l a y e d i n t h e case
o f success. I f an e r r o r o c c u r r e d , y o u can cor r ec t i t us i ng t hi s log.
Af t e r h a vi ng c o mp l e t e d t h e e n h a n c e m e n t , y o u n e e d t o fill t h e s e gme nt s
a n d t h e n a m e o f t h e e n h a n c e m e n t i n t h e c o n t r o l r e cor d i f y o u s e n d t he
I Doc a n d r e a d t h e r e s pe c t i ve s e g me n t s i f y o u u p d a t e t h e IDoc.
A s s i g n m e n t t o
message t y p e and
I D o c t y p e
Ch e c k i n g t he
e n h a n c e m e n t
129
4 | Changes to IDocs
F i l l i n g t he
s e g me n t s w i t h an
a p p r o p r i a t e exi t
Ch e c k i n g f o r
message o r I Doc
t y p e s
Ge n e r a t i n g and
a p p e n d i n g t he
s e g me n t
L o g d i s p l a y
N t e l f l l f c a 0 j <r Long Text
9
Check e x t e n s i o n ZSMHARA
E x te n s io n ZSMHARA e x i s t s
E x te n s io n ZSMHARA 1s r e l e a s e d
E x te n s io n ZSMHARA 1s l i n k e d l t h l o g i c a l aessage MATMAS
Ho predecessors e x i s t
E x te n s io n zsmmara i s a ss igne d t o b a s i c t y p e matma$05
Check segment Z 1MARA
Segaent Z1HARA c o n s i s t e n t
Fi gur e *.82 Ch e c k i n g t h e En h a nc ement
Fi l l i ng S e g m e n t s
You n o w s e l e c t a n a p p r o p r i a t e exi t i n t h e o u t b o u n d f unc t i on mo d u l e o f
t he IDoc a n d i m p l e m e n t y o u r c h a n g e s (Li st i ng 4. 2) . The f unc t i on m o d
u l e f r om t h e e n h a n c e m e n t s s e r v e s as a n e x a mp l e her e. T h e p r o c e d u r e is
i dent i cal f o r all e n h a n c e m e n t t e c h n o l o g i e s , b u t t h e n a me s o f t h e t r a n s
f er var i abl es i n t he s a mp l e c o d e c o r r e s p o n d t o t h o s e o f t h e E X I T _ S A P -
LMV0 1 _ 0 0 2 exi t .
* .................. ............. . . . . . . . . . . .................................................................... i
* I NCLUDE ZXMGVU03
* ............................................................................................... *
F i l l e n t e r p r i s e - i n t e r n a l s e g m e n t s f o r MATMAS.
c a s e m e s s a g e _ t y p e .
* C h a n g e i f t h i s i s r e a l l y t h e r e q u i r e d
* m e s s a g e .
w h e n ' MATMAS .
* o n l y t h e n i m p l e m e n t t h e i n s e r t s .
i d o c _ c i m t y p e - * ZSMMARA .
c a s e s e g m e n t _ n a m e .
* C h e c k w h i c h s e g m e n t i t i s . I f i t
* i s o n e o f t h o s e t o b e e n h a n c e d , a c o r r e s p o n d i n g
* c u s t o m e r s e g m e n t i s g e n e r a t e d a n d a p p e n d e d .
wh e n * E1 MARAM- .
p e r f o r m f i l l _ z l m a r a
t a b l e s i d o c _ d a t a .
wh e n o t h e r s .
e x i t .
1 30
Adapting Existing IDoc Types | 4-2
e n d c a s e .
wh e n o t h e r s .
e x i t .
e n d c a s e .
L i s t i n g 4 2 Enhanc i ng t h e " EXI T _ SAPL MV0 1 _ 0 0 2 "
I n Li st ing 4 . 3 , y o u c a n s e e t h e f i l l _ z l m a r a f or m, wh i c h is cal l ed i n t he
exi t m e n t i o n e d pr e vi ous l y. O f c our s e a d i v i s i o n i n t o s u b r o u t i n e s i n t he
code i s n ' t ne c e s s a r y b u t ma k e s it e a s i e r t o r e a d pr ogr ams .
* _______________________ ______________________ _____________________ __________________________ __________ _________________________________*
* * * I NCLUDE ZXMGVF01 .
* _____________________________________________________________________________________________________________*
* & F o r m f i l l _ z l m a r a
*&.................................................................................................................................................... *
FORM f i l l _ z l m a r a t a b l e s i d o c _ d a t a s t r u c t u r e e d i d d .
t a b l e s : e l m a r a m , z l m a r a .
d a t a : m a t n r t y p e m a r a - m a t n r .
r e a d t a b l e i d o c _ d a t a w i t h k e y s e g n a m = ' E 1 MARAM' .
* r e a d p o s s i b l e , b e c a u s e t h e s e g m e n t o c c u r s o n l y o n c e ,
e l m a r a m - i d o c _ d a t a - s d a t a .
m a t n r = e l m a r a m - m a t n r .
s e l e c t s i n g l e ZZSMFELD1 ZZSMFELD2 f r o m M a r a
i n t o c o r r e s p o n d i n g f i e l d s o f z l m a r a
w h e r e m a t n r e q e l m a r a m - m a t n r .
i f s y - s u b r c e q 0 .
i d o c _ d a t a - s e g n a m = ' Z I M A R A ' .
i d o c _ d a t a - s d a t a = z l m a r a .
a p p e n d i d o c _ d a t a .
e n d i f .
ENDFORM . - f i 1 l _ z l m a r a
L i s t i n g 4.3 Code f o r t h e f i l l _z 1 mar a For m
You have t o l et t h e s y s t e m k n o w i f y o u w o r k wi t h a cus t omer - s peci f i c
e n h a n c e m e n t ; o t h e r w i s e , t h e s y s t e m i d e n t i f i e s c u s t o m s e g m e n t s as
i ncor r ect . Fo r t hi s p u r p o s e , navi gat e t o t h e O u t b o u n d Op t i o n s t a b a n d
t h e I Doc Type s u b t a b i n t h e p a r t n e r pr of i l e o f t h e s e n d i n g s ys t e m (see
Fi gur e 4. 83) . Her e, t h e IDoc is d e s i g n e d wi t h t he c o r r e s p o n d i n g cont r ol
r ecor d, a n d t h e s e n d i n g s y s t e m c he c ks f o r all s e g me n t s w h e t h e r t h e y are
a l l o we d i n t hi s c o mb i n a t i o n o f I Doc t y p e a n d e n h a n c e me n t .
131
Ex ampl e o f t he
c al l ed f o r m
Par t ner p r o f i l e w i t h
e n h a n c e m e n t
4 | Changes to IDocs
C o n t r o l r ec o r d f o r
t h e e n h a n c e me n t
P a r t n e r p r o f i l e s : O u t b o u n d p a r a m e t e r s
Pi itne.No 2SHTAR6EI SaBines Target System
Partn.Type PI
Log*al system
Partnei Role
g M e s s a g e d WATfUS
Message code
Messagefonefcon T e s t
Recet/er port
Message Control Pott Processing
SUBSTSTEB6
Permitted Agent Teie
Otfcul Mode
Transfer Coc Immed O Start subsystem Output Mode
O Collect lOocs Oo not ttar t subsystem
F i gu r e 4-83 Par t ner Pr of i l e w i t h En h a nc ement
The IDoc a d di t i ona l l y c o n t a i n s t h e n a me o f t h e e n h a n c e m e n t i n t h e c o n
t rol r ecor d; i n o u r e xa mpl e , t he e n h a n c e m e n t is ZSMMARA i n t h e Ext ens i on
field. Finally, y o u c a n g e n e r a t e t h e e n h a n c e d IDoc t h a t wi l l b e s e n t (see
Fi gure 4. 84) .
lOoc Display
l O c c 00 00000 0 0 0 7 6 8 7 6 8
Q C ontr ol Rec
^ CU Data r ecor d s
=> D E1 R* M
0 2 1 MARA
E ' M A R A !
0 E'MAKTM
E'MAKTM
E1MARMM
CD S t a s i s reco r ds
^D~03
Q lOot written to til#
30
Receiver found. No fillers
Q ot
Total number 000006
Seamen! 000001
Segment 000002
Segment 000003
Segment 000004
Segment 000005
Segment 000006
Data passed to port OK
IDoc ready (Or dispatch (ALE sei>
Direclon 1 OuCDOl
Current slatus 03 rrm
BasKtfpe i m t i m s m
Ertenston ZSitn
Message tipe H A T I U S
Partner No 2SMTARGET
Partn Type LS
Port S18SYSTE"
Comen ot selected segment
Fid name
ZSnFElDl
Z2SHFEID?
Fid cort
iEHOI
'EM .
F i gu r e 4 84 Enhanced I D o c t o Be Sent
You' ve n o w c o mp l e t e d all ne c e s s a r y t asks o n t h e s e n d e r si de. T h e next
s e c t i o n deal s wi t h u p d a t i n g an e n h a n c e d IDoc.
132
Adapting Existing IDoc Types | 4 . 2
P o s t i n g S e g me n t s
To us e a n e n h a n c e m e n t i n i n b o u n d pr oc es s i ng, y o u m u s t f i r st assi gn t he
c o r r e s p o n d i n g i n b o u n d f unc t i on m o d u l e t h a t cons i s t s o f me s s a ge t ype,
IDoc t y p e , a n d e n h a n c e m e n t . You d o t h i s i n Tr a ns act i on WE 5 7 ( s e e Fig
ur e 4. 85) . D o n ' t g e t c o n f u s e d by t h e n a me o f t h e IDOC_INPUT_MATMAS01
f u n c t i o n mo d u l e ; it can p r oc e s s all ma t e r i a l ma s t e r IDocs ( t h e n a me was
as s i gned f o r hi st or i cal r e a s on b e c a u s e it wa s d e v e l o p e d w h e n o n l y t h e
matmaSOI IDoc t y p e was avai l abl e).
Cha n g e V ie w "IDoc: A s s i g nm e nt o f FM to Log. M e s s a g e a n d IDoc Type":
Function module IDOC.INPUTJIATMASOI
Function type F Function module
8aslc type HATMAS05
Extension ZSHNARA
Message Type HATHAS
Message Variant
Mess, tancton
Object Type BUS1001006
Direction _ [ 2 inbound
3
Description Matenal master
Name Standard material
F i gu r e 4.85 As s i g n i n g t h e I n b o u n d Fu n c t i o n M o d u l e f o r t h e Enhancement
The p r o g r a mmi n g wo r k consi st s o f t w o p a r t s . First, y o u m u s t e n s u r e in
t h e a pp l i c a t i o n t h a t t h e c o r r e s p o n d i n g u p d a t e mo d u l e s al so t r a n s f e r t he
cus t omer - s peci f i c fi el ds t o t h e d a t a b a s e . Usual l y, y o u ' r e n o t r e s pons i bl e
f or t hi s p a r t o f t h e d e v e l o p m e n t w o r k , a n d i t s t o o modul e- s pec i f i c t o be
e x p l a i n e d i n det ai l her e. The s e c o n d p a r t o f t h e p r o g r a mmi n g w o r k is to
e n s u r e t h a t t h e da t a t h a t ha s b e e n a d d i t i o n a l l y t r a n s f e r r e d in t h e IDoc
is r ead a n d t r a n s f e r r e d t o t h e t r a n s f e r p a r a me t e r s o f t h e u p d a t e modul e ,
w h i c h m u s t b e d o n e b y y o u .
Agai n, t he ma t e r i a l m a s t e r is u s e d as an e x a mp l e h e r e . Li st i ng 4 . 4 s h o ws
t h e s a m p l e c o d e f o r t h e f i el ds f r o m t h e c u s t o me r - s p e c i f i c s e g me n t ,
ZIMARA.
A s s i g n i n g an
i n b o u n d f u n c t i o n
m o d u l e
Us i n g d a t a f r o m
t h e I Do c
133
4 | Changes to IDocs
d a t a : w a _ z l m a r a t y p e z l m a r a .
i f m e s s a g e _ t y p e eq MATMAS .
i f f _ c u s t _ s e g m e n t - s e g n a m e q ' Z 1MARA' .
w a _ z l m a r a - f _ c u s t _ s e g m e n t - s d a t a .
m o v e - c o r r e s p o n d i n g w a _ z l m a r a t o f _ m a r a _ u e b .
e n d i f .
e n d i f .
L i s t i n g 4 4 Tr ansf er r i ng t h e Da t a f r o m t h e " Z 1M A R A " Cu s t o me r Segment
The t r a n s f e r s t r u c t u r e is d e l i v e r e d by SAP so t h a t i t a l r e a d y i ncl udes
p o t e n t i a l a p p e n d s t o t h e MARA t a bl e a ut oma t i c a l l y. Thi s is us ual l y t he
case. I f not , y o u c a n a l s o a d d a n a p p e n d t o t h e t r a n s f e r s t r u c t u r e t hat
c o n t a i n s t he s a me fi el ds as y o u r a p p e n d t o t h e d a t a t abl e.
W h e n d o ALE
ser vi ces r un?
4.2. 4 S pecial R e q u i r e m e n t s f o r M a s t e r Data
You a l r e a d y k n o w t h a t t h e SMD p r o v i d e s spec i a l f u n c t i o n s f o r ma s t e r
d a t a . Some t i me s , h o we v e r , t h e avai l abl e s peci al f unc t i ons a r e n ' t wa n t e d .
The f o l l o wi n g s e c t i o n s d e s c r i be h o w y o u c a n mo d i f y t he m.
Sending A ll Data A f t e r Changes
W h e n u s i n g Sha r e d M a s t e r Da t a Tool s a n d t h e c o r r e s p o n d i n g c h a n g e
p o i n t e r s , SAP a s s u me s t h a t I Docs s h o u l d b e k e p t as s mal l as possi bl e
f or p e r f o r ma n c e r e a s ons . Thi s al so us ual l y c o r r e s p o n d s t o real i ty. But
s o me t i me s y o u c ol l abor at e w i t h p a r t n e r s w h o can o n l y pr ocess compl e t e
d a t a r e cor ds . To still b e a bl e t o us e c h a n g e p o i n t e r s , y o u c a n i mp l e me n t
m i n o r modi f i cat i ons f o r ma t e r i a l mast er s.
C o m b i n a t i o n o f A L E S e r v i c e s a n d E x i t s
SAP g e n e r a l l y p r o v i d e s t h e o p t i o n t o i m p l e m e n t c h a n g e s t o I D o c s v i a t h e
s e t t i n g s i n C u s t o m i z i n g . T h e m a n i p u l a t i o n s , h o w e v e r , a r e i m p l e m e n t e d a f t e r
y o u r I D o c has b e e n g e n e r a t e d . Y o u r e x i t s , i n c o n t r a s t , a r e e x e c u t e d w h i l e t h e
I D o c i s g e n e r a t e d . T h i s m e a n s t h a t p o s s i b l e f i l t e r i n g p r o c e s s e s o r r u l e s m a y
n o t b e d e p l o y e d w h e n y o u r e x i t i s e x e c u t e d . Y o u s h o u l d c o n s i d e r t h i s f o r t h e
i m p l e m e n t a t i o n . F o r e x a m p l e , i f y o u o n l y w a n t t o p r o c e s s a p l a n t s e g m e n t f o r
a s p e c i f i c p a r t n e r , y o u m u s t a s s u m e t h a t y o u r e x i t w o r k s w h i l e a l l p l a n t s e g
m e n t s a r e s t i l l i n c l u d e d . C o n s e q u e n t l y , y o u m u s t m a k e s u r e t h a t y o u r c h a n g e s
a r e m a d e t o t h e c o r r e c t p l a n t s e g m e n t .
134
Adapting Existing IDoc Types | 4-2
Th e s e t t i n g t h a t o n l y t h e c o m p l e t e ma t e r i a l is s u p p o s e d t o b e s e n t is
al r e a dy avai l abl e f or t h e ma t e r i a l mas t er , f o r e xa mpl e , i f t h e cr os s- pl ant
s t a t u s o f a val ue wi t h d i s t r i b u t i o n l ock" ha s b e e n c h a n g e d t o a val ue
" w i t h o u t d i s t r i b u t i o n l ock. " For t h i s p u r p o s e , t h e MASTER I D0 C_ CRE -
ATE_SMD_MATMAS f u n c t i o n mo d u l e ma n a g e s a n i n t e r n a l t abl e, a _ t _ c o m -
p l e x _ m a t n r , wi t h t h e MANDT, MATNR, a n d MSGFN fi el ds. I f y o u n o w
a p p e n d y o u r ma t e r i a l s t h a t ar e t o be s e n t c o mp l e t e l y as wel l a n d s e t t h e
MSGFN field t o " 005" f or " me s s a ge r epl aces pr e v i o u s messages, " t h e s ys
t e m s e n d s t h e c o mp l e t e ma t e r i a l . The c o r r e s p o n d i n g s a mp l e c o d e coul d
be s t r u c t u r e d as s h o w n i n Li st i ng 4. 5.
* T h i s c h a n g e h a s t h e e f f e c t t h a t s p e c i f i c m e s s a g e s
* a r e a l w a y s s e n t c o m p l e t e l y .
* T h e s e l f - d e v e l o p e d r e d u c e d m e s s a g e t y p e
* i s t h e k e y f o r t h e d e c i s i o n h e r e ,
d a t a : MESTYPE t y p e BDCPS- MESTYPE .
LOOP AT A_T_CHGPTRS .
s e l e c t s i n g l e MESTYPE f r o m BDCPS
i n t o MESTYPE w h e r e CPI DE NT e q A_ T _ CHGPT RS- CPI DE NT .
i f MESTYPE eq ZSMMAT* .
T. MARAKEY- MANDT - SY- MANDT .
T_MARAKEY- MATNR = A_ T _ CHGPT RS- CDOBJ I D .
COLLECT T_MARAKEY .
A_T_COMPLEX_MATNR- MANDT = SY- MANDT .
A_T_COMPLEX_MATNR- MATNR = A_ T _ CHGPT RS- CDOBJ I D .
A_T_COMPLEX_MATNR- MSGFN = C_MSGFN_R .
COLLECT A _ T _ C 0 MPLEX_MATNR .
c l e a r MESTYPE .
END I F .
ENDLOOP .
L i s t i n g 4 . 5 S e n d i n g t h e C o m p l e t e Ma t e r i a l Af t e r Mo d i f i c a t i o n s
Thi s c o d e mu s t be a d d e d b e f o r e t h e s ys t e m f u r t h e r pr oc es s es t h e dat a.
Because t h e mo d u l e ma y c h a n g e , y o u s h o u l d s e a r c h f or t he f ol l owi ng
c o mme n t :
DESCRI BE TABLE t . m a r a k e y L I N E S h l i n e s .
CHECK h l i n e s GT 0 .
Th e n , i n s e r t t h e c o d e di r ec t l y b e f o r e t hi s i n y o u r f u n c t i o n m o d u l e . Next ,
i n s t e a d o f t h e f u n c t i o n mo d u l e p r o v i d e d by SAP, a s s i gn y o u r o w n f u n c
t i on m o d u l e i n Tr a ns act i on BD60. Be s ur e t o i dent i f y t h e c h a n g e s i n t he
" S e n d c o m p l e t e "
mo d i f i c a t i o n
G e t t i n g t h e c h a n g e
p o i n t e r
A p p e n d i n g t o SAP
t a b l e
L o c a t i o n o f t h e
mo d i f i c a t i o n
135
4 | Changes to IDocs
En h a n c i n g and
r e d u c i n g
A p p r o p r i a t e
p a r t n e r p r of i l e
or i gi nal m o d u l e f or e a c h r e l e a s e c h a n g e a n d r e p r o d u c e t h e m i n y o u r
f unc t i on mo d u l e i f r e q u i r e d . Al t er nat i vel y, y o u c a n c o p y t h e SAP mo d u l e
a f t e r t h e r e l e as e c h a n g e a n d i nt e gr a t e y o u r modi f i cat i ons . Unf or t unat el y,
a n a p p r o p r i a t e e x i t i s n ' t y e t avai l abl e a t t h e l oc a t i on w h e r e t h e modi f i ca
t i on n e e d s t o b e i mp l e me n t e d .
Reduced IDocs in Combination w i t h Custom Segments
I f y o u ve a d d e d c u s t o m s e g me n t s t o t he ma s t e r d a t a IDocs, y o u ma y wa nt
t o wo r k wi t h r e duct i ons f o r r easons o f p e r f o r ma n c e o r bec aus e y o u r
p a r t n e r d o e s n t wa n t t o recei ve par t i cul ar dat a. Because y o u r e n h a n c e me n t
is an IDoc t ype b u t y o u r r educt i on a mes s age t ype, y o u c a n ' t si mpl y use
o n e o f t h e m as t h e basi s f or t he o t h e r one. I nst ead, y o u have t o gene r at e
a r e duced IDoc t h a t d o e s n ' t k n o w y o u r cust omer- speci fi c s e g me n t s a n d in
whi c h y o u can de l e t e e ve r yt hi ng f r om t h e s t a nda r d ver si on t h a t y o u d o n ' t
w a n t t o s e n d . I n a ddi t i on, y o u mu s t al so g e n e r a t e an e n h a n c e me n t t ype
t hat c ont a i ns y o u r a ddi t i ona l s e gme nt s wi t h o u t k n o wi n g t he r educt i on.
W h e n c r e a t i ng t h e r e d u c e d me s s a ge t ype, Tr a ns act i on WE 8 2 a u t o ma t i
call y g e n e r a t e s an e n t r y i n wh i c h t h e basi c t y p e is a s s i g n e d t o t h e ne wl y
c r e a t e d r e d u c e d me s s a ge t y p e . Thi s is d o n e a u t o ma t i c a l l y w h e n y o u save
t he r e d u c e d me s s a ge t y p e s o t h a t y o u can us e i t i mme di a t el y. To n o w use
t h e c o mb i n a t i o n f r o m y o u r r e d u c t i o n a n d y o u r e n h a n c e m e n t , c o p y t he
basi c t y p e , a n d i ns e r t t h e e n h a n c e m e n t i n t h e c o p i e d e nt r y. Fi gur e 4. 86
s h o ws t hi s f o r t h e ZSM1 r e d u c t i o n (see Ch a p t e r 2, Sect i on 2 . 1 . 1 , Shar ed
M a s t e r Dat a Tool) a n d t h e ZSMMARA e n h a n c e m e n t f r o m t h i s s ect i on.
C h a n g e V i e w " O u t p u t T y p e s a n d A s s i g n m e n t t o I D o c T y p e s " :
Output T n m ano Assignment to IDoc Types
ZSH1 HATHAS05 ZStlMARA 64 E
0
F i gu r e 4 - 8 6 As si gni ng t h e En h a n c e me n t t o t h e Reduc ed Mes s age Type
In t h e p a r t n e r profi l e, t h e e n h a n c e m e n t is c o mb i n e d wi t h t h e basi c t ype,
a n d t h e s t a n d a r d m o d u l e car r i es o u t t h e r e d u c t i o n w h i l e y o u r exi t fills
t h e cus t omer - s peci f i c fi el ds. Fi gure 4 . 8 7 di s pl a ys t h e a p p r o p r i a t e p a r t n e r
prof i l e i n t h e o u t b o u n d pr oc e s s i ng f o r t h e r e d u c e d me s s a ge t ype, ZSM1,
wi t h " MATMAS05" s peci f i ed i n t h e Basic Type fi el d a n d ZSMMARA"
1 3 6
Adapting Existing IDoc Types 4-2
i n t h e Ext e ns i on field. Th e i n b o u n d pr oc e s s i ng m u s t t a ke w h a t it get s;
h o we v e r , e n h a n c e m e n t s a n d r e d u c t i o n s m u s t a l s o be k n o w n t her e.
P a r tn e r profil es: Outbound parameter s
P a r t n e r N o
P a r t n T y p e
P a r t n e r R o l e
j g M e s s a g e T y p e
M e s s a g e c o d e
M e s s a g e f u n c t i o n
S A L E S
L S
S a l e s s y s t e m ( c l i e n t 8 1 0 )
L o g i c a l s y s t e m
Z S f l i S a b i n e s R e d u c e d M a t e r i a l
T e s t
M e s s a g e C o n t r o l p o s t p r o c e s s i n g P e r m i t t e d A g e n t T e l e
R e c e i v e r p o r t
P a c k S iz e
Q u e u e P r o c o s s m g
SALES
j o o
T r a n s a c t i o n a l R FC L S S a l e s
O u t p u t M o d e / "
O T r a n s f e r I D o c i m m e d O u t p u t M o d e 4
C o l l e c t I D o c s
I D O C T y p e
B a s i c type
E r t e n s i o n
V i e w
E C a n c e l P r o c e s s i n g
S e g r e l e a s e i n ID oc w o
H A T W A S 0 5
z s h h a r a
E n h a n c e m e n t D i s t r i b u t i o n o f S
S a b i n e s E n h a n c e d M a t e n a i

S e g m e n t Af ipi. R e !
F i gu r e 4 . 8 7 Par t ner Pr of i l e w i t h Re d u c t i o n a n d En h a nc ement
To t e s t t h e s e s et t i ngs , g e n e r a t e y o u r IDoc ( see Fi gur e 4. 88) .
IDoc display
V IDOC 0000000000768770
Control Rec
^ D a t a r e c o r d s Total n u m b e r 0 0 0 0 0 5
Direction 1 Outbox
C u rre n t s t a t u s 03 CCM
B a s i c type HAinS05
Z1MR segmem 000 002
O E 1 H A R A 1 S e g m e n t 000003
O e i m a k t u S e g m e n t 0000 04
E t MAKTM S e g m e n t 0000 05
E x t e n s i o n ZSniMRA
M e s s a g e t y p e ZSnt
P a r t n e r No SALES
P a r t n Type LS
^ S t a t u s r e c o r d s
P o r t SALES
^ Q 03 Data passed to port OK
0 IDoc sent l o SAP system or external program
^ D 30 IDoc read* for dispatch (ALE service)
Content o*selected segment
Q Receiver found. No H e r * . No conversion .Version
D Ot lOoc generated
n r r ------------
ZZSHFElOl HEH01 E
ZZSHFELD2 EM02 0
Figure 4 88 Sample IDoc
137
4 | Changes to IDocs
4.3 Custom Function Modules for File
Generation in File Ports
For file p o r t s , y o u n e e d t o speci f y t o wh i c h file t h e c o r r e s p o n d i n g IDoc
is s u p p o s e d t o b e wr i t t e n i f t hi s p o r t is us ed. You d o t h i s i n Tr ansact i on
WE 2 1 , t he port management (see Fi gure 4. 89) . Her e, y o u can al ways wr i t e
t h e IDoc t o a def i ni t e file b y s pec i f yi ng t h e n a me o f t h e c o r r e s p o n d i n g
file i n t h e O u t b o u n d File field i n t h e t ab w i t h t h e s a me n a me .
C r e a t i n g a f i l e p o r t
g i f ] I I 0 P Q i
v C D Ports
I 1 d l T r a n s a c t i o n a l R F C
__7 <3 f i i * ___________
CPFR2-VMI
D S D . P O R T
E U P E X P O R T
POSSIM
SMFILE
S U B S Y S T E M
TICKETS
O C P t - C
CD ABAP.PI
I1 O X M L F I I *
X M L HTTP
Cop Of POSSIM (for CPFR2-VMI EDI)
DSD File-Port *0r Movement d ata
WC Port Sor IDocs of m e s s a g e tn> e EUP ExP
P ort K a s se n s i mu l a t l o n
S a b i n e s T e s t p o d for Files
PorttUf e n EDI -S ubsys te m v ia O a ie isc hnms te ile
PorlfufVerkaufshilfsmffiel
Pc ft 2SH1_0TEI
De scription S a b i n e s F ile Port
v i s io n ~7~
O Bo c rec hpes SAP Release 2 0/2 1
O C o c recftpes SAP Release 3.013 1
lOoc record tpes SAP Release *>
S y s t e m Sctnr> g
p ] Unicode formal
Continue despite comerslon err or
Replacement ctiar
O u t b o u n d Tripper i n b o u n d f i l e S t a t u s m e
O Logical directory
p f c r t * a l director*
A c c e s s T e s t
Oirectory
Function module
Descnpoon
Outbound file
BBI
Satnnes cr-n Function Module
E)
F i gu r e 4 . 8 9 Fi l e Por t w i t h Cu s t o m Fu n c t i o n M o d u l e
M o d u l e f o r f i l e
names i n f i l e po r t s
M a i n t e n a n c e
t r a n s a c t i o n f o r f i l e
f u n c t i o n mo d u l e s
Mo r e f r equent l y, howe ver , file n a me s are s u p p o s e d t o be a s s i gned d y n a m
ically. I n t h e s e cases, us e a f u n c t i o n m o d u l e t h a t c o mp r i s e s t h e n a me o f
t h e file f r o m t h e IDoc dat a, f o r e xa mpl e , f r o m t h e IDoc n u mb e r , t h e c u r
r e n t t i me , o r s i mi l a r i n f o r ma t i o n . Thi s way, y o u a v o i d t h a t t h e sys t em
o v e r wr i t e s a n exi s t i ng file, a n d y o u can al so f i nd t h e d a t a mo r e easily.
Fi gur e 4 . 8 9 s h o ws t h e us e o f a n a d d i t i o n a l f u n c t i o n mo d u l e t h a t is cr e
a t e d w i t h i n t he c u s t o m e r n a me s p a c e ( Z_ SM_ PATH_ CREAT E_ DAT E_ T I ME) .
It i s n ' t suffi ci ent t o s i mpl y i m p l e me n t t h e r e qui r e d f unc t i on mo d u l e . To
have t he sys t em di s pl ay it i n t h e sel ect i on list i n t h e file p or t , y o u mus t
a ddi t i onal l y r e gi s t e r it f or t h e file p o r t s a n d l et t h e s ys t e m k n o w w h e t h e r
1 3 8
Custom Function Modules for File Generation in File Ports | 4-3
it uses logical o r physi cal pat hs . In Tr ansact i on WE55, y o u i m p l e me n t t hi s
a s s i g n me n t b y a d d i n g a n e w e n t i y (see Fi gur e 4. 90) . F u n c t i o n modul e s
ma r k e d wi t h "L" us e logical pat hs; all o t h e r mo d u l e s us e physi cal pat hs.
Change View "IDoc: Function Modules f o r File Names": Overview
^ E x p a n d < - C o l l a p s e j N e w E n t r i e i 2 0 D e l i m i t Q v a r i a b l e U s t } F o r m
I D o c : F u n c t i o n M o d u l e s ( o r F i l e N a m e s
^ a m e o f f u n c t i o n m o d u l e > aTh A s c r i p t i o n
>X PATH CREATE i l e n a m e d e t e r m i n a t i o n f o r t h e DX W o r k b e n c h
. o g i c a l d i r e c t o r y , f i l e n a m e i n f o r m a t T c l i e n t d o c n u r r t E
M t f f l MOUERT
3 )
-
EP I- LPA IH CREATE .USERHAHE . o g i c a l d i r e c t o r y , f i l e n a m e i n S Y -U N A M E f o r m a t
EDI PATH CREATE CLIENT DOCNUM D i r e c t o r y * f i l e n a m e i n f o r m a t T _ C l i e n t _ D o c n u m
D i r e c t o r y * f i l e n a m e i n f o r m a t T_CCY YMMDD_HH MM: EPI PATH CREATE fATE TIME
EPI PATH CREATE LENGTH LE 8 D i r e c t o r y f i l e n a m e i n f o r m a t N T H H M M S S T
D i r e c t o r y - m e s s a g e t * p e _ l a s t 8 c h a r a c t e r s o f DO E P I PATH CREATE "ESTYP
EDI PATH CREATE POS UNIX DOS D i r e c t o r y * f i l e n a m e ( n a m e l a s t 8 c h a r a c t e r s o f O O C f
EDI PATH CREATE RETAIL .STORE D i r e c t o r y * f i l e n a m e i n f o r m a t T _ S t o r e _ D O C N U M 16
HL-P-4TH CREATE USERKME D i r e c t o r y t i l e n a m e i n f o r m a t SY-UNAME
-
;pl path CREATE USERname pT th
M EAP 6EJ. QU.If.Ul p 1LEH&HE
D i r e c t o r y * f i l e n a m e i n f o r m a t T_SY-UNAME_CCYYMI>
3E M -P A E x p o r t F i l e N a m e s
S a b i n e s o w n F u n c t i o n M o d u l e
[ -
E
< ] [ ][
Fi gu r e 4 . 9 0 F u n c t i o n M o d u l e s f o r Fi l e N a m e s
The s i g n a t u r e o f a f unc t i on mo d u l e t h a t wo r k s wi t h logical p a t h s looks
l i ke t h e o n e s h o w n i n Li st i ng 4. 6.
* * " L o c a l i n t e r f a c e :
I MPORTI NG
*
V A L U E ( D A T A T Y P E ) L I K E E D I P O - A C T R I G
V A L U E ( D I R E C T OR Y ) L I K E E DI P O- OUT P UT DI R
*
V A L U E ( F I L E N A M E ) L I K E E D I P O - O U T P U T F I L E
VALUE( CONTROL) L I K E EDI DC STRUCTURE EDI DC
EXPORTI NG
VALUE( PATHNAME) L I K E EDI _ PATH- PTHNAM
EXCEPTI ONS
LOG I CA L_PATH_E RROR
L i s t i n g 4 . 6 S i g n a t u r e o f a F u n c t i o n M o d u l e Us i n g Logi cal Pat hs
S i g n a t u r e for
l ogi cal p a t h s
139
4 | Changes to IDocs
T r a n s a c t i o n FILE
S i g n a t u r e f or
p h y s i c a l p a t h s
Fu r t h e r mo r e , y o u m u s t al so d e t e r m i n e t h e physi cal pat h, whi c h ha s b e e n
as s i gned in Cus t omi z i ng i n Tr ansact i on FILE. Fo r t h i s p u r p o s e , SAP pr o
v i d e s a speci f i c f unc t i on mo d u l e . Th e f ol l owi ng s a mp l e c o d e (Li st i ng 4. 7)
i n d i c a t e s i t s use.
DATA: L O G I C A L . P A T H L I K E F I L E P A T H - P A T H I N T E R N .
LOGI CAL _ PATH - DI RECTORY.
CALL FUNCTI ON ' F I L E _ GE T _ N A ME _ U S I N G _ P A T H '
EXPORTI NG
* C L I E N T - SY- MANDT
L OGI CAL _ PATH = LOGI CAL_PATH
* OPERATI NG_SYSTEM - SY- OPSYS
* PARAMET ERS =
* PARAMETER. ? - *
USE_BUFFER =
F I L E _ NAME - SY- UNAME
USE_PRESENTATI ON_SERVER = *
I MPORTI NG
F I L E _ NAME_ WI TH_ P AT H = PATHNAME
EXCEPTI ONS
PATH_N0 T _ F 0 UND - 1
MI SSI NG_ PARAMETER = 2
OPERATI NG_SYSTEM_N0 T _ F 0 UND - 3
FI L E_SYSTEM_NOT_FOUND = 4
OTHERS = 5 .
L i s t i n g 4 . 7 SAP Fu n c t i o n M o d u l e T h a t De t e r mi n e s t h e Physi cal Fi l e Name f o r a
Logi cal Fi l e Name
I f y o u ge ne r a t e a f unct i on mo d u l e t hat wo r k s wi t h physi cal pat hs r i ght from
t he begi nni ng, y o u mus t use t h e fol l owi ng s i gnat ur e (see Listing 4. 8).
* * L o c a l i n t e r f a c e :
* " I MPORTI NG
* VAL UE( DATATYPE)
* " VA L UE( DI RECT ORY)
* " V A L U E ( F I L E N A ME )
VALUE( CONTROL)
EXPORTI NG
VALUE( PATHNAME)
L I K E E D I P 0 - A CT RI G
L I K E EDI P O- OUT PUT DI R
L I K E E D I P O - O U T P U T F I L E
L I K E EDI OC STRUCTURE EDI DC
L I K E E D I P A T H - P T H N A M
L i s t i n g 4 . 8 S i g n a t u r e o f a F u n c t i o n M o d u l e Us i ng Phys i cal Fi l e Pa t h s
1 4 0
Custom IDocs | 4-4
4.4 Custom IDocs
The p r e r e q u i s i t e f or u s i n g c u s t o m IDocs ar e c u s t o m t abl es f r om wh i c h
da t a is r e t r i e v e d f or s e n d i n g t h e IDocs a n d s t o r e d i n i n b o u n d pr ocessi ng.
As a n e xa mpl e , t h e d e s c r i p t i o n s i n t h e f ol l owi ng s e c t i o n s us e a si mpl e
case w i t h o n l y a f e w fi el ds, wh i c h n e v e r t h e l e s s c ove r s all aspect s t h a t are
r e l e v a n t t o IDocs.
Thi s e x a mp l e us e s a header table a n d an i tem table. The i t e m t a bl e c o n
t ai ns sever al i dent i cal fi el ds t h a t t h e IDoc pr oc es s es u s i n g a qual i f yi ng
s e gme nt . Due t o t h e di ffi cul t r eusabi l i t y, SAP d o e s n ' t r e c o m m e n d t h e use
o f qual i f i er s. I n t h e s t a n d a r d v e r s i on, h o we v e r , q u i t e a l ot o f qual i fi er s
still exi st so t h a t y o u ma y n o t b e a bl e t o avoi d us i ng t he m.
Fi gur e 4. 91 di spl ays t h e s t r u c t u r e o f a h e a d e r t abl e. An i n t e r f a c e pr oj ec t
usual l y al r e a dy i nc l ude s t h e s e t abl es so t h a t y o u c a n us e t h e m i n y o u r
IDoc. To i l l us t r at e t h e r e l a t i o n s h i p b e t w e e n IDoc a n d d a t a r e c or d, t he
a ppl i ca t i on t abl es w e r e cr e a t e d as wel l a n d n o t c o n s i d e r e d as exi st i ng.
Dictionary: Maintain Table
f g R j 0 I O r 0 0 n f t g i f f l Technical Settings Indexes. Append Structure
Transp Table ZSHH | Active
Short Description (sm Header
Attributes Delivery ana Maintenance 1 Entry help/check CurrencyJQuantity Fields
X
p s i B i E j g Srch Help 11 Predefined Type |
Field Key mm Data element DataTy Length Decim [ShortOescripton
ANDT
0 0
HAND! CINT | 3 0 Client
j _ n
0 0 jr
CHAR 30 0 Partial key o SAP object

CL01
:ELP2
' n


CHAR4Q
: har- q
CHAR | 40
{
fHAP m
OCharacter field o f length 40
CiaM1annlh1ft vnon 1 u u^narauerrieioLengui - i u
F i gu r e 4. 91 Sampl e Header Tabl e
The i t e m t abl e t h a t b e l o n g s t o t h e h e a d e r t a b l e c o n t a i n s a n i t e m n u m b e r
as an a d d i t i o n a l k e y field, t h r e e s i mi l a r fi el ds f or t h e qual i f i cat i on, a n d a
q u a n t i t y field wi t h a u n i t o f m e a s u r e m e n t f or a speci al i mp l e me n t a t i o n
f or s o me u n i t s o f me a s u r e me n t . Fi gur e 4 . 9 2 di spl ays t h e d e f i n i t i o n o f
t h e i t e m t abl e i n Tr a ns act i on SE11.
D a t a f o r t he
c u s t o m I D o c
He a d e r t a b l e
I t e m t a b l e
1 4 1
4 | Changes to IDocs
D i c t i o n a r y : M a i n t a i n T a b l e
C8 I 4 & ; < * A a Qjl 3 ^ ! 9 Technical Settings Indeies Append Stiucture
Transp Table
Short Description
ZSHP
SM Position
A c t f *
Altnbutes Del w r y and Maintenance Entry help/check CurrencyfOuantity Fields
|Key[iniii |pata element
E B B
Srch H e p Predefined
Field
lPala Ty-
T ^
Length |Decim [SMort Description
1ANDT
KET1
J&NR
PELDA
EIL&S
FLP&
1EN6E
1E1NA
E
0.
0

JD
-C-
B JMHOT
B *EY FEID
E
CINT
CHAR 30
0 Client
key of SAP object
NUtlC

jHEKfilS
'"E1NA
n
,CHB6
CUM
ia*i
CHAR
CHAR
CHAR
OUAN
1em number of the SO document
UNIT
6 0 Character field o f length 6
6 0Characterfiel donength6
6 0 Character field of length 8
t 5 3 Quantity field, 15 characters
3 ; 0 u n i t o f measure
F i gu r e 4 . 92 Sa mp l e I t e m Tabl e
Q u a n t i t y f i el ds
i n t h e Da t a
D i c t i o n a r y
For t h e M e n g e fi el d, y o u n e e d t o s pec i f y wh i c h r e f e r e nc e u n i t o f m e a
s ur e is s u p p o s e d t o be used. Fi gur e 4. 93 di spl ays it i n t h e Ref er ence Table
a n d Ref er ence Fi el d c ol umns .
D i c t i o n a r y : M a i n t a i n T a b l e
I d . -5-
a 0-0 : * 4 a
11 Ji i [Ifl Technical SetDngs lndees Append Structure
Transp Table zsup Active
Snort Description $M Position
Attributes Fields Fn'ryhPlp/rhcfk
Search Help ] _ 1 / 8
Field |Data element iDataTy [Reference table |Ref field IShoct Description
HANOI HANDT CINI Client
EY1 KEY.FELO CHAR Partial keyotSAPobiect
POSNR POSNR
1
hunc
1 [ 1 ........1. 1... !
nem number of the SD document
-
ELDA
ELDB
(CWAR6___________
CHAR6 CHAR
1 1----- -
Character field o f length 6
ELDC CHARS CHAR Character field o f length 6
IIENGE HEN815 QUAN ZSHP HE1NA Quantity field. 15 characters
EINA KE1NA UNIT Unit of measure
F i gu r e 4 . 9 3 Ref er ence U n i t o f Me a s u r e i n t h e I t e m Tabl e
i n p u t h e l p You s h o u l d p r o v i d e an i n p u t he l p o r che c k t abl e w h e r e v e r pos s i bl e (see
Fi gure 4. 94) . In t h e ZSMP s a mp l e t abl e, t h e i n p u t h e l p s ar e e n a b l e d f or
t h e KEY1 fi el d, wh i c h s h o u l d r e f er t o t h e h e a d e r t abl e, a n d f o r t h e uni t
o f me a s u r e field (MEINA), wh i c h is c o p i e d f r o m Cus t omi zi ng. In addi -
1 4 2
Custom IDocs | 4-4
t i on, SAP del i ver s a check t a bl e f or t h e c l i e nt ( MANDT field). Thi s t abl e
is u s e d her e.
D i c t i o n a r y : M a i n t a i n T a b l e
*9 & 0 *r A ' | g t
j f l T e c h n i c a l S e t t in g s I n d e x e s A p p e n d Structure
T r a n s p T a b l e ZS"P Acih
S h o d D e s c r i p t i o n SM P o s it i o n
Attributes Delivery a n d M ain t e n a n c e F i e l d ' ^ a r . T i C u r r e n c w o u a n t i t v f i e l d s
v f K l t e l * [ S o a r c h Help 1 / 8
Field D a t a e l e m e n t D a ta T y F o r e i g n i C h e c n a b i e Origin o f t h e in p u l help S r c h Help D D o m a i n
HANDT HANDT vlNT
f 111fv
i m SWA h 9 l P 1 o l e e n t # d f l t h h l H J M 3 HANDT
r * 1M'
!EY1
P0SHR
< EY_FEID
P OSttt
CHAR
Nunc
l a g i A h g . i g i M i c e n v r q * u h cnt
-----
U N r fit
FElDA CHAR6 CHAR
------ T
FE108 JHATO CHAR .HAI6
FELOC :h a m CHAR ; h. ro
flEHSE
' F I S *
"EK615
HF 1K l
IUAH
INI T T OM nrviit h ^ l r a i t h r h f
-
3LN.6.1.5
n t nn 1nn
1
!vwy
-
QklZw
F i g u r e 4 . 9 4 Ent r i es f o r t h e I n p u t Check
4.4.1 C r e a t i n g C u s t o m I D o c Types and M e s s a g e Types
To us e t h e ZSMH a n d ZSMP s a mp l e t a bl e s i n a n IDoc, y o u m u s t cr eat e
t h e c o r r e s p o n d i n g c u s t o m s e g me n t s . Sect i on 4 . 2 . 3 , C u s t o m Se gme nt s ,
a l r e a dy i n t r o d u c e d t h e c r e a t i o n o f s e g me n t s i n t h e c o n t e x t o f e n h a n c e
me n t s f o r SAP I Docs. At t hi s p o i n t , h o we v e r , s o me ge ne r a l r e ma r k s c o n
c e r ni ng s e g me n t s n e e d t o be ma d e , wh i c h r e f er mo r e t o de s i gn g u i d e
l i nes t h a n ha ndl i ng.
I n g e n e r a l , a s e g m e n t c a n c o n t a i n up t o 1 , 0 0 0 cha r ac t e r s . For p e r f o r - S e g m e n t si ze
ma n c e r e as ons , y o u s h o u l d t r a n s f e r as f e w s e g me n t s as pos s i bl e bec aus e
e ach s e g m e n t e nt a i l s a d d i t i o n a l c o n t r o l i n f o r ma t i o n . So i t ' s us ef ul t o
g e n e r a t e s e g me n t s t h a t ar e as l o n g as pos s i bl e . But y o u h a v e t o p e r f o r m
a b a l a n c i n g act he r e : The e x t e r n a l l e n g t h ma y be g r e a t e r t h a n t h e l engt h
on t h e d a t a ba s e : c o n s e q u e n t l y , y o u c a n ' t f ul l y us e t h e 1,000 cha r ac t e r s
f o r t h e i n t e r n a l l e n g t h . I f t h e t abl e t o w h i c h t h e s e g m e n t b e l o n g s is
l arger, y o u ma y w a n t t o a d d fi el ds t o t h e s a me s e g m e n t d e f i n i t i o n a t a
l at er s t age. Thi s s h o u l d a l s o be c o n s i d e r e d w h e n de f i ni ng t h e l e n g t h o f
t h e i ni t i al s e gme nt .
143
4 | Changes to IDocs
Reu s a b i l i t y
S e g me n t f o r
t h e h e a de r
S e g me n t f o r t he
i t e m t a b l e
You s h o u l d al so t r y t o g e n e r a t e r e us a bl e s e g me n t s f o r y o u r o w n i nt er est
(to r e d u c e y o u r wo r k ) . Fo r e xa mpl e , i f y o u w a n t t o have d i f f e r e n t t abl es
wi t h a d d r e s s dat a, y o u o n l y g e n e r a t e o n e s e g m e n t f or t h e m. I n t hi s s e g
m e n t , y o u c a n fill w h a t e v e r fi el ds a r e n e e d e d i n a speci f i c case. The fields
s h o u l d be l o n g e n o u g h so t h a t y o u can a l s o u s e t h e m f o r t h e l onges t
e n t r i e s f r om t h e t abl es . O f cour se, y o u can a l s o r e u s e SAP s e g me n t s . So
i f y o u k n o w a s u i t a b l e SAP s e g me n t , f i r st che c k i f it me e t s y o u r r e q u i r e
me n t s b e f o r e c r e at i ng a c u s t o m s e gme nt .
I f y o u a l r e a d y k n o w t h a t y o u w a n t t o i m p l e m e n t c o m m u n i c a t i o n vi a
EDI, al so have a l o o k at t h e c o r r e s p o n d i n g EDI mes s age . I f t hi s mes s age
f o r t h e EDI field t h a t c o r r e s p o n d s t o t h e SAP field al l ows f o r a g r e a t e r
field l e ngt h, use t h e EDI field l engt h in y o u r s e g me n t a n d n o t t h e s h o r t e r
SAP fi el d l e n g t h . Thi s a l s o faci l i t at es l a t e r c o n v e r s i o n s . It c a n al s o be
usef ul t o che c k w h i c h fi el ds ar e u s e d t o g e t h e r i n t h e EDI s t a n d a r d wh e n
c o mb i n i n g fi el ds i n a s e g m e n t de f i ni t i on. I f y o u t h e n a c t ua l l y c o mb i n e
t h e s e fi el ds i n a s e g me n t , t h i s a l s o faci l i t at es t h e c o n v e r s i o n t o t h e EDI
s t a n d a r d . To m e e t t h e E u r o p e a n s t a n d a r d , EDIFACT, r e f e r t o t he i n f o r ma
t i on p r o v i d e d on http://www.edifactory.de.
For t h e ZSMH a n d ZSMP t abl es, t h r e e s e g me n t s w e r e c r e a t e d as exa mpl e s :
o n e f o r t h e h e a d e r , o n e f o r t h e t h r e e s i mi l a r fi el ds, a n d o n e f o r t he
r e ma i n i n g fi el ds o f t h e i t e m t a b l e . All s e g me n t s ar e v e r y s h o r t bec aus e
t h e y r e f e r t o s a mp l e d a t a a n d n o t t o real dat a.
Fi gur e 4 . 9 5 di spl ays t h e h e a d e r s e g me n t . Th e S e g me n t f or t h e Posi t i on
e l e me n t s o n l y c o n t a i n s t he i t e m n u mb e r . Because IDocs have a hi e r a r c hi
cal s t r u c t u r e , y o u d o n ' t h a v e t o r e p e a t t h e KEY1 key fi el d o f t h e h e a d e r
t abl e. Thi s wo u l d o n l y pl ace an u n n e c e s s a r y l oad o n t h e syst em.
As y o u can s e e i n Fi gure 4. 96, t h e c he c kbox f o r t he ISO c o d e is sel ect ed
f or t h e u n i t o f me a s ur e (MEINA). You still have t o pr ogr a m t hi s i mp l e me n
t at i on, as t h e che ckbox ser ves f o r i nf or ma t i on onl y. A cha r ac t e r da t a el e
m e n t wi t h a char act er i st i c t h a t ha s t wo char act er s mo r e (CHARI 7) has bee n
sel ect ed f or t h e MENGE field, whi c h has 15 char act er s i n t he ZSMP t able.
As y o u recall, t hi s addi t i on is necessar y t o t r a n s f e r t he dec i ma l p o i n t and
a possi bl y exi st i ng mi nus sign t o t h e p a r t n e r i n t h e e xt er nal for mat .
1 4 4
Custom IDocs | 4-4
Development segments: Display segment definition Z2ZSMH000
B
S e g m e n t t y p e a t t r i b u t e s
S e g m e n i l y p e Z 1 Z S H H [ ~ Qualified segment
S h o r t D e s c r i p t i o n S a b i n e s S e g m e n t f o r Z S M H
Segm definition Z2ZSHH000
Last Changed By "AISELSA
|p o s (Field Name )ata element S O c o j E x p . n
i | K E Y 1 KEr_FEL0 39 E
2 FELD1 CHAR40
n
40 R
3 FEL02 CHAR10 0J
Fi gu r e 4 . 9 5 Segment f o r t h e Header Tabl e
Development segments: Display segment definition Z2ZSMP000
9
Segment type attnbutes
Segmenir/pe Z1ZSHP r Qualified segment
Short Description Sabines Segment for ZSMP
Segm definition Z2ZSHPQ00
Last Changed By HA1SELSA
|POS leidName )ata element SO CO
t
POSNR POSHR
Id
2 HEN&E CHARt7
n
7 H
3 HEINA MEINA
Fi gu r e 4 . 9 6 Se g me nt f o r t h e I t e m Tabl e
Fi nal l y t h e r e is t h e t h i r d s e g me n t , wh i c h wi l l b e cal l ed Z1ZSMQ. A qualify
ing segment is s u p p o s e d t o be u s e d h e r e . You can t r a n s f e r va r i ous fields
t o a q u a l i f y i n g s e g m e n t . A c o n t r o l l i n g fi el d, cal l ed t h e qualifier, t h e n
i ndi c a t e s wh i c h field is me a n t . You us e t h e s e fi el ds i f y o u d o n ' t k n o w
h o w ma n y o f t h e fi el ds t h a t ar e i dent i cal w i t h r e gar d t o t h e pr ope r t i e s
wi l l b e t r a n s f e r r e d . In o u r e x a mp l e , t h e field c a n o c c u r z e r o t o t h r e e
t i me s , a n d y o u de c i de d e p e n d i n g o n t h e qual i f i er i nt o w h i c h o f t h e t hr ee
fi el ds, FELDA, FELDB, o r FELDC, t h e r e s pect i ve val ue is s u p p o s e d t o be
e n t e r e d . You a l r e a d y k n o w t hi s p r o c e d u r e f r o m p a r t n e r r ol e s i n Sales
a n d Di s t r i b u t i o n (SD) o r Ma t e r i a l s M a n a g e m e n t ( MM) i n SAP. The p r e
r e q u i s i t e her e, ho we v e r , is a speci f i c d o m a i n f o r t h e qual i fi er , wh i c h has
al r e a dy b e e n c r e a t e d as y o u c a n s e e i n Fi gur e 4. 97.
Q u a l i f i e r i n t h e
DDI C
145
4 | Changes to IDocs
D o m a i n f o r t he
q u a l i f i e r
D a t a e l e m e n t f o r
t h e q u a l i f i e r
Dictionary: Maintain Domain
Domain ZSfiOUAL Actr^e
Short Description ZSMQUAL
Properties Value Range
Formal
Data Type CHAP Character String
No Characters

Decimal Places 0
Output Characteristics
Output Length
Convers Routine
Lowercase
F i gu r e 4 . 9 7 D o m a i n f o r t h e Qu a l i f i e r
You t h e n def i ne t h e pos s i bl e i n p u t val ues i n t h e Val ue Range t ab o f t he
d o ma i n . In o u r e xa mpl e , t hi s is "A" o r "B" o r C (see Fi gure 4. 98) . If
y o u us e o n l y o n e val ue r a nge i n t h e d o ma i n , t he I Doc d o c u me n t a t i o n
di spl ays wh i c h s e l e c t i on o p t i o n s ar e avai l abl e f o r t h i s field.
Di ct i onar y: Mai nt ai n Domai n
0 E g a; To * o% b a
Domain ZSH0UAL Active
Short Description ZSMOUAL
Properties Definition
iKltalBlB lB HI
Single Vais
FwVal |Short Descript
* Belongs to FELDA
3 Belongs to FELDB
: Belongs to FELDC
F i gu r e 4* 98 Li st o f t h e I n p u t Val ues
You t h e n us e t hi s d o ma i n t o cr eat e t h e a p p r o p r i a t e da t a e l e me n t i n t he
ne x t s t ep i n Transact i on SE11. For t hi s pur pos e , assi gn a meani ngf ul name
wi t h i n t h e c u s t o me r namespace, a n d r e f er t o t h e ne wl y cr eat ed doma i n.
Figure 4. 99 i l lust rates t hi s us i ng t he ZSMOUAL dat a e l e me n t as an exampl e.
Custom IDocs | 4-4
Dictionary: Maintain Data Element
Qr |
Documentation Supplementary Documentation
Data element ZSHQUAL Actwe
Short Description ZSMQUAL
Attr.buies Further Characteristics Field Label
Elementary Type
Domain ESHQUAL gt MQUAL
Data Type CHAR Character String
Length 1 Decimal Places 0
O Predefined T*pe Data Type
Length 0 Decimal Places 0
O Reference Type
Data Type
Length 0 Decimal Places 0
Fi gu r e 4 . 9 9 Dat a El e me n t f o r t h e Qu a l i f i e r
The ( a d mi t t e d l y r a t h e r smal l ) s e g me n t i n o u r e x a mp l e n o w me r e l y c o n
t ai ns a fi el d f o r t h e q u a l i f i e r a n d a n a d d i t i o n a l fi el d. Thi s field ha s t he
pr o p e r t i e s o f t h e field t h a t t h e t abl e c o n t a i n s t h r e e t i me s i n a n i dent i cal
f o r ma t , FELDA, FELDB, o r FELDC. Fi gur e 4 . 1 0 0 di spl ays t h e t hi r d, qua l i
f yi ng s e g m e n t o f o u r e x a mp l e as Z1ZSMQ.
Development segments: Display segment definition Z2ZSMQ000
S e g m e n t t y p e a t t r i b u t e s
S e g m e n t f r p e
Short Description
212SH0
Segmenttor qualitnng Fields
Segm definition
Last Changed By
P o s F i e l d N a m e
Z 2 Z S K Q 0 D 0
H A 1 S E L S A
E Released
D a t a e l e m e n t ( ' S O c o j E x p j g
Q U L
F E L D
2 S H Q U A L
C H A R 6
n a
a
Fi gu r e 4. 100 Q u a l i f y i n g Segment
Do n ' t f or get t o r el ease all s e g me n t s as des c r i bed i n Sect i on 4. 2. 3, Cus t om
Segment s . Af t e r t hat , t h e s y s t e m bui l ds t h e I Doc t y p e f r om t h e s egment s .
Q u a l i f y i n g
s e g me n t
C u s t o m I Doc
basi c t y p e
147
4 | Changes to IDocs
Sp e c i f i c a t i o n s f o r
t h e r o o t s e g me n t
I n s e r t i n g s e g ment s
A d d i t i o n a l
s e g me n t
Thi s is aga i n i mp l e me n t e d i n Tr a ns act i on WE30; t hi s t i me , ho we v e r , y o u
c r e a t e a speci f i c basi c t ype. Th e al r e a dy k n o w n n a mi n g r ul es ("Z," Y,"
o r / < NAMESPACE> / a t t h e b e g i n n i n g o f t h e n a me ) a p p l y he r e as wel l .
Fi gure 4 . 101 di s pl a ys t h e s c r e e n w i t h t h e g e n e r a l s peci f i cat i ons f o r t he
IDoc t ype.
N e w basic IDoc type
Create new
O Create as copy Copy from
O Create successor Successor of
Administration
Person responsible MAJSELSA
Processing person MAJSELSA
Description_______| Sabines ID o c i y p
UBl
0 0 ________________________
F i gu r e 4.101 Cr eat i ng a Cust om I Do c Type
First, e n t e r t h e ma i n o r r o o t s e g m e n t i n t h e S e g me n t Type field (in o u r
e xa mpl e , t hi s is t he s e g m e n t f or t h e h e a d e r t abl e, Z1ZSMH). It c a n occ ur
o n l y o n c e b u t has t o occur, wh i c h is w h y t h e M a n d a t o r y Seg. che ckbox
is s e l ec t ed (see Fi gur e 4. 102) .
Af t e r wa r d , c r e a t e t h e i t e m s e g m e n t ( her e: Z1ZSMP), wh i c h can o c c u r any
n u m b e r o f t i me s (see Fi gur e 4. 103) . Even t h o u g h i t ' s o pt i ona l , y o u mu s t
s e t t he m i n i m u m n u m b e r o f o c c u r r e n c e f or t hi s s e g m e n t t o 1." Because
t h e M a n d a t o r y Seg. c h e c k b o x i s n ' t s e l e c t e d, t h e s e g m e n t c a n al s o be
mi ssi ng. Befor e y o u navi gat e t o t h e a t t r i b u t e ma i n t e n a n c e , t he s ys t e m
asks y o u a t wh i c h l evel y o u w a n t t o a d d t h e s e gme nt .
In o u r exampl e, t he qual i fyi ng s egment , Z1ZSM0, was also a d d e d a t t he child
l evel because it wi l l be ge ne r a t e d f r om t he s a me t abl e r ecor d at a l at er stage
(see Fi gure 4. 104) . You can n o w bui l d y o u r e nt i r e IDoc t hi s way.
1 4 8
Custom IDocs | 4-4
Create basic type: ZSMTYP01
Its- Maintain Attributes 0 /
Segm.type Z1ZSMH
0 Mandatory seg
Minimum number 1
Maximum number 1
Parent segment
Hi er level 0
S )
F i gu r e 4 1 0 2 D e f i n i n g t h e Ro o t Segment
Create b asi c t y p e : ZSMTYP01
H S a b i n e s I Ooc Typ
Z1ZSHH S a b i n e s Segment f o r ZSHH
| [ e * Se gment Hierarchy 0 /
Add s egment type a s child
O Add s egment type at same level
0[ *
& Maintain Attributes 0 /
S e g m ty p e Z1ZSMP
Mandatory seg.
Minimum number 1
Maximum numbe r 99
Pa re nt segment
Hler.level | 8 [
^ Se gm ent editor %
Fi gu r e 4. 103 Spec i f i c at i ons f o r t h e I t e m Segment
149
4 | Changes to IDocs
D o c u m e n t a t i o n i n
Tr ans ac t i on W E 6 0
C r e a t e b a s i c t y p e : Z S M T Y P 0 1
ZIZSflH
Z1ZSNP
Sabines !0oc Typ
Sabines Segment f o r ZSHH
Sabines Segment f o r ZSHP
E * Segment Hierarchy 0 /
Add segment t i p e as child
O Add segment type at s ame level
X
| [ g Maintain AilnDutes
Segmtrpe zizsno
Mandatory seg
Minimum number 1
Maximum number 99
Parent segment
Hierievei
*
0/
F i gu r e 4*104 Spec i f i c at i ons f o r t h e Q u a l i f y i n g Segment
Tr a ns act i on WE 6 0 e n a b l e s y o u t o have t h e s y s t e m d i s p l a y t h e d o c u m e n
t at i on f or y o u r IDoc t ype. Th e s y s t e m a u t oma t i c a l l y g e n e r a t e s t h e d o c u
me n t a t i o n f r o m t h e da t a t h a t y o u s pec i f i e d. The s t r u c t u r e d e s c r i p t i o n
(see Fi gur e 4 . 1 0 4 ) t h e n mi g h t l o o k as s h o w n i n Tabl e 4. 1.
Basic Type ZSMTYP01
Z S M T Y P 01 Sa b i n e s I D o c Type
Z 1 Z S M H Sa b i n e s Se g m e n t f o r Z S M H
S t a t u s : m a n d a t o r y , m i n i m u m n u m b e r : 1, m a x i m u m n u m b e r :
1
Z 1 Z S M P Sa b i n e s Se g m e n t f o r Z S M P
S t a t u s : o p t i o n a l , m i n i m u m n u m b e r : 1, m a x i m u m n u m b e r : 9 9
Z 1 Z S M Q Se g m e n t f o r Q u a l i f y i n g F i e l ds
S t a t u s : m a n d a t o r y , m i n i m u m n u m b e r : 1, m a x i m u m n u m b e r :
3
Table 4-1 ZSMT YP01 Basic Type
150
Custom IDocs | 4-4
The r e ma i ni ng p a r t o f t h e d o c u me n t a t i o n i snt des c r i bed he r e bec aus e y o u
can obt ai n t he c o r r e s p o n d i n g i n f o r ma t i o n f r om t h e pr e c e di ng figures.
Wh e n t h e IDoc t y p e is c o mp l e t e , y o u h a v e t o c r e a t e t he me s s a ge t ype.
Thi s is d o n e i n Tr a ns act i on WE81 ( t h e me s s a ge t y p e is cal l ed "logi cal
mes s age" her e) . Fi gure 4 . 1 0 5 s h o ws t h e ZSMNACH s a mp l e me s s a ge t ype.
New Entries: Overview o f Added Entries
I s B l P
EDI: Logical Message Types
_ Message Type [Short text
ZSHNACH jSabines Message Type)
Fi gu r e 4-105 Cr eat i ng t h e Message Type
In Tr a ns act i on WE8 2 , t h e me s s a ge t y p e a n d t h e IDoc t y p e t h a t has bee n
cr e a t e d as t h e basi c t y p e ar e a s s i g n e d t o e a c h o t h e r . Fi gur e 4 . 1 0 6 d i s
pl ays t hi s a s s i g n me n t f o r t h e p r e v i o u s l y c r e a t e d obj e c t s , ZSMNACH a n d
ZSMTYP01.
New Entri es: Overview o f Added Entries
Q. IE SI D-
Output Types and Assignment to IDoc Types
Message Type [Basic type lEnlension (Rel ease r f
ZSHNACH jZSHT YP01 700 R
IS I B Bl
Fi gu r e 4 1 0 6 Ass i gni ng t h e I D o c Type t o t h e Message Type
Af t e r y o u ' v e c o mp l e t e d e v e i y t h i n g , y o u can aga i n check y o u r r e s ul t s . As
y o u can s e e i n Fi gure 4 . 1 0 7 , e v e r y t h i n g is okay f o r o u r s a mp l e IDoc.
I f y o u n e e d a d d i t i o n a l f u n c t i o n s , s u c h as r e d u c t i o n s o r l i nks t o bus i nes s
obj ect t ypes , y o u c a n c o n f i g u r e t h e m i n Tr a ns act i on BD60. Thi s t r a n s
ac t i on is o p t i o n a l b e c a u s e a " nor ma l " IDoc d o e s n ' t n e e d t h e s e set t i ngs.
Howe ve r , y o u a l r e a d y k n o w t h e m f r om o t h e r SMD f unct i onal i t i es.
C u s t o m message
t y p e
Me s s a g e
t y p e -
I D o c t y p e
Ch e c k l og
1 5 1
4 | Changes to IDocs
Pr oper t i es o f t he
message t y p e
L o g display
^ fc- * * a I f i ] [ m i l Long Text
9
9
Check b a s i c t y p e ZSMTYP01
B a s i c t y p e ZSHTYPOi e x i s t s
B a s i c t y p e ZSHTYPOI 1s r e l e a s e d
B a s i c t y p e ZSNTYP01 i s l i n k e d t o l o g i c a l aes sage ZShHACH
No p r e d e c e s s o r s e x i s t
Check segment Z1ZSHH
S e g t e n t Z1ZSMH c o n s i s t e n t
Check segment Z1ZSHP
Segent Z1ZSHP c o n s i s t e n t
Check segment Z1ZSHQ
Segment Z1ZSM0 c o n s i s t e n t
F i gu r e 4 1 0 7 Check Log f o r Success
Fi gur e 4 . 1 0 8 s h o ws pos s i bl e Ref e r enc e Me s s a g e Type, F o r ma t Funct i on
Mo d u l e , a n d Reducabl e Mes s age Type p r o p e r t i e s f or o u r s a mp l e message
t ype. Obj e c t t y p e s a n d cl assi fi cat i on d a t a h a v e n ' t b e e n c r e a t e d b e c a u s e
t hi s h a s t o b e d o n e by t h e d e v e l o p e r s o f t h e appl i c a t i on. The o b j e c t t ypes
s e r v e t o c r e a t e l i nks, a n d t h e cl assi fi cat i on da t a is r e q u i r e d i f y o u w a n t t o
s e n d ma s t e r d a t a vi a d i s t r i b u t i o n cl ass t ypes.
New Entri es: Details o f Added Entries
Message Type ZSHnach
Additional Data for Message T y p e /
Additional Data
Reference Message Type
Format Function Module
E Reducable Message Type
Classification Data
Classifiable Object
ALE Object Type
Change Pointer. Message Type Supports Table BDCP2
F i gu r e 4. 108 S M D Set t i ngs f o r t h e " Z S M N A C H " Mes s age Type
152
Custom IDocs | 4-4
You can n o w begi n g e n e r a t i n g a n d p r o c e s s i n g t h e a p p r o p r i a t e IDocs for
t hi s me s s a ge a n d IDoc t ype.
4.4. 2 G e n e r a t i n g an IDoc
W h e n c r e at i ng a n IDoc, y o u s h o u l d o b s e r v e s o me r ul e s i n advance:
Th e p r o g r a m s h o u l d o n l y g e n e r a t e s e g me n t s t h a t c o n t a i n fi el ds t hat
a r e n t i nitial.
Th e s e g me n t s ma y o n l y c o n t a i n a l p h a n u me r i c cha r ac t e r s bec aus e t h e
f o r ma t is s u p p o s e d t o be g e ne r a l l y c o mp r e h e n s i b l e .
Fo r all l anguage s , cur r e nc i e s , a n d u n i t s o f me a s u r e m e n t , us e t h e c o r
r e s p o n d i n g ISO val ues as t he s t a n d a r d v e r s i o n d o e s . SAP pr ovi des
f u n c t i o n mo d u l e s f o r c o n v e r s i o n s , wh i c h y o u c a n a l s o use.
As c o m m o n f or a l p h a n u me r i c c o n t e n t , al l fi el ds s h o u l d b e fi l l ed left-
al i gned. You c a n u s e t h e CONDENSE c o m m a n d f o r t h i s pur pos e .
Fo r d e c i ma l n u mb e r s , t h e s y s t e m a l wa ys uses a p o i n t as t h e deci mal
s e pa r a t or ; t h e pos s i bl y exi s t i ng mi n u s si gn is i ndi c a t e d a t t h e end.
Th o u s a n d s s e p a r a t o r s ar e n e v e r used.
A f l oat i ng p o i n t n u m b e r is di s p l a y e d w i t h a p o i n t as t h e d e c i ma l s e p
a r a t o r a n d w i t h o u t a t h o u s a n d s s epa r at or . A pos s i bl e exi s t i ng mi nus
si gn is i n d i c a t e d at t h e b e g i n n i n g t hi s t i me; t h e e x p o n e n t is al ways at
t h e end.
Dat e fi el ds ar c d i s p l a y e d i n t h e s a me wa y as o n t h e d a t a b a s e , t h a t is,
i n t h e y y y y M M d d for mat .
Ti me s ar e a l s o d i s p l a y e d i n t h e s a me w a y as o n t h e da t aba s e, t h a t is,
i n t h e HHmms s f or ma t .
The r e a r e t h r e e o p t i o n s f o r g e n e r a t i n g a n IDoc: You ca n g e n e r a t e a di r e c t
t r a ns a c t i on o r a di r e c t s e n d r e p o r t , us e me s s a ge cont r ol , o r wo r k wi t h
cha nge poi nt e r s . The r es pect i vel y r e q u i r e d Cus t omi z i ng f o r t h e nec es s ai y
t r a ns a c t i on c o d e s a n d a s s i g n me n t s o f t h e f u n c t i o n mo d u l e s is des c r i bed
i n C h a p t e r 2, Sect i on 2. 1, S t a n d a r d M e t h o d s f o r t h e IDoc Ge n e r a t i o n .
Thi s e x a mp l e t h e r e f o r e wo r k s w i t h a f u n c t i o n mo d u l e . In gene r al , y o u
can us e t hi s f u n c t i o n mo d u l e , wh i c h w e ll call Z_MASTERIDOC_CREATE_
ZSMNACH, f or al l o p t i o n s m e n t i o n e d e a r l i e r f or t h e g e n e r a t i o n o f IDocs.
It ' s cal l ed i n a r e p o r t (see Li st i ng 4. 9).
P r o g r a mmi n g
g u i d e l i n e s
I D o c g e n e r a t i o n
153
4 | Changes to IDocs
F u n c t i o n mo d u l e
G e n e r a t i n g a n
I Doc : s i g n a t u r e
D a t a d e f i n i t i o n s
Thi s f u n c t i o n mo d u l e c ove r s t h e ma i n p r o g r a m a s pe c t s . I t t r a n s f e r s a
va r i a bl e t h a t y o u can us e t o d e t e r m i n e t he d a t a t h a t is s u p p o s e d t o be
s e nt . I n t hi s case, it' s t h e O B J K E Y var i abl e. To kee p it s i mpl e , t h e var i abl e
refers t o t h e Z S M H t abl e; i f y o u us e l ar ger t abl es, y o u s h o u l d cr eat e a s t r uc
t ur e t h a t o n l y consi st s o f t h e k e y fi el ds. Thi s is f ol l owed b y t h e var i abl es
f or t h e s e n d e r ( s e n d e r p a r t n e r ID S N D P R N , s e n d e r p a r t n e r t y p e S N D P R T ,
a n d s e n d e r p a r t n e r f u n c t i o n S N D P F C ) a n d t h e r e c e i ve r ( r e c e i ve r p a r t n e r
ID R C V P R N a n d r e c e i v e r p a r t n e r t y p e R C V P R T ) . The s y s t e m r e t u r n s t he
n u m b e r o f t h e g e n e r a t e d IDocs so t h a t y o u re p r o v i d e d wi t h an i nt er na l
t a bl e f or t h e c o n t r o l recor ds.
Basically, a f u n c t i o n mo d u l e l i ke t h i s o n e c a n g e n e r a t e mu l t i p l e IDocs,
b u t o u r e x a mp l e is l i mi t e d t o o n e . Th e s i g n a t u r e o f t h e f u n c t i o n m o d
ul e is f o l l o we d by da t a de c l a r at i ons a n d t h e i ni t i al i zat i on pr ocess o f all
s t r uct ur e s .
F U N C T I O N z m a s t e r i d o c _ c r e a t e _ z s m n a c h .
" L o c a l i n t e r f a c e :
I M P O R T I N G
V A L U E ( O B J K E Y ) T Y P E Z S M H
V A L U E ( R C V P F C ) T Y P E B D A L E D C - R C V P F C
V A L U E ( R C V P R N ) T Y P E B D A L E D C - R C V P R N
V A L U E ( R C V P R T ) T Y P E B D A L E D C - R C V P R T
*
V A L U E ( S N D P F C ) T Y P E B D A L E D C - S N D P F C
*
V A L U E ( S N D P R N ) T Y P E B D A L E D C - S N D P R N
* '
V A L U E ( S N D P R T ) T Y P E B D A L E D C - S N D P R T
E X P O R T I N G
V A L U E ( C R E A T E D _ _ C O M M _ . I D O C S ) L I K E S Y
D E F A U L T S P A C E
D E F A U L T S P A C E
C H A N G I N G
R E F E R E N C E ( T E _ I D 0 C _ C 0 N T R O D T Y P E E D I D C _ T T
D A T A : B E G I N O F f _ i d o c _ h e a d e r .
I N C L U D E S T R U C T U R E e d i d c .
D A T A : E N D O F f _ i d o c _ h e a d e r .
D A T A : B E G I N O F t _ i d o c _ d a t a O C C U R S 1 0 .
I N C L U D E S T R U C T U R E e d i d d .
D A T A : E N D O F t _ i d o c _ d a t a .
D A T A : B E G I N O F t _ i d o c _ c o m m _ c o n t r o l O C C U R S 1 0 .
I N C L U D E S T R U C T U R E e d i d c .
1 5 4
Custom IDocs | 4-4
D A T A : E N D O F t _ i d o c _ c o m m _ c o n t r o l .
D A T A : c o m m _ c o n t r o l _ l i n e s L I K E s y - t a b i x .
D A T A : i d o c _ m u s t _ b e _ s e n t .
D A T A : w a _ z l z s m h T Y P E z l z s m h .
D A T A : w a _ z s m h T Y P E z s m h .
D A T A : w a _ z l z s m p T Y P E z l z s m p .
D A T A : w a _ z s m p T Y P E z s m p .
D A T A : i t _ z s m p T Y P E T A B L E O F z s m p .
D A T A : w a _ z l z s m q T Y P E z l z s m q .
* I n i t i a l i z e
C L E A R t _ i d o c _ c o m m _ c o n t r o l .
R E F R E S H t _ i d o c _ c o m m _ c o n t r o l .
C L E A R t _ i d o c _ d a t a .
R E F R E S H t _ i d o c _ d a t a .
* C h e c k A L E d i s t r i b u t i o n m o d e l
L i s t i n g 4 . 9 Da t a Dec l ar at i ons
I f y o u w o r k w i t h ALE d i s t r i b u t i o n , che c k b e f o r e y o u g e n e r a t e t h e Re a d i n g t h e
IDoc w h e t h e r t h e p r e d e f i n e d c o m b i n a t i o n o f s e n d e r , r ecei ver , a n d d i s t r i b u t i o n mo d e l
me s s a ge t y p e is a l l owe d, t h a t is, w h e t h e r i t ' s ma i n t a i n e d i n t h e c u s t o me r
d i s t r i b u t i o n mo d e l . You c a n us e t h e s t a n d a r d m o d u l e A L E _ M O D E L _ D E T E R -
M I N E _ I F _ T 0 _ S E N D p r o v i d e d by SAP f o r t hi s p u r p o s e (see Li st i ng 4 . 1 0 ) .
C A L L F U N C T I O N A L E _ M O D E L _ D E T E R M I N E _ I F _ T 0 _ S E N D
E X P O R T I N G
m e s s a g e _ t y p e ' Z S M N A C H
*
s e n d i n g _ s y s t e m
r e c e i v i n g _ s y s t e m
r e c e i v i n g _ s y s t e m
V A L I D D A T E
- r c v p r n
S Y - D A T U M
I M P O R T I N G
i d o c _ m u s t _ b e _ s e n t i d o c _ m u s t _ b e _ s e n t
E X C E P T I O N S
o w n _ s y s t e m _ n o t _ d e f i n e d =
O T H E R S
I F i d o c _ m u s t _ b e _ s e n t I S I N I T I A L .
EXI T .
ENDI F .
L i s t i n g 4. 10 D e t e r m i n i n g t h e Da t a o f t h e D i s t r i b u t i o n M o d e l
1 5 5
4 | Changes to IDocs
Ge n er a t i n g
s e g ment s
Re d u c t i o n
a c t i v a t e d ?
I f y o u g e t a pos i t i ve r esul t , t h e r oot s e g m e n t is g e n e r a t e d n e x t (see List
i ng 4. 11) . Usi ng t h e M o v e - C o r r e s p o n d i n g o r C o r r e s p o n d i n g F i e l d s
s t a t e me n t s al ways ha s t h e b e n e f i t t h a t po t e n t i a l n e w fi el ds d o n t l ead t o
cha nges i n t h e p r ogr a m.
* Z S M H = = > G e n e r a t e E 1 Z S M H H E A D E R s e g m e n t
S E L E C T S I N G L E * F R O M z s m h
I N T O C O R R E S P O N D I N G F I E L D S O F w a . z s m h
W H E R E k e y l = o b j k e y - k e y l .
M O V E - C O R R E S P O N D I N G w a _ z s m h T O w a _ z l z s m h .
L i s t i n g 4-11 Fi l l i ng t h e He a d e r Se g me n t - A p p l i c a t i o n Dat a
The s e g me n t g e n e r a t e d s o f ar is n o w t r a n s f e r r e d t o t h e d a t a r e cor d t abl e
(see Li st i ng 4. 12) . Onl y t h e s e g m e n t n a me f r o m t h e cont r ol ar ea n e e d s t o
b e t r a n s f e r r e d , e v e r y t h i n g el s e wi l l be g e n e r a t e d a t a l a t e r st age.
C L E A R t _ i d o c _ d a t a .
t _ i d o c _ d a t a - s e g n a m = Z I Z S M H * .
t _ i d o c _ d a t a - s d a t a - w a _ z l z s m h .
L i s t i n g 4.12 Fi l l i ng t h e Header Se g me nt Co n t r o l Dat a
I f r e d u c t i o n is e n a b l e d f o r y o u r me s s a g e t y p e , t h e f o l l o wi n g f u n c t i o n
mo d u l e checks wh i c h fields ar e act i ve f o r t h e s e g me n t t h a t is s u p p o s e d t o
be p r o c e s s e d i n t he r e d u c e d t y p e (see Li st i ng 4. 13) . The Z S M N A C H t y p e in
o u r e x a mp l e is n o r e d u c t i o n , so i t wi l l b r i n g back all f i el ds a n d s e g me n t s
as r el evant ; n e v e r t h e l e s s , t h e call ha s b e e n e x e c u t e d h e r e f or i l l ust r at i on
pur pos e s .
* R e d u c i n g s e g m e n t s
C A L L F U N C T I O N ' I D O C _ R E D U C T I O N _ F I E L D _ R E D U C E '
E X P O R T I N G
m e s s a g e _ t y p e = Z S M N A C H '
s e g m e n t _ t y p e = ' Z 1 Z S M H '
s e g m e n t _ d a t a = t _ i d o c _ d a t a - s d a t a
I M P O R T I N G
s e g m e n t _ d a t a = t _ i d o c _ d a t a - s d a t a .
L i s t i n g 4.13 Chec k i ng i f t h e F u n c t i o n M o d u l e Is Suppos ed t o Be Reduced
The a p p e n d t o t h e IDoc da t a t a bl e is i m p l e m e n t e d in t h e n e x t st ep:
A P P E N D t _ 1 d o c d a t a .
1 5 6
Custom IDocs | 4-4
Af t e r wa r d , t h e s ys t e m i mme d i a t e l y c r e a t e s t h e ne x t s e g me n t ( s e e List
i ng 4. 14) .
* ZSMP = = > E1 ZSMP
SELECT * FROM z s mp
I NTO CORRESPONDI NG F I E L D S OF TABLE i t _ z s m p
WHERE k e y l = o b j k e y - k e y l .
LOOP AT i t _ z s m p I N T O w a _ z s m p .
MOVE- CORRESPONDI NG w a . z s m p TO w a . z l z s m p .
L i s t i n g 4. 14 Ge n er a t i n g t h e I t e m Se g me nt - A p p l i c a t i o n Dat a
Thi s is t h e f i r st field wi t h di gi t s t h a t ar e s u p p o s e d t o b e t r a n s f e r r e d as
a l p h a n u me r i c cha r ac t e r s . A C o n d e n s e is execut ed:
CONDENSE w a _ z l z s m p - m e n g e .
Al so a field exi st s t h a t is s u p p o s e d t o b e s e n t i n t h e ISO c o d e a n d n o t in
t h e SAP u n i t (see Li st i ng 4. 15) . It ' s t h e u n i t o f me a s ur e . The SAP f u n c
t i on mo d u l e f o r t h e c o n v e r s i o n d i r e c t i o n f r om SAP u n i t t o ISO c o d e is
UNI T_OF_ MEASURE_ SAP_ TO_ I SO.
CALL FUNCTI ON U N I T _ OF _ ME A S URE _ S A P _ T O_ I S O
EXPORTI NG
s a p _ c o d e = w a _ z l z s m p - m e i n a
I MPORTI NG
i s o _ c o d e = w a _ z l z s m p - m e i n a
EXCEPTI ONS
n o t _ f o u n d = 01
n o _ i s o _ c o d e - 02 .
CLEAR t _ i d o c _ d a t a .
t _ i d o c _ d a t a - s e g n a m - Z 1 Z SMP' .
t _ i d o c _ d a t a - s d a t a = w a _ z l z s m p .
L i s t i n g 4. 15 D e t e r m i n i n g t h e I SO Un i t s o f Meas ur e
Here, t he r e d u c t i o n is mi ssi ng, whi c h is al r e a dy c o n t a i n e d in t h e c o d e f or
t h e h e a d e r s e g m e n t i n Li st i ng 4. 13. Th e a p p e n d i mme d i a t e l y fol l ows:
APPEND t _ i d o c _ d a t a .
In a d d i t i o n , a n o p t i o n a l q u a l i f yi ng s e g m e n t is p r o v i d e d t h a t is de r i ve d
f r om t h e s a me d a t a r e cor d (see Li st i ng 4. 16) . The s ys t e m checks t h e t hr e e
pos s i bl e cases, FELDA, FELDB, o r FELDC, a n d g e n e r a t e s t h e s e g me n t s i f
t h e c o r r e s p o n d i n g da t a is avai l abl e.
I t e m s e g me n t
C o n v e r t i n g u n i t s of
me a s u r e me n t
Q u a l i f y i n g
s e g me n t
157
4 | Changes to IDocs
C o n t r o l r ec o r d
r e q u i r e d f i el ds
I F N O T w a _ z s m p - f e l d a I S I N I T I A L .
w a _ z l z s m q - q u a l - A .
w a _ z l z s m q - f e l d = w a _ z s m p - f e l d a .
C L E A R t _ i d o c _ d a t a .
t _ i d o c _ d a t a - s e g n a m = ' Z 1 Z S M Q ' .
t _ i d o c _ d a t a - s d a t a - w a _ z l z s m q .
A P P E N D t _ i d o c _ d a t a .
E N D I F .
I F N O T w a _ z s m p - f e l d c I S I N I T I A L .
w a _ z l z s m q - q u a l = * C * .
w a _ z l z s m q - f e l d - w a _ z s m p - f e l d c .
C L E A R t _ i d o c _ d a t a .
t _ i d o c _ d a t a - s e g n a m - ' Z 1 Z S M Q ' .
t _ i d o c _ d a t a - s d a t a = w a _ z l z s m q .
A P P E N D t _ i d o c _ d a t a .
E N D I F .
I F N O T w a _ z s m p - f e l d b I S I N I T I A L .
w a _ z l z s m q - q u a l - * B ' .
w a _ z l z s m q - f e l d = w a _ z s m p - f e l d b .
C L E A R t _ i d o c _ d a t a .
t _ i d o c _ d a t a - s e g n a m = * Z 1 Z S M Q * .
t _ i d o c _ d a t a - s d a t a - w a _ z l z s m q .
A P P E N D t _ i d o c _ d a t a .
E N D I F .
E N D L O O P .
L i s t i n g 4. 16 Ge n er a t i n g t he O p t i o n a l Q u a l i f y i n g Segment s
Next , y o u n e e d y o u r c o n t r o l r e cor d; ho we v e r , t h e r e ar e o n l y a f e w fields
t h a t y o u n e e d t o fill i n y o u r s e l f . In o u r e x a mp l e (see Li st i ng 4 . 17) , t h e s e
m a n d a t o i y f i el ds ar c fi l l ed f o r s e n d e r i n f o r ma t i o n , r e c e i v e r i n f o r m a
t i on, a n d pos s i bl y r e q u i r e d ser i a l i z at i on i n f o r ma t i o n . The s ys t e m a u t o
mat i cal l y speci f i es t h e t i me s t a mp , t h e c r e a t i n g o r mo d i f y i n g p e r s on, a n d
t h e like.
* D e s i g n c o n t r o l r e c o r d .
C L E A R f _ i d o c _ h e a d e r .
f _ i d o c _ h e a d e r - m e s t y p = Z S M N A C H ' .
f _ i d o c _ h e a d e r - i d o c t p = ' Z S M T Y P O r .
f _ 1 d o c _ h e a d e r - s n d p f c = s n d p f c .
f _ i d o c _ h e a d e r - s n d p r n - s n d p r n .
f _ 1 d o c _ h e a d e r - s n d p r t = s n d p r t .
1 5 8
Custom IDocs | 4-4
f _ i d o c _ h e a d e r - r c v p f c = r c v p f c .
f _ i d o c _ h e a d e r - r c v p r n - r c v p r n .
f _ i d o c _ h e a d e r - r c v p r t = r c v p r t .
f _ i d o c _ h e a d e r - s e r i a l - s p a c e .
L i s t i n g 4. 17 F i l l i n g t h e M a n d a t o r y Fi el ds i n t h e Co n t r o l Recor d
The s ys t e m t r ans f er s t h e fi nal l y c o mp l e t e ma s t e r IDoc t o t h e c o m m u n i
ca t i on l a ye r ( s e e Li st i ng 4. 18) . Du r i n g t hi s pr oc es s , t h e h i e r a r c h y f o r t he
i ndi vi dua l s e g me n t s is s e t u p ac cor di ng t o t h e IDoc t y p e def i ni t i on.
* T r a n s f e r I D o c t o c o m m u n i c a t i o n l a y e r
C A L L F U N C T I O N ' M A S T E R _ I D O C _ D I S T R I B U T E '
E X P O R T I N G
m a s t e r _ i d o c _ c o n t r o l - f _ i d o c _ h e a d e r
T A B L E S
c o m m u n i c a t i o n _ i d o c _ c o n t r o l - t _ i d o c _ c o m m _ c o n t r o l
m a s t e r _ i d o c _ d a t a = t _ i d o c _ d a t a
E X C E P T I O N S
e r r o r _ i n _ i d o c _ c o n t r o l = 01
e r r o r _ w r i t i n g _ i d o c _ s t a t u s = 0 2
e r r o r _ i n _ i d o c _ d a t a - 0 3
s e n d i n g _ l o g i c a l _ s y s t e m _ u n k n o w n = 0 4 .
D E S C R I B E T A B L E t _ i d o c _ c o m m _ c o n t r o l
L I N E S c o m m _ c o n t r o l _ l i n e s .
c r e a t e d _ c o m m _ i d o c s - c o m m _ c o n t r o l _ l i n e s .
t e _ i d o c _ c o n t r o l [ ] = t _ i d o c _ c o m m _ c o n t r o l [ ] .
E N D F U N C T I O N .
L i s t i n g 4. 18 Sendi ng t h e Gener at ed I Docs
Not e t hat , f o r b e t t e r r eadabi l i t y, t hi s c o d e d o e s n t i ncl ude s o me r e cur r i ng
as pe ct s wi t h wh i c h d e v e l o p e r s a r e us ual l y f ami l i ar . Fo r e x a mp l e , y o u
ma y w a n t t o us e mo r e var i abl es w h e r e h a r d c o d e was u s e d i n t hi s e x a m
pl e. Thi s e x a mp l e a l s o d o e s n ' t che c k i f t h e s e g me n t s ar e fi l l ed b e f o r e
t h e y ar e a p p e n d e d , wh i c h y o u s h o u l d al ways do.
Youve n o w c r e a t e d t h e d a t a r e c or ds f o r y o u r t abl es. The q u i c k v i e w in
Fi gur e 4 . 1 0 9 di s pl a ys t h e d a t a o b j e c t t h a t is s u p p o s e d t o be s e n t as an
e x a mp l e her e.
Tr ansf er t o t h e
c o m m u n i c a t i o n
l ayer
C o m p l e t e c u s t o m
I Doc
1 5 9
4 | Changes to IDocs
M
abi nes Obj ect List
Partial l e v Char 2SMH-FEL02 Partial keyi Item | Reserve | Reserve Reserve t Quantity| Uom; Uo m |
4711 |FELD1|FELD2 |471 100001OFELQA | F E L 0 8 |FELDC 10 PC P C I
4711 FELD! FEL:>2 4 711 0 00 020 FELDA1 FELD91 FELDCl ICO C PC
F i gu r e 4 1 0 9 Data Object t o Be Sent
individual display Tr a ns act i on BD87 lists t h e IDoc t h a t ha s b e e n g e n e r a t e d f r om t h e dat a
o b j e c t ( see Fi gure 4. 110) .
IDoc display
i I
^ I D o c 0 0 0 0 0 0 0 0 0 0 7 6 8 7 9 6
Q Control Rec
CD Data records Total number. 0
^ D Z1ZSMH Se gm ent 00000
^ D z i z s M P Se gm ent 00000
0 Z1Z SMQA Se gm ent 00000
D Z1Z SMOC Se gm ent 00000
D Z1ZSMQ 0 Se gm ent 00000
^ Z1ZSMP Se gm ent 00000
Z1ZSMO A Se gm ent 00000
Z1Z SMOC Se gm ent 00000
D Z1Z SMQB Se gm ent 00000
P C i Status records
Technical short info 7
Direction 1 Outbox
Current status 03 C C O
Basic type
ZSMTYP01
Extension
M e ssag e type ZSMNACH
Partner No. PRODUCTION
Partn.Type LS
Port A0 00000003
Content o f sel ected segment
Fid na m e
POSNR
1EN6E^
1EINA
Fid cont
D00010
PCE
F i gu r e 4.110 Sample IDoc in Transaction BD87
Control record T h e c o n t r o l r e c o r d (see Fi gur e 4 . 1 1 1 ) i n d i c a t e s t h a t y o u r IDoc t y p e
(here: S a b i n e s IDoc Type) a n d y o u r me s s a ge t y p e ( her e: ZSMNACH) we r e
a c t ua l l y used.
EDlDC | Control Record
DIRECT Direction 1 : Outbound
DOCREL Release 700
OUTMOD OutoutMode 2
STATUS Status 30 IDoc reactyfor dispatch (ALE service)
DOCTYP Basic Type 30 Sabines IDoc Typ
CIMTYP Enhancement 3 0 :
MESTYP Message Type ZSMNACH
Figure 4. 111 Section Taken from the Control Record
1 6 0
Custom IDocs | 4-4
The d a t a o f t h e i ndi vi dua l s e g me n t s n o w al so cl earl y s h o ws t h e c o n v e r
si on o f t h e d a t a f r o m PC," as t h e i n t e r n a l u n i t o f me a s u r e pi ece, t o "PCE"
as t h e c o r r e s p o n d i n g ISO u n i t o f me a s u r e i n t h e MEI NA field (see Fi gure
4 . 1 1 2 ) . T h e l i st a d d i t i o n a l l y i n c l u d e s t h e qua l i f y i n g s e g me n t , Z1ZSMQ,
wh i c h ha s b e e n cr e a t e d as an exa mpl e .
Technical Name Description value
SEONUM Segment Number 000001
SEGNAM Segment Name Z1ZSMH
KEY1 Partial key of SAP oblect 4711
FELD1 Character field of length 40 FELD1
FELD2 Character Field Length = 10 FELD2
SEGNUM Segment Number 000 002
SEGNAM Segment Name Z1ZSMP
POSNR Item number of the SD document 000 010
MENGE 17-Char Field 10 000
MEINA Unit of measure PCE
SEGNUM Segment Number 000 003
SEGNAM Segment Name Z1ZSMQ
QUAL ZSMQUAL A Belongs to FELDA
FELD Character field of length 6 FELDA
SEGNUM
9GONAM
Segment Number
Segment Name
000004
Z1ZSM0
GUAL
: ELD
ZSMQUAL
Character field of length 6
C : Belongs to FELDC
FELDC
SEGNUM Segment Number 000 005
C-J-L ZSMQUAL B Belongs to FELDB
FELD Character field of length 6 FELDB
SEGNUM Segment Number 000 006
SEGNAM Segment Name Z1ZSMP
POSNR Item number of the SD document 000 020
MENGE 17-Char Field 100.000
MEINA Unit of measure PCE
SEGNUM Segment Number 000007
SEGNAM Segment Name Z1ZSMQ
GUAL ZSMQUAL A Belongs to FELDA
= ELD
3 E G N J V
Character field of length 6
Segment Number
FELDA1
: 0 1 0 os
SEGNAM
C-U.-l
Segment Name
ZSMQUAL
Z1ZSMQ
C Belongs 10 FELDC
FELD Character field of length 6 'ELDC1
Fi gu r e 4.112 Da t a Recor ds
4.4. 3 U p d a t i n g an IDoc
The i n b o u n d pr ocessi ng is n o w s u p p o s e d t o pr ocess t h e message a n d IDoc
types. For t hi s pur pos e , y o u n e e d t he a ppr opr i a t e f unct i on mo d u l e again.
1 6 1
4 | Changes to IDocs
T h e s a m p l e m o d u l e o n l y c o n t a i n s t h e d a t a t h a t i s n e c e s s a r y f o r I D o c p r o
c e s s i n g . U s u a l l y , t h e s y s t e m i s s u p p o s e d t o e v a l u a t e a l l r e t u r n c o d e s , c h e c k
t h e u s e r a u t h o r i z a t i o n s , a n d s e t l o c k e n t r i e s . F u r t h e r m o r e , t h e e x a m p l e uses
o n l y o n e I D o c p e r c a l l ( t h e o r e t i c a l l y , m u l t i p l e I D o c s a r e f e a s i b l e ) a n d n o n e
o f t h e A L E s e r v i c e s i s d e p l o y e d . C o m p r e h e n s i v e c h e c k s f o r t h e c o m p l e t e n e s s
a n d c o r r e c t n e s s o f t h e d a t a a r e m i s s i n g as w e l l . B e c a u s e t h e s e c h e c k s ar e
a p p l i c a t i o n - s p e c i f i c , y o u m u s t c o n s u l t t h e p e r s o n r e s p o n s i b l e f o r t h e m o d u l e
a n d i n t e g r a t e t h e m y o u r s e l f .
Y o u c a n o b t a i n t h e v a r i a b l e s t h a t r e c u r i n t h i s s a m p l e m o d u l e b y m a k i n g t h e
f o l l o w i n g e n t r y i n t h e T O P i n c l u d e o f y o u r f u n c t i o n g r o u p :
i n c l u d e m b d c o n w f . " R e p o r t c o n t a i n i n g t h e ALE c o n s t a n t s .
A m o n g o t h e r t h i n g s , t h e m b d c o n w f i n c l u d e c o n t a i n s t h e c o n s t a n t s t h a t ar e
l i s t e d i n T a b l e 4 . 2 a n d u s e d l a t e r . T h i s i s m e r e l y a s u b s e t o f t h e v a r i a b l e s f r o m
m b d c o n w f .
Fi xed v al ues i n t he
SAP i n c l u d e
V a r i a b l e F i x e d V a l u e \
C_ WF _ R E S UL T _ E RROR 9 9 9 9 9
C _ WF _ R E S U L T _ D E L E T E _ I D O C 9 9 9 9 8
C _ W F _ R E S U L T _ W I _ C O M P L E T E 9 9 9 9 7
C _ WF _ R E S U L T _ O K 0
C _ WF _ R E S U L T _ R E T R Y _ I D O C 1
C _ W F _ R E S U L T _ C O N T I N U E _ I D O C 2
C _ I D O C _ S T A T U S _ O K 5 3
C _ I D O C _ S T A T U S _ E R R OR 51
Tabl e 4. 2 Fi xed Val ues f r o m t h e m b d c o n w f I ncl ude
i n b o u n d f u n c t i o n W h i l e t h e f u n c t i o n m o d u l e s a r e n t s u b j e c t t o f u r t h e r r e s t r i c t i o n s i n t h e
m o d u l e : Si g n a t u r e o u t b o u n d p r o c e s s i n g , i n b o u n d f u n c t i o n m o d u l e s m u s t h a v e a u n i f o r m
s i g n a t u r e b e c a u s e t h e y a r e a u t o m a t i c a l l y c a l l e d b y t h e A L E c o m m u n i c a
t i o n l a y e r . F i g u r e 4 . 1 1 3 s h o w s t h e n e c e s s a r y p a r a m e t e r s a n d t h e i r t y p
i n g . P a r a m e t e r s o f t h e T a b l e s t y p e a r c n o l o n g e r c o m m o n i n m o r e r e c e n t
1 6 2
Custom IDocs | 4-4
r el eases; h o we v e r , h e r e t h e y h a v e t o be u s e d t o m e e t t h e r e q u i r e me n t s
o f t h e ALE c o mmu n i c a t i o n layer. I f r e q u i r e d , y o u c a n c o p y o n e o f t he
e xi s t i ng IDoc i n b o u n d f u n c t i o n modul e s .
FUNGI ION Z_IOOC_INPUT_ZSHNACH
L o c a l I n t e r f a c e :
IMPORTING
VALUE(INPUT.HETHOD) LIKE BDVFAP_PAR-INPUTHETHD
VALUE(HASS_PROCESSIN$) LIKE BDWFAP.PAR-flASS.PROC
VALUE(NO.APPLICATION L06) LIKE SV-DATAR OPTIONAL
VALUE(MASSSAVEINFOS) LIKE HASSSAVINF STRUCTURE MASSSAVINF
OPTIONAL
- EXPORTING
VALUE(YORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
VALUE(APPLICATI0NJVARIA8LE) LIKE 8DWF_PARAH-APPL_VAR
VALUE( IN_UPDATE_TASK) LIKE BDWFAP_PAR- UPDATETASK
VALUE(CALL_TRANSACTION_OONE) LIKE BDFAP_PAR-CALLTRANS
' TABLES
IDOC.CONTRL STRUCTURE EOIDC
IDOC_DATA STRUCTURE E0I0D
IOOC.STATUS STRUCTURE BDIDOCSTAT
RETURN_VARIABLES STRUCTURE BDWFRETVAR
SERIALIZATION INFO STRUCTURE BDI.SER
EXCEPTIONS
k)RONG_FUNCTION_CALLEO
------------------------------------------------------------------------------------------------------------------------------------------
F i gu r e 4-113 Si gnat ur e o f an I n b o u n d Fu n c t i o n M o d u l e
To n o t us e r e s our ces unnec es s ar i l y, y o u m u s t fi rst check i f t he f unct i on
m o d u l e c o r r e s p o n d s t o t h e IDoc t h a t is s u p p o s e d t o be p r oc e s s e d. For
t hi s p u r p o s e , y o u can che c k t h e me s s a ge t y p e i f t h e me s s a ge t y p e s are
n o n - r e d u c i b l e (see Li st i ng 4. 19) .
I F i d o c _ c o n t r l - m e s t y p < > Z S M N A C H
R A I S E w r o n g _ f u n c t i o n _ c a l l e d .
E N D I F .
L i s t i n g 4. 19 Chec k i ng t h e Mes s age Type
For r e duc i bl e IDocs, a d i f f e r e n t me s s a ge t y p e c a n b e u s e d so t h a t y o u
have t o che c k t h e IDoc t ype(s) t h a t a r e p e r mi t t e d f or t h e r e duc i bl e me s
sage t y p e i n t hi s case (see Li st i ng 4. 20).
I F i d o c _ c o n t r l - i d o c t p <> ' Z S M T Y P O r .
R A I S E w r o n g _ f u n c t i o n _ c a l l e d .
E N D I F .
L i s t i n g 4 . 2 0 Ch e c k i n g t h e I D o c Type
Ch e c k i n g t he
v a l i d i t y o f t h e
f u n c t i o n mo d u l e s
1 63
4 | Changes to IDocs
S t a r t i n g t he
s u b r o u t i n e
T r ans f er r i ng t he
I D o c d a t a
Va r i abl es f o r t he
a p p l i c a t i o n d a t a
Thi s is f ol l owed by t h e va r i a bl e def i ni t i ons (see Li st ing 4. 21) .
D A T A : s u b r c L I K E s y - s u b r c .
* S t r u c t u r e f o r t h e h e a d e r d a t a
D A T A : w a _ z s m h T Y P E z s m h .
* V a r i a b l e s f o r t h e i t e m s
D A T A : i t _ z s m p T Y P E T A B L E O F z s m p .
L i s t i n g 4-21 De c l a r at i o n o f t h e Requi r ed Var i abl es
Then, t he s y s t e m r eads t h e I Doc a n d copi es t he da t a t o t r a n s f e r t h e s t r uc
t ur e s (see Li st i ng 4. 22) . I n t hi s e xa mpl e , t h e f unc t i on mo d u l e c a n pr ocess
o n e I Doc onl y, so t h e t r a n s f e r r e d t abl e, wh i c h c o n t a i n s me r e l y o n e dat a
r ecor d, is a l wa ys r e a d u s i n g I n d e x 1 . I f y o u w a n t t o us e a mas s - c ompa t -
i bl c mo d u l e , t h e pr oc e s s i ng t akes pl ace i n a l oop.
R E A D T A B L E i d o c _ c o n t r l I N D E X 1 .
P E R F O R M i d o c _ p r o c e s s _ z s m n a c h T A B L E S i d o c _ d a t a
i d o c _ s t a t u s i t _ z s m p
U S I N G i d o c _ c o n t r l
C H A N G I N G s u b r c w a _ z s m h .
L i s t i n g 4. 22 Readi ng t h e Co n t r o l Recor d
The c o n t e n t o f t h e f o r m is s t r u c t u r e d as i l l ust r at ed i n Li st ing 4. 23. To
p r ovi de an e x a mp l e t h a t c ons i de r s t h e n e w t echnol ogi es f o r t h e t a bl e dec
l arat i on, wh i c h ar e avai l abl e as o f Rel ease 4. 0, t h e t abl e t ype is i ncl uded
her e.
F O R M i d o c _ p r o c e s s _ z s m n a c h
T A B L E S t _ i d o c _ d a t a S T R U C T U R E e d i d d
t _ i d o c _ s t a t u s S T R U C T U R E b d i d o c s t a t
i t _ z s m p s t r u c t u r e z s m p
U S I N G f _ i d o c _ c o n t r l S T R U C T U R E e d i d c
C H A N G I N G s u b r c L I K E s y - s u b r c
w a _ z s m h l i k e z s m h .
* S t r u c t u r e f o r t h e h e a d e r d a t a
D A T A : k e y l T Y P E z s m h - k e y l .
* V a r i a b l e s f o r t h e i t e m s
D A T A : w a _ z s m p T Y P E z s m p .
D A T A : p o s i T Y P E z s m p - p o s n r .
D A T A : t a b i x T Y P E s y - t a b i x .
1 6 4
Custom I Docs | 4-4
* D a t a f o r t h e I D o c s e g m e n t s :
DATA: w a _ z l z s m h TYPE z l z s m h .
DATA: w a _ z l z s m p TYPE z l z s m p .
DATA: w a _ z l z s m q TYPE z l z s m q .
* T r a n s f e r I D o c d a t a
LOOP AT t _ i d o c _ d a t a WHERE d o c n u m - f _ i d o c _ c o n t r l - d o c n u m .
CASE t _ i d o c _ d a t a - s e g n a m .
WHEN Z 1 ZSMH* .
CLEAR k e y 1 .
w a _ z l z s m h = t _ i d o c _ d a t a - s d a t a .
MOVE- CORRESPONDI NG w a _ z l z s m h TO w a _ z s m h .
k e y l = w a _ z s m h - k e y l .
WHEN ' Z 1 ZSMP .
CLEAR p o s i .
w a _ z l z s m p - t _ i d o c _ d a t a - s d a t a .
MOVE- CORRESPONDI NG w a . z l z s m p TO w a _ z s m p .
w a _ z s m p - k e y l = k e y l .
L i s t i n g 4. 23 Tr ansf er r i ng t h e Us e r Da t a f r o m t h e I D o c Segment s
I n t h i s ease, t h e u n i t o f me a s u r e is al so c o n v e r t e d , t h i s t i me f r o m t h e ISO
c o d e t o t h e SAP uni t . Importing parameter unique, whi c h i s n ' t e va l ua t ed
her e, is r e t u r n e d t o X i f exact l y o n e a p p r o p r i a t e v a l u e ha s b e e n f ound
( s e e Li st i ng 4. 24).
CALL FUNCTI ON UNI T _ OF _ ME AS URE_ I S0 _ T 0_ S A P
EXPORTI NG
i s o _ c o d e - w a _ z s m p - m e i n a
I MPORTI NG
SAP_C0DE - w a _ z s m p - m e i n a
* UNI QUE
EXCEPTI ONS
NOT. FOUND = 1
OTHERS = 2 .
APPEND w a _ z s m p TO i t _ z s m p .
p o s i = w a _ z s m p - p o s n r .
L i s t i n g 4 . 2 4 C o n v e r t i n g f r o m I SO Un i t s o f M e a s u r e t o I n t e r n a l Un i t s o f Me a s u r e
Thi s is f o l l o we d by t h e e v a l u a t i o n o f t h e ne x t s e g me n t , t h e qual i f i ed s e g
m e n t (see Li st i ng 4. 25) .
Va r i a b l e s f o r t h e
s e g ment s
Re t r i e v i n g d at a
f r o m t h e I Doc
C o n v e r t i n g t he
u n i t o f measur e
f r o m I SO t o SAP
Qu a l i f i e d s e g me n t
i n i n b o u n d
p r oc es s i ng
1 6 5
4 | Changes to IDocs
WHEN - Z 1 ZSMQ- .
w a _ z l z s m q - t _ i d o c _ d a t a - s d a t a .
READ TABLE i t . z s m p WI TH KEY k e y l = k e y l
p o s n r - p o s i I N T O w a _ z s m p .
t a b i x = s y - t a b i x .
CASE w a _ z l z s m q - q u a l .
WHEN A * .
w a _ z s m p - f e l d a = w a _ z l z s m q - f e l d .
WHEN - B .
w a _ z s m p - f e l d b = w a _ z l z s m q - f e l d .
WHEN * C * .
w a _ z s m p - f e l d c = w a _ z l z s m q - f e l d .
ENDCASE .
MODI FY i t _ z s m p FROM w a _ z s m p I NDEX t a b i x .
CLEAR w a _ z s m p .
ENDCASE .
ENDLOOP .
ENDFORM . I DOC_PROCESS_ZSMNACH
Listing 4.25 Processing of the Qualifying Segment, "Z1ZSAAQ"
I f t h e d a t a c o n t a i n s e r r o r s , f o r e x a mp l e , i f m a n d a t o r y s e g me n t s a r e mi s s
i ng o r d a t a n e e d s t o be c h e c k e d a g a i n s t Cus t omi z i ng a n d d o e s n t mat ch,
mo d i f y s u b r c t o t r i gge r a n e r r o r i n t h e cal l i ng mo d u l e .
Posting using the Af t e r wa r d , i f t h e r e t u r n v a l u e is c or r ec t , t h e s y s t e m t r ans f er s t h e da t a
application module t 0 t |i e a c l u a ] u p d a t e mo d u l e , wh i c h is al ways cal l ed i n t he u p d a t e mo d e
(see Li st i ng 4. 26) . Th e ALE c o mmu n i c a t i o n l a ye r t h e n t r i gger s t h e Com-
m i t W o r k a n d e n s u r e s t h a t t h e I Doc s t a t us a n d t h e a p p l i c a t i o n o b j e c t ar e
u p d a t e d o r d i s c a r d e d si mul t ane ous l y.
* E v e r t h i n g o k s o f a r ? T h e n p o s t
I F s u b r c = 0 .
CALL FUNCTI ON * Z _Z SM_ CREATE
EXPORTI NG
h e a d e r = w a _ z s mh
p o s i s - i t _ z s m p
EXCEPTI ONS
OTHERS - 1 .
L i s t i n g 4 . 26 Cal l ing the Update AAodule of the Application
1 6 6
Custom IDocs | 4-4
Now, t h e s ys t e m eva l ua t es t he r e t u r n c o d e o f t h e u p d a t e mo d u l e a n d set s
t h e s t a t us val ue o f t h e IDoc a c c or di ngl y ( see Li st i ng 4. 27) . The e r r o r a n d
s uccess me s s a ge s o f t hi s e x a mp l e ar e r a t h e r basi c, o f c our s e . You s houl d
u s e a n i c e me s s a ge cl ass a n d a l s o t r a n s f e r t h e t _ i d o c _ s t a t u s - m s g i d a n d
t _ i d o c _ s t a t u s - m s g n o val ues, wh i c h a r e i ndi c a t e d by ast er i sks, as cr e a t e d
i n y o u r me s s a ge class.
I F s y - s u b r c < > 0 .
s u b r c - 1 .
* E r r o r ? T h e n c o p y t o s t a t u s t e x t
PERFORM s t a t u s _ f i 1 l _ s y _ e r r o r
T ABL ES i d o c _ s t a t u s
USI NG i d o c . d a t a
s y ' E r r o r * My m o d u l e .
ELSE .
* Ok ? T h e n s u c c e s s s t a t u s
i d o c _ s t a t u s - d o c n u m = i d o c _ c o n t r l - d o c n u m .
i d o c _ s t a t u s - s t a t u s - c _ i d o c _ s t a t u s _ o k .
i d o c _ s t a t u s - m s g t y = S .
* t _ i d o c _ s t a t u s * m s g i d - y o u r _ m s g i d . " G l o b a l v a r i a b l e .
* t _ i d o c _ s t a t u s - m s g n o = m s g n o _ s u c c e s s . " G 1o b a l v a r i a b l e .
i d o c _ s t a t u s - m s g v l - o k .
APPEND i d o c . s t a t u s .
ENDI F . i f s y - s u b r c <> 0 .
ENDI F .
* F i l l t h e ALE e x p o r t p a r a m e t e r s
L i s t i n g 4 . 27 Chec k i ng t h e St at us o f t h e I D o c Up d a t e and Mes s age As s i g n me n t
I f successf ul , y o u m u s t n o w e n s u r e i f a c o n n e c t i o n t o t h e wo r k f l o w
is g i v e n t h a t an e v e n t u a l l y exi s t i ng e r r o r wo r k f l o w is cancel ed; i f an
e r r o r occur s , t h e c o r r e s p o n d i n g wo r k f l o w n e e d s t o b e t r i gger e d. Thi s is
d o n e b y t h e ALE c o mmu n i c a t i o n layer, wh i c h uses t h e val ues t h a t are
t r a n s f e r r e d h e r e (see Li st i ng 4 . 2 8 ) a n d t h e Cus t omi z i ng s e t t i n g s t h a t are
d e s c r i b e d i n Sect i on 4 . 4 . 5 , Er r o r Wo r k f l o w f o r Cus t om IDocs.
CLEAR i n _ u p d a t e _ t a s k .
CLEAR c a l l _ t r a n s a c t i o n _ d o n e . " C a l l T r a n s a c t i o n n o t u s e d .
I F s u b r c <> 0 . E r r o r o c c u r r e d
w o r k f l o w _ r e s u l t = c _ w f _ r e s u l t _ e r r o r .
r e t u r n _ v a r i a b l e s - w f _ p a r a m - c _ w f _ p a r _ e r r o r _ i d o c s .
r e t u r n _ v a r i a b l e s - d o c _ n u m b e r = i d o c _ c o n t r l - d o c n u m .
APPEND r e t u r n _ v a r i a b l e s .
S e t t i n g t he
e r r o r s t a t u s
S e t t i n g t he
success s t a t u s
W o r k f l o w h a n d l i n g
1 6 7
4 | Changes to IDocs
A s s i g n m e n t t o t he
pr oces s code
E L S E . I D o c p r o c e s s e d s u c c e s s f u l l y
w o r k f l o w _ r e s u l t - c _ w f _ r e s u l t _ o k .
r e t u r n _ v a r i a b l e s - w f _ p a r a m = c _ w f _ p a r _ p r o c e s s e d _ i d o c s .
r e t u r n _ v a r i a b l e s - d o c _ n u m b e r - i d o c _ c o n t r l - d o c n u m .
A P P E N D r e t u r n _ v a r i a b l e s .
r e t u r n _ v a r i a b l e s - w f _ p a r a m - c _ w f _ p a r _ a p p l _ o b j e c t s .
A P P E N D r e t u r n _ v a r i a b l e s .
E N D I F .
L i s t i n g 4 . 28 Tr ans f er r i ng t h e Da t a t o t h e Er r or W o r k f l o w
You us ual l y d o n ' t h a v e t o p r o g r a m t h e act ual u p d a t e m o d u l e y o u r s e l f
b e c a u s e t h e a ppl i ca t i on m u s t al r e a dy h a v e d e v e l o p e d s o me t h i n g t h a t cr e
at es t h e s a me d a t a vi a di al og t r ans act i on. To e n s u r e t h a t t h e d a t a resul t i ng
f r om u p d a t i n g an IDoc a n d t h e d a t a t h a t a us e r has ma n u a l l y c r e a t e d is
i dent i cal , y o u s h o u l d al ways have b o t h p r o c e d u r e s access t he s a me f u n c
t i on mo d u l e . Her e, t h e checks, locks, a n d a u t h o r i z a t i o n q u e r i e s de f i ne d
by t h e a pp l i c a t i o n ar e al so code d.
I n o u t b o u n d p r oc e s s i ng, y o u o n l y h a v e t o assi gn f u n c t i o n mo d u l e s t o
process c o d e i f y o u us e o u t p u t d e t e r mi n a t i o n . In i n b o u n d pr ocessi ng, this
a s s i gnme nt is al ways r e q u i r e d . Fur t he r act i vi t i es t he r e f or e i nvol ve speci f y
i ng t h e charact eri st i cs o f t h e f unc t i on mo d u l e i n Transact i on BD51. Figure
4 . 1 1 4 di spl ays t h e s el ect i on o f t h e char act er i st i cs. Op t i o n 2 ( I ndi vi dual
I n p u t wi t h IDoc Lock i n Call Tr ansact i on) is r ar el y sel ect ed d u e t o p e r f o r
ma n c e r e as ons . O u r s a mp l e f unc t i on mo d u l e uses o p t i o n 1, I ndi vi dual
I nput . The c o d e e xa mpl e s al r e a dy i ndi c a t e d t he r e q u i r e me n t s f or usi ng
Ma s s Processi ng ( o p t i o n 0). Basically, i t ' s all a b o u t i nt e gr a t i ng e v e i y t h i n g
t h a t ha s b e e n i mp l e me n t e d o n l y o n c e i n t o a l o o p vi a a c o mp l e t e t abl e.
N e w E n t r i e s : O v e r v i e w o f A d d e d E n t r i e s
C h a r a c t e n s t i c s o f i n b o u n d F u n c t i o n
unctjon module ( nbcund)
IDOC INPUI ZSfK'CH

C&Codt: Howar* IDoc package* pr o c t t s t d ? (3) 3Entt i*s*o (2 0 /


^ i w '
Inpul ly ShwiDcscn*.
1 i n d M O u a l i n p u t
2 i n d M d u a l i n p u t w it h I D o c l o c k i n C A L L T R A N S A C T I O N
Figure 4 . 114 Processing Type of the AAodule
1 6 8
Custom IDocs | 4-4
Af t e r wa r d , y o u assi gn t h e f u n c t i o n mo d u l e t o i t s me s s a ge t y p e a n d all
pos s i bl e I Doc t y p e s us i ng Tr a ns act i on WE 5 7 (see Fi gur e 4 . 1 1 5 ) . I n t he
Obj e c t Type field, e n t e r an o b j e c t t y p e f r o m t h e Busi ness Obj e c t Repos i
t o r y (BOR), f or e x a mp l e , BUS 1001006 f or t h e mat er i a l . It ' s t h i s a s s i g n
m e n t t h a t e n a b l e s t h e s y s t e m t o w r i t e l i nks b e t we e n t h e IDoc a n d t he
bus i ne s s o b j e c t t h a t ha s b e e n c r e a t e d a n d d i s p l a y t h e m i n Tr ansact i on
BD87. De sc r i bi ng t h e d e v e l o p m e n t o f b u s i n e s s o b j e c t t y p e s f o r a ppl i c a
t i on obj ect s is b e y o n d t h e s c ope o f t hi s b o ok, h o we v e r .
New Ent r i es: Det ai l s o f Added Ent r i es
a a
FuncSon rrwdjle ZJ0CCJKPUT_2S1NCM
Functon m >o F Functor rroflule a'
BM K t n > * ZS1TTP01
Eiens on
Message Type U l M A C H
Message vanar*
Mess furxBon
CDWlTyp#
100c Ass-;w?.toii t>lo9 M e s s w 'vpe
Direction
3
O o s t r p l o n
N i m e
Fi gu r e 4-115 A d d i t i o n a l Char act er i st i cs o f t h e I n b o u n d F u n c t i o n M o d u l e
Af t e r a s s i g n i n g t h e f u n c t i o n m o d u l e , y o u c r e a t e t h e p r o c e s s c o d e i n
Tr a ns act i on WE42. I n t h e Op t i o n ALE t a b, y o u c a n c h o o s e i f y o u w a n t t o
wo r k wi t h o r w i t h o u t ALE ser vi ces, a n d t h e Pr oce s si ng Type t ab enabl es
y o u t o sel ect t h e p r o c e d u r e f o r t h e p r oc e s s c o d e (sec Fi gur e 4. 116) .
New Ent r i es: Det ai l s of Ad d e d Ent r i es
[ n
P r o c e s s c o s * Z S 1 1
^ C S i t ' i D o u r * ) p r o c e s s < 0 D O S f r l o n P o s t I D o i Z S M N A C H
l O e n b f c a b o n
3
O p l o n A i E
Process^ - w , w ^ s . m c .
Ptocessif>gwio a l e servtce
Processing h e *
Processing b* task
O Processing crt process
S' r-n
^ F c * e n o y . a c c e s s T i x k Oo o m o d u l e ' o r A i E - F W
inbound processing1
Fi gu r e 4. 116 Process Code i n I n b o u n d Pr ocessi ng
A s s i g n m e n t t o t h e
a p p l i c a t i o n
C r e a t i n g pr ocess
c o d e
1 6 9
4 | Changes to IDocs
Ch a r a c t e r i s t i c s o f
t h e mo d u l e
A s s i g n i n g t he
message t y p e t o a
l ogi cal message
W h e n c r e a t i ng a n e w pr ocess c ode , t he s ys t e m a u t oma t i c a l l y navi gat es
y o u t o t h e i n p u t s cr een f o r a d d i t i o n a l char act er i st i cs i f y o u sel ect t he Pro
cessi ng by F u n c t i o n Mo d u l e o p t i o n . Lat er, y o u c a n go t h e r e b y cl i cki ng
on t he # i con. Fi gure 4 . 1 1 7 s h o ws t h e s e a d d i t i o n a l charact eri st i cs. Here,
y o u al so s pec i f y t h e obj ect s a n d e v e n t s f o r h a n d l i n g e r r o r s vi a wor kf l ow.
In o u r e xa mpl e , n o t h i n g is d e f i n e d h e r e , so e r r o r s can c u r r e n t l y o n l y be
p r o c e s s e d vi a Tr a ns act i on BD87. Ma x i m u m N u m b e r o f Repea t s speci fi es
t h e ma x i mu m n u m b e r o f a t t e m p t s f o r successf ul l y p o s t i n g an IDoc to
a n a p p l i c a t i o n . I f t hi s i s n t successf ul w i t h i n t hi s n u m b e r o f a t t e mp t s ,
ma n u a l e r r o r h a n d l i n g is r equi r ed.
New Entri es: Details o f Added Entries
Process code
Module (inbound)
Function Module
Maximum Number of Repeals
IDoc p a c k e t / 7
Object Type
End Event
IDoc
Object Type
Start Event
End event
Success Event
ApplicationObject
Object Type
Start event
F i gu r e 4.117 As s i g n i n g t h e I n b o u n d Fu n c t i o n M o d u l e
Finally, y o u can assi gn y o u r me s s a ge t y p e t o a l ogi cal me s s a ge i n Tr ans
a c t i o n WE41 (see Fi gur e 4 . 1 1 8 ) , wh i c h c o n c l u d e s y o u r d e v e l o p m e n t
wo r k .
1 7 0
Custom IDocs | 4-4
New Entries: Details o f Added Entries
Dialog Structure
Process code ZSH1
CD Inbound process code
Assignment to logical m e s s a g e / / r
(> Message type ZSHNACH
O All types
M e s s a g e code
O All codes
Message function
O All functions
F i gu r e 4118 As s i g n i n g t h e Message Type
All y o u n e e d n o w is t h e a p p r o p r i a t e p a r t n e r pr of i l e i n Tr ansact i on WE20
t h a t uses y o u r p r oc e s s c o d e t o e n a b l e y o u t o r ecei ve a n d u p d a t e IDocs
( see Fi gur e 4. 119) .
Partner profiles: Inbound parameters
Partner No.
Partn Type
Partner Role
g Message type
Message code
Message function
PRODUCT I OH Productive system (client 811)
LS
ZSHNACH
Test
Postprocessi ng permitted agent Telephony
Process code E$m
0 Cancel Processing Alter Syntax Error
Processing By Function Module
O Trigger by background program
Tri gger Immediately
F i gu r e 4. 119 Par t ner Pr of i l e I n b o u n d Par amet er s
171
Par t ner p r o f i l e w i t h
c u s t o m pr ocess
c o d e
4 | Changes to IDocs
Sa mp l e IDocs Fi gur e 4 . 1 2 0 s h o ws s o m e successf ul l y p o s t e d IDocs wi t h a p r o p e r suc
cess message.
Doc Selection
IDoc number Slat |Message Type |statusTet 1Partner No. |BasicTpe Segme
768800 53 [ZSMNACH |S: 000 ok PRODUCTIO ZSMTYP0I 9
768801 53 [ZSMNACH S: 0 0 0 O k PRODUCTIO ZSMTYP01 9
76880? 53 [ZSMNACH IS 000 ok PRODUCTIO ZSMTYP0I 9
768803 53 ZSMNACH |S: 000 ok PRODUCTIO ZSMTYP0I 9
768804 53 ZSMNACH S 000 ok PRODUCTIO ZSMTYP0I 9
F i gu r e 4 1 2 0 Successf ul l y U p d a t e d I Docs
F a u l t y I Do c s Fi gur e 4 . 1 2 1 , i n t u r n , s h o w s f aul t y IDocs. Th e s t a t us t ext , h o we v e r , is
s o me w h a t basi c. You s h o u l d speci f y er r or s as d e t a i l e d as pos s i bl e t o facil
i t at e t h e wo r k f or p e r s o n s w h o m o n i t o r t h e I Docs i f e r r o r s occur.
Doc Selection
idoc number Slat [Message Type Statu sTexl | Partner no BasicType Segme
768805 51 ZSMNACH Messages for input and oulbound processing - PRODUCTION ZSMTYP01 9
F i gu r e 4.121 I Docs w i t h A p p l i c a t i o n Errors
4 . 4 . 4 G e n e r a t i n g I D o c F u n c t i o n M o d u l e s
Ge n e r a t i n g
s u i t a b l e ALE
i nt er f aces
The r e ar e t w o o p t i o n s t o h a v e t h e s y s t e m a u t oma t i c a l l y g e n e r a t e m o d
ul es f o r c r e a t i n g a n d u p d a t i n g a n IDoc. The f i r st o p t i o n is t o g e n e r a t e
s u i t a b l e IDoc i nt e r f a c e s t o BAPIs. In t hi s pr ocess, t h e me s s a ge t y p e a n d
t he IDoc t y p e ar e g e n e r a t e d . The s e c o n d o p t i o n is b a s e d o n a f unc t i on
mo d u l e . Bot h me t h o d s a r c d e s c r i b e d i n t h e f o l l o wi n g s ect i ons .
Se g me n t
g e n e r a t i o n i n
Tr ans ac t i on BDBG
H a v i n g t h e S y s t e m G e n e r a t e I D o c AAodules f r o m BAPI
The s e g me n t s ar e b u i l t f r om i m p o r t a n d c h a n g e p a r a me t e r s o f t h e s i g n a
t ur e. (The e x p o r t p a r a me t e r s a r e n ' t r e q u i r e d he r e bec aus e IDocs n e v e r
r e s ul t i n a r e s p o n s e . ) Fo r t hi s p u r p o s e , as ma n y i ndi vi dua l va r i a bl e s as
pos s i bl e b e c o me a s e g me n t , s t r u c t u r e s ar e p r o v i d e d wi t h a s e p a r a t e s e g
m e n t t h a t o n l y occur s onc e , a n d t a bl e t y p e s o b t a i n a s e p a r a t e s e g me n t
1 7 2
Custom IDocs | 4-4
t h a t occur s mul t i pl e t i me s . Th e n , a mo d u l e is g e n e r a t e d r es pect i vel y for
g e n e r a t i n g as wel l as f o r u p d a t i n g t h e c o r r e s p o n d i n g IDoc.
Tr a ns act i on BDBG g e n e r a t e s t h e c o r r e s p o n d i n g IDoc i nt e r f a c e t o a BAPI,
a n d i n Fi gur e 4 . 1 2 2 , y o u can v i e w an ALE i nt e r f a c e t h a t ha s al r e a dy b e e n
d e l i ve r e d b y SAP in t h e Fu n c t i o n di spl ay.
Generate ale I n t e r f a c e f o r bapi
Kessage type
ACC_EnPLOIEE_EXP
ACC_E"PLOYEE_EXP a l re a d y e x i s t s
IDoc type
ACC_EPL0IEE_EXP02
ACC_E"PL0YEE_EXP02 a l re a d y e x i s t s
Segient
E18PACHE84
E1BPACHE04 a l re a d y e x i s t s
E16PAC6L04
E1BPAC6L04 a l re a d y o x i o t s
EiePCTX6l
EIBPACIIOI a l re a d y e x i s t s
E18PACCR04
E1BPACCR04 a l re a d y e x i s t s
E1BPACTR00
E1 BPACTROO a l re a d y e x i s t s
E18PACCRP0
E1 BPACCRP0 a l re a d y e x i s t s
E1BPEXTC
E1 BPEXTC a l re a d y e x i s t s
F un cti on nodule f o r Outbound ALE K i t h Oata F i l t e r i n g
*IE_CC_E"P10EE_E XP_P0ST
ALE_ACC_EHPIOYEE_EXP_POST a l re a d y e x i s t s
F un cti on nodule f o r Inbound ALE With Packet Processing
ID0C_INPUI_ACC_EnPlOYEE_E XP
IDOC_IKPl)I_ACC_EMPLOYEE_EXP a l re a d y e x i s t s
F i gu r e 4.122 Display of an Already Existing Interface
The u p d a t e vi a a g e n e r a t e d mo d u l e is al ways c a r r i e d o u t w i t h t h e same
pr ocess code: BAPI f or i ndi vi dua l pr oc e s s i ng a n d BAPP f o r mu l t i p r o c e s s
i ng. So, y o u d o n ' t n e e d a c u s t o m p r oc e s s code.
Having the System Generate IDoc Modules from Function Modules
The s e c o n d o p t i o n t o a u t oma t i c a l l y g e n e r a t e I Doc mo d u l e s is b a s e d o n a
f unc t i on m o d u l e t h a t h a s n ' t b e e n i mp l e me n t e d as a BAPI. Mo r e r e s t r i c
t i ons a p p l y her e. The f u n c t i o n m o d u l e m u s t c o n t a i n o n l y o n e i mp o r t
a n d o n e e x p o r t p a r a me t e r . Howe ve r , t h e i m p o r t p a r a m e t e r ma y be a
c o mpl e x var i abl e. The e x p o r t p a r a m e t e r mu s t be o f t h e B A P I R E T M t y p e i f
ALE i n t e r f a c e f o r
f u n c t i o n m o d u l e s
173
4 | Changes to IDocs
y o u h a v e a s i mp l e i m p o r t var i abl e, a n d i t m u s t be o f t h e B A P I R E T S t ype
i f y o u h a v e a c o mp l e x t r a n s f e r var i abl e. Tr a ns act i on BDFG is r e qui r e d
f or t h i s p u r p o s e , a n d a l t h o u g h i t i s n t a BAPI, t h e r e f e r e nc e t o a b u s i
ness o b j e c t t y p e f r o m t h e BOR is ma n d a t o i y . T h e n y o u can s pec i f y t he
na me s , packages, a n d p r o p e r t i e s o f y o u r o b j e c t s u s i n g Tr a ns act i on BDFG
(see Fi gur e 4. 123) .
ALE Interfaces f o r Functi on Module
Function Module that Processes Business Object
Z.SH1
Business Obiect Type BUS1001006
a /
IDoc interface
Message Type Z_sm
IDOC Type Z.SH181
Packet
Z_SM*
zsni
ALE Outbound Processing
Function Module ZAIE__Shi
Function Group
a l e inbound Processing
Function Module ZID0C_1NPUT_SH1
Function Group ZSH1
0 m update Task
Mass Processing AJlowed
X
F i gu r e 4*123 Ent r i es i n Tr ansact i on BDFG
The s ys t e m t h e n us e s t h e s e s pe c i f i c a t i ons t o g e n e r a t e e v e r y t h i n g t hat
is r e q u i r e d as i l l us t r a t e d i n Fi gure 4 . 1 2 4 . So i t can p a y o f f t o d e v e l o p a
f unc t i on mo d u l e wi t h t h e r e q u i r e d p r o p e r t i e s a r o u n d t h e a p p l i c a t i o n s
mo d u l e a n d t o s p a r e t h e r est o f t he wo r k .
174
Custom IDocs | 4-4
R e s u l t s
^ Cl) ALE Interface
^ O Message Type
<3 Z.SMl
Z_SM1 has been generated
=* CD IDoc Type
!Z_SM101
0Z _ SM 1 O1 has been generaled
O Check basic tipe Z_SM101
( D Basic type Z.SM101 Is not released
O 8asic W e Z_SM10I Is linked to logical message Z_SM1
O Mo predecessors exist
I* Segments
^ CD Function Module for Outbound ALE
ZALE__SM1
O ZALE__SM1 has been generated
^ < 3 Function Module (or inbound ALE
8 ZIDOC J N P U T _ S M t
O ZIDOC_INPUT_SMt has been generated
Fi gu r e 4-124 Gener at ed Ob j e c t s i n Tr ansact i on BDFG
4 . 4 . 5 E r r o r W o r k f l o w f o r C u s t o m IDocs
The e r r o r pr oc e s s i ng is basi cal l y i mp l e me n t e d vi a wo r k f l o w t asks, a n d
s o me o f t h e p r o g r a m mi n g e x a mp l e s a l r e a d y e n s u r e t h a t w o r k f l o w tasks
ar e s t a r t e d o r c o mp l e t e d o r t h a t t h e n e c e s s a i y e v e n t s ar e t r i gger ed.
In e r r o r h a n d l i n g , a d i s t i n c t i o n is ma d e a m o n g e r r o r s o f t h e IDoc i n t e r
face, e r r o r s o f t h e e xt e r na l s ys t e m/ EDI s u b s y s t e m, a n d e r r o r s o f t he SAP
appl i ca t i on. SAP pr ovi des e r r o r t asks f or t h e IDoc i nt er f a ce a n d t h e e x t e r
nal s ys t em, wh i c h y o u ca n fi nd i n Tr a ns act i on WE40. Fi gur e 4 . 1 2 5 s h o ws
t h e m f o r b o t h t h e i n b o u n d a n d t he o u t b o u n d pr oc es s i ng. Her e, ED IS is
t h e d e f a u l t e r r o r c o d e f o r t h e e x t e r n a l s y s t e m, b u t y o u c a n a l s o creat e
y o u r o w n e r r o r t asks. Thi s i nvol ve s e r r o r ha n d l i n g t h a t is i n d e p e n d e n t
o f t h e app l i c a t i o n a n d is t h e r e f o r e g e ne r a l l y val i d.
Fo r t h e e r r o r s i n t h e a p p l i c a t i o n , a s e p a r a t e e r r o r w o r k f l o w exi s t s f or
each me s s a ge t y p e . I f y o u p r o g r a m IDocs y o u r s e l f , y o u m u s t c r e a t e t hi s
e r r o r wo r k f l o w c ompl et el y. Thi s is d e s c r i b e d he r e f or t h e ZSMNACH me s
sage t y p e t h a t wa s cr e a t e d previ ousl y.
Gener al er r or :
w o r k f l o w t as k s
175
4 | Changes to IDocs
S e t t i n g s : E r r o r a n d S t a t u s P r o c e s s i n g
alT[&Maa| |s?alfT~ TTi[al&a|ta>Ti
Process Codes for Error Processing
H
CodejType
EOtc|
denote aeon I
TS745Q3411
ECU :
EOILJ2
0008068
0008373
EDIM|2
ECIM : TS
0000020
C3030
EW0I2
EOtP|2 TS
0007989
0001307
OIS[3 ED .SIAPRC
ECK :
EC IV .'
TS C303070
C003074
| Epressjinact.ve|
utbound. irxompi
ibound, rroi mes
i conversion
ismwith IDoc
lulDOur
lutbour
>age Without IDoc
- document (outbound vrfo IDoc)
error handling wrthlDoc
error message with IDoc packet
ftl aMfl al h M ' I Tal dJMaMai
Process Codes for Status Inbound
::itiri: i t on Description of prccese |
\2 7S70003' ?S IDOC OWNSrOpOrtwilhOOC:><lCO$Oing
2 TS30000078 Motivation for iDoc StaJjs Report
F i gu r e 4 1 2 5 Techni cal Er r or Pr ocess Codes
First o f all, y o u mu s t c r e a t e a c u s t o m bus i ne s s o b j e c t t y p e f o r t h e IDoc in
Tr a ns act i on S W O l . Thi s bus i ne s s o b j e c t t y p e m u s t i n h e r i t f r o m t h e I D O -
C A P P L t y p e so t h a t all m e t h o d s r e q u i r e d ar e avai l abl e. Agai n, t h e n a me o f
t h e b u s i n e s s o b j e c t t y p e m u s t be w i t h i n y o u r n a me s p a c e . Fi gur e 4 . 1 2 6
s h o ws t he bus i ne s s o b j e c t t y p e o f t hi s exa mpl e .
C o n t e x t w i t h BOR
N o t e t h a t t h e r e c a n b e t w o b u s i n e s s o b j e c t t y p e s i n t h e c o n t e x t o f I Do c s .
O n e o f t h e m i s m a n d a t o r y a n d i s u s e d f o r t h e e r r o r w o r k f l o w . T h i s i s t h e
o n e t h a t m u s t i n h e r i t f r o m I D O C A P P L a n d p r o v i d e s a f e w , a l w a y s i d e n t i c a l
m e t h o d s .
T h e s e c o n d b u s i n e s s o b j e c t t y p e r e f e r s t o t h e a c t u a l o b j e c t i n t h e
a p p l i c a t i o n w h o s e d a t a i s p a r t o f t h e I D o c d a t a . T h i s b u s i n e s s o b j e c t t y p e is
o p t i o n a l . I t ' s a s s i g n e d t o t h e m e s s a g e t y p e u s i n g T r a n s a c t i o n B D A 4 , a n d i f
i t s m a i n t a i n e d a p p r o p r i a t e l y i n t h e i n b o u n d p r o c e s s c o d e , t h i s a s s i g n m e n t
r e s u l t s i n a n u p d a t e o f t h e o b j e c t l i n k s .
Business Obj ect Types f or IDocs
1 7 6
Custom IDocs | 4-4
Obj ect Type ZDOCSMNACH: Edi t Basi c Data
<%B f f t ^
Objecnype ZDOCSHNACH IDOCZSMNACH
Object Name ZSMNACH
Program ZSHZOOCSHNACH
Obj.type status revised Saved modeled
Transport Data Change Data Defaults Customizing
Name
Description
Organizational tine
Application
F i gu r e 4*126 Business Object Type for Error Workflow
The IDoc n u m b e r is al ways t h e k e y f o r such IDoc e r r o r obj ect s, a n d a d d i - Attributes
t i onal a t t r i b u t e s ar e t h e m o s t i mp o r t a n t a t t r i b u t e s f r om t h e h e a d e r t able,
w h i c h is i l l us t r a t e d i n Fi gur e 4 . 1 2 7 . Th e r e d h i g h l i g h t i n g i ndi cat es t hat
t h e ZDOCSMNACH IDoc ha s i n h e r i t e d f r o m t h e IDOCAPPL s u p e r t y p e .
O b j e c t t y p e ZDOCSHNACH 0 IDoc f o r S a b i n e
Q I n t e r f a c e s
IFSAP SAP s t a n d a r d I n t e r f a c e
Key f i e l d s
ZSHNACH.IDocNunber
o A t t r i b u t e s
------ 2SHNACH.
------ZSHNACH
------ ZSHNACH
------ ZSHNACH.
------ ZSHNACH
------ ZSHNACH
------ ZSHNACH
------ ZSHNACH.
------ ZSHNACH
O b je c t T y p e
SenderAddress
S t a t u s
S h o r t l n f o
C r e a t e D a t e
HessageType
A p p l O b j e c t s I n b o u n d
T r a n s l d
Sh o r tn e s s a g e
ZSHNACH. A p p l 1 c a t 1onObj e c t I D
V
a a
O b j e c t t y p e
Address o f sender
S t a t u s o f IDoc
D i s p l a y s h o r t I n f o ( I D o c n u n b e r and l o g i c a l message)
I Doc C r e a t e d On
Message Type
A p p l i c a t i o n o b j e c t s c r e a t e d o r changed i n Inboun d p r o c e s s i n g
T r a n s a c t i o n I D (tRFC)
S h o r t text o f IDoc s t a t u s r e c o r d , p o s s i b l y t r u n c a t e d
A p p l i c a t i o n o b j e c t ID
Figure 4.127 Attributes
177
4 | Changes to IDocs
Methods ZOOCSMNACH al so i n h e r i t s t h e n e c e s s a r y m e t h o d s a n d e v e n t s f r o m t he
and events s u p e r t y p e , wh e r e a s t h e i n p u t F i n i s h e d e v e n t m u s t be o v e r wr i t t e n . I f y o u
d o n t have a n y speci al r e que s t s , y o u can s i mp l y l eave t he c o d e as i t is.
Fi gure 4 . 1 2 8 di spl ays o u r s a mp l e b u s i n e s s o b j e c t t ype.
Methods
ZSMNACH
ZSMNACH
-ZSMNACH
ZSMNACH
-ZSMNACH
-ZSMNACH
-ZSMNACH
-ZSMNACH
ZSMNACH
E x ist ence Chec k
DocuaentProcess
DocuaentProcessXML
D i s p l a y
I n p u t A n a l y z e
. For war d
S t a t u s P r o c e s s
E r r or He ssage
I n p u t F o r e g r o u n d
E r r o r P r o c e s s
D i s p l a y O b j e c t s
I nputBackground
Events
-ZSMNACH. p r o c e s s S t a t e R e a c h e d
-ZSMNACH. e r r o r P r o c e s s C o t p l e t d
-ZSMNACH. 1 n p u t E r r o r O c c u r r e d
-ZSMNACH.InputSuccess
ZSNNACH.inputFinished
Check e x i s t e n c e o f o b j e c t
D i s p l a y and s e t s t a t u s
D i s p l a y m XML F o r * a t l t h XSL and S e t S t a t u s
D i s p l a y
F o r w a r d i n g t o i nbound p r o c e s s i n g by t h e a p p l i c a t i o n
For war d I Doc t o l o g i c a l system
Subsequent p r o c e s s i n g f o r a s t a t u s
O E r r o r message
I n p u t i n d i a l o g
E r r o r h a n d l i n g
D i s p l a y G e n e r a t e d O b j e c t s
I n p u t 1 t h o u t d i a l o g
I Doc can be pr o c e s s e d by a p p l i c a t i o n
E r r o r h a n d l i n g compl eted
E r r o r i n a p p l i c a t i o n i n p u t , f u r t h e r p r o c e s s i n g r e q u i r e d
i- I Doc p o s t e d s u c c e s s f u l l y
I Doc ZSMNACH Inbound co m p l e t e d v i a o r k f l o *
Figure 4-128 Methods and Events
Assigning the Howe ver , y o u m u s t m a k e a m i n o r c h a n g e t o t h e Appl _Obj ec t p a r a me t e r
fields from the (s ee Fi gure 4. 129) , t h a t is, r e f er t o t he appl i c a t i on. Thi s r e f e r e nc e mu s t
application s peci f i ed s e pa r a t e l y f o r each obj ect ; i t c a n ' t b e i n h e r i t e d . In t h e Data
Type Ref e r enc e t ab, y o u s pec i f y t h e c u s t o m Ref e r enc e Tabl e ( her e: ZSMH)
a n d t he Ref e r enc e Fi el d ( her e: KEY 1).
Workflow task Next , y o u c r e a t e t h e act ual w o r k f l o w t ask. Tr a n s a c t i o n P F T C J N S is
r e q u i r e d h e r e ( s e e Fi gur e 4 . 1 3 0 ) . I n t h e i n p u t s c r e e n, s e l e c t t h e t ask
t ype, a n d e n t e r a n a me f o r y o u r wo r k f l o w t ask. Th e t ask i n t hi s e xa mpl e
is o f t h e TS type ( s t a n d a r d t ask) a n d t he Ab b r e v i a t i o n f or t h e wo r k f l o w
t ask i n w h a t e v e r a b b r e v i a t e d f o r m us ual l y consi st s o f y o u r mes
sage t y p e a n d t h e t e r m "Error" ( h e r e ZSMNAC_Error). In Ob j e c t Me t h o d
i n t h e Ob j e c t Type field, y o u r e f e r t o y o u r bus i ne s s o b j e c t t y p e (here:
ZDOCSMNACH) a n d i n t h e M e t h o d fi el d t o t h e i n h e r i t e d m e t h o d ( her e:
INPUTFOREGROUND). Thi s is t h e t as k t h a t is e x e c u t e d i n t h e f o r e g r o u n d in
IDoc s i n g l e pr oc e s s i ng o f a n IDoc ha s r u n o n a n e r r o r s t a t us . Li st i ng 4. 28
i n Sect i on 4 . 4 . 3 , Upda t i ng a n IDoc, s h o ws h o w t hi s e r r o r is t r i gger ed a n d
t r a ns f e r r e d t o t h e wo r k f l o w r u n t i me .
1 7 8
Custom IDocs | 4-4
Overvie
Parameter O b ). Type F i r s t Release
Appl O bjec t ZDOCSHNACH 700
Resul t ZOOCSnNACH 700
Ex cept ion ZDOCShNACH 700
N o _ o f _ r e t n e s ZOOCSHHACH 700
LU
/
Parameter
Object r,pe
Release
Texts
Name
Description
Parameter attnbutes
Appl_Ob)ect
ZOOCSnNACH
700
Multiline
Data rpe reference
(SABAP Dictionary
Reference table
Reference field
C Object type
0 H
Fi gu r e 4-129 A d a p t i n g t h e O b j e c t Ref er ence
S t a n d a r d T a s k : C h a n g e
S t a n d a r d t a s k
Name
Package
97100179 ZSMNAC.Error
ZSMNACH input error
ZSMI
g Description Container
Applicatn Component
) Triggering events ?) Tertnmatmg events
Figure 4-130 Workflow Task for Error Handling
179
4 | Changes to IDocs
Assigning the T h e e v e n t t h a t t r i gger s t h e w o r k f l o w t ask is t h e INPUTERROROCCURRED
start event e v e n t t h a t is i n h e r i t e d by IDOCAPPL i n t h e b u s i n e s s o b j e c t t y p e (see Fig
ur e 4. 131) .
S t a n d a r d T a s k : C h a n g e
Standard task
Name
Packaoe
< 3 Basic data
97100179 ZSMNAC_Enor
ZSMNACH input error
ZSM1
| Description Contawe* A
Applicatn Component
B S S r a i B E E I H *>) Trmiaang events Default rules O SAPphone
x m M
| Standard events
H .Binding Object Category lObjectType Event Name
r a a
BO 808 Object lype 3 ZOOCSittuCH [NPUURROROCCIMRED ZSMNAC H Applic a#on Error
II I M l
? a |
F i gu r e 4131 St ar t Ev ent
Binding A w o r k f l o w t ask r e q u i r e s a b i n d i n g t h a t y o u c a n us e t o t r a n s f e r t h e dat a
o f t h e o b j e c t t o t h e d a t a o f t h e t ask. The s y s t e m c a n cr eat e t hi s bi ndi ng
aut omat i cal l y. Fo r t h i s p u r p o s e , y o u m u s t cl i ck o n t h e b i n d i n g vi ew.
The b i n d i n g o f t hi s e x a mp l e e n s u r e s t h a t t h e wo r k f l o w is p r o v i d e d wi t h
i n f o r ma t i o n f r o m t h e IDoc. Ev c i y t h i n g is o k a y i f y o u r b i n d i n g a ppe a r s
as s h o w n i n Fi gur e 4. 132.
l [ ? C har>ai~Bin3ir ; For Task
1 7
V System Fields
^ G Container
t _EVT_OBJECT
o _EVT_OBJTYPE
0 _EVT_OBJKEY
o _EVT_CREATOR
ZSMNACH
Event of an Object
_EVT_OBJKEY
Agent
_EVT_RECENSRJC _EVT_RECEfV* RJD
_EVT_CREATlON_D Current D a * of Application Server
_EVT_CRATiON_n Current l i m e of Appiicaion Server
Result
Exception
MessageType
MessageNumber
Messagevanamei
Final value of Mettiod
Workflow Eccepoon
Message t fpe( E. i. w. )
Message number
Message variable 1
D
l a a a B i
JD _A0hoc_Obcts
J 8 _Macn_Ob)ects
_Wi_Group_ID
_Worklem
_Rule_Resu
Excepaon
_wi_ObjectJO
1 IPIWPJ . p j a ja j p l
Binding Event Application Error*-* Task
&_EVT OBJECTi
a a -
Task
6EXCEPT10N6
6 _V*_OBJECTJDR
j Ni Hoc Objects ofWorHow Instar
k Attachments of Workflow instance
h Grouping Characteristic for Workf
j > Slep Inslance
IJ Result of Agent Determination
kj WortfiowEicepdon
Coe for Sabine
001 100
Figure 4.132 Binding for Start Event
1 8 0
Custom IDocs | 4-4
The successful u p d a t e o f t he IDoc is al ways t h e e n d e ve nt , i r r e s pect i ve Terminating event
o f w h e t h e r i t c o me s f r om t h e e r r o r h a n d l i n g o f Tr a ns act i on DB87 o r is
ca r r i ed o u t vi a a p r o g r a m t h a t is s c h e d u l e d i n t h e b a c k g r o u n d . INPUTFIN-
I SHED is t h e n a me o f t h e e n d e ve nt , wh i c h is t r i gge r e d i n t h e pr e vi ous l y
cr e a t e d p r o g r a ms f o r pr oc e s s i ng t h e ZSMNACH mes s age t y p e (see Listing
4 . 2 8 i n Sect i on 4 . 4 . 3 , Upda t i ng a n IDoc). As y o u c a n s e e i n Fi gur e 4. 133,
a b i n d i n g is n o t avai l abl e f o r t h e Te r mi n a t i n g e ve nt .
St andar d Tas k: Change
S!*nc ate task
Nam*
Paetage
d B a s * .
9 7 1 0 0 1 7 9 Z S M N A C . t r r o r
Z S M N A C H I n p u t e r o r
Z S M 1 *i> plksto Conponer4
T il *L D e f a u l t r u l e s Q
S t a n d a r d e v e r t !
F i gu r e 4. 133 T e r mi n a t i n g Event
Final ly, y o u m u s t s pec i f y w h o ma y c a r r y o u t t h i s t ask f r o m t h e e r r o r Agent assignment
wor kf l ow. Thi s d e p e n d s o n h o w y o u r e n t e r p r i s e h a n d l e s wo r k f l o ws in
g e ne r al ; i n t h e s t a n d a r d v e r s i on, t hi s i nvol ves a Ge ner al Task t h a t ma y be
p e r f o r me d by a n y e mp l o y e e (see Fi gur e 4. 134) . T h e s et t i ngs i n Tr ansac
t i on WE2 0 in t he i n b o u n d p a r t n e r prof i l e f or t h e ag e n t wi t h p o s t p r o c e s s
i ng a u t h o r i z a t i o n s d e t e r m i n e t o w h o m t h e wo r k f l o w is a c t ua l l y sent .
S t a n d a r d t a s k : M a i n t a i n A g e n t A s s i g n m e n t
* fv ** BJ Oigassignment a?
ZSMNACH input error I S 9 7 1 0 0 1 7 9
PB-'ask: E l y
0 * n * a ' T a t k ........
O General forwarding allowed
O General forwarding not allowed
O r orwar ng n<x allowed
C l a s s t a t i o n N O . C L A S S N o t c l Q
Locked tor instantiation
Locked against eietution
Transfer K
Figure 4-134 Agent Assignment
1 8 1
4 | Changes to IDocs
Ex t e n d i n g t he
pr oc es s c o d e by
e r r o r h a n d l i n g
A s s u m i n g t he
w o r k f l o w t ask
Call Tr ansact i on WE4 2 agai n. Up t o n o w, y o u u s e d t hi s t r a ns a c t i on onl y
f or l i nki ng t h e pr ocess c o d e a n d t h e f u n c t i o n mo d u l e . No w y o u assi gn
y o u r b u s i n e s s o b j e c t t y p e (see Fi gur e 4 . 135) a n d speci f y t he e v e n t s to
b e p r oc e s s e d. Th e ALE c o mm u n i c a t i o n l a ye r i n c o mb i n a t i o n w i t h y o u r
pr ogr a m t h e n e ns ur e s t h a t t h e c o r r e s p o n d i n g e v e n t s a r e us e d ( see Li st ing
4 . 2 8 i n Sect i on 4 . 4 . 3 , Up d a t i n g a n IDoc).
C ha nge View "Function modules f o r inbound ALE-EDI": Details
Process code
Object Type
Start Event
End event
Success Event
Application Object
Object Type
Start event
F i gu r e 4-135 As s i g n i n g t h e Er r or Ha n d l i n g t o t h e Pr ocess Code
Tr a ns a c t i on SBWP, t h e c e n t r a l wo r k p l a c e , li sts t h e f a ul t y I Docs i n t he
Wor kf l ow Tasks i n t h e i nbox. In Fi gure 4 . 1 3 6 u n d e r W o r k p l a c e I n b o x
W o r k f l o w , y o u can f i nd t h r e e f a ul t y IDocs f o r w h i c h I wa s speci f i ed as
t he a g e n t i n t h e p a r t n e r profil e.
Doubl e- cl i ck o n t h e t e x t o f t h e t ask, a n d t h e s y s t e m na v i g a t e s t o t h e
act ual pr oc e s s i ng m e n u w h e r e y o u can s et , e di t , a n d v i e w d e l e t i o n flags
(see Fi gure 4. 137) .
1 8 2
Custom IDocs | 4-4
~ 9 ' j \ Business Workplace of MAISELSA
T ? Mew m e s s a g e M roi< 5ef M F i n d d o c u m e n t I Q A p p o i n t m e n t c a l e n d a r Oistr*uOo*> fcsls
j Workplace MAJSFLSA
" Qintxn
0 U n r e a d D o c u m e n t s 2
0 D o c u m e n t s 2
* 5 H W o rk fl o w 3
P C D G r o u p e d a c c o r d i n g t o c o n t e n t
P G r o u p e d a c c o r d i n g t o c o r i e n t type
^ G r o u p e d a c c o r d i n g t o s o r t hey
! G r o u p e d a c c o r d i n g t o t a s k
[H Owidue errtrioi 0
B D e a d l i n e M e s s a g e s 0
E i n c o i r e c l e n t r e s 0
I- i>Outbo
c 9 P e s u b m i s s i o n
P Private t o w s
I- ( 9 S h a r e d *oldets
P c j * ' W d e r s s u D s c n o e o
9 T r a s h
T J S h a r e d t r a s h
Wo r k f l ow 3
Title S t a t u s
' M e s s a g e s f i x i n p u t a n d o u t t o u r i d p r o c e s s i n g *
M e s s a g e s f i x i n p - j l a n d o u t b o u n d p r o c e s s i n g
M e s s a g e s f i x mpji a n d o u t b o u n d p r o c e s s i n g
| C r e t t o n Da
0 8 / 1 9 0 0 0 9
0 8 / 1 9 * 2 0 0 8
08/19*2008
C r e t t o n P j M t Co [W
1 1 3 1 3 0 5
1 1 2 8 2 7 5
11: 2 8 : 2 1 5
* * M e s s a g e s f o r In p u t an d out b o u n d processing
Descr i p t i o n
P l e a s e S o t o P r o b l e m in IDoc
O b j e c t s dill a t t a c h m e n t s
. zsywcH-QQttmxm?6eft)5
Fi gu r e 4*136 Faul t y I Docs i n t h e I nbox
Display Status Record
S3 Process Delete tlacj M 4 1I T ] I m I I IDoc Display
IDoc number 000 000000 076880 5
Direction 2 4 = inbound
St at us_________________ [51 Application document not posted
Message Messages for input and outbound processing
Sts details Logging_________________________________
Time of log entiy
Date 0 8 / 1 9 / 2 0 0 8
Time 1 1 : 13 : S1
Time of database change ~7
Date 0 8 / 1 9 / 2 0 0 8
Time 1 1 : 1 3 5 1
Fi gu r e 4-137 View After Assuming the Workflow Task
A g e n t A s s i g n m e n t of E r r o r T a s k s
You assign agents t o e r r o r tasks in t h e p a r t n e r p r o f il e s . I n i t i a l l y , y o u Agent assignment
search f o r t h e ac tua l message in t h e i n d i v i d u a l display; i f y o u c a n t
fi n d a n y t h i n g t h e r e , t h e sett ings f o r t h e e n t i r e p a r t n e r are scanned,
and i f y o u c a n ' t f i n d a n y t h i n g t h e r e e it he r , t h e e r r o r is sent to t h e I D o c
1 83
4 | Changes to IDocs
a d mi n i s t r a t o r . T h e s ys t e m checks w h e t h e r a speci f i c u s e r is d e f i n e d o r
b e l o n g s t o t h e o r ga ni z a t i ona l u n i t t h a t is s peci f i ed t he r e a n d w h e t h e r t he
us e r is a l l o we d t o e xe c ut e t h e t ask. Eve i y u s e r ma y c a r r y o u t a t ask o f
t h e general task t y p e o r a t as k t h a t wa s a s s i gned t o t h e u s e r vi a t h e or ga
ni zat i onal m a n a g e m e n t i n SAP ERP HCM. The t asks ar e e i t h e r s peci f i ed
i n t h e j o b d e s c r i p t i o n o r a s s i g n e d di rect l y. Co o r d i n a t e t h e s e t t i ngs i n
t he or ga ni z at i onal m a n a g e m e n t w i t h t h e e mp l o y e e s r e s p o n s i b l e because
t h e s e s e t t i n g s c a n a l s o i nf l ue nc e o t h e r e l e m e n t s i n t h e SAP s ys t em.
IDoc administrator Us e Tr a ns a c t i on OYEA t o ma i n t a i n t h e IDoc a d m i n i s t r a t o r a n d s ome
o t h e r gene r a l s et t i ngs . Her e, y o u can al so e n t e r d e f a u l t s e t t i n g s f or f r e
q u e n t l y r e q u e s t e d a s pe c t s , s u c h as t h e m a x i m u m n u m b e r o f s ynt a x
e r r o r s p e r I Doc (see Fi gur e 4. 138) .
G l o b a l P a r a m e t e r s f o r I D o c I n t e r f a c e
B
A W . H I - m W I J M Us e r Info____________________________________________
I Doc Administrator
O ^ e t t Type' 0 Organizational unit
Identification 50010120 EDI Department
General IDoc Interface
Max Number of Syntax Errors 1
IDoc Inbound Processing using tRFC
Server Group for IDoc inbound
I
Outbound I Docs Using tRFC,
Use Last Code Page Found
IDoc inbound from File/
C l Synchronous Processing
E Warnings for Status Processing
Commit M e r 0 Data Records
Figure 4138 Global Settings
4 . 4 . 6 U s e f u l F u n c t i o n AAodules
Some o f t h e n e c e s s a i y f u n c t i o n m o d u l e s f o r p r o c e s s i n g c u s t o m - p r o
g r a mm e d IDocs h a v e a l r e a d y b e e n i l l us t r a t e d i n t h e p r o g r a mmi n g exam-
1 8 4
Custom IDocs | 4-4
pi es. Tabl e 4 . 3 li sts t h e m o s t i mp o r t a n t f u n c t i o n mo d u l e s aga i n f o r y o u r
r e f er e nce. Thi s l i st al so i nc l ude s t h o s e c o n v e r s i o n mo d u l e s t h a t a r e n ' t
c o n t a i n e d i n t h e e xa mpl e s .
F u n c t i o n M o d u l e F u n c t i o n
A L E _ M O D E L _ D E T E R M I N E _ I F _ T O _
S E N D
C h e c k w h e t h e r a s p e c i f i c m e s s a g e m a y b e g e n e r a t e d
a c c o r d i n g t o t h e d i s t r i b u t i o n m o d e l .
A L E _ S E R I A L _ K E Y 2 C H A N N E L D e t e r m i n e / s e t o b j e c t c h a n n e l f o r s e r i a l i z a t i o n .
C L O L C O N V E R S I O N _ P E R F O R M C o n v e r s i o n f r o m i n t e r n a l t o e x t e r n a l f o r m a t s .
C L O I _ P U T _ S I G N _ I N _ F R O N T P u t m i n u s s i g n i n f r o n t .
C U R R E N C Y _ A M O U N T _ I D O C _ T O _ S A P C o n v e r t c u r r e n c y a m o u n t s t o SAP f o r m a t .
C U R R E N C Y _ A M O U N T _ S A P _ T O _ I D O C C o n v e r t c u r r e n c y a m o u n t s t o e x t e r n a l f o r m a t .
C U R R E N C Y _ C O D E _ I S O _ T O _ S A P C o n v e r t c u r r e n c i e s f r o m I SO c o d e t o SAP f o r m a t .
C U R R E N C Y _ C O D E _ S A P _ T O _ I S O C o n v e r t c u r r e n c i e s f r o m SAP f o r m a t t o I SO c o d e .
I D O C _ D A T E _ T I M E _ G E T G e t s t a t u s i n f o r m a t i o n f r o m t h e r e c e i v e r .
I D O C _ R E D U C T I O N _ F I E L D _ R E D U C E D e t e r m i n e a c t i v e f i e l d s i n t h e r e d u c e d m e s s a g e t y p e .
I D O C _ S E R I A L I Z A T I O N _ C H E C K C h e c k t i m e s t a m p i n t h e s e r i a l i z a t i o n f i e l d o f t h e I D o c
h e a d e r .
I D O C _ S E R I A L _ P O S T U p d a t e t h e s e r i a l i z a t i o n t a b l e .
I D O C _ S T A T U S _ W R I T E _ T O _ D A T A B A S E C h a n g e I D o c s t a t u s .
L A N G U A G E _ C O D E _ I S O _ T O _ S A P C o n v e r t l a n g u a g e c o d e f r o m I SO c o d e t o SAP f o r m a t .
L A N G U A G E _ C O D E _ S A P _ T O _ I S O C o n v e r t l a n g u a g e c o d e f r o m SAP f o r m a t t o I SO c o d e .
M A S T E R J D O C . D I S T R I B U T E T r a n s f e r I D o c t o t h e c o m m u n i c a t i o n l ayer .
M M O D E L _ I N T _ V A L I D _ G E T D e t e r m i n e i n t h e d i s t r i b u t i o n m o d e l w h o s e n d s w h i c h
me s s a g e t o w h o m .
O W N _ L O G I C A L _ S Y S T E M _ G E T F i n d t h e c u s t o m l o g i c a l s y s t e m n a m e .
R F C _ D A T A _ D E T E R M I N E _ F O R _ C H E C K S D e t e r m i n e an RFC d e s t i n a t i o n o f a p a r t n e r .
U N I T_ 0 F _ M E A S U R E_l SO_ T 0 _S A P C o n v e r t u n i t o f m e a s u r e f r o m I SO c o d e t o S A P f o r m a t .
U N I T _ O F _ M E A S U R E _ S A P _ T O _ I S O C o n v e r t u n i t o f m e a s u r e f r o m SAP f o r m a t t o I SO c o d e .
T abl e 4 . 3 Fu n c t i o n M o d u l e s f o r I D o c Pr ocessi ng
1 8 5
4 | Changes to IDocs
4.5 Summary
No w y o u ' v e s e e n all t h e d e v e l o p m e n t t asks f or ma n a g i n g c o m p a n y s pe
ci al t i es i n IDocs. We s t a r t e d w i t h t h e a d a p t i o n o f s t a n d a r d IDocs wi t h
Cus t omi zi ng t asks, b e c a u s e t hi s is t h e easi est way. The n e x t s t e p is t he
d e v e l o p me n t o f c h a n g e s t o s t a n d a r d IDocs wi t h t h e he l p o f e n h a n c e me n t
t e c h n i q u e s . To d o so, w e r e v i e we d t h e t e c h n i q u e s avai l abl e f or t h e n o n
i nt er a ct i ve IDoc pr ocessi ng.
At t h e e n d we w e n t t h r o u g h t h e c o m p l e t e p r oc e s s o f d e v e l o p i n g c us
t o m e r I Docs s t a r t i n g wi t h t h e a p p l i c a t i o n t abl es a n d e n d i n g wi t h t he
c o mpl e x pr oc e s s o f IDoc e r r o r ha ndl i ng.
1 8 6
IDoc communication is essentially asynchronous t h e sending
system doesn' t receive i n f o r m a t io n a b o u t how t h e IDoc is p r o
cessed in t h e receiving system. B u t , t h i s i n f o r m a t io n can be t rans
f e r r e d f r o m t h e receiver to t h e sender. This c h a p t e r will outline
t h e various options available here.
5 Confirmations
I Doc c o mmu n i c a t i o n is f u n d a me n t a l l y a s y n c h r o n o u s . In o t h e r wor ds ,
t h e s e n d e r d o e s n ' t r ecei ve a n y i n f o r ma t i o n a b o u t h o w t h e r e c e i ve r p r o
cesses t h e IDoc. Howe ver , i f r e q u i r e d , t h e r e c e i ve r ca n act i vel y s e n d t hi s
i n f o r ma t i o n bac k t o t h e s e nde r .
5.1 "ALEAUD" I Docs
ALEAUD IDocs ar e g e ne r a l l y d e p l o y e d w h e n t w o SAP s y s t e ms ar e i n use.
Thi s s c e n a r i o (a s e n d e r s e n d s a n a p p l i c a t i o n IDoc a n d a r e c e i v e r s ends
bac k a n ALEAUD IDoc) is k n o w n as ALE audit. In SAP Nc t We a v e r Process
I n t e gr a t i on (SAP Ne t We a v e r PI), t h e IDoc a d a p t e r al so pr ocesses t h e ALE
AUD IDoc as a n application acknowledgment.
To us e an ALEAUD IDoc, y o u n e e d a s u i t a b l e d i s t r i b u t i o n mo d e l (see Fig
ur e 5. 1) t h a t i n s t r u c t s t h e r e c e i v e r o f t h e or i gi nal IDoc t o s e n d an ALEAUD
I Doc t o t h e s e n d e r o f t h e or i gi nal IDoc.
* g g . Z S M I ...
ZSM1
^ 0 X D O client 800 T90CLNT090
^ 0 Productive system (client 811) PRODUCTION
f a ZSMNACH Sabines Message Type
^ @ Productive system (client 811) PRODUCTION
^ 0 XDO client 800 T90CLNT090
^ f a ALEAUD ALE: Confirmations for inbound IDocs
No filter set
Fi gu r e 5.1 Par t ner M o d e l f o r t h e " A L E A U D " I Doc
D i s t r i b u t i o n mo d e l
f o r ALE a u d i t
187
5 Confirmations
I n i t i a l s t a t u s val ues
A L E A U D " I Doc
The ALEAUD IDoc c o n f i r ms t h e s t a t us o f t h e IDoc i n t h e t a r ge t s ys t em.
Fi gur e 5. 2 s h o ws s o me p o s s i b l e s t a t u s val ues. For e xa mpl e , a n IDoc is
a s s i g n e d s t a t u s 53 i f i t ' s p o s t e d successful l y. I n a d d i t i o n , a d e l e t i o n flag
c a n b e s e t t o p e r ma n e n t l y e xc l u d e a n IDoc f r om pr oc e s s i ng ( st at us 68)
o r a n IDoc can h a v e a n i n t e r me d i a t e pr oc e s s i ng s t a t us (e. g. , s t a t us 64:
Waiting a n d 51: Incorrect processing).
^ 1 3 Productive system (client 811) 24
P G$ IDocs in outbound processing 13
^ [ | IDoc in inbound processing 11
l> O Application document not posted 61 3
I 1 0 Application document posted 53 2
^ Q E r r o r- n o f u r in e r processing 68 2
l> & IDoc ready to be transferred to application 64 4
F i gu r e 5. 2 I D o c St at us Val ues i n Recei vi ng Syst em
We' l l n o w us e t h e r e por t RDBSTATE t o s e n d o u r conf i r ma t i ons . Thi s r e p o r t
mu s t be s c h e d u l e d o n a r e g u l a r bas i s . Fi gur e 5. 3 s h o ws t h e r e q u i r e d
e n t r i e s , t h a t is, f o r wh i c h y o u w a n t ALEAUD IDocs t o be g e n e r a t e d , f or
wh i c h me s s a ge t ype, a n d f o r w h i c h per i od.
D a le IDoc changed ____________________18 8 / 0 1 / 2 8 8 8 | to_____[ 0 8 / 0 1 / 2 0 0 9
F i gu r e 5. 3 " RBDSTATE" Repor t
The ALEAUD I Doc cont a i ns a h e a d e r s e g me n t , wh i c h pr o v i d e s i n f o r ma t i o n
a b o u t t h e s e l e c t i o n ma d e by t h e user . I n o u r e xa mpl e , i t s t a t e s t h a t we ' l l
s e n d c o n f i r ma t i o n s f or t h e me s s a ge t y p e ZSMNACH ( see Fi gur e 5. 4). This
is f o l l o we d by o n e s e g me n t f o r each IDoc i n t h e s el e c t i on p e r i o d , whi c h
pr o v i d e s i n f o r ma t i o n a b o u t t h e s t a t us o f t h e IDoc i n t h e r ecei vi ng s ys t em
as wel l as t h e IDoc n u m b e r i n b o t h s ys t ems .
1 8 8
"ALEAUD" IDocs | 5-1
SEGNUM
SEGNAM
Segment Number
^pnmprt Namp
000001
c l ADHD*
MESTYP_LNG
Am i im
v v u i i i v i i i i m i 1 i v
Message Type
Numhor
ZSMNACH
nnnnni wCvi ivn
SEGNAM
o c y i i i c i u i v u i i i u c i
Segment Name E1STATE
DOCNUM IDoc number C0000000007688J7
STATUS Status of IDoc S3
STACOD Stalus code SAP0CC
STAPAI [Parameter 1 ok
STATVP Type of system error message ( S : Success message
STAMQU
C T B H f J n
Stalus message qualifier
niirrthPr
SAP
nnn
STAPAI JJVO Parameter i 0k
86GNUM Segment Number 000003
SEGNAM Segment Name E1PRTOB
DOCNUM
PFfiNI !M
IDoc number
N u m h P f
0000000000135191
000004 WW VI
SEGNAM
W v U l l l v l l i l i U I I I U v l
Segment Name E1STATE
DOCNUM IDoc number 0000000000768808
STATUS Status of IDoc 68
STACOD Status code SAP3CC
STAMOU
Q T A M M O
Stalus message qualifier
Statue rnaccano niimhor
SAP
inn
SEGNUM
o w i u i i u i m u c i
Segment Number 000005
SEGNAM Segment Name E 1 P = ? " C B
i C C N U M IDoc number 0000000000135192
Fi gu r e 5. 4 Sampl e " A L E A U D " I Doc
The r esul t s h o w n in t h e s e n d i n g s ys t e m c o mp r i s e s t h r e e n e w s t a t us val
ue s (39, 40, a n d 41), as s h o w n i n Fi gur e 5. 5. St at us va l u e 40: Application
document n o t created in target system is r e d b e c a u s e e v e n i f t h e s e n d e r no
l o n g e r n e e d s t o t a ke ac t i on her e, i t s h o u l d be cl e a r t h a t t h e p a r t n e r d i d n ' t
p o s t t h e s e IDocs b u t a s s i g n e d t h e m s t a t us 68: Error - no f u r t h e r process
ing i ns t e a d. The f o l l o wi n g t wo s t a t us val ues ar e g r e e n : 47, wh i c h , i n t he
s e n d i n g s ys t em, me a n s t h a t t h e r e cei vi ng s ys t e m s ucc es s f ul l y pr oces s ed
t h e IDoc ( a n d t h e r e f o r e o b t a i n e d s t a t us 53), a n d s t a t us 39, wh i c h means
t h a t t h i s IDoc is still i n an i n t e r me d i a t e s t age. All IDocs t h a t have a val ue
o t h e r t h a n 53 o r 68 i n a p a r t n e r s ys t e m ar e a s s i g n e d s t a t u s 3 9 b e c a u s e
i t ' s a s s u me d t h a t t h e p a r t n e r wi l l c o n t i n u e t o pr oc e s s all IDocs t h a t d o n t
have s t a t us 53 o r 68 unt i l t h e y o b t a i n s t a t us 53 o r 68.
~ @ X D 0 client 800 10
^ IDocs in outbound processing 10
^ Application document not created in target system 40 1
l> z s m n a c h 1
^ IDoc is m the target system (ALE service) 39 7
l> f a ZSMNACH 7
^ Application document created in target system 41 2
P b ZSMNACH 2
Figure 5 .5 Status Values in Sending System After ALE Audit
1 8 9
St a t u s v a l u e s i n
s e n d i n g s y st em
5 | Confirmations
I Do c s w i t h a u d i t
messages
P r o c e s s i n g by
w o r k f l o w t a s k
I f t h e s t a t u s o f an IDoc c h a n g e s i n a p a r t n e r s y s t e m, a n d i f t h e r e p o r t
RBDSTATE is c x c c u t e d agai n, a n e w e n t i y is s e n t w i t h i n a n ALEAUD IDoc.
5.2 STATUS" IDocs
W h e n ALEAUD IDocs a r e u s e d t o s e n d c o n f i r ma t i o n s , all t h r e e s t a t us val
ues r e s ul t i n t he s e n d e r n o l o n g e r b e i n g a bl e t o pr ocess o r r e s e n d t he
IDoc. He r e , i t s g e n e r a l l y a s s u m e d t h a t t h e r e c e i v e r wi l l r e s ol ve a n y
er r or s t h a t occur . Howe ver , i n t h e case o f EDI s ubs ys t e ms , i n par t i cul ar,
y o u ma y s e e a d d i t i o n a l s t a t u s val ues i n t h e EDI s u b s y s t e m, o r y o u may
w a n t t o r e s e n d a n IDoc b e c a u s e an e r r o r o c c u r r e d i n t h e EDI s u b s y s t e m.
You' r e al r e a dy f ami l i ar w i t h s t a t u s pr oc e s s i ng f r om Ch a p t e r 3, Sect i on
3. 3, Processi ng St at us Files. Here, an IDoc is u s e d t o c r e a t e a n e w st at us
v a l u e f or t h e or i gi nal IDoc.
Fi gur e 5 . 6 s h o ws pr oc e s s c o d e STA1, wh i c h is u s e d t o pos t t h e STATUS
IDoc. As y o u can see, p r o c e s s i n g b y ( wor kf l ow) t ask is s peci f i ed u n d e r
Processi ng Type i f y o u r s y s t e m has n o t c h a n g e d s i n c e it was d e l i ve r e d by
SAP. For t hi s r e a s on, y o u s h o u l d o n l y us e STATUS IDocs i f y o u real l y nee d
t he o t h e r s t a t us val ue. Wor kf l ow pr oc e s s i ng is m o r e p e r f o r ma n c e - i n t e n
si ve t h a n pr oc e s s i ng by f u n c t i o n mo d u l e . Wh e r e pos s i bl e , y o u s h o u l d
w o r k w i t h t he ALEAUD s ce nar i o. You s h o u l d al so o n l y wo r k w i t h STATUS
IDocs i f y o u w a n t t o pr oc e s s IDocs agai n.
1 9 0
'STATUS" IDocs | 5-2
Th e STATUS I Doc d o e s n ' t t r a n s f e r t h e s t a t u s o f t h e IDoc i n t h e r e cei v
i ng s ys t em. I nst ead, y o u s pec i f y t h e n e w s t a t us t h a t y o u w a n t t h e IDoc
t o o b t a i n i n t h e s e n d i n g s ys t em, al ong w i t h a s u i t a b l e pi ece o f t ext . In
o u r e x a mp l e , t h i s t e x t is a l wa y s h a r d - c o d e d i n t h e IDoc. You can al so
r e f e r e nc e a me s s a ge i n a me s s a ge cl ass, b u t t hi s m u s t exi s t i n t he or i gi
nal s e n d i n g s y s t e m. Th e l a t t e r o p t i o n faci l i t at es t h e us e o f m o r e user -
fr i endl y, l anguage- speci f i c mes s age s . Fi gur e 5 . 7 s h o w s t h e ma i n fi el ds in
t h e STATUS IDoc, t h e r e f e r e nc e t o t he IDoc t h a t is t o r ecei ve a n e w st at us
va l ue , t h e n e w s t a t us v a l u e itself, a n d t h e c o m m e n t t ext .
IDoc display
C J IDOC 0000000000768832
H ) Control Rec.
^ <3 Data records
E1STATS
I 1 CD Status records
Total number 000001
Segment 000001
Technical short info 7
Olrection 2 Inbox
Current status 53 C C
Basic fipe SYSTATG1
Extension
Message type STATUS
Partner No. PRODUCTION
Partn Type LS
Pori SUBSYSTEM
Content of selected segment
Fid name Fid cont
MANDT 8 0 0 0
DOCNUn 000 000000 076879 6 B
L080AT 20080801 L j
LOST IM 01010
STATUS
6
UNAHE MAISELSA
STATXT STATUS CHANGE WITH ST ATM 1
LI
E
0
i || * ||
1 j ! K M
Fi gu r e 5 . 7 Sa mp l e " STATUS" I Doc
Fi gur e 5 . 8 s h o ws t h e r e s ul t o f p o s t i n g t h e SYSTAT IDoc. I n o u r case,
s t a t u s val ue 18, EDI subsystem initialization OK is a s s i gned. Si mi l arl y, t hi s
s t a t u s d o e s n t p e r mi t f u r t h e r pr ocessi ng.
STATUS" message
t y p e
I m p l e m e n t e d
s t a t u s
1 9 1
5 Confirmations
Status M o n i t o r f o r ALE Messages
Display IDocs Display relationships j Display status long text Object key
QQECDE3EED I@!SBE13[D3Q
Doc Selection
IDoc number|Slat |Message Type StatusText Partner No. [BasicType j Segments
768 796 18 ZSMNACH STATUS CHANGE WITH STATUS IDOC PRODUCTION |ZSMTYP01 9
F i gu r e 5 . 8 M o d i f i e d I D o c i n t he Sendi ng Syst em
5.3 Summary
You' ve s e e n n o w t h e d i f f e r e n t p o s s i b i l i t i e s f o r b r i n g i n g i n f o r ma t i o n
a b o u t t h e IDoc back t o t h e or i gi nal s e nde r . Thi s h e l p s y o u t o o v e r c o me
o n e o f t he d i s a d v a n t a g e s o f a s y n c h r o n o u s c o mmu n i c a t i o n : n o t k n o wi n g
w h a t h a p p e n e d a t y o u r p a r t n e r ' s si t e. Al so, w i t h t he h e l p o f t h e STATUS
IDoc o r t h e St at us File, y o u ar e a bl e t o r e s e n d a n IDoc t h a t wa s al r e a dy
s e n t successf ul l y bef or e.
In t h e n e x t cha pt e r , we ' l l r e v i e w t h e mo r e c o mp l i c a t e d pr ocesses, wh e r e
t h e s e q u e n c e o f I Docs b e c o me s an i m p o r t a n t f act or, t h e ser i a l i z at i on
me t h o d s f o r IDocs.
1 9 2
Even though n o r m a l IDoc communication makes provision f o r
th e use o f t i m e s t a m p s to s o r t system IDocs in t h e correct sequence
before t h e y are dispatched o r posted, IDocs m a y "queue j u m p "
du r i n g parallel processing a n d when t e rm i n a t i o n s occur. I f y o u
d o n ' t w a n t t h i s to happen, y o u m u s t ensure t h a t IDocs are
always processed in exactly t h e correct sequence.
6 Serializing IDocs
In s o me s i t ua t i ons , i t ' s nec es s ar y t o a d h e r e t o t h e exact p o s t i n g s e q u e n c e
f or IDocs. On e s u c h s i t uat i on i nvol ves g o o d s mo v e me n t s . I f q u e u e - j u mp
ing occur s a m o n g IDocs t hat have g o o d s mo v e me n t s f or t he s a me mat er i al
i n t h e s a me s t or a ge bi n, t hi s wi l l r e s ul t i n n u me r o u s d i f f e r e n t pos t i ngs,
wh i c h ar e n o t d e s i r a bl e f r om a fi nanci al a u d i t o r s ys t e m l oad per spect i ve.
So, SAP s o f t wa r e s u p p o r t s s eve r al t ypes o f IDoc ser i al i zat i on:
Ser i al i zat i on
o p t i o n s
No t all ser i a l i z at i on t y p e s a r e al ways pos s i bl e . Also, t h e y c a n h a v e var i
ou s d i f f e r e n t ef f ect s. In t h e n e x t s ec t i on, we ' l l d e s c r i be h o w t o us e each
ser i a l i z at i on t ype, h o w t o fi nd t h e me s s a ge t ypes s u p p o r t e d , a n d h o w to
conf i gur e t h e e n t i r e pr ocess.
6.1 Serialization Using Groups
Wh e n us i ng gr oups f o r ser i al i zat i on pur pos e s , y o u a s s u me t h a t mo r e t h a n
o n e IDoc is b e i n g d i s p a t c h e d f or a pa r t i c ul a r pr ocess, so n u me r o u s di f
f e r e nt mes s age t ypes ar e used. In t he case o f a mat er i al mast er, f or e x a m
ple, y o u al so have t h e o p t i o n o f ma ki ng a cl assi fi cat i on w h e n y o u creat e
Ser i al i zat i on us i ng ser i a l i z at i on gr oups
Ser i al i zat i on us i ng t i me s t a mp s
Ser i al i zat i on us i ng bus i ne s s obj ect s
Ser i al i zat i on us i ng qRFC
1 9 3
6 | Serializing I Docs
Pr ocessi ng
sequence
E v a l u a t i o n r e p o r t
" RBDSER0 1 "
Ser i al i z at i on
g r oups
a mat er i a l . Cl assi fi cat i ons ar e t h e n s e n t w i t h t h e mes s age t y p e C L F M A S ,
wh i l e mat er i a l s ar e s e n t w i t h t h e al r e a dy f a mi l i ar me s s a ge t y p e M A T M A S .
A mat er i al ma s t e r is r e qui r e d t o successful l y pr ocess t he C L F M A S IDoc. I f a
mat er i al is cr eat ed, pos t i ng pr o b l e ms ma y occ ur i f t h e C L F M A S IDoc queue-
j u m p s a n d over t akes t h e M A T M A S IDoc. Even t h ough t he C L F M A S IDoc can be
successful l y p o s t e d i f t he IDoc is r est ar t ed af t e r t he MATMAS I Doc ar r i ved
a n d was pos t e d successful l y, i t s bet t er , i n t e r ms o f sys t em p e r f or ma nc e , i f
such q u e u e - j u mp i n g is p r e v e n t e d . For t hi s r eas on, y o u have t h e o p t i o n o f
g r o u p i n g t h e mes s age t y p e s i nt o a ser i al i zat i on g r o u p i n t he s e n d i n g a n d
recei vi ng s ys t ems as wel l as speci f yi ng t h e r e qui r e d pr ocessi ng s eque nce.
A p r e r e qui s i t e f or t hi s p r o c e d u r e is t h e us e o f a cha nge p o i n t e r t o eval uat e
t he r e l e va nt IDocs, so t hi s p r o c e d u r e c onc er ns ma s t e r dat a.
I ns t ea d o f u s i n g t h e r e p o r t R B D M I D O C t o e va l ua t e t h e c h a n g e p o i n t e r s o r
Tr a ns act i on BD21, wh i c h e va l ua t e s all o f t h e c h a n g e p o i n t e r s f o r a me s
sage t ype, y o u us e t h e r e p o r t R B D S E R 0 1 , wh i c h sel ect s all o f t h e cha nge
p o i n t e r s f o r a g r o u p o f me s s a g e t y p e s a n d e n s u r e s t h a t all I Docs wi t h
t h e fi rst me s s a ge t y p e ar e c r e a t e d first, f o l l o we d b y all IDocs w i t h t he
s e c o n d me s s a ge t ype, a n d so o n . I f i ndi vi dua l IDocs c o n t a i n e r r or s , t hey
ar e i g nor e d a n d a d d e d l at er, i n t he usual way, vi a e r r o r ha ndl i ng.
To wo r k wi t h ser i a l i z at i on g r o u p s , i t ' s i m p o r t a n t t h a t p r o c e s s i n g i n b o t h
t he s e n d i n g a n d r e cei vi ng s y s t e ms is s e t t o Wa i t f o r Backgr ound Pr ogr am
i n t he p a r t n e r pr of i l es i n Tr ansact i on WE20.
The f i r st s t ep w h e n w o r k i n g w i t h ser i a l i z at i on g r o u p s is t o us e Tr ansac
t i on BD44 t o cr eat e t h e s er i a l i z at i on g r o u p i n t h e s e n d i n g a n d r ecei vi ng
s ys t ems . Fi gur e 6. 1 s h o ws t h e s et t i ngs f or o u r cl assi fi cat i on e xa mpl e . The
mat er i al ma s t e r s ( M A T M A S ) will b e p r o c e s s e d first, f o l l o we d by t h e cl as
si fi cat i on a s s i g n me n t s ( C L F M A S ) .
Change View "Assignment of logical messages to serial, group":
New Entries Cft y , gjL Q
Dialog Structure
Serializat group ZSH1
^ P i Serialization aroups
3 Assignment of logical messages Assignment of logical messages to serial group
rfessage type seq. number
CLFHAS 2 0 l
J -
m m
Figure 6.1 Creating a Serialization Group
1 9 4
Serialization Using Groups | 6.1
The s e s e t t i ngs mu s t b e conf i gur e d i n b o t h t h e s e n d i n g a n d r e cei vi ng s ys
t e ms . In t h e r e cei vi ng s y s t e m, y o u c a n al so s pec i f y a d d i t i o n a l i n f o r ma
t i on a b o u t paral l el pr oc e s s i ng i n Co l u mn P. In o u r e x a mp l e (see Figure
6. 2), h o we v e r , t h e flag f o r par al l el p r o c e s s i n g wa s n o t s e t b e c a u s e y o u
w o u l d t h e n n e e d t o s pec i f y a s e r v e r g r o u p . It ' s bes t t o l eave s u c h s pe c i
fi cat i ons t o y o u r s ys t e m a dmi ni s t r a t or .
Inbound processing of senalization group
Group Message Type Isending syst |Ob>fProc P RFC server group
MATMAS T90CLNT090 100

Z8N1 CLFMAS T90CLNTQ9O 50

Fi gu r e 6 . 2 Pr ocessi ng i n t h e Recei vi ng Syst em


In t h e s e n d i n g s ys t em, y o u t h e n us e t h e r e p o r t RBDSER01 o r Tr ansact i on
BD40 t o c r e a t e I Docs f o r a p a r t i c u l a r g r o u p . Her e, y o u o n l y n e e d t o
speci f y t h e ser i a l i z at i on g r o u p (sec Fi gur e 6. 3). Thi s is al so t h e case f or
t h e r e p o r t s d e s c r i b e d next .
Generate IDocs f o r Serialization Group From Change Pointers
I s
Serialization Group ZSf11|
Fi gu r e 6 . 3 Cr eat i ng I Docs f o r a Gr oup
First, t h e s ys t e m g e n e r a t e s all o f t h e MATMAS IDocs (see Fi gur e 6. 4).
| [ & Information E 3 /
3 m a s t e r I D o c s . s ^
Fi gu r e 6 . 4 Fi rst Mes s age Ty pe Cr eat ed
Then, it gener at es t he classification IDocs (see Figure 6. 5). In bot h cases, t he
cus t ome r di s t r i but i on model is r el evant f or d e t e r mi n i n g wh i c h p a r t n e r will
recei ve t h e IDocs. For each change, y o u c a n al so cr eat e several IDocs for
var i ous di f f er ent par t ner s , i f t h e use o f mul t i pl e recei vers is per mi t t ed.
Par al l el p r oc es s i ng
C r e a t i n g I Do c s f o r
a g r o u p
1 9 5
6 | Serializing IDocs
Se r i a l i z a t i o n g r o u p
i n o u t b o u n d
p r oc es s i ng
Di s p a t c h i n g
t h e g r o u p
l [ g I n f o r m a t i o n [ * J /
ip .? ? ? . H R t o [ . m s a g e t y p e C L F M A S
a s ___________________________________________
F i gu r e 6.5 Second Mes s age Ty pe Cr eat ed
In t h e s e n d i n g s ys t e m, all o f t he s e n e w IDocs obt a i n s t a t u s SO: Ready f o r
dispatch, as s h o w n i n Fi gur e 6. 6. To r e t a i n t he s e q u e n c e , i t ' s i mp o r t a n t
t h a t t he s e IDocs ar e n o t i n c l u d e d i n c o n v e n t i o n a l di s pat ch j o b s ( r e por t
R S E O U T O O ) . Th e var i ant s h e r e mu s t be s e l e c t e d so t h a t t he s e mes s age s are
excl uded.
0 X D O client 800 5
GiJ IDocs in ouffiound processing 5
^ iS IDoc ready far dispatch (ALE serwee) 30 5
^ CLFMAS 2
r> HJ 0KOO6 ) S . S . & . S 2
^ 3 MATMAS 3
l> CD 01(006) S. 3
F i gu r e 6.6 Cr eat i ng I Docs But N o t Di s pat c hi ng Them Yet
You can n o w st ar t t h e r e p o r t R B D S E R 0 2 o r Tr ansact i on BD41 t o di spat ch
t h e IDocs. You can use t h e flag Al ways Send Cont rol Message t o de t e r mi n e
w h e t h e r o r n o t t o s e n d t h e cont r ol message di r ect l y (see Figure 6.7).
Dispatch o f IDocs o f Serialization Group
<&B
Senaiization Group ZSm
Logical recewer system 10
l
Date o f last change 9 2 / 1 2 / 2 0 0 9 to 0 2 / 12 / 20OS*g)
Time of last change 0 0 : 0 0 : 0 0 ] to J 2 3 5 9 5 9
3
0 Check IDoc dispatch status
Waiting time until check 00 05 00
Always send control message

Figure 6.7 Dispatching IDocs


1 9 6
Serialization Using Groups | 6.1
Wh e n t h e s e I Docs a r r i v e i n t h e t a r g e t s y s t e m, t h e i r s t a t u s is 64: IDoc
ready to be transferred to application. O u r e x a mp l e s h o ws a l ar ge n u m b e r
o f u n p r o c e s s e d IDocs be c a u s e we s e l ec t ed a l o n g pe r i o d o f t i me i n wh i c h
t h e s y s t e m w o u l d col l ect c h a n g e p o i n t e r s (see Fi gure 6. 8).
O P r o d u c t i v e s y s t e m ( c l i e n t 8 1 1 ) 5
^ [ 2 lOoc in inbound processing 5
^ & IDoc ready to be transferred to application 6 4 5
t> CLFMAS 2
I 3 MATMAS 3
Fi gu r e 6.8 Unpr oc ess ed I Docs i n Tar get Syst em
To p o s t t he IDocs i n a usef ul ma n n e r , y o u c a n s t a r t pr oces s i ng w h e n t he
last IDoc i n t hi s g r o u p a n d c h a n g e p o i n t e r e va l ua t i on ha s ar r i ved. You, as
t h e s e nde r , can us e t he r e p o r t R B D S E R 0 3 o r Tr ansact i on BD42 t o i ns t r uct
t h e r e c e i ve r t h a t p o s t i n g can n o w c o mme n c e . Thi s i n f o r ma t i o n , wh i c h
has i t s o wn me s s a ge t y p e S E R D A T , is t h e n t r a n s f e r r e d t o t h e s e n d e r i f y o u
h a v e n t al r e a dy u s e d t h e r e p o r t R B D S E R 0 2 t o g e n e r a t e a cont r ol message.
The ser i a l i z at i on i n f o r ma t i o n is t r a n s f e r r e d wi t h i n t h e S E R D A T IDoc. You
g e t a l i ne i t e m s e g m e n t f or each me s s a ge t y p e i n t h e ser i a l i z at i on gr oup
(see Fi gur e 6. 9).
E C I D D Data Records
SEGNUM Segment Number 000001
SEGNAM Segment Name E1TBD40
SERGROUP Senalization group for senal ZSM1
SEQNUMBER
MESTVP
Application ID sequence number
Message Type
0001
MATMAS
SEGNUM
S E G N - M
Segment Number
Segment Name
000002
E1TBD40
SERGROUP Senalization group for senal ZSM1
SEQNUMBER Application ID sequence number 0002
MESTYP Message Type CLFMAS
Fi gu r e 6.9 SERDAT I Doc , W h i c h St ar t s Post i ng
You c a n al so s t a r t p o s t i n g wi t h o u t s e n d i n g a S E R D A T IDoc. To d o t hi s, use
t h e r e p o r t R B D S E R 0 4 o r Tr a ns act i on BD43 i n t h e r e cei vi ng s ys t em.
I n b o u n d
p r o c e s s i n g i n
p a r t n e r s y st em
197
6 | Serializing I Docs
Se r i a l i z a t i o n w i t h
t a b l e BDSER"
C u s t o m i z i n g f o r
t i m e s t a m p
s er i al i z a t i on
T i me s t a mp i n
t a b l e BDSER"
6.2 Serialization Using Timestamps
Se r i al i za t i on u s i n g t i me s t a mp s , al s o k n o w n as " se r i a l i z a t i on a t IDoc
level, " e n s u r e s t h a t i f t wo IDocs q u e u e - j u mp a n d c o n t a i n d i f f e r e n t dat a
f or t h e s a me obj ect , t h e o l d e r IDoc t h a t q u e u e - j u mp e d c a n n o l o n g e r be
pos t ed.
For t hi s p u r p o s e , t he l ast t i me s t a mp p o s t e d is e n t e r e d f or each obj ect
i n t h e t abl e B D S E R . An IDoc f o r t h e s a me o b j e c t c he c ks i t s t i me s t a mp
f r om t h e SERIAL c o n t r o l r e cor d field aga i ns t t h e t i me s t a mp i n t h e a bove
m e n t i o n e d t a bl e BDSER, a n d i t s o n l y p o s t e d i f i t s t i me s t a m p is later.
Ot h e r wi s e , t h e IDoc o b t a i n s s t a t u s 51, a n d it ca n be fl agged f o r de l e t i on.
Thi s o n l y c o n c e r n s ser i a l i z at i on i n t h e r e cei vi ng s y s t e m. IDocs cr e a t e d
u s i n g t h e g e n e r a t e d BAPI i nt e r f a c e d o n t s u p p o r t t hi s f u n c t i o n because
t h e g e n e r a t i o n p r o g r a m d o e s n ' t i m p l e m e n t t h e c o r r e s p o n d i n g f unc t i on
modul es .
I n Tr a ns act i on BD95, y o u a s s i gn IDoc fi el ds t o c e r t a i n fi el ds i n t h e d a t a
base ( s e e Fi gur e 4 . 9 i n C h a p t e r 4, Se c t i on 4 . 1 . 3 , Fi l t er i ng Segment s ) .
The s e f i el ds ar e a l s o t h e b a s i s f o r d e t e r m i n i n g o b j e c t a s s i g n m e n t f or
t i me s t a mp s er i al i zat i on.
Tr a ns a c t i on BD57, s h o w n i n Fi gur e 6 . 1 0 , c o n t a i n s t h e me s s a g e t ypes
d e l i ve r e d by SAP, wh i c h s u p p o r t s e r i a l i z a t i o n u s i n g t i me s t a mp s . Thi s
t r a n s a c t i o n a l s o s h o ws wh i c h fi el d is i mp o r t a n t f o r t h e s e q u e n c e . One
e x a mp l e o f s u c h a fi el d is t h e d o c u m e n t n u m b e r E B E l . N i n t h e mes s age
t y p e O R D C H G .
Tabl e B D S E R (see Fi gur e 6 . 1 1 ) c o n t a i n s t h e a s s o c i a t e d e n t r i e s w i t h t he
IDocs t h a t w e r e p o s t e d f o r an o b j e c t as wel l as t h e t i me s t a mp i n d i c a t
i ng w h e n p o s t i n g t o o k pl ace. The SERIAL fi el d h e r e c ont a i ns t h e t i me
s t a mp f r om t h e SERIAL field i n t h e c o n t r o l r e cor d f o r t h e last successful l y
p o s t e d IDoc. IDocs t h a t ar c bas e d o n t h e s a me o b j e c t b u t h a v e a n ea r l i e r
t i me s t a mp m u s t n o t be post ed.
1 9 8
Serialization Using Timestamps | 6 . 2
Change View " L i n k Type and Serialization Type o f Message T yp e" :
l ^ l l New Entries I ^ I B H ^ E I I B I I B I
Link Type and Serialization Type of Message Type
Message Type [Serialization object type Sbjecttype l ink
lAtriA'S ATNR - |
MATMAS_VHS ATNR t )
MK_MYSTD ATNR
MY MATHAS ATNR
OILDEB UNNR
OILORD 8ELN
0 1 LOTS BELN
ORDCHG : beln BELN
ORDERS BELN
ORDRSP BELN
PFS_HATHAS01 ATNR
PICKSD BELN
PRCMAS RCTR
QSMT CMTB
F i g u r e 6.10 I Do c s T h a t S u p p o r t T i me s t a mp Ser i al i zat i on
HANDT SNDPRT SNDPRN RfVPRT RCVPRN RCVPFC 0BJVAIUE
800 KU 0000030099 L I 0000010099 LF EBELN 4500000235
800 KU 0000030099 AG L I 0000010099 LF EBELN 4500000236
-
800 KU 0000030099 A6 LI 0000010099 LF EBELN 4500000238
F i g u r e 6.11 Tabl e ' BDSER
You c a n us e t h e r e p o r t R B D S R C L R t o r e mo v e o b s o l e t e t i me s t a mp s f r om
t h e Tabl e BDSER.
Function Modules for Serialization
SAP del i ver s t w o f u n c t i o n mo d u l e s f o r t i me s t a m p ser i a l i z at i on: I D 0 C _
S E R I A L I Z A T I O N _ C H E C K f o r c he c ki ng t i me s t a mp s a n d I D O C _ S E R I A L _ P O S T
f or u p d a t i n g t he ser i al i zat i on t abl e a f t e r a n e w I Doc h a s b e e n successful l y
pos t e d. I f y o u w a n t t o us e t hi s m e t h o d t o ser i a l i z e IDocs, go t o Tr ansac
t i on BD57, ma i n t a i n t h e field t o b e us ed, a n d t h e n us e t h e e n h a n c e m e n t
t e c hnol ogy t o i m p l e me n t t h e t w o f u n c t i o n mo d u l e s i n t h e i n b o u n d f u n c
t i o n modul e .
1 9 9
6 | Serializing IDocs
O b j e c t c h a n ne l
s er i al i z a t i on
A s s i g n m e n t t o
message t y p e
6.3 Serialization Using Business Objects
For ser i a l i z at i on u s i n g bus i ne s s obj e c t s , o n e c o m m o n c h a n n e l n u m b e r
is a s s i g n e d t o all IDocs f o r t h e s a me o b j e c t t y p e . A channel numbe r is a
mes s age a t t r i b u t e g e n e r a t e d us i ng t h e f u n c t i o n m o d u l e AL E _ S ERI AL_KEY -
2CHANNEL o r as s i g n e d i n t h e a pp l i c a t i o n pr ogr am.
Thi s t y p e o f ser i a l i z at i on is s o me t i me s al so k n o w n as object channel serial
ization. Her e, ser i a l i z at i on oc c ur s a t t h e o b j e c t t y p e l evel (e. g. , b a s e d on
all BOM IDocs). The b u s i n e s s o b j e c t t y p e f o r t h i s p u r p o s e is I DOCBOMMAT.
Because SAP d o e s n ' t d e l i v e r a n y o b j e c t c h a n n e l s er i a l i z a t i on f o r m a t e
rial ma s t e r s , w e ll us e BOMs i n o u r e x a mp l e h e r e . Fi gur e 6 . 1 2 s h o ws
Tr a ns act i on BD105, wh i c h c o n t a i n s all obj ect s f o r wh i c h SAP del i ver s
ser i a l i z at i on us i ng bus i ne s s obj ect s. You can ma i n t a i n t hi s t a bl e your s e l f ,
b u t y o u m u s t use exi t s t o b u i l d t he as s oc i a t e d i mp l e me n t a t i o n i nt o t he
pr oc e s s i ng r out i ne s .
C h a n g e V ie w "ALE:O bj ect Cha n n e l S erial iz: S up p o r t e d B u s i n e s s Object
N e w Entries CQ EAlz& D
ALEObiect Channel Seri ali z Supported Bu siness O b i e d Types

ObiectType (Descript
BUS2012 Purchase Order *
BUS2013 Purch.schedulmg agreement
BUS2015 inbound delrvery
BUS2022 Cl earing Case
BUS2032 Sales Order
BUS2035 Customer scheduling agreement
BUS2054 Wor k breakdown structure
BUS2102 Returns
L
BUS6050 Delivery Processing
r
ECH Engineering Change Management: Ch ange master
ID0CB0H00C
IDOCBOHHAJ IDOC for material BOMs
Figure 6.12 Ob j e c t s Co n n e c t e d t o O b j e c t Channel Ser i al i zat i on
A me s s a ge t y p e t h a t c a n b e s e r i a l i z e d is t h e n as s i gned t o each o f t hese
obj ect s. You us e Tr a ns act i on BD104 t o access t hi s a s s i g n me n t . For o u r
s a mp l e BOM, t h e me s s a ge t y p e is BOMMAT, as s h o w n i n Fi gur e 6. 13.
2 0 0
Serialization Using Business Objects | 6 . 3
Change View "ALE: Object Channel Serialization:
Ne wE nlne s - & ^ S 3 0
ALE: Obiecl Channel Senalization: Message Type o f Bus. o|
Ob) Type (Message Type
" 1
BUS2162 tCUST0f1ERRETURN_C0NFIRnDELIVERY *
BUS6050 OELIVERYPROCESSIN6 EXECUTE
*
ECU ECHHAS
IDOCBOMDOC 80MD0C
idocbohmat bohhat
IOOCBOHORD 80M0RD
IDOCDSPMAS OSPHAS
IDOCPALHAT PALHAT
i o o c st t m a t s t t h a t
LIKP SDPACK
LIKP SOPICK
LIKP SHP_OBDLV_CONFIRH_DECENTRAL
LIKP SHP_OBDLV_SPLIT_DECENTRAL
F i gu r e 6.13 Ob j e c t s and T h e i r I Docs
The f unc t i ons f or ac t i va t i ng o b j e c t c h a n n e l ser i a l i z at i on a r e o n l y avai l
abl e i n ALE Cus t omi zi ng. Sur pr i si ngl y, t h e y ar e l ocat e d u n d e r t h e Ma s
t e r Da t a Di s t r i b u t i o n m e n u o p t i o n e v e n t h o u g h s e r i a l i z a t i on is whol l y
i n d e p e n d e n t o f t h e t y p e o f d a t a u s e d a n d ha s n o t h i n g t o d o w i t h t h e
Shar ed M a s t e r Dat a t ool (SMD). Fi gur e 6 . 1 4 s h o w s a n e x t r a c t f r om ALE
Cus t omi zi ng.
Stiucture
IDoc .Interface/Application.Link Enabling (ALE)
t> Basic Settings
1 Communication
Modelling and Implementing Business Processes
!
1 ^
Global Organizational Units
\X G > Maintain Distribution Model and Distribute Views
1 Configure Predefined ALE Business Processes
a
Master Data Distribution
1' [ J Replication of Modified Data
J f Serialization for Sending and Receiving Data
v Q r Serialization Using Message Types
[ _ Define Serialization Groups
[ Maintain Distnbution Model
Define Inbound Processing
l> B Serialized Distribution Using Message Types
^ L Serialization Using Business Objects
B ( Actuate Outbound Business Oblects
B Actwate Inbound Business Objects
Q Check Consistency System-Wide
Figure 6.14 Path to Serialization Settings in ALE Customizing
A c t i v a t i n g
s er i al i z a t i on
2 0 1
6 | Serializing IDocs
To a c t i va t e s er i al i zat i on, t h e ser i a l i z at i on (lag SFLAG is s e t i n t h e s e ndi ng
s ys t e m f o r t h e r e c e i v e r (here: SALES) a n d t h e b u s i n e s s o b j e c t IDOCBOM
MAT, as s h o w n i n Fi gure 6. 15.
Change View "ALE: Object type serialization : Outbound c o nt ro l '
N e w Entries f ; (jJ. c f 0
ALE: Object type serialization Outbound control
Recewpartn ?ec an Ob) Type Se r flag H
S A I F S LS DOCBOHHAT
0 EJ
0
F i g u r e 6 . 1 5 Set t i ngs i n Sendi ng Syst em
The s e t t i ngs m u s t be conf i gur e d i n t h e s a me w a y i n t he r e cei vi ng s ys t em.
I n o u r e xa mpl e , t h e s e n d e r is T90CINT090 (see Fi gure 6. 16) .
Change View "ALE: Obj ect type serialization : I nbound c o n t r o l " :
NewEntr.es
ALE: Object type serialization: Inbound control
Se nd p a n no Pan v Part Ob) Type Ser l a g [ M
T90CLNT090 LS IDOCBONMAT
0 E
F I
F i g u r e 6 . 1 6 Set t i ngs i n Recei vi ng Syst em
Checking the Af t e r y o u ' v e f i n i s h e d c o n f i g u r i n g t h e s e t t i n g s i n b o t h s y s t e ms , y o u
settings c a n p e r f o r m a c o n s i s t e n c y che c k i n Tr a ns act i on BD101. Here, y o u see
w h e t h e r s er i a l i z a t i on us i ng o b j e c t t y p e s is ac t i va t e d. The s t a t u s traffic
l i ght s i n t h e Local St at us a n d Pa r t n e r St at us fi el ds al so i ndi cat e w h e t h e r
Cus t omi z i ng is o k a y a n d c on s i s t e n t . The t raffi c l i ght i n t h e Di f f er ence
fi el d t h e n s h o w s w h e t h e r s o m e IDocs q u e u e - j u mp e d . Thi s is t h e case in
o u r e x a mp l e i n Fi gur e 6. 17. I f all o f t h e I Docs i n b o t h s y s t e ms h a v e bee n
p o s t e d i n t h e c o r r e c t s e q u e n c e , t h e val ues i n t h e C o u n t e r field s h o u l d
al so c o r r e s p o n d her e.
You c a n us e Tr a ns act i on BD1 0 0 t o speci f i cal l y v i e w o n l y t h o s e IDocs
t h a t wi l l b e p r o c e s s e d u s i n g o b j e c t c h a n n e l s er i a l i z at i on. Fi gur e 6 . 1 8
s h o ws t h e t h r e e IDocs t h a t have a l r e a d y b e e n d i s p a t c h e d i n o u r p a r t i c u
l a r e xa mpl e .
202
Serialization Using Business Objects 6 . 3
S e r i a l i z a t i o n U s i n g O b j e c t T y p e s : C o n s i s t e n c y C h e c k
Q & V 7 3 b l O o c s
Outbound and Inbound Serialization in This System
Direction ' Partner P P ODiect Type Local Status P ar tn e r Status C h an n el D i fference Loc C ! Partn Messa ge s
Inbound SALES
O u t b o u n d
LS IOOCBOMMAT
LS IOOCBOMMAT
c c o
c c o
c c o
c c o
6278
c c o
c c o
Fi gu r e 6.17 Check F u n c t i o n f o r O b j e c t Channel Ser i al i zat i on
S e r i a l i z a t i o n U s i n g O b j e c t T y p e s : D i s p l a y S e r i a l i z e d I D o c s
a 9 3 W&3I2*
I D o c s S e r i a l i z e d U s i n g O b j e c t T y p e s :
iDo c n um b e r | O b j e c t Type
7 6 8 7 8 5 1IOOCBOMMAT
7 6 8 7 8 6 I O O C B O M M A T
768787 IOOCBOMMAT
[ C N j C o u n t e r j P Partn no
6 2 7 8 1 1 L S j S A L E S ~
6 2 7 8 2 LS SA1.ES
6 2 7 8 3 LS SALES
[ F | P I Partn n o . R | D S. ; M e s s a g e Type
1lS|T90CLNT090 I |l|o3|BOMMAT
LS T90C1.NT050 1 03 BOMM.AT
LStT90CLNT090 1 03 BOMMAT
F i gu r e 6.18 I Docs w i t h O b j e c t Channel Ser i al i zat i on
I n t h e r e cei vi ng s ys t em, i ndi vi dua l pr oc e s s i ng o f speci f i c I Docs e ns ur e s
t h a t o u r s e c o n d I Doc is p o s t e d first. T h e s ys t e m " not i ce s " t h a t i t s n o t y e t
i t s o w n n u m b e r s t u r n i n t h e r e l e v a n t c h a n n e l , so i t c h a n g e s i t s s t a t u s to
wa i t i n g s t a t us 6 6 ( see Fi gur e 6. 19) . I f t h e f i r st I Doc ar r i ves a n d is s uccess
ful l y pr oc es s ed, i t c a n be r e s c h e d u l e d a n d pr oc e s s e d agai n.
W a i t s t a t u s
f o r I D o c s t h a t
q u e u e - j u m p
Z 0 Sales system (client 810) 9
^ [ IDocs in outbound processing 1
I - Data passed to port OK 03 1
^ | 0 IDoc in inbound processing
I - 0 Application document not posted 51 1
1- 0 iDoc with enors added 56 1
^ A IDoc is waiting for predecessor lOoc (serialization) 66 1
^ l b BOMKAT 1
^ ( B 01 ( 1 5 9 ) : IDoc must be processed later. S. IDoc no & required 1
GD I D o c m u s t b e p r o c e s s e d l a t e r . 0 0 0 0 0 2 . I D o c n o 0 0 0 0 0 3 r e q u i r e d 1
Fi gu r e 6.19 W a i t St at us f o r I D o c T h a t Qu e u e - J u mp e d
On c e agai n, t h e SERIAL field i n t h e IDoc c o n t r o l r e cor d d e t e r mi n e s t he
s e q u e n c e h e r e . Howe ve r , t hi s field d o e s n t c o n t a i n a t i me s t a mp , wh i c h
is us ual l y t h e case, b u t r a t h e r a c o mb i n a t i o n o f t he o b j e c t n a me , obj ect
" Se r i a l " f i e l d i n
c o n t r o l r ecor d
203
6 | Serializing IDocs
c ha n n e l n u m b e r ( o f t h e c h a n n e l u s e d f or t he t r ansf er ) , a n d t h e t r a n s f e r
n u mb e r . Thi s is t h e val ue i n t h e C o u n t e r field, wh i c h y o u c a n al so see
i n t h e I Doc di s p l a y s c r e e n i n Tr a ns act i on BD100. Fi gur e 6 . 2 0 s h o ws t he
cont r ol r e c o r d o f t h e s a mp l e IDoc t h a t q u e u e - j u mp e d a n d ha s t h e c o u n
t e r '' 3. " Th e IDocs w i t h t h e c o u n t e r " I a n d "2" h a v e n ' t a r r i v e d y e t , so
o u r IDoc ha s b e e n a s s i gned s t a t u s 66, wh i c h y o u c a n al so s e e her e.
Display Control Record
lOoc Oisplay
Doc number 70014
Direction 2 4 * Inbound
Status 66 0 2 0 IDoc is waiting for predecessor IDoc (serialization)
T v n i n f n P a r t n e r A r t r o e s i n J n O M a U t
info about I D o c /
SAP Release 700
Output Mode
Serialization [D0CB0HIUT6278000003
Time of c r e a t i o n /
Date 18 08 2008
Time 15 11 22
Last database update /
Date 18 08 2008
Time [ 1 5 : 1 1 : 2 2
F i gu r e 6.20 Co n t r o l Recor d f o r a Ser i al i zed I Doc
Data channel To g e t a n o v e r v i e w o f t h e s t a t u s e s o f t h e s er i al i zed IDocs, y o u can vi ew
registry t ji e ^4 channel registry ( i n o u t b o u n d pr ocessi ng, y o u d o t hi s i n Tr a ns
a c t i o n BD102). Th e r e s ul t is d i s p l a y e d i n Fi gur e 6.2 1 . Thr e e IDocs have
a l r e a d y b e e n sent .
Change View "ALE: Outbound Channel Registry": Overview
y NewEntnes l . O l S B U H
ALE Outbound Channel Registry
ObiectType (Chan |Part ty Receivpartn Recpart Date Time IcounteH
ID0C60HHAT LS SALES 08/18/2008 H 5:11:22 |3
Figure 6. 21 V ie w of Registry in Sending System
2 0 4
Serialization Using qRFC | 6 . 4
You can us e Tr ansact i on BD103 t o vi ew t he s a me pr ocess in t he recei vi ng
s ys t e m a n d s e e t ha t , so far, j u s t o n e IDoc ha s ar r i ved (see Fi gur e 6. 22) .
I t ' s e xa ct l y t h i s s i t u a t i o n t h a t p r o d u c e s t h i s s t a n d b y p o s i t i o n i n IDoc
pr oc es s i ng, i n o t h e r wo r d s , d i f f e r e n t val ues i n t h e C o u n t e r field i n t he
r e cei vi ng a n d s e n d i n g s ys t ems .
Change View "ALE: Inbound Channel Registry": Overview
f f i l N e w Entries HI MM
ALE: inbound Channel Registry
0b,edType jChann Part ty Send part no. Send Pa (Date Time Counter]
ID0CB0HHAI [6278 LS T90CLNTO9O 18.08 2008 14:50:46 1
Fi gu r e 6.22 V i e w o f Regi st r y i n Recei vi ng Syst em
6.4 Serialization Using qRFC
Ser i al i zat i on u s i n g qRFC (Queued RFC), in wh i c h t h e s e q u e n c e o f t h e
IDocs is al so r e t a i n e d , ha s o n l y b e e n ava i l a bl e s i n c e SAP Ne t We a v e r
6. 40. I n s t e a d o f t h e f unc t i on m o d u l e ID0C_INB0UND_ASYNCHR0N0US, t he
f unc t i on mo d u l e ID0C_INB0UND_IN_QUEUE is cal l ed i n t h e t a r ge t s ys t em.
Thi s t y p e o f ser i a l i z at i on is pos s i bl e f o r all IDocs. I n SAP Ne t We a v e r PI,
it ca n al so b e u s e d t o i m p l e m e n t t h e Quality o f Service EOI O (Equally Once
In Order) i n t h e IDoc ada pt e r .
You conf i gur e ser i a l i z at i on u s i n g qRFC in t h e o u t b o u n d p a r t n e r profil e
by s e t t i n g t h e Q u e u e Pr oce s si ng flag o n t h e O u t b o u n d O p t i o n s t ab page
( see Fi gur e 6. 23) . Thi s o p e n s a n e w fi el d i n wh i c h y o u speci f y h o w y o u
w a n t t he q u e u e n a m e t o b e c r e a t e d u s i n g r ul es t h a t r e f e r e n c e a f unct i on
mo d u l e . Fi gur e 6 . 2 3 s h o ws t h r e e o f t h e r ul e s d e l i ve r e d by SAP ( b o t t o m
ri ght ). The r ul e I DOC_QUEUE_SUS_MM r e q u i r e s t h e us e o f an IDoc o f t he
t y p e ORDERS o r ORDRSP.
The f u n c t i o n mo d u l e s f o r c r e a t i ng q u e u e n a me s can b e a s s i g n e d a rul e
n a me i n Tr a ns act i on WE85. Fi gur e 6 . 2 4 s h o ws t hi s a s s i g n me n t f o r t he
t h r e e r ul es s h o w n i n Fi gur e 6. 23: CONSTANT:EDIQUEUE, FIRST_16_0F_MES-
TYP, a n d IDOC_QUEUE_SUS_MM.
Se r i a l i z a t i o n u s i n g
qRFC
Rul es f o r q u e u e
names
205
6 | Serializing IDocs
Q u e u e m o n i t o r
Partner NO.___________ SALES Sales system (diem 810)
PartnType _[18] Logical system
Partner Role
g Message Type "ATMS Matenal master
Message code
Message fijnction Test
Partner profiles: Outbound parameters
Wi
Message Control Postprocessing Permitted Agent Tele
Receiver port
Pack Size
0 Queue Processing
r
Transacftonai RFC LS Sales
Rule Name F . L & U . 6 J ! 0 L S I V P
Output Mode
Transfer IDoc Immed.
C Collect IDocs
O r Rule Name ( 4) 3 Entries found
IDoc Type /
nnOC3EIEEEl|lH
HATHAS03 Basic tfpe
Extension
view
0 C a n c e l P r o c e s s i n g A f t e r S y n t a x E r r o r
Rule
[CONSTANT EDIOUEUE
FIRST_16_OF_MESTVP
IOOC_OUEUE_SUS_MM
F i gu r e 6.23 Par t ner Pr of i l e w i t h Q u e u e Pr ocessi ng
Change View "IDoc: Rules f or Creating Queue Names f or qRFC IDoc":
New Entries J l Q Q r fy H j l Q
IDoc Rules for Creating Queue Names for qRFC lOoc
_ Rule Name_________________________[Function Module______________________ ( 3
M T f t l M g E j ]lDOC_QUEUE_CONST_EDI QUEUE B |
: IRST_16_0F_HESTYP !00C_0UEUE_NAHE_HESTYP B
I DOC_QUEUE_SUS_HH !00C_QUEUE_SUSJ1H
F i gu r e 6.24 Ge n er a t i n g Q u e u e Names
I f y o u ' r e wo r k i n g wi t h y o u r o w n f u n c t i o n mo d u l e s , t h e s e r e q u i r e a s u i t
abl e m o d u l e s i g n a t u r e (see Fi gure 6. 25) .
Fi gure 6 . 2 6 s h o ws o u r e x a mp l e (at t h e ver y b ot t om) : The q u e u e ha s b e e n
gi ven a fi xed n a me (SAP_ALE_ED I QUEUE), t h e RFC d e s t i n a t i o n a d d r e s s e d
b y t hi s q u e u e is cal l ed SALES, a n d t h e t r a ns a c t i on t h a t y o u can us e t o
m o n i t o r t h e o u t b o u n d q u e u e is cal l ed WEOUTQUEUE.
2 0 6
Serialization Using qRFC | 6 . 4
FUNCTION IDQC_QUEUE_NAHE_HESTYP
l o k a l e S c h n i t t s t e l l e :
IMPORTING
REFERENCE(CONTROL) LIKE EDIDC STRUCTURE EOIOC
EXPORTING
VALUE(NAME) TYPE CHARI6
TABLES
DATA STRUCTURE EDID4
F i gu r e 6.25 Si gnat ur e o f a Fu n c t i o n M o d u l e f o r Cr eat i ng Queues
qRFC M onit or (Outbound Queue)
Number o f LUW Entries
Queue I n f o r a a t i o n e n
Nunber o f E n t r i e s D i s p l a y e d
Nunber o f Queues D i s p l a y e d
441
1 0
1
800 FB4CLNT800 496
a m
800 R3AD LEDELIV
DTZ_800
DTZ_800
1
794
=
8UU
800
R3AD HATERIAZSM00
R3AD HATERIAZSM101
t 3 6 t d c 0 0 T36 50
t 3 6 t d c 0 0 T36 50
1
1
800 R 3 A D M A T E R 1 A Z S N 1 0 2 t 3 6 t d c 0 0 _ T 3 6 _ 5 0 1

800
800
800
800
R3AD.SALESD01001
R3AD_SALESD01002
R3AD_SALESD01033
R3AD SALESD01174
DTZ_800
DTZ_800
DTZ_800
DTZ 800
2 4
2 4
48
48
800 R3AD SALESD01175 DTZ 800 48
800 R3AD_SALESD01300 DTZ_800 2 4
8UU R3AD SALESD01460 DTZ 800 24
800 SAP_ALE_EDIQUEUE SALES 3
F i gu r e 6.26 O u t b o u n d SALES Qu e ue
So, i f y o u h a v e c r e a t e d t h e q u e u e , a n d , f or e x a mp l e , an IDoc i n t he
r e c e i vi ng s y s t e m n o w e n c o u n t e r s a n e r r or , s u b s e q u e n t I Docs c a n no
l o n g e r be p o s t e d a n d each o b t a i n s t a t u s 75: IDoc is in inbound queue (see
Fi gur e 6. 27).
^ [ 2 'Doc in inbound processing 11
! O Application document not posted 51 2
1' O IDoc with errors added 56 1
I 1 > IDoc is waiting (or predecessor lOoc (serialization) 66 1
I 1 Application document posted 53 6
^ A IDoc is in inbound queue 75 1
^ MATMAS 1
CD E A (0 75) : IDoc received via qRFC 1
Figure 6. 27 IDocs in Target System
S t o p p e d q u e u e i n
s t a t u s m o n i t o r
207
6 | Serializing IDocs
Er r or h a n d l i n g i n
an i n b o u n d queue
The e r r o r s c e na r i o is al so s h o w n i n t h e i n b o u n d q u e u e , wh i c h is m o n i
t o r e d us i ng Tr ansact i on WEI NBQUEUE (see Fi gure 6. 28) .
IDoc Inbound Queue
(Description inbound IDoc Queue Display
7
U IDoc Inbound Queue
^ CD T90CLNT090
^ SAP_ALE_MATMAS
v
f e e . 0 0 0 0 0 0 0 0 0 0 0 7 0 0 1 8 1MATMAS
Status 51 Messages have bee n issued
f a 0 0 0 0 0 0 0 0 0 0 0 7 0 0 1 9 1MATMAS
f a 0 0 0 0 0 0 0 0 0 0 0 7 0 0 2 0 1MATMAS
f a 000 0 0 0 0 0 0 0 0 7 0 0 2 1 | MATMAS
Sender
Queue
IDoc No. IMessage Type
Current Status with Current Message
IDoc No. IMessage Type
IDoc No. IMessage Type
IDoc No. IMessage Type
F i gu r e 6.28 Di s p l a y i n g I Docs i n a Qu e ue
You can p os t pr oc e s s t h e I Doc h e r e , i deal l y i n s u c h a wa y t h a t i t c a n be
p o s t e d successful l y. Howe ver , y o u ca n al so us e t h e " t r as hcan" i con t o flag
t h e IDoc bl ocki ng t h e q u e u e f o r d e l e t i o n ( st at us 68) (see Fi gur e 6. 29).
IDoc Inbound Queue
a : fa B O
inbound IDoc Queue Display
~ CH IDoc Inbound Queue
| Description
S1atus:51 Messages have bee n issued
(Q 000 0 0 0 0 0 0 0 0 7 0 0 1 9 | MATMAS
f a 000 0 0 0 0 0 0 0 0 7 0 0 2 0 | MATMAS
f a 000 000000 007002 1 I MATMAS
Sender
Queue_______________________________
IDoc No. IMessage Type
Current Status with Current Message
IDoc No. IMessage Type
IDoc No. IMessage Type
IDoc No. IMessage Type
0 Do you want to give IDoc '00 000000 000700 18' an
error status?
Yes No
J J L
Cancel
Figure 6.29 Deleting IDocs from a Queue
2 0 8
Summary | 6.5
Af t e r y o u v e p r o c e s s e d o r r e mo v e d t h e I Doc t h a t c o n t a i n s e r r o r s (see
Fi gur e 6. 30) , y o u c a n r e s t a r t t h e q u e u e . All o t h e r IDocs ar e n o w pos t e d
(Fi gure 6. 31).
IDoc I nbound Queue
t n - fa O 3
Inbound IDoc Queue Display Oescnption
^ U IDoc Inbound Queue
^ (_J T90CLNT090 Sender
^7
U SAP_AJ_E_MATMAS Queue
^ <Q 0 00 000000 007001 9 I MATMAS IDoc No. IMessage Type
G Status 75 IDoc recewedvia qRFC Current Status with Current Message
f e 00 0 0 0 0 0 0 0 0 0 7 0 0 2 0 | MATMAS
3 0000000000070021 | MATMAS
IDoc No. IMessage Type
IDoc No IMessage Type
S INFORMATION 0 /
D I DO C 00 6 6 0 0 0 6 0 0 0 7 0 0 1 8 WAS CHANGED TO STATUS W AND
DELETED FROM INBOUND QUEUE SAP.ALS.MATMAS
Continue ^
Fi gu r e 6.30 Resul t o f De l e t e O p e r a t i o n
^ [ ] IDoc in inbound processing 11
I 9 Application document not posted 51 1
P 9 IDoc vwth errors added 56 1
P & IDoc is waiting for predecessor IDoc (serialization) 66 1
P Application document posted 53 6
P E r r o r - n o further processing 68 2
Fi gu r e 6.31 Resul t A f t e r Res t ar t i ng a Qu e ue
6.5 Summary
In t hi s cha pt e r , y o u ' v e s e e n all poss i bi l i t i es f o r ser i al i zat i on o f IDocs, a n d
l e a r n e d a b o u t t h e pl aces t o f i nd wh i c h ser i a l i z at i on t y p e is i mp l e me n t e d
f o r y o u r IDoc. The d i f f e r e n t t y p e s o f ser i a l i z at i on ma y l ead t o a ddi t i ona l
w o r k i f t h e y a r e o u t o f sync, s o ma k e s u r e y o u o n l y u s e ser i a l i z at i on
w h e r e it is r eal l y n e e d e d f o r y o u r pr ocess.
Re s t a r t i n g a queue
2 0 9
This chapter deals w i t h a d m i n i s t ra t i v e issues, specifically, IDoc-
related i n f o r m a t io n t h a t is w r it t e n to t h e dat a b a se a n d regular
background j o b s.
7 Administration
Thi s c h a p t c r gi ves y o u a n o v e r v i e w o f t h e a d m i n i s t r a t i o n o p t i o n s f or
IDocs. On e o p t i o n d i s c u s s e d i n t h i s c h a p t e r is h o w t o l i nk IDocs t o d i s
pl ay o r s ea r ch f or i n f o r ma t i o n . A n o t h e r is t o i nc r e a s e t h e p e r f o r ma n c e
o f y o u r s y s t e m by s c h e d u l i n g r e g u l a r r e p o r t s t h a t y o u wo u l d o t h e r wi s e
h a v e t o r u n ma n u a l l y . Thi s c h a p t e r a l s o s u mma r i z e s I Doc f u n c t i o n a l
i t ies a n d t h e as s oc i a t e d t r a ns a c t i on codes, a n d e xpl a i ns h o w IDocs are
a r c h i v e d a n d t h e i r s t a t us c onve r t e d.
7.1 IDoc Links
The r e ar e t wo t ypes o f l i nks: l i nks b e t we e n IDocs a n d t h e act ual bus i nes s
o b j e c t s w h e n a bus i ne s s o b j e c t t y p e is a s s i gned; a n d l i nks b e t we e n t he
s e n d e r ' s I Doc a n d t h e r e c i p i e n t ' s IDoc. The l a t t e r t y p e o f l i nk is k n o wn
o n l y t o t h e r eci pi ent .
I Doc l i nks have t h e i r o w n d a t a b a s e t a bl e cal l ed IDOCREL ( s e e Tabl e 7. 1).
The t abl e c ont a i ns b o t h d a t a i t ems t h a t ar e r e l a t ed t o each o t he r ; t h e y are
i de nt i f i e d b y t h e i r i n t e r n a l n u mb e r .
The SRRELROLES t abl e c o n t a i n s t h e obj ect s t h a t ar e as s oc i a t e d wi t h t hese
i n t e r n a l n u m b e r s . T h e r e a r c s eve r al d i f f e r e n t l i nk t y p e s i n t hi s t abl e.
Tabl e 7 . 2 s h o ws t h e e n t r y t y p e s t h a t ar e r e l e v a n t t o IDocs.
" SRRELROLES"
t a b l e
21 1
7 | Administration
L i n k T y p e R O L E A R O L E B
I DCO O U T B E L E G O U T I D O C
I DC1 I N I D O C I N B E L E G
I D C 4 I N I D O C O U T I D O C
I D C 8 I N I D O C I N T I D
I D C 9 O U T I D O C I N B E L E G
I D C A O U T I D O C O U T I D
I DCB I N I D O C O U T B E L E G
Tabl e 7.1 I Do c - Re l a t e d Ent r i es i n t h e " I DOCREL" Dat abas e Tabl e
A b b r e v i a t i o n i n t h e
R O L E T Y P E F i e l d
D e s c r i p t i o n
I NBE L EG R e c i p i e n t d o c u m e n t
I N I D O C R e c i p i e n t I D o c
I N T I D T r a n s a c t i o n I D t h a t c a m e w i t h t h e I D o c
O U T B E L E G S e n d e r d o c u m e n t
O U T I D S e n d e r t r a n s a c t i o n I D
O U T I D O C S e n d e r I D o c
Tabl e 7.2 Ent r i es i n t h e " SRRELROLES Tabl e
For an e xa mpl e , l et ' s l ook a t an IDoc a n d a mat er i al ma s t e r i n t hi s t abl e
(see Fi gur e 7. 1). Th e O B J K E Y i n each case is t h e u n i q u e o b j e c t key, f or
e xa mpl e , t h e ma t e r i a l n u m b e r o r t h e IDoc n u m b e r . Fo r d o c u me n t s ,
t h e O B J T Y P E is a l wa y s t h e a s s o c i a t e d b u s i n e s s o b j e c t t ype; f o r IDocs,
on t h e o t h e r h a n d , i t ' s a l wa ys "IDOC"; a n d f o r t r a n s a c t i o n IDs, i t s
"TRANSID".
I f a n I Doc is c r e a t e d f o r t h i s mat er i a l , t h e r e wi l l a l s o be an e n t r y f or t hi s
i n t h e S R R E L R O L E S t abl e ( s e e Fi gur e 7. 2) . In b o t h obj e c t s , t h e u n i q u e
n u m b e r t h a t is r e f e r r e d t o i n t h e Tabl e I D O C R E L is i n c l u d e d a t t he field
R O L E I D .
212
IDoc Links | 7-1
Table SRRELROLES Display
Check Table
CLIENT 800
OBJKEY SH-100
08JTYPE BUS1001 006
LOOSYS
ROLETYPE 0UTBELEG
ROLEID tWol1lYSNV6jmm0Qlqscc0
UTCTIME 2 0 . 0 9 0 . 309.1GO 659
Figure 7.1 Exampl e o f a Ma t e r i a l
Table SRRELROLES Display
Check Table
CUENT 800
OBJKEY 000 000000 076376 5
OBJTVPE IDOC
LOGSYS
ROLETYPE OUT I DOC
ROLEID NVrVtKRvHF 6jmmOQIqsccO
UTCTIME 2 0 0 9 0 . 3 1 0 . 1 0 4 . 0 2 6
Figure 7.2 Ex ampl e o f t h e I Do c t o Be I n c l u d e d i n a Li nk
O u r e x a mp l e obj e c t s , IDoc 763755 a n d ma t e r i a l SH-100, h a v e t h e link
t y p e IDCO b e c a u s e w e ' r e o n t h e o u t b o u n d s i de o f t h e l i nk. Fi gur e 7. 3
s h o ws t h e r e l e v a n t t a bl e e n t r y i n Tr a ns act i on SE11.
Table IDOCREL Display
Check Table .
C UENT 800
ROLE A IWoMIYSNVSjmmOQlQSCcO
ROLE S IWrVtKRvHF6]mmOOlQSCcO
RELATION IWrVIKRvHVSjmmOQIqsccO
BRELTYP
UTCTIME
IDCO
20 0 9 0 310 1 0 4 . 0 2 6
Figure 7 3 Entry in Database Table "IDOCREL"
O u t b o u n d ma t e r i a l
213
7 | Administration
All o t h e r l i nks a r e ma n a g e d i n a s i mi l a r way. The y c a n be v i e we d fr om
w i t h i n IDoc m o n i t o r i n g i n Tr ansact i on BD87 o r i n t h e i ndi vi dua l IDoc
di s pl ay by me a n s o f t h e o b j e c t ser vi ces.
Object key The l i nk t o t h e o b j e c t t y p e c a n al so be u s e d t o di s pl ay t h e key val ues o f
t h e I Doc c o n t e n t s . To d o this, us e t he Obj e c t Key f u n c t i o n i n Tr ansact i on
BD87 (see Fi gur e 7. 4).
Status Monitor f or ALE Messages
| & Display iPocTl|<a Display relaPonshlpsl | @ Display status long lex! | | 0D|ec key |
F i gu r e 7.4 Object Key in Transaction BD87
The o t h e r l i nks can be di s pl ayed f r om w i t h i n t h e i ndi vi dua l di spl ay. You
can al so v i e w a r e l a t e d o b j e c t i n t h e i ndi vi dua l di s pl ay by s i mp l y d o u b l e
cl i cki ng i t . I f y o u ' v e e d i t e d a n IDoc, y o u ' l l al so s e e t h e l i nk t o t he or i gi nal
IDoc her e. Thi s or i gi nal o b j e c t is r e t a i n e d f or t h e s a k e o f c o mp l e t e n e s s .
Fi gur e 7 . 5 s h o w s t h e r e c i p i e n t s y s t e m ( be caus e t hi s s ys t e m c o n t a i n s a
h i g h e r n u m b e r o f links).
Deactivate link Al s o Bus i ne s s o b j e c t s t h a t a r e p a r t o f l i nks c a n be d i s p l a y e d d i r e c t l y
f r om h e r e . You can access t hi s f u n c t i o n vi a t h e o b j e c t ser vi ces, as bef or e
(t op a r r o w i n Fi gur e 7. 5). To get t o t h e act ual l i nks f o r t h e IDoc, us e t he
IDoc l i nks i con ( l o we r a r r o w i n Fi gur e 7. 5). I f y o u d o n ' t w a n t t o h a v e all
l i nks w r i t t e n t o t h e d a t a b a s e Tr a ns act i on WENOLINKS is u s e d t o speci f y
wh i c h l i nks ar c w r i t t e n f o r wh i c h me s s a ge t ype. The l o we r p a r t o f Figure
7 . 6 s h o w s a dea ct i va t e d l i nk f o r MATMAS.
2 1 4
IDoc Links | 7.1
SAP
IDoc display
^ <3 IDoc 0000000000070
Q Control Rec.
l> CDData records
I1 CDStatus records
Total number 000003
| [ g - IDoc IDoc 0000000000070027 message frpe B E l /
' i a | < R3[Er3|HB0l3fI3[^0[II
I E * Service: Relationships
Technical short info
Direction
Current status
Basic type
Ertension
Message type
Partner No
Partn Type
Port
2 inbox
53 CCO
HATHAS03
MATHAS
T90CLNT090
IS
SAPJ00
a.
^ O ver vi ew
BDemiview
C3^IE3|1HEE3E30|IHE1I^0
to IDoc: 0000000000070027 message tfpe MATMAS
Oocument Type
lor inbound IDoc Standard material
Application Objectfor Outbound IDoc Standard matenal
Outbound IDoc IDoc
Description
test
ZSM11
0000000000768839
| Date *|Time J
08/19/2009 15 52:36
1552:34
Fi gu r e 7.5 Li nks i n Re c i p i e n t Syst em
Deactivate Writing of IDoc Links (Selectively)

"[Description Unk Types


^ a IDoc Unk Types
" CD Non-Excluded Link Types
CD IDC0
OlOC1
CD IOC2
H J C C 3
CD IOC4
CD IDC7
CD IDC9
C D Excluded u n k Types
CD Excluded for ai i Message Types
^ CD Excluded for Specified Message Types
^ C D IDCB
MATMA8
Outbound Doc. Unked with Outbound IDoc
Inbound IDoc Linked with inbound Document
inbound IDoc Linked with Communication IDoc
Inbound IDoc Unked with Onginal Document Alter Edit
Inbound IDoc Unked with Outbound IDoc in Source System
Outbound IDoc Unked with Original Document Arter Edit
Outbound IDoc Unked with Inbound Doc. in Target System
inbound IDoc Linked with Outbound Doc. in Source System
Material master
Fi gu r e 7.6 De a c t i v a t i n g Li nks
Re por t RSRLDREL is u s e d t o d e l e t e wr i t t e n l i nks f r o m t h e syst em.
2 1 5
7 | Administration
I m p o r t a n t r e p o r t s
7.2 Regular Jobs
Du r i n g t h e p r o c c s s o f s e t t i n g u p a n d t e s t i ng IDoc l i nks, ma n y t hi ngs
ar c d o n e ma n u a l l y t h a t ar e p r o c e s s e d by m e a n s o f r e gul a r j o b s i n t he
p r o d u c t i o n s y s t e m. Li kewi se, in t est s ys t ems , t h e p r o c e s s i n g m o d e f or
s e n d i n g a n d pr oc e s s i ng I Docs is o f t e n s e t t o Proccss I mme d i a t e l y in t he
p a r t n e r prof i l es. Fo r p e r f o r ma n c e r e as ons , t hi s i s n ' t r e c o m m e n d e d in
p r o d u c t i o n s y s t e ms a n d is l i s t e d by SAP as i nc or r e c t i n go- l i ve checks.
Tabl e 7. 3 li sts s o m e i m p o r t a n t r e p o r t s a n d t h e i r f u n c t i o n s . Mo s t o f t hese
r e p o r t s c a n b e r egul ar l y s c he dul e d.
R e p o r t N a m e R e p o r t F u n c t i o n j
I D X _ D E L E T E _ I D O C T Y P _
W I T H O U T J S
D e l e t e I D o c t y p e f r o m S A P N e t W e a v e r PI
e x c e p t i o n s t a b l e
( o n l y a v a i l a b l e i n SAP N e t W e a v e r PI )
I D X _ S E L E C T _ I D O C T Y P _
W I T H O U T J S
C o p y I D o c t y p e t o SAP N e t W e a v e r PI
e x c e p t i o n s t a b l e
( o n l y a v a i l a b l e i n SAP N e t W e a v e r PI )
R B D A G A I 2 Po s t I D o c s a f t e r AL E e r r o r
R B D A G A I N S e n d I D o c s a f t e r a n A L E e r r o r
R B D A P P 0 1 I D o c p a s s e d t o a p p l i c a t i o n
R B D A U D 0 1 AL E a u d i t : s t a t i s t i c a l a n a l y s e s
R B D A U D 0 2 R e o r g a n i z i n g t h e a u d i t d a t a b a s e
RBDCPCL R D e l e t e c h a n g e p o i n t e r s
R B D M A N I N R e p o s t i n g o f I D o c s ( AL E)
R B D M I D O C C r e a t e I D o c s f r o m c h a n g e p o i n t e r s
R B D M O I N D C o n v e r t I D o c s t a t u s
RBDSER01 C r e a t e I D o c s o f a s e r i a l i z a t i o n g r o u p f r o m
c h a n g e p o i n t e r s
RBDSER0 2 D i s p a t c h I D o c s o f a s e r i a l i z a t i o n g r o u p
RBDSER0 3 C h e c k t h e s e n d s t a t u s o f t h e I D o c s o f a
s e r i a l i z a t i o n g r o u p
T abl e 7.3 Pr ogr ams f o r Regul ar Schedul i ng
2 1 6
Transaction Code Overview 7 . 3
Report Name Report Function
RBD SER0 4 I n b o u n d p r o c e s s i n g o f I D o c s o f a s e r i a l i z a t i o n
g r o u p
RBDSRCLR D e l e t e s e r i a l i z a t i o n d a t a
RBDSTATE A L E a u d i t : s e n d i n g t h e c o n f i r m a t i o n s
RSARFCEX R e s t a r t f r o z e n " t RFCs
RSEOUOO S e n d I D o c s i n s t a t u s 3 0
RSRLDREL D e l e t e I D o c l i n k s
S A P L B D R C AL E : d e t e r m i n e r e c o v e r y o b j e c t s
Tabl e 7.3 Pr ogr ams f o r Regul ar Schedul i ng ( Co nt . )
7.3 T r a n s a c t i o n C o d e O v e r v ie w
Tabl e 7 . 4 c o n t a i n s t h e t r a n s a c t i o n c o d e s f o r all o f t h e f unc t i o n a l i t i e s
u s e d in t hi s b ook. M e n u i n f o r ma t i o n ha s b e e n d e l i be r a t e l y o mi t t e d f r om
t hi s li st, w h e r e pos s i bl e , as t h e SAP me n u s s o me t i me s c h a n g e f r om o n e
r e l e as e t o t h e n e x t . T h e t e x t al so ma k e s di r e c t r e f e r e nc e t o t h e t r a n s a c
t i on, w h e r e possi bl e.
Tabl e 7 . 4 c o n t a i n s t h e ge ne r a l t r a ns a c t i on codes, wh i l e Tabl e 7. 5 cont ai ns
t h e t r a ns a c t i on code s t ha t , wh i l e r e l a t e d t o IDocs, r e f er di r ec t l y t o t he
obj ect s o f a speci f i c mo d u l e a n d a r e n ' t f or g e n e r a l use.
Transaction Code Function j
B D 2 0 I D o c p a s s e d t o a p p l i c a t i o n
BD2 1 S e l e c t c h a n g e p o i n t e r
B D 2 2 D e l e t e c h a n g e p o i n t e r
B D 2 3 D e l e t e s e r i a l i z a t i o n d a t a
B D 4 0 Re a d c h a n g e p o i n t e r f o r g r o u p
BD4 1 D i s p a t c h I D o c s f o r g r o u p
B D 4 2 C h e c k I D o c s f o r g r o u p
B D 4 3 P o s t I D o c s f o r g r o u p
Table 7-4 Main General Transaction Codes
Gener al t r a n s a c t i o n
c o d e s
217
7 | Administration
Transaction Code I Funct i on I
B D 4 4 A s s i g n m e s s a g e t y p e t o s e r i a l i z a t i o n g r o u p
B D 4 7 D e p e n d e n c i e s b e t w e e n m e t h o d s
B D 4 8 D e p e n d e n c y m e t h o d - me s s a g e
B D 5 0 A c t i v a t e c h a n g e p a r a m e t e r s f o r m e s s a g e t y p e
B D5 1 M a i n t a i n f u n c t i o n m o d u l e s ( i n b o u n d )
B D 5 2 A c t i v a t e c h a n g e p o i n t e r p e r c h a n g e d o c u m e n t i t e m
B D 5 3 R e d u c e m e s s a g e t y p e s
B D 5 4 M a i n t a i n l o g i c a l s y s t e m s
B D 5 5 A s s i g n r u l e t o m e s s a g e t y p e
B D 5 6 F i l t e r I D o c s e g m e n t s
B D 5 7 M a i n t a i n l i n k a n d s e r i a l i z a t i o n t y p e
B D 5 8 C o n v e r t o r g a n i z a t i o n a l u n i t s
B D 5 9 M a i n t a i n f i l t e r o b j e c t s
B D 6 0 M a i n t a i n f u n c t i o n m o d u l e f o r a n a l y s i s
B D6 1 A c t i v a t e c h a n g e p o i n t e r s g e n e r a l l y
B D 6 2 C r e a t e r u l e
B D 6 3 T r a n s p o r t A L E t a b l e o f m e s s a g e t y p e
B D 6 4 M a i n t a i n d i s t r i b u t i o n m o d e l
B D 6 5 D e f i n e m a n d a t o r y f i e l d s
B D 66 A s s i g n I D o c f i e l d t o c h a n g e d o c u m e n t
B D 6 7 M a i n t a i n m e t h o d s ( i n b o u n d )
B D 68 A s s i g n cl asses t o r e c i p i e n t l o g i c a l s y s t e m
B D 6 9 A s s i g n m e n t o f m e s s a g e t y p e t o I D o c
B D 7 9 A L E I D o c s e g m e n t s : c o n v e r s i o n r u l e s
B D8 1 F i l t e r o b j e c t s : p a r a m e t e r f i l t e r i n g
B D 8 2 G e n e r a t e p a r t n e r p r o f i l e s
B D 8 3 Se n d I D o c s a f t e r a n A L E e r r o r
B D 8 4 P o s t I D o c s a f t e r A L E e r r o r
B D 8 5 R u l e s f o r c r e a t i n g q u e u e n a m e s f o r q R F C I D o c s
Table 7.4 Main General Transaction Codes (Cont.)
2 1 8
Transaction Code Overview 7 . 3
T r a n s a c t i o n C o d e I F u n c t i o n I
B D 8 7 S t a t u s m o n i t o r
B D 9 5 C h a n g e A L E o b j e c t t y p e , a s s i g n f i l t e r o b j e c t s s e g m e n t
( I D o c ) a n d s e r i a l i z a t i o n o b j e c t s
B D 9 6 F i l t e r o b j e c t s : r e c i p i e n t d e t e r m i n a t i o n ( B A P I )
B D 9 7 D e t e r m i n e RFC d e s t i n a t i o n s f o r m e t h o d cal l s
B D 9 9 M e s s a g e t y p e d e p e n d e n c i e s
B D 1 0 0 I D o c d i s p l a y o b j e c t c h a n n e l v i e w
B D 1 0 1 C o n s i s t e n c y c h e c k
B D 1 0 2 O u t b o u n d r e g i s t r y
B D 1 0 3 I n b o u n d r e g i s t r y
B D 1 0 4 A s s i g n I D o c s t o b u s i n e s s o b j e c t
B D 1 0 5 M a i n t a i n s u p p o r t e d b u s i n e s s o b j e c t s
B D A 4 A s s i g n m e s s a g e t y p e t o o b j e c t t y p e
B D B G G e n e r a t e AL E i n t e r f a c e
BDCCC AL E Basi s C u s t o m i z i n g d a t a : c h e c k c e n t e r
B D C C V M a i n t a i n i t e m s t o b e c h e c k e d
B D L S M C o n v e r t A L E Basi s C u s t o m i z i n g d a t a : c o n v e r s i o n
m a t r i x
BDLSS C o n v e r t l o g i c a l s y s t e m n a m e s a f t e r c l i e n t i s c o p i e d
( n o t i n p r o d u c t i o n s y s t e ms )
BDLST C o n v e r t A L E Basi s C u s t o m i z i n g d a t a : e x e c u t i o n ( n o t e :
s t a r t s i m m e d i a t e l y w i t h o u t w a r n i n g )
B D M 2 M o n i t o r i n g : r e c i p i e n t I D o c s ( I D o c t r a c k i n g )
B D M 5 T e c h n i c a l c o n s i s t e n c y c h e c k
B D M 7 AL E a u d i t : s t a t i s t i c a l a n a l y s e s
B D M 8 A L E a u d i t : s e n d i n g t h e c o n f i r m a t i o n s
B D M 9 R e o r g a n i z e t h e a u d i t d a t a b a s e
B D M O A L E C C M S g r o u p a d m i n i s t r a t i o n
B D M O N I C M a i n t a i n A L E C C M S m o n i t o r i n g o b j e c t s ( d e f i n i t i o n )
B D M O N I C 2 M a i n t a i n A L E C C M S m o n i t o r i n g o b j e c t s ( g r o u p
d e f i n i t i o n )
Table 7.4 Main General Transaction Codes (Cont.)
2 1 9
7 | Administration
Transaction Code I Funct i on I
B D M O N I C 3 A L E C C M S m o n i t o r b r a n c h
BDR1 D i s p l a y a p p l i c a t i o n l o g f o r r e c o v e r y
B DR 2 R e o r g a n i z e r e c o v e r y d a t a
BDRC A L E : d e t e r m i n e r e c o v e r y o b j e c t s
B DR L A L E : p r o c e s s r e c o v e r y o b j e c t s
BDTP Bu s i n e s s p r o c e s s - m a i n t a i n t e m p l a t e s
BF01 L i b r a r y o f " p u b l i s h a n d s u b s c r i b e b u s i n e s s
t r a n s a c t i o n e v e n t s
BF05 L i b r a r y o f p r o c e s s b u s i n e s s t r a n s a c t i o n e v e n t s
C M O D P r o j e c t m a n a g e m e n t o f SAP e x t e n s i o n s
FI BF SAP Bu s i n e s s F r a m e w o r k : b u s i n e s s t r a n s a c t i o n e v e n t s
O B 7 2 C r e a t e g l o b a l c o m p a n y c o d e
O Y E A G l o b a l p a r a m e t e r s f o r I D o c i n t e r f a c e
P F T C C H G M o d i f y w o r k f l o w t a s k
P F T C . C O P C o p y w o r k f l o w t a s k
P F T C . D E L D e l e t e w o r k f l o w t a s k
P F T C . D I S D i s p l a y w o r k f l o w t a s k
P F T C J N S C r e a t e w o r k f l o w t a s k
SALE A L E C u s t o m i z i n g
S A R A A r c h i v e a d m i n i s t r a t i o n
SARI A r c h i v e i n f o r m a t i o n s y s t e m : c e n t r a l a d m i n i s t r a t i o n
SARJ A r c h i v e r e t r i e v a l c o n f i g u r a t o r
SE11 A B A P D i c t i o n a r y : i n i t i a l s c r e e n
SE18 B A d l B u i l d e r : d e f i n i t i o n m a i n t e n a n c e i n i t i a l s c r e e n
SE19 B A d l B u i l d e r : i m p l e m e n t a t i o n m a i n t e n a n c e i n i t i a l
s c r e e n
SE38 A B A P E d i t o r : i n i t i a l s c r e e n
SE8 0 O b j e c t N a v i g a t o r
SE84 R e p o s i t o r y i n f o s y s t e m
S M O D SAP E n h a n c e m e n t M a n a g e m e n t
Table 7-4 Main General Transaction Codes (Cont.)
220
Transaction Code Overview 7 . 3
Transact i on Code I Funct i on j
WE02 Display IDocs
WE05 IDoc lists
WE06 Active IDoc monitoring
WE07 IDoc statistics
WE08 Status of file interface
WE09 Search for IDoc based on business cont ent
WE10 Search for IDoc in dat abase release 4. 6C and earlier
releases
WE11 Delete IDocs (note: use only after obtaining
agreement)
WE12 Receipt of modified out bound file
WE14 Out bound processing from IDoc
WE15 Out bound processing from MC
WE16 Original inbound file
WE17 Process status file
WE18 Create status file
WE19 Test tool
WE20 Partner profiles
WE21 Ports for IDoc processing
WE23 Verification of IDoc processing
WE24 Default values for out bound parameters
WE27 Default values for i nbound parameters
WE30 IDoc types
WE31 IDoc segments
WE32 IDoc views
WE34 Objects for display of XML IDocs
WE40 Settings for errors and status processing
WE41 Process codes, out bound
WE42 Process codes, inbound
WE46 Error and status processing (like WE40)
Table 7.4 Main General Transaction Codes (Cont.)
221
7 | Administration
Application-
specific transaction
codes
Transaction Code I Funct i on I
WE47 Maintain status values
WE54 Function modul es for changing file names
WE55 Create file names
WE57 Assign message for application object
WE58 Status of process codes: texts
WE59 Status of process codes: modify
WE60 Documentat ion for IDoc types
WE61 Documentat ion for IDoc record types
WE62 Documentat ion for segments
WE63 Documentat ion for IDoc types (like WE60)
WE64 Documentat ion for message types
WE70 Conversion: basic types
WE71 Conversion: extensions
WE72 Conversion: IDoc types
WE73 Conversion: logical messages
WE81 Logical message types
WE82 Assignment of message type t o IDoc type
WE84 Assignment of IDoc fields and application fields
WEDI IDoc basis and EDI basis
WEINBQUEUE Moni t ori ng program for IDoc i nbound queue
WEOUTQUEUE Moni t ori ng program for IDoc out bound queue
WENOLINKS Switch off links
WELI Maintain status groups
Tabl e 7.4 Main General Transaction Codes (Cont.)
Application-Specific Transaction Codes
M o s t o f t h e s e t r a n s a c t i o n c o d e s a r e f r om SMD a n d a r e n ' t m e n t i o n e d
expl i ci t l y i n t hi s b o ok, b u t y o u ' l l l i kel y fi nd t hi s t a bl e useful .
222
Transaction Code Overview 7 . 3
Transact i on Code I Funct i on |
BD10 Send material
BD11 Get material
BD12 Send cust omer
BD13 Get customer
BD14 Send vendor
BD15 Get vendor
BD16 Send cost center
BD17 Get cost center
BD18 Send general l edger account
BD19 Get general l edger account
BD24 Send cost elements
BD25 Send activity type
BD26 Get activity type
BD27 Send cost center activity prices
BD28 Send obj ect / cost center t ype control dat a
BD30 Distribute material object list
BD31 Distribute document object list
BD32 Distribute plant allocations (material BOMs)
BD33 Distribute material variants (ALE)
BD34 Distribute order BOM
BD35 Send business process groups
BD36 Send business processes
BD37 Send business process prices
BD85 Consistency check for transfer
BD86 Consistency check for sales
BD91 Send characteristic
BD92 Send class
BD93 Send classification
BDA5 Distribute document s
Table 7.5 Main Module-Specific Transaction Codes
223
7 | Administration
I T r a n s a c t i o n C o d e I F u n c t i o n 1
B D D 5 A p p l i c a t i o n c o n s i s t e n c y c h e c k ( SD)
B D F D F R e q u e s t f u n d
B DF DS Se n d f u n d
B D M C U p l o a d i n f o s t r u c t u r e s
Table 7-5 Main Module-Specific Transaction Codes (Cont.)
7.4 Archiving
G D P d u IDocs ar e d o c u m e n t s t ha t , u n d e r Ge r ma n l a w a t l east , ma y have t o be
a r c h i v e d i n a c c o r d a n c e wi t h t h e GDPdU ( Ge r ma n Pr i nci pl es o n Dat a
Access a n d t h e Ex a mi n a t i o n o f Di gi t al Doc ume nt s ) . Thi s l egal i n s t r u me n t
al ways a p p l i e s i n c o m m u n i c a t i o n wi t h p a r t n e r s w h e n t h e IDoc is t he
fi rst el e c t r oni c d o c u m e n t t h a t y o u r ecei ve i n a pr oc es s . I f y o u ' r e r eadi ng
t he IDocs f r om a file t h a t wa s s e n t by a p a r t n e r , t hi s file, t oo, m u s t be
ar chi ved. Li kewi se, i n c o mp a n i e s t o wh i c h Good Manufacturing Practice
(GMP) appl i es, all c h a n g e s t o t h e s t a t us o f w a r e h o u s e st ock h a v e t o be
ar chi ved. Thus, y o u can s ee t h a t i n m o s t cases, IDocs c a n n o t b e s i mpl y
d e l e t e d f r o m t h e s ys t em; t h e y h a v e t o b e a r c h i v e d u s i n g SAPs pr opr i -
e t a i y a r c hi vi ng s ys t em.
Archivabie On e IDoc-speci f i c r u l e is t h a t y o u h a v e t o s pec i f y f o r e v e r y pos s i bl e
status values | q 0 c s t a t us v a l u e w h e t h e r IDocs w i t h t hi s s t a t us ar e a r c hi vabi e o r not .
O f cour s e, SAP pr o v i d e s i n a r chi vabi e f o r m t h o s e val ues t h a t n o r ma l l y
i ndi cat e t h a t a n IDoc ha s a "success" s t a t u s a n d t h e a s s oc i a t e d d o c u m e n t
al r eady exi st s (in i n b o u n d pr ocessi ng) , o r t h a t t h e a s s oc i a t e d d o c u me n t
wa s successf ul l y t r a ns f e r r e d t o t h e r e c i p i e n t ( i n o u t b o u n d pr ocessi ng) .
The t r a ns a c t i on f or ma i n t a i n i n g s t a t u s val ues is WE47. Fi gur e 7 . 7 s h o ws
t he s t a t us ma i n t e n a n c e s c r e e n f o r s t a t us val ue 72, wh i c h i ndi c a t e s t hat
an I Doc wa s s e n t s ucces s f ul l y vi a RFC i n o u t b o u n d pr ocessi ng.
224
Archiving | 7 . 4
D i splay View "Status maintenance": Details
? a s s
IDoc status 12
Description Dispatch OK
Processing 7
Direction 1 Outbound
Procg level S External systerWEDl subsystem
E f f e c t /
Process code
Qualification 4 C C Q Outbound: IDoc dispatched
Archiving /
Fi gu r e 7-7 Se t t i n g Ar c h i v i n g O p t i o n s p e r St at us
Th e a c t u a l pr oc e s s o f a r c hi vi ng is c o m p l e t e d i n Tr a ns a c t i on SARA, as
w i t h all o b j e c t s t o be a r chi ved. Th e a r c hi vi ng o b j e c t f o r I Docs is also
cal l ed IDOC a n d cont a i ns t h e usual Wr i t e, Read, Ma n a g e me n t , a n d Del et e
f unc t i ons (see Fi gur e 7. 8).
A r c h i v e A dm i n i s t rat i o n : Ini ti al Screen
$ 8 0 Logs Customizing DataBase Tables Information System
Ajchwing Object |ID0C [ 5 ) l D o c intermediate Document
Ac ti ons.
Write
B Delete
M Read
/ S Management
F i gu r e 7.8 Ar c h i v i n g O b j e c t f o r I Docs
W h e n i t c o me s t o t h e a r c h i v i n g r e p o r t i t sel f, w h i c h is s t a r t e d us i ng
t h e Wr i t e b u t t o n , y o u c a n s pec i f y i n g r e a t de t ai l wh i c h IDocs a r e t o be
ar chi ved (see Fi gur e 7. 9). W h e n t est mo d e is act i ve ( s h o wn as a flag on
t h e F l o w C o n t r o l t a b page) , y o u ' r e p r e s e n t e d w i t h a n ar c hi ve file, b u t
t h e d e l e t i o n r e p o r t d o e s n ' t d e l e t e t h e a r c h i v e d IDocs f r om t h e dat aba s e.
Tr ans ac t i on SARA
A r c h i v i n g Cr i t e r i a
f o r I Do c s
225
7 | Administration
As a g e n e r a l r ul e, y o u s h o u l d n ' t w a i t t o o l o n g t o ar c hi ve I Docs. The
f e w e r IDocs y o u h a v e i n t h e da t aba s e, t h e f a s t e r y o u r s ea r ch pr ocesses
wi l l r u n , a n d vi e wi n g IDocs o r s ea r chi ng field c o n t e n t will b e j u s t as easy
af t e r ar chi vi ng.
Maintain Variant: Report RSEXARCA, Variant ZSM_ARCH
2 ? Attributes y
Direction (1=outb. 2=inb)
Current Status
Basic type
Extension
Logical Message
Port of Sender
Partner Type of Sender
Partner Number of Sender
Port of Receiver
Partner Type of Receiver
Partner Number of Receiver
Processing Options
Test Mode
O Production Mode
Delail Log
Log Outpul
Archwing Se ssion Note
F i gu r e 7.9 Cr i t er i a f o r I D o c Ar c h i v i n g
O u r e x a mp l e c o n t a i n s b o t h I Docs w i t h a s ucc es s f ul s t a t u s a n d IDocs
wi t h a n uns ucc es s f ul s t a t u s (see Fi gur e 7. 10) . The SAP s t a n d a r d set t i ngs
f or a r c hi vi ng s t a t us val ues s pec i f y t h a t IDocs w i t h er r or s r e ma i n act i ve
bec aus e t h e y c a n n o t be ar chi ved.
226
Archiving | 7 . 4
^ C l XDO client 800 30
^ IDocs in outbound processing 20
1' 0 Error passing data to port 02 1
1' Data passed to port OK 03 19
I D o c in inbound processing 10
I - O IDoc with errors added 56 3
I ' Application document posted 53 7
F i gu r e 7.10 I Do c s Bef or e Ar c h i v i n g
Now, t he ar chi vi ng pr ocess is s t a r t e d w i t h t h e All I Docs Th a t Have an
Ar c hi vabl e St al us Wi l l Be Ar c hi ve d s e t t i n g ( t hi s h a p p e n s i f y o u h a v e n ' t
m a d e a n y speci f i c sel ect i on) . Fi gur e 7. 11 s h o ws t h e resul t .
IDOCS IlDoc Status Number I
^ V IDoc selection
Changed on is in the range 6i/bi/2066 io 12731/2009
^ XDO client 800 4563
^ G 3 IDocs in outbound processing 698
Error passing data to port 02 221
P 9 Error during syntax check of IDoc (outbound) 26 1
P Error in ALE service 29 332
l> A IDoc ready for dispatch (ALE service) 30 5
l> IDoc is in the target system (ALE service) 39 139
| 0 IDoc in inbound pr oce ssin g_________________________________ 3 m
I* Application document not posted 51 3508
P 9 . IDoc wth errors added 56 120
! 9 Error during syntax check of IDoc (inbound) 60 6
I- Error in ALE service 65 2
P A IDoc ready to be transferred to application 64 229
Fi gu r e 7.11 I Do c s A f t e r Ar c h i v i n g
As m e n t i o n e d pr e vi ous l y, i t ' s a l s o pos s i bl e t o s e a r c h ar chi ved IDocs. A
pr e r e qui s i t e f o r t hi s is t h a t y o u h a v e ac t i vat ed t h e i nf o s t r u c t u r e pr ovi ded
by SAP, SAP_ I D 0 c _ 0 0 1 , o r y o u r o wn i nf o s t r uc t ur e , i n Tr ansact i on SARJ.
The s e i nf o s t r u c t u r e s ar c u s e d t o e s t abl i s h t h e c o n t e x t f or t h e d a t a i n t he
ar chi ve. For t hi s p u r p o s e , p a r t o f t he d a t a , wh i c h s h o u l d b e k e p t as smal l
as pos s i bl e , is r e t a i n e d i n t h e d a t a b a s e wh i l e t h e r e ma i n i n g da t a is i n t he
ar chi ve. For IDocs, i t ' s suf f i ci ent t o r et ai n a s mal l a m o u n t o f d a t a fr om
t h e c o n t r o l r e c o r d i n t h e da t a ba s e ; t h e vas t ma j o r i t y is t h e n d e l e t e d af t e r
ar chi vi ng. Fi gur e 7 . 1 2 s h o ws t h e SAP-speci fi c s t r u c t u r e SAP_IDOC_001.
Fo r act i ve s t r uc t ur e s , t h e c o r r e s p o n d i n g da t a r e c or ds ar e cr e a t e d a u t o
mat i cal l y a f t e r ar chi vi ng.
A c t i v a t i n g i nf o
s t r u c t u r e
227
7 | Administration
Sear ch f o r
ar c h i v e d I Docs
D i s p l a y I Docs
f r o m ar c hi ve
Archive Retrieval Configurator
Infostructure $AP_lOOC_OOl |nfo Structure for IDOC
@ Technical data |
Arc hiving object IDOC IDoc - Intermediate Document
Field catalog |SAP_100C_881 | F i e l d Ca t a l o g f o r IDOC
Info Structure fields Optional fields

CBEiin E

441l\%
DIRECT 0
-
C r g a t f l l on
me ch?nq?d
L ]
n
_ E M I E
m m
-
$AP
R e c i p i e n t
OOCREL E
RCVLAD
-
Changed on
IDoc number
0
F I
m m
D0CHUH
E
Standard
PI s t f l y e r s .
m
STPVRS
F I
STATUS
M
Message u s e
STDHES
-

n
100 TP
CIHTYP
-
ness, f u n c t i o n
HESCOD
WESFCT
-
n t s s r a T m
Sender

n
_ I I
-
n ?q
OUTnOD
l i i
Sender type
F I
m m Senfler SKPLAP
Sender
F I
SNDPRN
ipAerthan.ae F i l e
REFINT
Receiver p o r t
F I
i M
RFFGRP

R f i c . P a r t n . I v p f i
Rpr01 vor

m
RCVPRT
QVPRN

lessaae
r c h i v e Key
REFHES
ARCKET

R?Q. P?rtn. FnQt. RCVPFC


* r t n r Ro l e SHDPFC
r*>
xpress
EAPBSS
E l
H o. da t a r e c r f l s
HASE6HUH g
F i gu r e 7.12 A r c h i v e I n f o St r u c t u r e SAP_ I DOC_ 0 0 1 "
You c a n us e t h i s i nf o s t r u c t u r e i n Tr a ns act i on SARI t o s ea r ch f or ar chi ved
IDocs. Thi s c a n b e d o n e f o r all a r c h i v e d obj e c t s , a l t h o u g h t h e r e s ul t is
s i mp l y a t a b u l a r v i e w o f t h e i ndi vi dua l fi el ds. Fo r IDocs, t h e n o r ma l IDoc
s ea r ch i n Tr ansact i on WE 0 9 is s t r u c t u r e d s o t h a t y o u can c h o o s e w h e t h e r
t o s ea r ch i n t h e ar chi ve, i n t h e d a t a b a s e , o r i n b o t h . Th e a d v a n t a g e o f
t hi s is t h a t y o u can s ea r ch f o r a r c h i v e d IDocs i n t he usual ma n n e r , a n d
t he d a t a is di s pl ayed i n t h e s a me wa y f o r d a t a b a s e IDocs a n d ar chi ved
IDocs. In o t h e r wo r d s , it d o e s n ' t ma k e a n y di f f e r e nc e w h e r e t h e da t a
comes f r om. Click t h e Sel ect Dat a Sour ce b u t t o n t o s e l e c t t h e d a t a sour ce
( b o t t o m r i g h t i n Fi gure 7. 13) . The a l t e r n a t i v e o f s el ect i ng files manual l y
i s n t r e c o m m e n d e d b e c a u s e y o u h a v e t o k n o w wh i c h IDocs ar e l ocat ed
i n wh i c h ar c hi ve file.
Fi gur e 7 . 1 4 s h o ws an I Doc t h a t wa s f o u n d i n WE 0 9 (517747). I t h a s s t a
t us 53, wh i c h s h o ws t h a t i t c o me s f r om t h e ar chi ve.
228
IDoc S e a r c h for B u s i n e s s Content
Criteria <cf Search m Control Recoct /
Created Al 60 00 00
Created On O1 / O I / 20OO
Last Changed Al
Last Changed On
Direcaon (1 Out). 2* tab)
IDoc Number
Current Staftis
Basic Type
Enhancement
Locai Message
Port <*Sender
Partner Type of Sender
Partner Number of Sender
PortofRecewer
Partner Typ of Recewer
Partner Number of Rece.ver
to 24 00 00
to 01/01/2009
to 24 OO 00
to
to
to
to___
to
to
to
to
to
to
Fast Search node
Criteria lor Search Data Records
Search in Segment
Search in Field
I
0 Database
0AKhf*
A / t h w A c c e s s /
A/cnve information System
O Select flies manually
HO
F i gu r e 7.13 I D o c Sear ch f o r Fi el d C o n t e n t
SAP
Doc oisoia*
Q Coracr Rec
^ CD Data records Tout number 000045
^ Segment OOOOOl
0 E1MKTM Segment 000002
Q ElfcWKTM Segment 000003
E1M*KTM Segment 000004
Q E1HAKTM Segment 000005
t DEtfcWRCM Segment 000006
Q E1MARCM Segment 000027
I Q E1MRCM Segment 000031
I ' 0 E1MRCM Segment 000034
0 E1HPMM Segment 000037
0 E1KWPMM Segment 000038
0 ElMBEV/M Segment 000039
0 E1MBE.W Segment 000040
O E1MBEV/M Segment 000041
O E1MBE.WI Segment 000042
O ElMvKEM Segment 000043
0 E1MLANM Segment 000044
0 E1MLANM Segment 000045
1 O Status record*
Technical short irrfo
Direction 2 Into.
Current status 53
Basic ffpe miS03
Eitenson
Message f*pe HAIBAS
Partner No I90CLNT090
PartnType LS
Port SAPL13
Content o selected segment
Id name Id cont
.
1
Figure 7.14 Individual IDoc Display in Transaction WE09
7 | Administration
Tr ans ac t i on W E 10
i n o l d e r r el eases
De l e t e I Docs
M a n u a l d e l e t e f l ag
P r o c e d u r e i n O l d e r R e l e a s e s
U p t o Re l e a s e 4 . 6 C , T r a n s a c t i o n W E 0 9 r e a d d a t a f r o m t h e d a t a b a s e o n l y .
T h e r e w a s a n a d d i t i o n a l t r a n s a c t i o n , W E 1 0 , f o r r e a d i n g d a t a f r o m t h e a r c h i v e .
T h e t w o f u n c t i o n s h a v e b e e n c o m b i n e d i n o n e e a s y - t o - u s e t r a n s a c t i o n i n
m o r e r e c e n t r el eas es.
D e l e t i n g I D o c s
Y o u ' l l s o m e t i m e s h a v e t o d e l e t e I D o c s . Y o u c a n d o s o i n T r a n s a c t i o n W E 1 1 .
H o w e v e r , w h e t h e r o r n o t y o u s h o u l d b e p e r m i t t e d t o d e l e t e I D o c s i n a p r o
d u c t i o n s y s t e m i s a m a t t e r t o b e c l a r i f i e d w i t h t h e p e r s o n w h o i s r e s p o n s i b l e
f o r G D P d U ( o r e q u i v a l e n t l e g i s l a t i o n ) i n y o u r o r g a n i z a t i o n b e c a u s e d e l e t e d
d a t a c a n n o t b e r e c o v e r e d .
7.5 Status Conversion
The r e ar e t wo a u t o ma t i c o p t i o n s f o r s t a t us c o n v e r s i o n i n t h e SAP s t a n
dar d. Bot h o p t i o n s u s e SAP-specific IDocs, ALEAUD a n d SYSTAT. The AL E -
AUD IDoc assi gns t h e s t a t us val ues 39, 40, o r 47, i n a c c o r d a n c e wi t h t he
r e c i pi e nt ' s st at us , wh i l e t h e SYSTAT I Doc can a s s i gn a n y n e w s t a t us wi t h
its o w n f ai l ur e o r success t ext . C h a p t e r 5, Conf i r mat i ons , de s c r i be s t he
f u n c t i o n a l i t y o f b o t h o f t h e s e I Docs i n de t a i l . I t s al so p o s s i b l e t o set
IDocs t h a t still c o n t a i n er r or s t o a s t a t us t h a t p r e v e n t s t h e m f r o m a n y fur
t h e r pr oc es s i ng, i n b o t h i n b o u n d a n d o u t b o u n d pr oc es s i ng. Thi s st at us
also a l l ows t h e af f ect ed IDocs t o b e a r chi ved. The c o r r e s p o n d i n g st at us
is 31 i n o u t b o u n d pr oc e s s i ng a n d 6 8 i n i n b o u n d pr oc es s i ng. No t e t h a t
c ons i s t e nc y is g u a r a n t e e d o n a s y s t e m- wi d e basi s o n l y i f t he ac t i ons t hat
s h o u l d have b e e n e x e c u t e d by t h e IDoc a r e e x e c u t e d i n s o me o t h e r wa y
( e i t he r by a n o t h e r IDoc t h a t d o e s n ' t c o n t a i n t h e er r or , o r manual l y) .
Set t i ng t h e s t a t us val ues t o me a n Err or , no f u r t h e r pr oc e s s i ng is d o n e in
t h e e r r o r w o r k f l o w us i ng t h e De l e t e Fl ag b u t t o n (see Fi gur e 7. 15).
The s t a t u s c h a n g e i t s e l f is ma d e a f t e r a s e c u r i t y p r o m p t a n d f or o n l y o n e
IDoc a t a t i me . The r e is n o f aci l i t y i n t he SAP s t a n d a r d f o r ma k i n g mass
cha nges t o s t a t us val ues, n o r is t h e r e l i kel y t o be s uch a facility. The next
s e c t i o n c o n t a i n s a s a mp l e p r o g r a m f o r ma k i n g mas s changes.
2 3 0
Status Conversion | 7 . 5
s| Display Status Record
P I | Process 11 Delete flag 1[ h ] [71 [T1 [ h ] 1iDoc Display]
iDoc number! 0900900000768840
Direction 1 Outbound
Status 02 Error passing data to port
Message ^ Could not find code page for receiving system
Sts details Logging___________________________
F i g u r e 7-15 Setting the Delete Flag in the Workflow
S a mp l e P r o g r a m f o r M a s s Ch a n g e s
I f y o u have t h e p r o b l e m, par t i c ul a r l y i n t e s t s ys t ems , t h a t a l arge n u m b e r
o f IDocs c a n n o t b e pos t e d, y o u c a n s e t al l o f t h e s e IDocs t o a n archi v-
abl e s t a t us a t o n e t i me . Not e , h o we v e r , y o u mu s t e n s u r e t h a t t hi s is d o n e
us i ng t h e or i gi nal SAP t ool s a n d t h a t t h e a s s oc i a t e d e r r o r wo r k f l o w has
b e e n cl osed.
Because t h e p r o g r a m can al so be u s e d t o s e t a n o t h e r s t at us , i t ma y be
ne c e s s a r y t o t r i gger a n e r r o r wor kf l ow. Thi s p r o g r a m r e p r e s e n t s a ma j or
i n t e r v e n t i o n i n t o t h e SAP s y s t e m, s o y o u s h o u l d a d d a l o t o f hi g h - q u a l
i t y c o m m e n t s t o t he c o d e a n d s e c u r e it wi t h a h i g h l evel o f a u t h o r i z a
t i on checks. O u r s a mp l e p r o g r a m (see Li st ing 7. 1) us e s a s t a t u s t e x t t hat
s h o ws wh i c h u s e r m a d e t h e s t a t us change.
Not es on t h e Code
This code is i nt ended as an example only and does n' t contain authorization
checks. Also carefully consider whet her you really want t o make every status
change shown in this example. One alternative would be t o change t o sta
tuses 31 and 68 only. In particular, not e t hat resetting a successful IDoc to
a status t hat permits further processing can lead t o duplicate postings and
inconsistencies.
Th e p r o g r a m i t s e l f wa s p r o g r a m me d u s i n g t h e n e w A BA P List Viewer
(ALV). Thi s has t h e a d v a n t a g e t h a t t h e di s p l a y d y n p r o a n d t h e GUI s t a t us
d o n ' t h a v e t o be c r e a t e d, wh i c h ma k e s i t mu c h e a s i e r f o r y o u t o wor k
w i t h t hi s e xa mpl e . Fi gur e 7 . 1 6 s h o ws whi c h s el e c t i on fi el ds y o u c a n use.
Her e, as be f or e , it' s o f c o u r s e u p t o y o u w h e t h e r y o u i n c o r p o r a t e a d d i
t i onal r e q u i r e me n t s .
Mass changes
Selection fields
231
7 | Administration
Se l e c t i o n l i s t
F i gu r e 7.16 I n i t i a l D y n p r o o f t h e Sa mp l e Pr ogr am
The i n p u t f r om Fi gur e 7 . 1 6 is u s e d t o l i st all o f t h e pos s i bl e IDocs (see
Fi gure 7. 17). You can l i mi t t h e IDocs b y pl aci ng c he c kma r ks i n t he a p p r o
pr i a t e s el e c t i on c o l u mn . Then, w i t h o u t a b u t t o n , w h e n e v e r y a c t i o n is
exe c ut e d, t h e l i st o f s e l e c t e d I Docs is c o n v e r t e d . You can al so a p p l y s p e
cial c ont r ol s t o t hi s c o n v e r s i o n u s i n g a b u t t o n , f o r e xa mpl e . In g e n
eral , t hi s can be d o n e wi t h b o t h t h e ol d a n d t h e n e w ALV.
232
Status Conversion | 7 . 5
S e l e c t e d I D o c s
m m
i D o c n u m b e r S | P a r t n n o
P
R | M e s s a g e T y p e | T | s i a i u s m e s s a g e i d M | s t a t u s t e t
7 6 8 / 4 5 0 3 T 9 0 C L N T 0 9 0 L S | M A T M A S
7 6 8 7 4 6 5 6 Z S M 2 L S M A T M A S
7 6 8 7 4 7 6 8 Z S M 2 L S 1m a t m a s
7 6 8 7 4 8 5 3 Z S M 2 L S M A T M A S
{ j -------------------------------
7 6 8 7 6 0
\
z
>
C
O
>

<
0
L S M A T M A S
j
7 6 8 7 5 1 6 8 Z S M 2 L S M A T M A S
7 6 8 7 5 2 6 8 Z S M 2 L S M A T M A S
7 6 8 7 5 3 5 3 Z S M 2 L S M A T M A S
7 6 8 7 5 4 3 7 Z S M 2 L S M A T M A S
7 6 8 7 5 5 3 7 | Z S H 2 L S M A T M A S
7 6 8 7 5 6 3 7 Z S M 2 L S M A T M A S
7 6 8 7 5 7 0 3 Z S M 2 L S M A T M A S
7 6 8 7 5 8 5 3 Z S M 2 L S j M A T M A S
7 6 8 7 5 9 1 2 Z S M 2 L S M A T M A S
7 6 8 7 6 0 5 3 | Z S M 2 L S J M A T M A S
7 6 8 7 6 1 5 1 S A L E S L S M A T M A S
7 6 8 7 6 2 5 1 S A L E S L S M A T M A S
7 6 8 7 6 3 6 4 S A L E S L S M A T M A S
1
7 6 8 7 6 5 0 3 T 9 0 C L N T 0 9 0 L S M A T M A S
F i gu r e 7.17 Resul t s o f t h e I D o c Search
The l i st s h o w n i n Fi gure 7. 18 s h o ws t he resul t s. I n o u r e xa mpl e , all o f
t h e IDocs w e r e c o n v e r t e d successful l y.
Z SMIDOCSTATUS
i D o c n u m t m r S t a t u s So nf lKf u r t r - f no S * * . d o r ryp*
P
M o * 9 < T y D . I
7 6 8 7 6 1 61 SAL E S I S KATIWS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 6 1 N e w S ' . t y i i IDoc M 5*1
t d - 1 i W . L t L S DOC 0 0 0 0 0 0 0 0 0 0 7 6 8 7 6 2 N e w b O O O M M

7 6 8 7 6 3 6 4 SAL E S L S W U A S DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 6 3 N e w S S I O J t X * IDoc -

7 6 8 7 6 * * 5 J S.M.ES S H * T H * S DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 6 4 N * w f . t f j s > i IDoc w s e t


o '
7 6 8 7 6 S j p 3 T 9 0 C I N T 0 9 0 L S W M A Z 0 0 ( 0 0 0 0 0 0 0 7 6 3 7 6 5 n e w * i d o < - w . m
w
7 6 8 7 6 6 * 5 1 SAL E S . 8 H At H * S DOC 0 0 0 0 0 0 1 X 1 0 7 6 5 7 6 6 I . ' - S M I U D K I I M H I
~ y ~
T 9 C C L N " J 9 0 I S DOC 0 0 ( 0 3 0 0 0 0 0 7 6 3 7 6 ' 1 i e w C . f i j t . * M i D c c w j s i d

7 6 8 7 6 8 C3 T9CCLNT090 L S DOC 0 0 ( J D 0 0 C < l 0 7 e 3 7 6 8 t . ? ~ S ' . W j i V i? C < w a s 5 f 1

7 6 8 7 7 1 12 T9CC L I " J 9 0 L S W I K A 5 DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 7 1 N e w S - . r t j t ' * lDo< W M i r l

7 6 8 7 7 ? * 0 3
7 6 0 7 7 1
T 9 0 C L N T 0 9 0
T ("" 1
*
VATIAS DOC 0 0 0 0 0 0 0 0 0 0 7 6 8 7 7 ? N w S J * j &S * IDoc w a s s * 1
n o r . f l f l f i. '*?

j * V V1 r v J
l a ; ; * , a
V W U V
T 9 0 C L M T 0 9 0 L S
1"VTV
V A ' W - i .
l / W U W W V W W V I v v r f ^ IT " > 3 VI
DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 7 6 N w S U f c t w IDoc w w *1

7 6 8 7 7 3 I I ? T 9 0 C U J T 0 9 0 L S H S T H 4 S DOC 0 0 0 0 0 0 0 0 0 0 7 6 8 7 7 3 N e w S U U S K ) 0 < w a * S ( 4

7 6 9 7 ? $ 12 T9CCLIJTD90 L S DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 7 5 N e w S a f e s S # IDoc w w

7 6 8 7 8 1 * 0 3 I 9 0 C L N T 0 9 0 L S MATMAS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 8 1 N * * 8 t l f e S f e ( I O 0 < W M M 4

7 6 8 7 8 ? * 0 3 T 9 0 C L N T 0 9 0 s MATMAS DOC 0 0 0 0 0 0 0 0 0 0 7 6 8 7 8 2 N i w S t t f e S I M D O C W M M I

* r , 3 r ? i a T 9 0 C I M T 3 9 0 L S ______________ MATMAS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 3 7 8 3 N e w S a f e s S * lDo< w a -.

7 6 8 7 8 4 0 3 T 9 0 C L N T 0 9 0 LS MTMS DOC 0 0 0 0 0 0 0 0 0 0 7 6 3 7 8 4 N e w S U f e S D t O K t t M M
l i 1 9 C C I H T 3 9 0 L S MATMAS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 3 7 8 8 N e w S ' . r t j i * r I Doc w i t sH
7 6 8 7 8 9 ' 0 3 T 9 0 C L M T 0 9 0 L S MATMAS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 8 9 N * w S ! J 5 >D0< " i t - t

> 6 8 . J I j T 9 C C L N ? i 9 0 L S DOC 0 0 0 0 0 0 0 0 0 0 7 6 8 7 9 0 N e w S a f e s W i 0 0 ( - S I 1M

7 6 8 7 9 1 ' 0 3 T90CLMTQ90 L S MATMAS DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 9 1 N e w S a f e s * x IDoc w a s t e l

7 6 9 7 1* ? O T 9 C < LK-T390 LS V . T U . , : DOC 0 0 ( 0 0 0 0 0 0 0 7 6 8 7 9 2 N e w 8 l a f e s t o * IDoc w i i i r t


o '
Figure 7.18 Results List After Status Value Conversion
Resul t s l i s t
233
7 | Administration
In Tr ansact i on BD87, i f t h e basi c v i e w is o p e n , y o u c a n s e e t he gene r i c
e r r o r t e x t w i t h p l a c e h o l d e r s (see Fi gur e 7. 19).
^ [ 2 IDoc in inbound processing 45
I 1 O Application document not posted 51 6
! 0: IDOC Witn errors added 56 3
1 Application document posted 53 7
^ Error-no further processing 68 29
^ 53 MATMAS 29
^ U ] ZSM(OOO) IDoc Status was changed from S to S 29
( D IDoc Slatus was changed from MASELSA to 68 29
F i gu r e 719 Mes s age Text i n t h e Basi c Li st
C o n v e r t e d I D o c I n t h e i n d i v i d u a l v i e w o f an IDoc, y o u c a n s e e e xa ct l y w h o ma d e t he
c o n v e r s i o n (sec Fi gur e 7. 20) .
IDoc Selection
I ..........
IDoc number |
768747
768752
768761
Stat MessageTypel
68 MATMAS
68 MATMAS
StatusText
IDoc Status was changed from MAJSELSA to 68
IDoc Status was changed from MAJSELSA to 68
Partner No
ZSM2
ZSM2 j
BasicType________ |
MATMAS33
MATMAS03
Extension
768762
768763
68 MATMAS
68 MATMAS
IDoc status was changed from MAJSELSA to 68
IDoc Slatus was changed from MAiSELSAIo 68
SALES
SALES
MATMAS05
MATMAS05
ZSMMAPA
ZSMMAPA
F i gu r e 7 2 0 Message Text i n t h e I D o c I n d i v i d u a l V i e w
Me s s a g e cl ass Fo r t h e e x a mp l e p r o g r a m u s e d h e r e , a me s s a g e cl ass w i t h t h e mo s t
i mp o r t a n t mes s age s has t o be s e t u p . Fi gur e 7. 21 s h o ws t h e t e x t us ed
f or t hi s p u r p o s e .
Message Maintenance: Change Messages
*2? # Selected entnes ^ aaa g 3 Long Text Next free number Ne ii used <
Message class ZSn Activ
Attributes
u u a * 30 n
F l M e s s a g e Message short text
| |000 | l Doc
|Seif-explanaty
0
F i gu r e 7.21 Message Cl ass o f t h e Sampl e Pr ogr am
Li st ing 7. 1 c ont a i ns t h e basi c c o d e r e qui r e d f or t h e e xa mpl e s descr i bed
i n t hi s cha pt e r . Agai n, n o t e t h a t o n l y t h e code t h a t is r e l e va nt t o IDocs is
234
Status Conversion | 7 . 5
gi ven her e, a n d i he c o d e s h o u l d n t be us ed in u n mo d i f i e d f or m; aut hor i z a
t i on checks, f o r exampl e, s houl d b e a d d e d . Also, t h e pr ogr am cont ai ns t ext
e l e me n t s t hat y o u ' l l have t o add, such as t e x t - b O l f or o n e o f t he bl ocks
o n t he s el ect i on s cr een. Wh e r e t h e s e d o n t a p p e a r o n t h e s el ect i on screen,
t h e y ar e i ndi cat ed i n t h e code i n each case f or exa mpl e , I D o c c o u l d
n o t be l o c k e d * ( 0 0 1 ) - a n d s o no f u r t h e r s c r e e ns hot s ar e us ed her e.
*&.............................................................................................................................................*
* 8 R e p o r t ZSMI DOCSTATUS
* & ..............................................................................................................................................................................................*
REPORT ZSMI DOCSTATUS .
I NCLUDE < i c o n > .
TA B L E S : e d i d c .
TABL ES:
e d i d s . t b d 0 5 .
DATA w a _ t b d 5 2 TYPE t b d 5 2 .
DATA w a _ e d p 2 1 TYPE e d p 2 1 .
DATA p a r t n e r TYPE e d i d c - s n d p r n .
n r l i n e s TYPE s y - t a b i x .
D a t a a l v TYPE REF TO c l _ s a l v _ . t a b l e .
DATA 1 r _ s e l e c t i o n s TYPE REF TO c l _ s a l v _ . s e l e c t i o n s .
DATA i _ S e l e c t e d _ r o w s t y p e s a l v _ t _ r o w .
DATA w a _ r o w t y p e l i n e o f s a l v _ t _ . r o w .
D a t a e x c TYPE REF TO c x _ r o o t ,
DATA msg TYPE s t r i n g .
T y p e s : BEGI N OF r _ e d i d c ,
d o c n u m L I K E e d i d c - d o c n u m .
s t a t u s L I K E e d i d c - s t a t u s .
s n d p r n L I K E e d i d c - s n d p r n .
s n d p r t L I K E e d i d c - s n d p r t .
s n d p f c L I K E e d i d c - s n d p f c .
m e s t y p L I K E e d i d c - m e s t y p .
m e s c o d L I K E e d i d c - m e s c o d .
m e s f c t L I K E e d i d c - m e s f c t .
t e s t L I K E e d i d c - t e s t .
s t a m i d L I K E e d i d s - s t a m i d .
s t a m n o L I K E e d i d s - s t a m n o ,
s t a t x t L I K E e d i d s - s t a t x t .
m s g ( 8 0 ) ,
i c o n ( 4 ) .
b o x ( 1 ) .
END OF r _ e d i d c .
Type d e f i n i t i o n s
235
7 | Administration
Se l e c t i o n scr een
s t r u c t u r e
DATA: i _ e d i d c t y p e t a b l e o f r _ e d i d c .
d a t a : w a _ e d i d c t y p e r _ e d i d c .
DATA: i d o c _ s t a t u s L I K E b d i d o c s t a t OCCURS 0 WI TH HEADER L I N E .
DATA: c _ e v e n t _ o b j e c t _ t y p e _ i d o c a p p l L I K E
s w e t y p e c o u - o b j t y p e VALUE I D O C A P P L ' .
DATA: c _ e v e n t _ e r r _ p r o c e s s _ c o m p l e t e d
L I K E s w e t y p e c o u - e v e n t VALUE ' ERRORPROCESSCOMPLETD .
CONSTANTS: c _ w f _ r e s u l t _ d e l e t e _ i d o c L I K E b d w f _ p a r a m - r e s u l t
VALUE 9 9 9 9 8 .
c _ w f _ r e s u l t _ w i _ c o m p l e t e L I K E b d w f _ p a r a m - r e s u l t
VALUE 9 9 9 9 7 .
D a t a : g _ r e p i d L I K E s y - r e p i d ,
g _ s a v e ( 1 ) TYPE c VALUE * A \
g _ v a r i a n t L I K E d i s v a r i a n t .
DATA:
$ i d o c _ g e s ( 6 ) TYPE n .
$ i d o c _ o k ( 6 ) TYPE n .
$ i d o c _ f e h l e r ( 6 ) TYPE n .
* S e l e c t I D o c s t o b e m o d i f i e d w i t h p r e - s e l e c t i o n
SEL ECTI ON- SCREEN BEGI N OF BLOCK 0 1 WI TH FRAME T I T L E t e x t - b O l .
S E L E C T - O P T I O N S : d o c n u m FOR e d i d c - d o c n u m .
SEL ECTI ON- SCREEN S K I P 1 .
S E L E C T - O P T I O N S : c r e d a t FOR e d i d c - c r e d a t DEFAULT s y - d a t u m TO s y -
d a t u m .
S E L E C T - O P T I O N S : c r e t i m FOR e d i d c - c r e t i m DEFAULT 000000 TO
2 3 5 9 5 9 ' .
S E L E C T - O P T I O N S : m e s t y p FOR e d i d c - m e s t y p .
S E L E C T - O P T I O N S : m e s c o d FOR e d i d c - m e s c o d .
S E L E C T - O P T I O N S : m e s f c t FOR e d i d c - m e s f c t .
S E L E C T - O P T I O N S : d i r e c t FOR e d i d c d i r e c t .
S E L E C T - O P T I O N S : s n d p o r FOR t b d 0 5 - s n d s y s t e m .
S E L E C T - O P T I O N S : s n d p r t FOR e d i d c - s n d p r t .
S E L E C T - O P T I O N S : s n d p r n FOR e d i d c - s n d p r n .
S E L E C T - O P T I O N S : s n d p f c FOR e d i d c - s n d p f c .
S E L E C T - O P T I O N S : r c v p r t FOR e d i d c - r c v p r t .
S E L E C T - O P T I O N S : r c v p r n FOR e d i d c - r c v p r n .
S E L E C T - O P T I O N S : r c v p f c FOR e d i d c - r c v p f c .
S E L E C T - O P T I O N S : s t a t u s FOR e d i d c - s t a t u s DEFAULT 6 8 .
SEL ECTI ON- SCREEN END OF BLOCK 01 .
SEL ECTI ON- SCREEN BEGI N OF BLOCK 02 WI TH FRAME T I T L E t e x t - b 0 2 .
S E L E C T - O P T I O N S :
s _ s t a m i d FOR e d i d s - s t a m i d ,
s _ s t a m n o FOR e d i d s - s t a m n o .
2 3 6
Status Conversion | 7 . 5
S E L E CT I ON - S C RE E N END OF BLOCK 0 2 .
S E L ECT I ON- SCREEN S K I P 1 .
PARAMETERS: n e w s t a t L I K E e d i d c - s t a t u s DEFAULT - 6 8 * .
S T A R T - O F - S E L E C T I O N .
SEL ECT : d o c n u m s t a t u s s n d p r n s n d p r t s n d p f c m e s t y p m e s c o d
m e s f c t t e s t
I NTO c o r r e s p o n d i n g f i e l d s o f
FROM e d i d c
PERFORM g e t _ e d i d s
E ND - O F - S E L E C T I O N .
PERFORM a l v .
WHERE d o c n u m
u p d d a t
u p d t i m
m e s t y p
m e s c o d
m e s f c t
s n d p o r
s n d p r t
s n d p r n
s n d p f c
d i r e c t
r c v p r t
r c v p f c
r c v p r n
s t a t u s
t a b l e i _ e d i d c
I N d o c n u m AND
I N c r e d a t AND
I N c r e t i m AND
I N m e s t y p AND
I N m e s c o d AND
I N m e s f c t AND
I N s n d p o r AND
I N s n d p r t AND
I N s n d p r n AND
I N s n d p f c AND
I N d i r e c t AND
I N d i r e c t AND
I N d i r e c t AND
I N d i r e c t AND
I N s t a t u s .
* C h a n g e s t a t u s
* ............................
FORM s t a t u s _ c h a n g e .
i _ s e l e c t e d _ r o w s = L R _ S e l e c t i o n s - > GET _ SELECTED_ ROWS( )
l o o p a t i _ s e l e c t e d _ r o w s i n t o w a _ r o w .
r e a d t a b l e i _ e d i d c i n t o w a _ e d i d c i n d e x w a _ r o w .
* I DOC p r o c e s s i n g
CALL FUNCTI ON * ENOUEUE_ES_EDI DOCE'
EXPORTI NG
m o d e _ e d i d c
m a n d t
d o c n u m
EXCEPTI ONS
f o r e i g n _ l o c k
s y s t e m _ f a i 1 u r e =
OTHERS
E
s y - m a n d t
w a _ e d i d c - d o c n u m
1
2
3 .
D a t a sel ec t i on
Change s t a t u s
Set l ock
237
7 | Administration
I F s y - s u b r c < > 0 .
CONCATENATE ' I D O C ' ( 0 0 3 ) w a _ e d i d c - d o c n u m
* I D o c c o u l d n o t b e l o c k e d ( 0 0 1 )
I NTO w a _ e d i d c - m s g SEPARATED BY s p a c e
w a _ e d i d c - i c o n = i c o n _ f a i l u r e .
ELSE .
CLEAR: i d o c _ s t a t u s .
REFRESH: i d o c _ s t a t u s
MOVE w a _ e d i d c - d o c n u m
MOVE n e w s t a t
MOVE S
MOVE ' ZSM
MOVE 0 0 0
MOVE s y - u n a m e
MOVE n e w s t a t
MOVE s y - u n a m e
MOVE s y - r e p i d
TO i d o c _ s t a t u s - d o c n u m
TO i d o c _ s t a t u s - s t a t u s
TO i d o c _ s t a t u s - m s g t y .
TO i d o c _ s t a t u s - m s g i d .
TO i d o c _ s t a t u s - m s g n o .
TO i d o c _ s t a t u s - m s g v l .
TO i d o c _ s t a t u s - m s g v 2 .
TO i d o c _ s t a t u s - u n a m e .
TO i d o c _ s t a t u s - r e p i d .
APPEND i d o c . s t a t u s .
CALL FUNCTI ON I DOC_ ST AT US_ WRI T E_ TO_ DATABASE
EXPORTI NG
i d o c _ n u m b e r
TABLES
i d o c _ s t a t u s
EXCEPTI ONS
i d o c _ f o r e i g n _ l o c k
i d o c _ n o t _ f o u n d
i d o c _ s t a t u s _ r e c o r d s _ e m p t y
i d o c _ s t a t u s _ i n v a l i d
d b _ e r r o r
y ; a _ e d i d c - d o c n u m
i d o c _ s t a t u s
1
2
3
4
5 .
I F s y - s u b r c EO 0
CONCATENATE * I DOC < 0 0 3 ) w a _ e d i d c - d o c n u m
New s t a t u s s e t f o r I D o c * ( 0 0 2 )
I NTO w a _ e d i d c - m s g SEPARATED BY s p a c e .
w a _ e d i d c - i c o n = i c o n _ c h e c k e d .
ELSE .
CONCATENATE * I DOC* < 0 0 3 ) w a _ e d i d c - d o c n u m
S t a t u s c o n v e r s i o n e r r o r * ( 0 0 4 )
I NTO w a _ e d i d c - m s g SEPARATED BY s p a c e .
w a _ e d i d c - i c o n - i c o n _ f a i l u r e .
MODI FY i _ e d i d c f r o m w a _ e d i d c i n d e x w a _ r o w .
CONTI NUE .
ENDI F .
2 3 8
Status Conversion | 7 . 5
C A S E n e w s t a t .
W H E N * 6 8 ' .
* I D o c w a s s e t t o a s t a t u s t h a t d o e s n o t p e r m i t f u r t h e r
* p r o c e s s i n g ; t h e r e f o r e , t r i g g e r e v e n t t h a t e n d s t h e
* e r r o r w o r k f l o w .
S E L E C T S I N G L E * F R O M e d p 2 1 I N T O w a _ e d p 2 1
W H E R E s n d p r n = w a _ e d i d c - s n d p r n
A N D s n d p r t = w a _ e d i d c - s n d p r t
A N D s n d p f c - w a _ e d i d c - s n d p f c
A N D m e s t y p = w a _ e d i d c - m e s t y p
A N D m e s c o d - w a _ e d i d c - m e s c o d
A N D m e s f c t = w a _ e d i d c - m e s f c t
A N D t e s t - w a _ e d i d c - t e s t .
I F s y - s u b r c <> 0 .
C O N C A T E N A T E ' I D O C ' ( 0 0 3 ) w a _ e d i d c - d o c n u m
f o r ' ( 0 0 5 ) ' m e s s a g e ' ( 0 0 8 ) e d i d c - s n d p r n
e d i d c - s n d p r t e d i d c - s n d p f c e d i d c - m e s t y p
' n o e n t r y f o u n d i n E D P 2 1 . " ( 0 0 6 )
I N T O w a _ e d i d c - m s g S E P A R A T E D B Y s p a c e .
E L S E .
S E L E C T S I N G L E * F R O M t b d 5 2 I N T O w a _ t b d 5 2
W H E R E e v c o d e - w a _ e d p 2 1 - e v c o d e .
I F s y - s u b r c <> 0 .
C O N C A T E N A T E ' I D O C - ( 0 0 3 ) w a . e d i d c - d o c n u m ' f o r ' ( 0 0 5 )
p r o c e s s c o d e ' ( 0 0 9 ) w a _ e d p 2 1 - e v c o d e
n o e n t r y f o u n d i n T B D 5 2 . ' ( 0 0 7 )
I N T O w a _ e d i d c - m s g S E P A R A T E D B Y s p a c e .
E L S E .
P E R F O R M s t a r t _ e v e n t ( s a p l b d 2 0 ) U S I N G w a _ e d i d c - d o c n u m
w a _ t b d 5 2 - e v e n t _ e n d w a _ t b d 5 2 - i d o c o b j t y p
c _ w f _ r e s u l t _ d e l e t e _ i d o c .
C O M M I T W O R K .
P E R F O R M s t a r t _ e v e n t ( s a p l b d 2 0 ) U S I N G w a _ e d i d c - d o c n u m
w a _ t b d 5 2 - e v e n t _ e n d w a _ t b d 5 2 - i d o c o b j t y p
c _ w f _ r e s u l t _ w i _ c o m p l e t e .
C O M M I T W O R K .
E N D I F .
E N D I F .
W H E N * 3 1 ' .
P E R F O R M e v e n t _ f o r _ t a s k _ e n d _ c r e a t e ( s a p ! b d l 6 )
U S I N G w a _ e d i d c - d o c n u m .
C O M M I T W O R K .
W H E N O T H E R S .
St a r t w o r k f l o w s ,
i f r e q u i r e d
End w o r k f l o w
239
7 | Administration
Ge t s t a t u s val ues
ENDCASE .
CALL FUNCTI ON DEOUEUE_ES_EDI DOCE
EXPORTI NG
m o d e _ e d i d c - E
m a n d t = s y - m a n d t
d o c n u m = w a _ e d i d c - d o c n u m .
ENDI F .
MODI FY i _ e d i d c f r o m w a _ e d i d c i n d e x w a _ r o w .
ENDLOOP .
I F s y - s u b r c = 0 .
* E n t r i e s w e r e s e l e c t e d a n d p r o c e s s e d
CLEAR: S i d o c _ o k . $ i d o c _ e r r o r .
LOOP AT i _ e d i d c TRANSPORTI NG NO F I E L DS
WHERE i c o n = i c o n _ c h e c k e d .
ADD 1 TO $ i d o c _ o k .
ENDLOOP .
LOOP AT i _ e d i d c TRANSPORTI NG NO F I E L DS
WHERE i c o n - i c o n _ f a i l u r e .
ADD 1 TO $ i d o c _ e r r o r .
ENDLOOP .
ENDI F .
ENDFORM .
* ____________________________________________________________
* R e t r i e v e d a t a
*__________ ____________ . . . . ______________ . . . . . ______________ . . . .
FORM g e t _ e d i d s .
DATA: h _ s t r ( 1 5 0 ) .
i t _ e d i d s TYPE TABLE OF e d i d s .
w a _ e d i d s L I K E e d i d s .
CHECK NOT s _ s t a m n o I S I N I T I A L .
LOOP AT i _ e d i d c i n t o w a _ e d i d c .
REFRESH i t . e d i d s .
SELECT * FROM e d i d s APPENDI NG TABLE i t . e d i d s
WHERE d o c n u m = w a _ e d i d c - d o c n u m
AND s t a t u s = w a _ e d i d c - s t a t u s
AND s t a m i d I N s _ s t a m i d
AND s t a m n o I N s _ s t a m n o .
I F s y - s u b r c NE 0 .
DELETE i _ e d i d c .
CONTI NUE .
ENDI F .
SORT i t _ e d i d s BY d o c n u m
l o g d a t DESCENDI NG
2 4 0
Status Conversion | 7 . 5
l o g t i m DESCENDI NG
c o u n t r DESCENDI NG .
DELETE ADJACENT DUP L I CA T E S FROM i t _ e d i d s
COMPARI NG d o c n u m .
READ TABLE i t _ e d i d s I NDEX 1 I NTO w a _ e d i d s .
w a _ e d i d c - s t a m i d = w a _ e d i d s - s t a m i d .
w a _ e d i d c - s t a m n o = w a _ e d i d s - s t a m n o .
h _ s t r = w a _ e d i d s - s t a t x t .
REPLACE & WI TH w a _ e d i d s - s t a p a 1 I NTO h _ s t r .
CONDENSE h _ s t r .
REPLACE WI TH w a _ e d i d s - s t a p a 2 I NTO h _ s t r .
CONDENSE h _ s t r .
REPLACE * & * WI TH w a _ e d i d s - s t a p a 3 I NTO h _ s t r .
CONDENSE h _ s t r .
REPLACE * & WI TH w a _ e d i d s - s t a p a 4 I NTO h _ s t r .
CONDENSE h _ s t r .
w a _ e d i d c - s t a t x t = h _ s t r .
MODI FY i _ e d i d c f r o m w a _ e d i d c .
ENDLOOP .
ENDFORM .
* _________________________________________________________________
* T i t l e ALV
* _______________________________________________________________
FORM t i t l e USI NG t i t l e TYPE l v c . t i t l e .
DATA s e t t i n g s TYPE REF TO c l _ s a l v _ d i s p l a y _ s e t t i n g s .
s e t t i n g s = a l v - > g e t _ d i s p l a y _ s e t t i n g s ( ) .
s e t t i n g s * > s e t _ l i s t _ h e a d e r ( t i t e l ) .
ENDFORM .
* ...................................................................................................................................
* AL V s e l e c t i o n o p t i o n s
* .......................................................................................................................................
FORM s e t _ s e l e c t i o n s USI NG p _ a l v TYPE REF TO c 1_ s a 1v _ t a b l e
* g e t t h e SELECTI ONS o b j e c t
1 r _ s e l e c t i o n s - p _ a l v - > g e t _ s e l e c t i o n s ( ) .
* s e t t h e s e l e c t i o n mode
1 r _ s e l e c t i o n s - > s e t _ s e l e c t i o n _ m o d e (
v a l u e = i f _ s a l v _ c _ s e l e c t i o n _ m o d e = > c e l 1 ) .
ENDFORM . " s e t _ s e l e c t i o n s
* _______________________________________________________________
* AL V o u t p u t
* ________________________________________________________________
FORM a l v .
TRY .
Set t ex t s
T i t l e ALV
AL V s el e c t i o n
o p t i o n s
Ge t AL V r ef er ence
241
7 | Administration
c l _ s a l v _ t a b l e = > f a c t o r y (
I MPORTI NG
r _ s a l v _ t a b l e = a l v
CHANGI NG
t _ t a b l e = i _ e d i d c ) .
CATCH c x _ s a l v _ m s g I NTO e x c .
msg = e x c - > g e t _ t e x t ( ) .
MESSAGE msg TYPE * A .
ENDTRY .
PERFORM t i t l e USI NG ' S e l e c t e d I D o c s 1 .
p e r f o r m s e t _ s e l e c t i o n s USI NG a l v .
a 1 v - > d i s p 1 a y ( ) .
p e r f o r m s t a t u s _ c h a n g e .
a 1 v - > d i s p l a y ( ) .
ENDFORM .
L i s t i n g 7.1 St at us Conv er si on o f Sel ect ed I Docs
7.6 S u m m a r y
Thi s c h a p t e r g a v e y o u an o v e r v i e w o f a d m i n i s t r a t i v e t asks t h a t are
r e l a t e d t o IDocs. De p e n d i n g on t h e s t r u c t u r e o f y o u r compa ny, s o me o f
t hi s w o r k mi g h t b e d o n e by a s pec i a l d e p a r t m e n t , b u t y o u s h o u l d k n o w
wh i c h wo r k has t o be d o n e . We ' v e a l s o i n c l u d e d s o m e h i n t s f or dai l y
w o r k a n d e r r o r ha ndl i ng.
2 4 2
This c h a p t e r provides some t i p s on usi ng SAP Net Weav er Process
Integration to s e n d or receive IDocs.
8 IDocs in Conjunction with SAP
NetWeaver Process Integration
C o mmu n i c a t i o n i n SAP Ne t We a v e r Pr oces s I n t e gr a t i on (SAP Ne t We a ve r
PI) us i ng IDocs is i m p l e m e n t e d vi a t h e IDoc a da pt e r . Th e r e q u i r e m e n t
i n t h e c r e a t i o n o f t h e IDoc a d a p t e r i n SAP Ne t We a v e r PI wa s t h a t no
di f f e r enc e ma y a r i s e f o r t h e b a c k e n d s y s t e ms i f t h e y c o mmu n i c a t e wi t h
SAP Ne t We a v e r PI i n s t e a d o f w i t h a n o t h e r b a c k e n d s y s t e m. For IDoc
d e ve l ope r s , t hi s me a n s t h a t act ual l y n o t h i n g n e e d s t o be d o n e ni ce,
r i ght ? But it' s i m p o r t a n t t o k n o w w h a t h a p p e n s i n SAP Ne t We a v e r PI so
t hi s r ul e c a n be f ol l owed.
As y o u ' v e l e a r n e d i n t h e c o u r s e o f t hi s b ook, IDocs wo r k wi t h logical
s y s t e ms o r w i t h p a r t n e r r ol es. In SAP Ne t We a v e r PI, y o u wo r k wi t h
b us i ne s s s y s t e ms t h a t a p p r o x i ma t e l y have t he s a me me a n i n g . On e d i f
f e r enc e, h o we v e r , is t h a t w h i l e p a r t n e r s a n d l ogi cal s y s t e ms ar e l i mi t ed
t o 10 cha r ac t e r s , b u s i n e s s s y s t e ms c a n h a v e a l e n g t h o f 2 5 6 char act er s.
I n SAP Ne t We a v e r PI, a c o n v e r s i o n f r om t h e l ogi cal s y s t e m t o t h e b u s i
n e s s s ys t e m a n d vi ce ver sa occur s . The f ol l owi ng s e c t i o n s d e s c r i be t he
c o n v e r s i o n opt i ons .
8.1 Conversion of Logical Systems
to Business Systems
In t h e SNDPOR field o f t h e cont r ol r e cor d o f an IDoc, SAP s ys t ems al ways
s e n d t h e c o mb i n a t i o n o f SAP< SID> , f o r e x a mp l e , SAPJOO f o r a n SAP s ys
t e m t h a t is cal l ed J 0 0 . In t h e MANDT field, y o u t h e n have t he c l i e nt f r om
w h i c h t h e IDoc wa s g e n e r a t e d .
Busi nes s s ys t ems
i n SAP N e t We a v e r
PI
" S N D P O R " f i e l d i n
SAP sy s t ems
243
8 | IDocs in Conjunction with SAP NetWeaver Process Integration
SLD
Ref er enc e t o t he
l ogi c al s ys t em
Par t i es i n SAP
N e t We a v e r PI
Pa r t n e r c o n v e r s i o n
In t h e SLD (System Landscape Directory) o f SAP Ne t We a v e r PI, y o u i ni ti al l y
r e gi s t e r t h e SAP s y s t e ms as a t echni cal s ys t e m wi t h t h e i r s y s t e m ID, o r
t h e y ar e c r e a t e d manual l y. All avai l abl e cl i ent s a r e k n o w n t h e n , a n d t he
l ogi cal s y s t e m n a m e f r o m t h e c l i e nt m a n a g e m e n t is a d o p t e d o r ma i n
t a i n e d f o r al l cl i ent s.
W h e n y o u c r e a t e a b u s i n e s s s y s t e m, y o u t h e n r e f e r e n c e e xa ct l y o n e
c l i e n t s o t h a t t h e l ogical s ys t e m n a m e is a u t o ma t i c a l l y d e t e r m i n e d f or
each b u s i n e s s s y s t e m. I f an I Doc is r e cei ved, y o u u s e t h e s y s t e m ID
f r o m SNDPOR t o d e t e r m i n e t h e SAP s y s t e m a n d t h e c l i e n t t o d e t e r mi n e
t h e b u s i n e s s s y s t e m. Thi s c l i ent is t h e n u s e d as t h e s e n d e r f o r f u r t h e r
pr oc es s i ng.
The SNDPRN field f or t he n a m e o f t h e l ogical s ys t em, wh i c h al so exi st s
i n t h e s e n d i n g s y s t e m, i s n ' t c o n s i d e r e d . I f t h e s e n d i n g s y s t e m i s n t an
SAP s y s t e m, t h e val ue is r ead f r o m t h e SNDPOR fi el d, t oo. In t hi s case, a
n a me t h a t ma t c h e s SNDPOR is s e a r c h e d a m o n g t he logical s y s t e m names
t h a t ar c a s s i g n e d t o t h e bus i ne s s s ys t ems , a n d t h e n t h e a s s o c i a t e d bus i
ness s ys t e m is used.
Thi s m e a n s t h a t non- SAP p a r t n e r s m u s t p o s s i b l y p r e p a r e y o u r IDocs
di f f e r e nt l y i f t h e y a r e p r o c e s s e d vi a SAP Ne t We a v e r PI. I f t h e s e n d i n g is
di r e c t l y t o an SAP s y s t e m, t h e SNDPRN field wo u l d be r el evant . Ideally,
y o u r p a r t n e r s e n d s t h e s a me n a me i n b o t h fi el ds. Fo r IDocs t h a t l eave
SAP Ne t We a v e r PI, t h e SNDPRN field is p o p u l a t e d ac cor di ng t o t h e par t
n e r ' s r e q u i r e me n t s .
8.2 Conversion of IDoc Partner Roles
I f y o u d o n ' t c o mmu n i c a t e w i t h a logical s ys t e m b u t w i t h a pa r t y out s i de
y o u r e n t e r p r i s e , f o r e xa mpl e , wi t h a c u s t o me r o r a v e n d o r , t h e s e n d e r
a n d r e c e i ve r da t a i n t h e IDoc is a l s o c o n v e r t e d i n t o t h e pa r t i e s o f SAP
Ne t We a v e r PI. Thi s is d o n e us i ng t h e Party o b j e c t t h a t is avai l abl e t he r e
(see Fi gur e 8. 1).
T h e a g e n c y is s pe c i f i e d as ht t p : / /s a p . c o m / x i/ X I f o r t h e act ual n a me in
SAP Ne t We a v e r PI. Fo r EDI c o n v e r s i o n s i t s s pe c i f i e d w i t h t h e val ues
" 016" a n d " 009" a n d can b e s e l ec t ed as s uch. For o t h e r val ues, y o u can
2 4 4
Header Mapping | 8 . 3
assi gn t h e age ncy itself. I f an IDoc is r e cei ved, t h e v a l u e f o r t h e s c he me
is A L E # < p a r t n e r t y p e > # p a r t n e r r o l e > .
Edit Party Status In Process
Party Sabine
Description
Communication Components Communication Channels
as
Agency * Scheme* N a m e '
rttpHsapcorrVciM XIParty Sabine
>09 OLN 012345678901
016 DUNS 123456789
ALE ALE*LS LOGSYS
EDI ALE#LI#LF V e n d o r n u m
F i gu r e 8.1 Par t i es i n SAP N e t We a v e r PI
So f or a l ogi cal s ys t e m as t h e s e nde r , "ALEtfLS" is s peci f i ed i n t he Scheme
field b e c a u s e no p a r t n e r r ol e s ar e k n o w n t h e r e , a n d t h e N a m e field
i nc l ude s t h e l ogi cal s ys t e m n a me . I f y o u h a v e a v e n d o r i n t h e r ol e o f t he
v e n d o r , "ALE#LI#LF" is e n t e r e d i n t he Sc he me field, a n d t h e SAP v e n d o r
n u m b e r f r o m Tr a ns act i on WE2 0 is i n t h e N a m e fi el d. SAP Ne t We a v e r PI
t h e n c o n v e r t s i t i n t o t h e SAP Ne t We a v e r Pi-speci fi c p a r t n e r n u mb e r , in
t hi s case, "SABINE."
8.3 Header Mapping
In t h e o u t b o u n d pr oc es s i ng, t h e IDoc a d a p t e r r e q u i r e s a c o mmu n i c a t i o n
c ha nnel , wh i c h is cal l ed a receiver communication channel. T h e n a mi n g is
f r om t h e b u s i n e s s s ys t e m p e r s p e c t i v e a n d n o t f r om t h e SAP Ne t We a ve r
PI p e r s p e c t i v e w i t h r e gar d t o t h e di r e c t i ons . The c o mmu n i c a t i o n c h a n
nel k n o ws h o w i t c a n r e ach t h e r e c e i v e r o f t h e IDoc. A r e c e i ve r a g r e e
m e n t speci f i es wh i c h c o mmu n i c a t i o n c h a n n e l is s u p p o s e d t o be u s e d f or
w h i c h me s s a ge t ype.
I n t h e r e c e i ve r a g r e e me n t , y o u n o w have t he o p t i o n t o h a v e t h e sys t em
p e r f o r m a header mapping. For t hi s pur pos e , a v a l u e f r om SAP Ne t Weave r
PI is s peci f i ed f o r t he s e n d e r o r r e c e i ve r c o m p o n e n t s o r f or p a r t n e r or
c o mmu n i c a t i o n c o mp o n e n t s . I n t h i s e x a mp l e (see Fi gur e 8. 2), t hi s was
c o n v e r t e d f o r t h e t wo c o mmu n i c a t i o n c o m p o n e n t s . SAP Ne t We a v e r PI
C o m mu n i c a t i o n
c h a n ne l
Recei ver
a g r e e m e n t
245
8 | IDocs in Conjunction with SAP NetWeaver Process Integration
t h e n s e a r c he s t h e a p p r o p r i a t e l ogical s y s t e m i n s t e a d o f t h e act ual s e n d e r
o r r e c e i ve r a n d wr i t e s i t t o t h e c o n t r o l r e cor d o f t h e IDoc.
Header Mapping
D Sender Communication Party
O H
0 Sender Communication Component ntegration_Server
r > ]
Receiver Communication Party
0 Receiver Communication Component Training
[ >
g g
F i gu r e 8.2 He a d e r M a p p i n g i n t h e Rec ei v er A g r e e me n t
xPath W h e n y o u cl i ck o n Ad v a n c e d d u r i n g e di t i ng, i n s t e a d o f a p r e d e f i n e d
s e n d e r f r o m t h e SLD, y o u can s pec i f y an xPath t h a t p o i n t s t o a specific
fi el d i n t h e pa yl oad. Th e n , y o u mu s t al so s pec i f y i n t h e as s oc i a t e d c o m
mu n i c a t i o n c h a n n e l h o w t hi s fi el d is s u p p o s e d t o b e s e nt . The synt ax
c o r r e s p o n d s t o t he pa r t y de f i ni t i on. Fi gur e 8. 3 s h o ws an e xa mpl e .
' V Edit Communication Channel Status In Process
Communication Channel
Party
Communication Component
Description
doc.Receiver
Training
Parameters Module
Sender
Agency ALE 3 Schema ALE#LS
Receiver
Agency a l e 5j| Schema ALE#LS
F i gu r e 8.3 Su i t a b l e I d e nt i f i e r s i n t h e xPat h Var i ant
8.4 Handling the Control Record
in SAP NetWeaver PI
Control record in I n SAP Ne t We a v e r PI, y o u c a n pr ocess t h e c o n t r o l r e cor d i n t h e map-
mapping p i n g y o u r s e l f o r h a v e i t cr e a t e d by SAP Ne t We a ve r PI. In ma p p i n g , y o u
c a n l abel t h e c o r r e s p o n d i n g n o d e as i r r e l e v a n t f o r ma p p i n g (sec Figure
8. 4).
2 4 6
Handling the Control Record in SAP NetWeaver PI | 8 . 4
Even i f t h e c o r r e s p o n d i n g n o d e is a m a n d a t o r y s e g m e n t o r c ont a i ns
m a n d a t o r y fi el ds, t h e m a p p i n g c a n n o w be a c t i v a t e d w i t h o u t h a vi ng
i mp l e me n t e d a n a s s i g n me n t . T h e c r o s s e d - t h r o u g h n o d e is di s p l a y e d in
g r e e n s o t h a t i t s a p p a r e n t t h a t e v e r y t h i n g is okay her e.
Q IDoc ORDERS ORDERSQ5
tzmi Miracs iive
Structure Occurrences Type
M O R D E R S 0 5 1.1
- M i o o c 1.1 ORDERS.ORDERSO5
BEGIN required * s d siring
N E D L D C 4 0
[ ]E1EDK01
1.1 E D L D C 4 0 O RDE RS .0 R DE RS0 5
1.1 ORDERS05 E1EDK01
W E 1 E D K I 4 0 . 1 2 ORDERS05 E l EDK14
M E 1 E D K 0 3 ORDERS05 E1EDK03
M E 1 E D K 0 4 0 . 1 0 ORDERS05 E l EDK04
(]E1EDK05 0..16 ORDERS05.E 1EDK06
WE1EOKA1 0 99 ORDERS05 E l EDKA1
M E 1 E D K 0 2 0..10 ORDERS05.E1 EDK02
M E 1 E D K I 7 0 . 4 ORDERS05 E l EDK17
W E 1 E O K I 8 0 3 ORDERS05 E1EDK18
W E 1 E O K 3 5 0 99999 ORDERS05 E l EDK35
M E 1 E D K 3 6 0 99 ORDERS05 E l EDK36
I^JEIEOVCTI 0 99 ORDERS05 E1EDKT1
M E I E O P O I 0 . 9 9 9 9 9 9 ORDERS05 E l EDP01
M E 1 C U C F O 0 99999 ORDERS05.E1 CUCFO
(*] E1 EO L37 0 999999 ORDERS05 E l EDL37
W E 1 E D S 0 1 0 . 5 ORDERSQ5 E1EDS01
F i gu r e 8.4 I g n o r i n g t h e Co n t r o l Recor d i n t h e M a p p i n g
You can al so ma k e s o me s e t t i n g s i n t h e r e c e i ve r c o mmu n i c a t i o n c ha n n e l
( see Fi gur e 8. 5) . Fo r e xa mpl e , i f y o u w a n t t o us e t h e IDoc ser i al i zat i on
vi a qRFC, wh i c h ha s n o t b e e n avai l abl e unt i l SAP Ne t We a v e r 6. 40, y o u
can set t h e Q u e u e Processi ng flag. T h e t ar get s ys t e m t h e n calls t h e I D0C_
I NB0UND_I N_0UEUE f u n c t i o n mo d u l e i n s t e a d o f t h e IDOC_INBOUND_ASYN-
CHRONOUS f u n c t i o n mo d u l e .
O Queue Processing
Apply Control Record Values from Payload
Take Sender from Payload
Take Receiver from Payload
Restore Original Parlies for Acknowledgments
F i gu r e 8.5 I D o c Recei ver C o m mu n i c a t i o n Channel
D e a c t i v a t i n g nodes
i n t h e m a p p i n g
S e t t i n g s i n
t h e I Do c
c o m m u n i c a t i o n
c h a n ne l
247
8 | IDocs in Conjunction with SAP NetWeaver Process Integration
Co n t r o l r ecor d
f r o m pa y l o a d
SAP N e t We a v e r PI
as t h e ac t ual
I D o c r ec ei v er
You s e t t h e Appl y Cont r ol Recor d Values f r om Payl oad flag i f y o u p o p u
l at e t h e c o n t r o l r e c o r d i n ma p p i n g y o u r s e l f . I f y o u d o n ' t p o p u l a t e t he
c o n t r o l r e cor d i n m a p p i n g a t all (as i n t h e p r e v i o u s e x a mp l e w i t h t he
c r o s s e d - t h r o u g h c o n t r o l r ecor d) , t hi s flag m u s t n e v e r be s et . Howe ve r , i f
y o u w a n t t o us e pa r t s o f t h e payl oad t o d e t e r m i n e t h e par t y, y o u mu s t
s e t t hi s flag, a n d t h e c o n t r o l r e cor d m u s t be p o p u l a t e d a c c or di ngl y in
mappi ng.
I ns t ea d o f a c o n v e r s i o n o f t h e s e n d e r s a n d r ecei ver s, y o u c a n t a ke t h e m
di r e c t l y f r o m p a y l o a d i f t h e c o r r e s p o n d i n g fl ags a r c s et . O f cour s e, t hi s
s aves t i me b e c a u s e t h e c o n v e r s i o n o f a n I Doc i n t o XMI. is t i me - c o n s u m
i ng. Finally, y o u can al so r e s t o r e t h e or i gi nal par t i es f o r s e n d i n g a c k n o wl
e d g m e n t s i n s t e a d o f c o n v e r t i n g t h e m i n SAP Ne t We a v e r PI.
8.5 Updating IDocs Directly in SAP NetWeaver PI
I f y o u w a n t t o s e n d a n IDoc di r ec t l y t o SAP Ne t We a v e r PI a n d i f it' s s u p
pos e d t o be u p d a t e d i n t h e local dat aba s e, t h a t is, i f SAP Ne t We a v e r PI is
t h e act ual d a t a r e c e i ve r a n d d o e s n ' t j u s t a s s u me t h e t ypi cal me d i a t o r role,
y o u c a n us e t h e IDXIDOCINB t abl e. All IDocs t h a t ar e e n t e r e d i n t hi s t abl e
ar e u p d a t e d by SAP Ne t We a ve r PI i t s e l f i n s t e a d o f f o r wa r d i n g t hem.
You can i n s e r t IDocs u s i n g t h e IDX_SELECT_IDOCTYP_WITHOUT_IS r e por t .
You c a n r e m o v e a l r e a d y - e n t e r e d I Docs u s i n g IDX_DELETE_IDOCTYP_
WITHOUT_IS.
8.6 Summary
Thi s c h a p t e r ha s d e s c r i b e d w h a t y o u h a v e t o c o n s i d e r w h e n y o u us e
IDocs i n SAP Ne t We a v e r PI, a n d wh i c h s e t t i ngs f aci l i t at e y o u r wo r k .
Havi ng IDoc i nt er f aces al r e a dy i n all SAP Rel eases as wel l as t h e s t r uct ur e
o f IDocs w h e r e c o n t r o l i n f o r ma t i o n is par t o f t h e me s s a ge i t s e l f l e a d to
s o me speci al IDoc f un c t i o n a l i t y i n s i d e o f SAP Ne t We a v e r PI.
The Author
S a b i n e Ma i s e l ha s w o r k e d as a n SAP c o n s u l t a n t
si nce 1 9 96, ha vi ng ga i ne d h e r i ni t i al SAP R/3 e x p e
r i e n c e as a n e mp l o y e e o f a b e t a c u s t o m e r o f SAP.
She al so h o l d s t r a i n i n g c our s e s f or SAP i n Swi t zer
l and a n d Ge r ma n y o n all aspect s o f SAP Ne t Weave r
i nt e r f a c e t e c h n o l o g i e s a n d t h e SAP Basis. In a d d i
t i on, Sabi ne has u n d e r t a k e n d e v e l o p me n t w o r k f or
t h e AFS (Apparel a n d Footwear Solution) i n d u s t r y
s o l u t i o n a n d s u p p o r t wo r k f or c u s t o m e r pr oj ect s.
He r s pe c i a l i z a t i ons ar e i n t e r f a c e t e c h n o l o g i e s , SAP Ne t We a v e r PI/XI,
ABAP d e v e l o p me n t , a n d w a r e h o u s e ma n a g e me n t .
249
Index
A
A B A P L i s t V i e w e r - * AI . V. 1 3 4
A c k n o w l e d g m e n t , 187
Ag e n c y , 2 4 4
A g e n t a s s i g n me n t , 184
AL E , 15
business process, 15, 18
c o m m u n i c a t i o n layer, 35
Cu sto miz ing - > SALE, 31
scenario, 15, 18
service, 45 , 73, 8 4 , 134
A L E 0 0 0 0 1 , 119
A L E A U D . 1 8 7 , 2 3 0
A L E i n t e r f a c e
f o r BAPI, 173
f o r f u n c t i o n modules, 174
A L E _ M O D E L _ D E T E R M I N E _ I F _ TO_
SEND, 155
ALE_PROCESSI NG, 50
AL E RE Q0 1 , 42
AL E _ S ERI A L _ K EY2 CH ANNE L , 2 0 0
ALV, 231
A N S I ASC X 1 2 . 27
AP I ( A p p l i c a t i o n P r o g r a m m i n g
I n t er f ac e) . 18
A p p l i c a t i o n , 43
A p p l i c a t i o n a c k n o w l e d g m e n t , 187
A p p l i c a t i o n L i n k E n a b l i n g - AL E , 15
A p p l i c a t i o n r e c o r d , 21
A r c h i v i n g o b j c c t , 2 2 5
A s y n c h r o n o u s i n t c r f a c c , 17
a _ t _ c o mp l e x _ ma t n r , 135
B
BA d I , 91
classic, 103
i m p l e m e n t i n g class, 113
in t er f a ce, 91, 113
new, 110
BAPI , 1 8, 4 7
release, 19
B A P I J D O C J N P U T l , 4 7
B A P I J D O C J N P U T P , 47
BA PI RE T M, 174
BAPI RETS, 174
B A P I _ T R A N S A C T I O N _ C O M MI T , 19
BAPI _ T R ANSA CT I ON_ ROU. B ACK, 19
BAPP, 47
Basi c t y p e , 1 2 6
BD1 0 , 4 0
BD4 0 , 195
BD4 1 , 196
BD4 2 , 197
BD4 3 , 197
BD4 4 , 194
BD5 1 , 168
BD5 2 , 32
BD5 3 , 3 8, 4 0
BD5 4 , 25
BD5 5 , 84
BD5 6 , 77
BD5 7 , 1 9 8 , 199
BD5 8 , 89
BD5 9 , 74
BD6 0 , 3 4, 36 , 6 9 , 7 0 , 1 35, 151
BD6 4 , 2 6 , 4 1 , 6 7
BD6 5 , 37
B D 66, 34
B D 68, 72
BD7 9 , 81
B D 8 7 -* I D o c - M o n i t o r , 24
BD9 5 , 7 3, 198
BD9 7 , 48
BD 1 0 0 ; B D 9 7 a , 2 0 2 , 2 0 4
B D l 0 1 ; B D 9 7 b , 202
B D 1 0 2 ; B D 9 7 c . 2 0 4
B D 1 0 3 ; B D 9 7 d , 2 0 5
B D 1 0 4 ; B D 9 7 e , 2 0 0
B D 1 0 5 ; B D 9 7 f , 2 0 0
BDA 4 , 1 7 6
BDBG, 2 4 , 4 7 , 1 73, 1 7 4
251
Index
BDCP, 36
BDCP2, 36
BDCP_BEFORE_WRI TE, 121
BDCPS, 36
BDFG, 174
BDSF. R, 198
BF01. 1 0 0
BF05. 1 0 0
B i n d i n g . 181
B O M M A T , 2 0 0
BOR. 1 8. 168
B r e a k p o i n t , 1 1 0
BTE, 9 0
B U S 1 0 0 1 0 0 6 , 168
Busi ness A d d - I n - B A d l . 91
Busi ness A p p l i c a t i o n P r o g r a m m i n g
I n t e r f a c e -* BAPI , 18
Busi ness O b j e c t R e p o s i t o r y - BOR, 18
Busi ness o b j e c t t y p e . 18
Bus i ness - r el at ed e r r o r , 20
Busi ness s y s t em. 243
Busi ness t r a n s a c t i o n e v e n t - BTE, 90
Busi ness w o r k f l o w , 18
c
CALI . C U S T O ME R - F U N C T I O N , 93
C f i l e. 23
Change d o c u m e n t , 30
C H A N G E D O C U M E N T . C L O S E , 30
C H A N G E D O C U M E N T . O P E N , 30
Change p o i n t e r , 31
a c t i v a t e generally, 32
f o r message type, 32
f o r reduced message types , 4 0
CHANGE_POI NTERS_CREATE, 31
CHANGE_ POI NTERS_ CREATE_ L ONG,
31
Ch a n n e l n u m b e r . 2 0 0
CI MTYP, 93
CL02, 72
Cl ass. 71
Cl assi c B A d l , 103
Cl as si f i cat i on, 6 9. 72
C L . E X I T H A N D L E R , 103
C M O D , 94
C O M M I T . 92
C o m m u n i c a t i o n c h a n n e l , 2 4 5
C o m p a n y c o d e , c r oss - syst em, 85
CONDENSE, 1 5 3 . 157
C o n d i t i o n t e c h n i q u e . 43
C o n v e r s i o n e x i t , 83
CONVF. RSI ON_ FXI T_ AI . PHA_ OUTPUT.
83
C o n v e r s i o n r o u t i n e , 83
Cr oss- syst em busi nes s area, 85
Cr oss- syst em c o m p a n y code, 85
Cu s t o me r
d i s t r i b u t i o n model, 2 6 , 6 7
m a n a g e m e n t object, 101
proj ect, 9 5
s e gm e nt, 122
C u s t o me r e x i t , 9 0 , 93
D
Da t a c h a n n e l r egi s t r y , 204
Da t a D i c t i o n a i y - * D D I C , 124
Da t a r ec o r d , 2 1
Da t a Sour ce, 228
Da t e f i e l d , 153
D D I C , 124
De b u g g i n g . 55
De c i ma l n u m b e r , 153
De s c r i p t i o n
s e m a n t i c , 16
technical, 16
D i a l o g cal l , 48
D i s t r i b u t i o n cl ass t y p e , 70
D o c u m e n t n u m b e r , 198
D T D ( D o c u m e n t Ty pe D e s c r i p t i o n ) , 23
E
E D I , 2 6
EDI FACT. 2 2. 2 7 . 144
E DI . PROCESSI NG, 44 , 50
EDI S, 6 5 , 175
E l e c t r o n i c Da t a I n t e r c h a n g e - * E D I , 26
252
Index
E n h a n c e me n t , 9 1, 9 5. 1 0 7
check, 1 2 9
d ynamic, 1 1 8
explicit, 1 0 7
i m p l e m e n t . 108
i m p l e m e n t a t i o n , 111
im p l i c i t , 115
p a r t n e r prof il e, 131
p o i n t , 107
proj ect, 9 0
release, 128
section, 107, 108
s p o t , 91, 107, 108, 1 1 0
s t a t i c , 118
technology, 6 7
type, 1 2 5
F. OI O ( E q u a l l y O n c e I n O r d e r ) , 2 0 5
E r r o r
business-related, 20
s t a t u s , 167
technical, 20
E r r o r w o r k f l o w , 1 7 5 , 176
connection, 167
Ex i t , 9 0
E X I T . S A P L B D 1 1 . 0 0 1 , 119
E x t e n s i b l e M a r k u p Language - X M L ,
23
E x t e n s i o n , 126
F
Fet ch I Do c , 41
FI BF, 101
F I DCMT , 89
Fi l e, 23
FI LE, 140
Fi l e p o r t . 56 . 138
F i l t e r g r o u p , 68
F i l t e r o b j e c t , 6 7, 68, 73
F l o a t i n g p o i n t n u m b e r , 153
F u n c t i o n m o d u l e
e v a l u a t i o n o f change po int e r s , 34
f i l e n a m e g e n e r a t i o n , 138
f o r q u e u e names, 2 0 6
t e s t , 55
G
GDPd U. 2 2 4
Gener al m e t h o d cal l , 48
Gener al r ul e, 83
Gener al t ask, 1 8 1 , 184
Gener at e c o n t r o l r e c o r d , 158
G e r m a n P r i n c i p l e s o n Da t a Access and
t he E x a m i n a t i o n o f D i g i t a l D o c u me n t s ,
2 2 4
G E T ' B A D I , 110
G M P ( Go o d M a n u f a c t u r i n g Pr act i ce) ,
2 2 4
H
He a d e r m a p p i n g , 2 4 5
He a d e r r e c o r d . 21
He a d e r t abl e, 141
H T M L ( H y p e r t e x t M a r k u p Language) ,
23
HTTP ( H y p e r t e x t T r a n s f e r Pr o t o c o l ) , 23
I
I Do c , 18
adapter , 2 4 3
ad m i n i s t r a t o r , 184
monitor , 24 , 160, 1 6 8
request, 41
s t a t u s f i l e , 62
suppress, 68, 76
tr acking, 24
type, 22
I DOCAP PL , 176
I D O C B O M M A T , 2 0 0
I DOC_ DAT E_ T I ME _ GE T, 24
I D O C J N B O U N D _ A S Y N C H R O N O U S , 23
I D O C _ I N B O U N D _ I N _ Q U E U E , 205
I DOC_ I N P U T _ M A T M A S 0 1 , 133
I DOC_ REDU CT l ON_ F I EL D_ REDUC E,
156
I DOCREL , 2 1 1 , 212
I DOC_ SE RI AL I Z A T I ON_ CHE CK, 199
253
Index
I DOC_ SERI AL _ POST 199
I DX_ DE L ET E _ I DOCT Y P_ WI T H OU T _ I S,
2 4 8
I D X I D O C I N B , 2 4 8
I DX_ SEI . ECT _ I DOCTYP_ WI THOUT _ I S,
2 4 8
I m p o r t i n g p a r a me t e r u n i q u e , 165
I n b o u n d i n t e r f a c e , 15
I n f o s t r u c t u r e , 2 2 7
I n i t i a l , 153
I NPUT ERROROCCURRED, 179
i n p u t F i n i s h e d , 1 7 8 , 181
I N P U T F O R E G R O U N D , 179
I n t e r f a c e
asynchronous, 17
s ynchr onous, 16
I n t e r m e d i a t e D o c u m e n t - > I D o c , 18
I SO code, 1 4 4 , 1 5 3
I t e m t abl e, 141
K
KEY, 33
L
L i n k , 211
Logi cal message, 151
Logi c al s y s t e m ( LS), 25
M
M a n d a t o r y f i e l d , 37
M a n d a t o r y s e g me n t , 1 2 7 , 148
M a s t e r da t a, 29
MA S T E R I D O C _ C R E A T E _ M A T M A S , 9 3,
107
MA S T E RI D O C_C REATE_ SMD_
M A T M A S , 135
M A S T E R J D O C _ D I S T R I B U T E , 159
MA T F E T , 2 6, 41
M A T M A S . 2 2 , 2 6
m b d c o n w f , 16 2
Message
code, 44
control, 2 9 , 4 3
d e t e r m i n a t i o n , 44
f u n c t i o n , 44
Mes s age t y p e , 2 2 , 1 5 1
reduced, 3 7
M e t a i n f o r m a t i o n , 22
M e t h o d c a l l , 48
M G V 0 0 0 0 1 , 95
M G V 0 0 1 0 0 , 100
M o d i f i c a t i o n , 90
M O V E , 81
N
NAC E, 43
N a m i n g r ul e, 148
c u s t o m e r object, 4 7
own object, 3 9
N e w B A d I , 110
N O _ D A T A char act er , 30
o
0 1 CL. 70
Ob j e c t c h a n n e l s e r i a l i z a t i o n , 2 0 0 , 201
Ob j e c t Key, 2 1 4
Ob j e c t ser vi ces, 214
OBJTYPE, 212
OPEN_FI _PERFORM_
XXXXXXXX_ E' ; OPEN_ FI _ PERFORM_
XXXXXXXX_E, 99
ORDCHG, 2 2, 198
ORDERS, 22
O r g a n i z a t i o n a l m a n a g e me n t , 1 8 4
O u t b o u n d i n t e r f a c e , 15
O u t b o u n d p a r t n e r p r o f i l e , 44
O u t p u t
type, 43
O Y E A , 184
254
Index
P
Par t ner , 26
i n b o u n d prof il e, 2 4
o u t b o u n d prof il e, 2 4
p ro f il e, 45, 79
role, 4 3 , 145
Part y. 2 4 4
P F T C J N S , 178
PI - * SAP N e t W e a v e r PI . 187
P o r i m a n a g e me n t , 138
Pr ocess code, 168
BAPI, 174
BAPP, 174
Pr ocessi ng l ay er , 63
Pr ocess I n t e g r a t i o n - SAP N e t We a v e r
PI, 187
Pr ocess i n t e r f a c e , 91
Pr opos al f o r r ul e, 81
P r o x y i n t e r f a c e , 16
P/ S i n t e r f a c e , 91
P u b l i s h & Su b s c r i b e - > P/ S i n t e r f a c e , 91
Q
qRFC, 205
Qu a l i f i e r , 1 4 4 , 145
Q u a l i t y o f Ser vi c e, 2 0 5
Qu e ue , 2 0 9
Qu e u e d RFC - qRFC, 205
R
R B D M I D O C , 35
RBDSF. R01, 1 9 4 , 195
RBDSnR02, 1 9 6
RBDSER03, 1 9 7
RBDSER04, 197
RBDSRCLR, 199
RDBSTATE, 188
Recei ver , 26
Re c e i v e r c o m m u n i c a t i o n c h a n n e l , 2 45,
2 4 7
Reduced message t y p e , 37
Rel ease s e c u r i t y , 1 5 , 1 9
Re mo t e F u n c t i o n Cal l -* RFC, 16
Request , 16
Request I Doc s , 41
Response, 16
RFC, 16
qu e u e d - * qRFC, 2 0 5
synchr onou s - > sRFC, 19
t r a n s a c t i o n a l - tRFC, 19
R F M ( RFC- enabl ed f u n c t i o n m o d u l e ) ,
18
ROL EI D, 212
ROLLBACK, 92
Ro o t s e g me n t , 78 , 79
RSEOUTOO, 59 , 196
RSNAST00, 4 4 , 58
RSRLDREL, 215
Rul e, 67 , 80
general, 83
s
SALE, 2 5 , 31
Sa mp l e f i l e. 56
SAP_ AI . E_EDI QUEUE, 2 0 6
S A P_ I DOC_ 0 0 1 , 2 2 7
SAP N e t W e a v e r PI , 2 0 5 , 2 4 3
agency, 2 4 4
header m a p p i n g , 2 4 5
p a r t n e r , 26
p a r t y , 2 4 4
SARA. 225
SARI . 2 2 8
SBWP, 183
S E 1 1 . 1 2 4
SE18. 103
SE19. 1 0 3 . 110
SE80, 111
SE84. 91
Segment
d e f i n i t i o n , 124
f i l t e r , 76
q u a l i f y i n g , 145
release, 125
type, 2 3 , 1 2 4
version, 8 4
Sender , 26
255
Index
Se n d e r f i el d
convert, 83
copy, 8 2
SERDAT. 1 9 7
SERI AL, 1 9 8 , 203
Se r i a l i z a t i o n , 193
business objects, 200
f l a g , 202
g r o u p , 193, 194
t i m e s t a m p , 1 9 8
Shar ed M a s t e r Da t a T o o l > S M D , 29
Si g nat ur e, 1 5 4
i n b o u n d f u n c t i o n module, 162
SLD, 2 4 4
S M 5 9 , 102
S M D , 29
SNDPOR, 2 4 3
SNDPRN, 2 4 4
SOAP, 16
Speci al m e t h o d c a l l , 48
sRFC, 19
SRRELROI . ES, 211
St an d a r d i n b o u n d p r oc es s i ng, 54
St an d a r d i n t e r f a c e , 15
St an d a r d o u t b o u n d p r o c es s i ng, 57
St an d a r d t ask. 178
St at us 4 2 < n o r m a l > , 57
St al us 5 3 < n o r m a l > , 188
St at us 6 6 , 2 0 4
St at us 6 8 < n o r m a l > , 188
St at us 7 4 < n o r m a l > . 61
STATUS I Do c , 62 , 1 9 0
St at us r ec o r d , 21
Success st at us, 1 6 7
S W 0 1 , 176
S y n c h r o n o u s i n t er f ac e, 16
S y n c h r o n o u s RFC > sRFC, 19
SYSTAT, 6 2 , 2 3 0
Sy s t em Landsc ape D i r e c t o i y > SLD, 2 4 4
Sy s t em name, l ogi c al , 25
Sy s t em, t e c h n i c a l , 2 4 4
T
Task, gen er a l , 1 8 1 , 184
Tec hni c al e r r o r , 2 0
T ec hni c al s y s t e m, 2 4 4
Templ at es , 45
Test
f l a g , 54
f u n c t i o n module, 55
t r a n s a c t i o n , 51
T i me , 153
Tr a n s a c t i o na l RFC - t REC, 19
T r a n s a c t i o n dat a. 29
T r a n s a c t i o n s e c u r i t y , 17
T R A N S I D , 212
T r a n s mi s s i o n m e d i u m 6, 4 3, 44
T r a n s mi s s i o n m e d i u m A , 43 , 50
T r a n s p o r t I Do c , 23
t REC, 19
u
U N / E D I FACT - > E D I FACT, 22
Un i c o d e . 56
U N I T _ 0 F _ M E AS U RE J S 0 _ T 0 _ S A P, 165
UNI T _ OF _ MEASURE_ SAP_ TO_ I SO, 157
U p d a t e t e c h n i q u e , 19
V
V e r s i o n c o n v e r s i o n , 84 , 119
V i e w . 77
w
W E 0 9 . 228
WF. 14, 58
W E 1 6 , 60
W E 1 7 , 65
W E 1 8 , 63
W E 1 9 , 5 2, 65
W E 2 0 , 2 4, 50 , 1 1 9 , 194
W E 2 1 , 138
W E 2 4 . 45
W E 2 7 , 45
W E 3 0 , 1 2 6 , 148
W E 3 1 . 124
W E 3 2 . 78
2 5 6
Index
WE 4 1 , 44
WE 4 2 , 1 6 9
W E 4 7 , 6 3. 2 2 4
W E 5 5 , 1 3 9
WF. 57 , 1 3 3 . 168
WF. 60 , 1 5 0
WF. 62, 81
W E 8 1 , 151
W E 8 2 , 1 3 6 , 151
W E 8 5 , 205
W E D I , 51
WE I N B Q U E U E , 208
W E N O U N K S , 2 1 4
WE O U T Q U E U E . 2 0 6
W M T O R D , 46
X
X M L , 23
xPat h. 2 4 6
257