0% found this document useful (0 votes)
161 views12 pages

Enhancement of IDoc Type

Download as doc, pdf, or txt
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 12

Usually enhancement takes place when the content in IDocs provided by SAP are not sufficient for the

business process. IDoc extension can take place whenever dictionary table has a new structure
appended required by the business process.
In brief IDoc extension takes place when extra fields are required for the business process.
et us take a scenario and understand the process of IDoc extension.
In this scenario say visitor is different from the actual customer who has came to the sales office in
behalf of the customer to obtain the quotation or inquiry etc. !r an authori"ed a#ent qualified by
the actual customer to order for items. So a field by name $A%&'I ('isitor) is added to *ustomer
master data. As there is no provision #iven by SAP to handle this+ we need to extend an IDoc.
,he standard messa#e type and IDoc type provided by SAP are D&-%AS and D&-%AS./.
*onsider the data in the table below for extendin# the IDoc. ,hese details can be understood in
different sections in the process of extendin# it.
-asic IDoc type D&-%AS./
'ersion 0.1
IDoc extension D&-%AS&2,
*ustom se#ment 345$A4
6ields in *ustom Se#ment 'isitor
Parent of *ustom Se#ment &45$A44
Outbound process
Step4. *ustomi"e kna4 table by appendin# a structure provided by SAP (3A5$A4)
*omponent *omponent ,ype
'ISI,!7 $A%&'I

Step89 :rite a module pool pro#ram to update some existin# customers to add data for 'isitor.
Step;9 *reate a custom se#ment
,ransaction *ode9 :&;4
Se#ment type9 345$A44 *lick (create). Provide short text
6ield $ame Data element
'ISI,!7 $A%&'I
Save
Step09 *reate IDoc extension
,ransaction :&;.
!b<ect $ame D&-%AS&2,
*hoose &xtension

