Vous êtes sur la page 1sur 8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

More NextBlog

CreateBlog SignIn

SAPABAP
CO NCEP T S I N A B A P : R EP O R T S , A LV , B DC, S CR I P T S /S MA R T FO R MS , B A P I , ENH A NCEMENT S , CR O S S
A P P LI CA T I O NS , B A DI , A LE/I DO C, U P DA T ES I N S A P

ALESTEPBYSTEPPROCEDUREWITHTCODES
Step1AnalysesHierarchyLevels:
Analysesthedatarelationshipsbeingprocessedintheinterface.

Search

BLOG ARCHIVE

BlogArchive

ABOU T ME

DefinetheappropriatehierarchicalParenttoChildrelationships.

SAP
BAN G AL ORE , KARN ATAKA,

NavigatetotransactioncodeWEDI

INDIA

TransactionWEDIdisplaystheIDOCmainmenu.Thisallows

Thisismargani

navigationaroundthevariousdevelopmentandcontrolareastocreate

V I EW MY CO MP LET E

acustomizedIDOC.
P R O FI LE

Step2Createanewsegment:
viawedi:DevelopmentIDOCSegmentsorTransactioncodeWE31.
EntersegmentnameandclickonCreate.
NameofthethesegmenttypemuststartwithZ1,andhavea
maximumofeightcharacters.
Enterdescriptionandentertherelevantfieldnamesanddata
elements.
Theeachfieldinthesegmentshouldrepresentastructureinthe
programsoforsegmentafieldnameandadataelementmustbe
defined.
SavethesegmentandenterPersonResponsibleandProcessing

CO NCEP T S I N A B A P W I T H T O P I C
WISE

ABAPINTERVIEWQUESTIONS(1)
ABAPOOPS(1)
ALECODINGWITHDISTRIBUTING
OFCUSTOMERDATAFROMHR
TOFISYSTEM(1)
ALESTEPBYSTEPPROCEDURE(1)
ALVPROGARMWITHPOPUP(1)

Person.

ATSELECTIONSCREEN(1)

GotoEditandSetRelease.

BAPI(1)

RepeatthisprocedureforeachnewSegmentintheIDOC.

BDCPROGRAMTOUPLODTHE
DATATOBOM(1)

Step3CreateanewIDOCType
viawediDevelopmentIDOCTypesorTransactionWE30.

BDCPROGRAMUPDATESTHEBOM
WITHDEPENDANCY(1)

Entersegmentname(startingwithZ),clickonBasicTypeandthen

BDCTOBAPI(1)

Create.

BIWINSTALLATIONSTEPS(1)

Createasnew,enterPersonResponsibleandProcessingPerson

BOR(1)

andenterdescription.
OnCreateBasicTypescreendecidewheresegmentsshouldbe
insertedandgotoEdit/CreateSegment.
http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

BUSINESSREQUIREMENTFOR
PROJECT(1)
1/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

CompleterelevantfieldsintheMaintainAttributesscreen:
FromtherelevantsegmentscreatedinStep2entertheSegment
typeandifmandatorysegment.

DIFFERENCEB/WCHECKandIF
STATEMENT(1)

TheMinimumandMaximumnumberofsegmentstobeallowedin

DIFFERENCEBETWEENHIDEAND
GETCURSOR(1)

thesequence.(Oneminimumandonemaximumifsegmentis

FAQ'S(1)

mandatory).
TheParentSegmentandHierarchyLevelwillbeautomatically

FAQ'SONCROSSAPPLICATIONS
(1)

createddependingonwhereintheIDOCtreeyoudecidedtocreate

FOREIGNKEY(1)

thatparticularsegment.
RepeatthisprocessforeachsegmentneededintheIDOCtype,
decidingwhethertoaddthenextsegmentsatthesamelevelorasa
Child.
WhenIDOCcreatedreturntoinitialscreen.GotoEditandSet

INTERVIEWTIPSandHOW
RESUMELOOKLIKE(1)
MMFLOWINSAP(1)
OOPS(1)

Release.

OVERALLCONCEPTSINABAP(1)

GotoTransactionWE60toviewtheIDocTypeyouhavecreated.

PROGRAMFORPURCHASEPRICE
VARIANCE(1)

Step4CreatenewMessageType

PROGRAMFORSCRIPT(1)

viawediDevelopmentMessageTypesorTransactionWE81.

PROGRAMFORSMARTFORM(1)

Display/ChangeandclickonNewEntries
CreateanewMessageTypeandSave.

REPORTFORCUSTMORBALANCE
(1)

Step5LinkMessageTypetoIDOCType

REPORTFORINITIALLOADOF
STOCKS(1)

viawediDevelopmentIDOCType/MessageorTransactionWE82.
Display/ChangeandthenclickonNewEntries.
EnterMessageType,BasicType(IDOCType)andRelease(46C)

REPORTFORPERFORMACEOF
VENDORWITHRESPECTTO
GOODSRECEIVED(1)

andSave.

REPORTFORSALESCURRENT
MONTH(1)

Step6CreateanentryinEDP13viatransactionsWE20andBD64.

REPORTFORSHIPPINGINVOICE
DETAILS(1)

ThepartnerprofilefortheIdocmustbesetupandgeneratedinthe
transactionBD64andtransactionWE20.
WE20AddMessageTypetoappropriatePartnerType,Enter
MessageType,ReceiverPortandIdocTypeandsave.
BD64CreateaModelView,EnterSenderandReceiverPorts,
AttachMessageType.GotoEnvironmentonMenuandclickon
GeneratePartnerProfilesandgenerate(notsave)profile.
Step7PopulatethecustomIDOCviaABAPProgram
SeeTestProgramZOUTBD_IDOC_TEMPLATE,AppendixIV.
CreateanInternalTableforeachsegmenttype,thisshouldbe
exactlythesamestructureasthesegmenttype.
ThecontrolrecordisfilledintoastructurelikeEDIDC.Themessage
typeandtheIdoctypefortheIdocmustbepopulatedintotheeddic

REPORTTOLISTCASHRECEIPTIN
ACCOUNTSRECEIVABLE(1)
SAMPLEEXAMPLEFORBAPI(1)
SAMPLEEXAMPLEFOR
PURCHASE_ORDER_DETAILS
(1)
SAMPLEEXAMPLEFOR
VENDER_BANK_DETAILS(1)
SAPFICOTABLESANDRELATION
BETWEENFICOTABLES(1)
SAPMMTABLESANDRELATION
BETWEENMMTABLES(1)

structure.

SAPOOPS(1)

PERFORMpopulate_Control_structureUSINGc_mestyp

SAPSDTABLESANDRELATION
BETWEENSDTABLES(1)

c_SEGMENT_type1.
http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

2/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

Thedatasegmentsarefilledintoastructurelikeediddsdatasdata

SDFLOWINSAP(1)

andthesegmentnamearepopulatedintotheeddiedstructure.

THEREPOTPROVIDES
INFORMATIONONAGINGOF
FSE(1)

PERFORMtransfer_Parent_data_to_seg.
ThestandardSAPfunctionmoduleMASTER_IDOC_DISTRIBUTEis
calledtopassthepopulatedIDOCtotheALELayer.
PERFORMmaster_idoc_distribute.
NOTE:Thisfunctionmoduleisonlycalledforstandaloneprograms

TRANSACTIONSAND
DESCRIPTIONS(1)

andSharedMasterDataprograms(SMD).Itisnotcalledwhenusing

Whatisthetypicalstructureofan
ABAPprogram?(1)

extensionsoroutputdetermination.

WORKFLOWBUILDINABAP(1)

TheALELayerhandlesthesendingoftheIDOCtothereceiving
system.
Errorhandling(seeStep7b).
Commitwork.
ProjectSpecificStep7bErrorHandling
Analyzewhichfieldsintheinterfacearemandatoryforthereceiving

S A P A ND O T H ER ER P CO NS U LT A NT S

ALLSAPNEEDS
DirectoryforSAPResources
ONLINEINFORMATION

systemandwhoneedstoreceiveerrornotification.

SAPandotherERPconsultants

DeclareastructureoftypeMCMAILOBJforsendinginstructions.

SAPFORUMS

EntervaluesfortheinternaltablebasedonstructureMCMAILOBJ

SAPHELPPORTAL

forselectionprocesses,onSYSUBRCchecksandwherefieldsare

SAPInsiderOnline

mandatoryforthereceivingsysteminsertFunctionModule

SAPKNOWLEDGEBASE

MC_SEND_MAIL.
Entervaluesinthefollowingparameters:
MS_MAIL_SENDMODE=B(BatchMode)

SAPNETWORK
SAPTutorialsandArticles

MS_MAIL_TITLE='MailTitle'
MS_MAIL_DESCRIPTION=Errordescription(e.g.MATNRnot
given)
MS_MAIL_RECEIVER=NameofReceiver(Tobedetermined)
MS_MAIL_EXPRESS=E(ExpressDelivery)
MS_MAIL_DLINAME=LeaveBlank
MS_MAIL_LANGU='E'(Langusage)
MS_MAIL_FUNKOBJ_NAME=LeaveBlank
TABLES
MS_MAIL_CONT=I_MCMAILOBJ

Note:
Ithastobedeterminedseparatelyforeachinterfacehowtheseerrors
andmailnotificationsaretobegroupeddependantuponthenumber
oferrorsthatarepotentiallylikely.Onepossibleapproachistosend
anemailforeachreasonforrejectionandincludealltherecordsthat
failedforthatreasoninthemailnotification.Anotherpossible
approachistosendanemailforeveryfailure.
WhenerrorcheckingformandatoryfieldsitiscommonSAPpractice
http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

3/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

torejectarecordonitsfirstfailure(irrespectiveofsubsequenterrors
inthatrecord)
Step7cSendstatusmail
AppendtotableI_MCMAILOBJdetailsofthetimetheinterfacewas
processed,howmanyIdocswerecreatedandhowmanyofthese
producedastatusof03.
SelecttheusertoreceivethemailfromZINT_RECEIVER,usingthe
nameoftheprogramasakey(SYCPROG).
UsefunctionModuleMC_SEND_MAILtosendamailtotheuser
containingthecontentsofI_MCMAILOBJattheendoftheinterface
processing.
Step8TestthepopulationofthecustomIDOC
viawediIDocDisplayIDocorTransactionWE02.
Enteryourmessagetypeandexecute.
Statusshouldbegreen,doubleclickononeoftheIdocsyouhave
createdtoviewitscontents.
IfaproblemhasoccurredclickonStatuswhichwillgiveyoua
descriptionoftheerror.
DropdownDataRecordsarrowandthisshouldlistthedatainthe
IDocinthecorrecthierarchicalstructure.
Clickoneachindividualsegmentandviewthecontenttocheckthat
thecorrectdatahasbeenread.
IfyouhaveUNIXaccessbyusingAL11youcanviewthefilethat
youhavecreated.
Note:
ForsomeinterfacesitmaybevalidtosendanemptyfiletoSAP.This
emptyfileisconvertedtothecustomIDOCformatexpectedbySAP.
ThiscustomIDOCwillcontaindummyinformation.Intheinbound
processingcode,ifthedummyinformationisidentifiedthenthe
processingoftheIDOCisconsideredtobecompleteandtheIDOC
shouldthenbeassignedasuccessfullyprocessedstatusof53,even
thoughithasnotbeenprocessedatall.
Hi,
2.2InboundInterface
Followsteps1to5inclusiveasdetailedaboveinoutboundinterface.
Step6
Writeacustomfunctionmoduletohandlecustominboundprocessing.
Thiscustomfunctionmodulemust
http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

4/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

Checkforthecorrectmessagetype
ReadtheIDocdatasegment
Performdataconversionandvalidatethedataasappropriate
Postthedatatothedatabase
Handleanyerrorsituations
Setthecorrectreturnvaluesforthestatusrecord
NotethattheFunctionModulemustnotmakeacommittothe
database.Thisisbecausethestatusrecordisnotwrittenuntilcontrol
returnstotheALElayer.SoifyoucommitworkintheFunction
ModuleandanerroroccursinreturningtotheALELayer,thestatus
recordmustnotbeupdatedwithasuccessfuloutcome.
ThecommitworkisexecutedintheALELayerafterthestatus
recordsareupdated,viathestandardSAPfunctionmodule
IDOC_INBOUND_PROCESS.Thisattributesofthisfunctionmodule
aresetupin(TransactionBD51),clickonNewEntriesandfillindata
themaininputparametersbeingInputTypeandDialogAllowed.
TakecareassomestandardSAPtransactionscontainaCommit
Workaspartoftheirprocessing.ThereforeusingaBDCtoprocess
inbounddatatoSAPmaynotbeacceptable.Youneedtocheckthat
theSAPtransactionisALEenabled.
Step7
(TransactionWE57)
AssignthecustomfunctionmoduletotheIDoctypeandthemessage
type.
SetfunctionmoduletotypeFanddirection2forinbound.

Step8
(TransactionWE42)
Createanewprocesscodeandassignittothefunctionmodule.The
processcodedetermineshowtheincomingIDocistobeprocessedin
SAP.
Step9
(TransactionBD67)
Assignthefunctionmoduletotheprocesscodecreatedabove.Gotto
NewEntriesandentertheprocesscodeandthefunctionmodule
name.
Step10
(TransactionWE20andTransactionBD64)
Createapartnerprofileforyourmessageandensurethatin
http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

5/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

transactionWE20theprocesscodeistheonethatpointstoyour
functionmodule.(Seestep6ofcreatingOutboundIdocs).
Step11
Ensurethaterrorhandlingfunctionalityispresent.
Note:
Ifaninterfaceisexpectingafileeveryday,andacustomIDocmay
onlybeoutputfromSAPperiodically,itwouldbenecessarytocreate
somekindofoutputfromSAPonadailybasistopasstoMercatorto
allowittomaptoanemptyfile.AswearedealingwithcustomIDoc
typeswecandesigntheIDocsothatthedatasegmentsarenot
mandatory.ThereforetheSAPprogram,onfindingnodatatopopulate
thecustomIDoc,wouldonlyneedtocreatethecontrolrecord.The
emptyIDoccontainingthecontrolrecordwouldbepassedtoMercator.
Mercatorwillmapthistoanemptyfileformat.

UsefulTransactionCodes:
WEDI:IDocMenu
WE02:IDocList(canenterIDocnumbertoselecton)
WE05:IDocList
WE19:TransactionWE19canbeusedtotesttheIDoc
WE30:IDocTypeDevelopment:InitialScreen
WE31:DevelopmentSegments:InitialScreen
WE60:DocumentationforIDocTypes.Thisallowsyoutoviewthe
IDocyouhavecreated.
WE81:DisplayViewEDI:LogicalMessageTypes:Overview
WE82:DisplayViewMessageTypesandAssignmenttoIDocTypes:
Overview
ForOutboundALEConfigurations:(Example)
IDocdefinitionsandnecessaryALEconfigurationssettingsforthe
outbound.

http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

6/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

CreateIdocsegmentsTransactionWE31.
CreateIdoctypeTransactionWE30.
CreateMessageTypeTransactionWE81.
AssignMessageTypetoIdoctypeTransactionWE82.
CreateadistributionModelTransactionBD64
UpdateoutboundparametersofthePartnerprofileTransaction
WE20
FortheLogicalsystemAfortheabovetwomessagetypesupdatethe
partnerprofile.
ForeachmessagetypespecifythePortandtheIDoctypes.
(Note:PortdefinitionneedtomaintainedusingtransactionWE21and
ithastobedefinedasaTransactionalRFCportwithRFCdestination
for
systemspecified,whichneedtobemaintainedusingSM59).

NewerPost

Home

OlderPost

S P O NS ER LI NK S

BBCBU SIN ESSO N L IN EL ISEN IN GO N IP L A Y ER


D O W N L O A D REA L P L A Y ERF O RO N L IN EBBCN EW S
O N L IN EBBCN EW S
O N L IN ED ICTIO N A RY

http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

7/8

6/23/2015

SAPABAP:ALESTEPBYSTEPPROCEDUREWITHTCODES

http://sapabapoo.blogspot.in/2007/08/alestepbystepprocedurewithtcodes.html

8/8