*lick and it leads to next screen.
inked basic type9 D&-%AS./
Provide description and enter
!bserve all the se#ments to be copied into your IDoc extension from linked basic
type.
Select &45$A44 and click (create se#ment) to obtain a popup window
Provide the required values and observe child se#ment 345$A44 to be added to
parent se#ment &45$A44.
Step/9 7elease se#ment and IDoc extension
,ransaction9 :&;4
Se#ment type9 345$A44
Path9 &dit Set release

Step=9 Assi#n -asic type to extension > messa#es
,ransaction9 :&?8
*lick + then
Select D&-%AS messa#e type a#ainst D&-%AS.= basic type
*lick provide the information
%essa#e ,ype -asic ,ype &xtension 'ersion
D&-%AS D&-%AS.= D&-%AS&2, 0.1
Delete the earlier one from which it was copied.
Save.
!bserve the result as follows
Step 19 *heck and ,ransport IDoc extension
,ransaction9 :&;.
!b<ect name9 D&-%AS&2,
Path9 Development ob<ect @A *heck
&nsure that there are no errors or warnin#s
$ow transport
Path9 Development @A ,ransport
Step?9 6ind suitable user exit for writin# code to support IDoc extension
,ransaction9 S&?0.
*lick &nhancements
In short text provide BcustomerB
6ind suitable enhancement to be 'S'....4
Alternative way
,ransaction9 S%!D
*lick 60 help for &nhancement
Path9 60help @A SAP Applications @A o#istics #eneral @A o#istics -asic Data @A
-usiness partners @A 'endor %aster.
6ind the enhancement as 'S'....8+ which is an approximate user exit.
$ow search for different extensions like 'S'....4. ,hen see for its components.
Identify the appropriate user exit to be C&2I,DSAP''.4D..4E (*reate &xport of
Additional *ustomer %aster Se#ments). ,his user exit can be used in outbound A&
process+ meant for fillin# the data into custom se#ments.
Fou have to identify here another user exit as C&2I,DSAP''.8D..4E+ which is
helpful for inbound A& process. ,his user exit can be used to read the se#ments
and post it to Application repository.
StepG9 Develop a pro<ect to encapsulate enhancements and components.
,ransaction9 *%!D.
&nhancement9 custex and click *reate to provide attributes.
*lick &nhancement Assi#nments.
Provide 'S'....4+ short text and save.
6rom the initial screen of the transaction+ select components and click change.
6ind 0 components to be added.
Activate them.
Select user exit &2I,DSAP''.4D..4 for outbound process and double click it. It leads to
function builder.
Double click on provided include pro#ram 32'S'U.4 and press enter.
$ow+ write supportin# code for IDoc extension+ i.e.+ populatin# custom se#ments in IDoc.
*heck the code and activate.
*ode in 32'S'U.4
BH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B
BH Include 32'S'U.4 B
BH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B
BIn this scenario+ the &45$A44 has been extended to accommodate
BUser@defined fields in the customer table kna4. ,he name of the
Bextended
Bse#ment is "4kna44. ,here is one custom field9 visitor
BH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B
BData declarations
DA,A9 kna4m like e4kna4m+
kna44 like e4kna44+
"4kna44 like "4kna44+
wDkna4 like kna4.
B make sure you are processin# correct messa#e type
check messa#eDtype eq ID&-%ASI.
B make sure data is added after the correct se#ment
check se#mentDname eq I&45$A4%I.
B since customer number is not passed in this user exit+ you need to #o
B throu#h the data records to find the customer number
loop at idocDdata.
case idocDdata@se#nam.
when I&45$A4%I.
move idocDdata@sdata to kna4m.
when I&45$A44I.
move idocDdata@sdata to kna44.
endcase. J case idocDdata@se#name.
endloop. J loop at idocDdata.
B select data from the user@defined fields in kna44.
select sin#le B
from kna4 J *ustomer master table
into wDkna4
where kunnr K kna4m@kunnr.
if sy@subrc eq ..
B set the idoc extension name for control record
idocDcimtype K ID&-%AS&2I.
B clear custom fields from kna4 to extended se#ment
clear "4kna44.
B copy custom fields from kna4 to extended se#ment
move@correspondin# wDkna4 to "4kna44. J field name must be same
B condense all fields of extended se#ment
condense9 "4kna44@visitor.
B populate se#ment name in the data record+ copy data contents into it
B and append the data record to existin# data records in
move I345$A44I ,! ID!*Ddata@se#nam. J administrative section
move "4kna44 to idocDdata@sdata. J data section
append idocDdata.
endif. J if sy@subrc eq ..

Step 4.9
Define o#ical System
Assi#n client to o#ical System
%aintain 76* Destination
%aintain *ustomer Distribution %odel
Lenerate Partner Profiles
Distribute *ustomer Distribution %odel
INBOUND PROCESS
Step 449 Append the custom structure to the table 5$A4 similar to the process done
in outbound process.
Step 48.
Define o#ical System
Assi#n client to o#ical System
Lenerate Partner Profiles

Step 4;. &xecute the transaction to CSend *ustomersE from !utbound system.

Step 40. $ow in the Inbound system+ create the pro<ect in the similar way as done at
outbound side.
In the user exit &2I,DSAP''.8D..4+ find include C32'S'U.8E. :rite the code to
support IDoc extension.
*ode in 32'S'U.8
BH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B
BH Include 32'S'U.8 B
BH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B
data9 kna4m like e4kna4m+
kna44 like e4kna44+
"4kna44 like "4kna44.
data fsDkna4 type kna4.

messa#e i...(.) with II$-!U$D P7!*&SS *A&DI.
!!P A, ID!*Ddata.
case idocDdata@se#nam.
when I&45$A4%I.
kna4m K idocDdata@sdata.
when I&45$A44I.
kna44 K idocDdata@sdata.
when I345$A44I.
"4kna44 K idocDdata@sdata.
select sin#le B
from kna4
into fsDkna4
where kunnr K kna4m@kunnr.
if sy@subrc eq ..
update kna4
set visitor K "4kna44@visitor
where kunnr K kna4m@kunnr.
else.
idocDstatus@docnum K idocDcontrol@docnum.
idocDstatus@status K I/4I.
idocDstatus@ms#ty K I&I.
idocDstatus@ms#id K I3&I.
idocDstatus@ms#no K I../I.
idocDstatus@ms#v4 K kna4m@kunnr.
append idocDstatus.
endif. J if sy@subrc eq ..
endcase. J case idocDdata@se#nam.
endloop. J !!P A, ID!*Ddata.

Step 4/. Assi#n 6% to extension>%essa#e type
,ransaction9 :&/1
Path9 *han#e $ew &ntries
Select CID!*DI$PU,DD&-I,!7E a#ainst D&-%AS.= basic type+ to fill extra
information as shown below.
6unction %odule -asic ,ype %essa#e ,ype &xtension
ID!*DI$PU,DD&-I,!7 D&-%AS.= D&-%AS D&-%AS&2,

Step 4=. &xecute the transaction to CLet *ustomersE.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy