IDOCdemo.docx
《IDOCdemo.docx》由会员分享,可在线阅读,更多相关《IDOCdemo.docx(36页珍藏版)》请在冰豆网上搜索。
![IDOCdemo.docx](https://file1.bdocx.com/fileroot1/2023-1/22/cc77fff9-f94e-4f47-b6ac-ea7b3a04f81f/cc77fff9-f94e-4f47-b6ac-ea7b3a04f81f1.gif)
IDOCdemo
CreatingIDocs
TABLEOFCONTENTS
GeneralDefinition3
1)CreatingaNewIDoc3
NamingConvention:
3
DesignGuidelines:
4
FormattingGuidelines5
1.1DataAnalysis5
1.2CreateDataElements6
1.3CreateSegment6
1.4CreateBasicIDocType7
1.5ReleasetheSegmentTypeandBasicIDocType9
OutboundIDoc10
1)ProgrammingintheIDocInterface10
1.1InterfaceandProgramFlowforFunctionModule.11
1.2Astand-aloneprogramtoGenerateIDocs.12
2)ConfiguringthesystemforOutboundIDocs13
2.1StepsforconfiguringanIDocusingMessageControl.13
2.2StepsforconfiguringanIDocusingstandaloneprogram.17
3)TransportingtheIDoctothereceivingsystem.18
InboundIDoc18
1)ProgrammingintheIDocInterface18
1.1BasicScenario:
18
1.2AdvancedScenario18
2)ConfiguringthesystemforInboundIDocs19
TestingIDocs22
MonitoringIDoc23
1)IDocDisplay23
2)IDocList25
3)IDocStatistics26
4)IDocSearch27
AppendixA28
APPENDIXB30
APPENDIXC30
REFRENCES31
GeneralDefinition
WhencreatinganewIDoc,thefollowingstepsneedstobecarriedoutinboththesending(ES1150)andreceivingsystem(GDV200).
TherearesixphasesinvolvedinthemethodologytocreateanIDocforanyOutboundProcess(WithorwithoutMC).
1)Analysis:
AnalyzethebusinessrequirementsandcomparethemwithwhatSAPProvides.
2)Preparation:
Identifyvariousparametersusedintheprocess
3)Setup:
ConfiguretheEDIcomponentsandbuildthenecessaryMasterData.
4)Testing:
testthesetupphase.
5)Execution:
Executetheprocess
6)Verification:
Verifytheresults
CaseScenario:
LetsgothroughthewholeprocessofcreatinganewIDoc.Wewilluseasimpleexamplewherethesystemsendsoutamonthlyreportforeachemployee’sweeklyhours.Thereportisdividedinthreeparts:
Header,DetailsandSummary.HereisanexampleofaFlatfileandactualreport
EmployeeHeader
(OccursOnce,Required)
LastName
(15)
FirstName
(15)
SocialSecurity
(11)
DateofBirth
(8)
WeeklyDetails
(Multiple)
WeekNumber
(1)
HoursWorked
(3)
HourlyRate
(3)
ClientSite
(20)
WorkDescription
(40)
Summary
(Occursonce)
TotalHours
(3)
TotalAmount
(10)
Smith
John
123-45-6789
102668
1
30
40
HoustonBrewery
BeerTesting
2
30
40
NetworkComputers
Highlevelconsulting
3
30
50
NetworkComputers
Programming
4
50
60
DSPSystems
EDIProgramming
140
6900
Toaccomplishthiswewillfirst:
createanewIDoc(coversthefirstthreephasesabove),second:
ConfiguretheIDoc(phasethree),andlasttest,executeandverify.
Hereisalsothebreakupofnamesthatwillbeassignedtothedifferentcomponents
COMPONENT
NAMINGCONVENTION
ACTUALNAME
MessageType
Z
ZEMP_MNT_RPT
IdocType
Z01
ZEMP_MNT_RPT01
SegmentType
Z
Z1EMP_HD,Z1WK_DET,Z1CL_DET,Z1SUMRY
OutboundFunctionModule
Z_IDOC_OUTPUT_
Z_IDOC_OUTPUT_EMPMTHRPT
1)CreatingaNewIDoc
ThefollowingstepstakeyouthroughastandardprocedurewhenevercreatingaNewIDoc.Beforegoingtothis,itisimportantgettherightstandards.
NamingConvention:
∙NamesassignedtoanIDoctypeshouldbemeaningful.ItshouldtelltheuserwhatthatIDocdoes.Maximumlengthallowedis30charactersforrelease4x.HereisaformatfornamingcustomIDoc’s.
Z
CustomIDoctypemuststartwith“Z”andendwithtwonumericcharacters.ThisnumberdenotestheversionoftheIDoc.Ingeneraltheversionnumberisincrementedbyone.Example,forourcasewewillassginthenameZEMP_MNT_RPT01.Forthenextversion,thisIDocwillbeZEMP_MNT_RPT02.
∙NamingSegmentsrequiresthefollowingformat
Z1
AllcustomsegmentsbeginwithZ1andallSAPSegmentsbeginwithE1
DesignGuidelines:
∙DevelopanIDoctypeforafunction,notforaspecificapplication.Example:
ORDERS02isdesignedfortheorderprocessandnotspecificallyforthesalesorderentryapplication.Thus,thisIDocisusedforseveraldocumentssuchasPurchaseorder,Salesorder,Orderresponse….YoushouldfollowasimilarstrategywhencreatinganewBasicIDoctype.
∙Useindustrystandardswheneverpossibleforyourdataelements.ConsultEDIstandardsfortheappropriatelengthanddatatypesandISOcodesforfieldssuchasmeasurementunitsandcurrencies.
∙Organizethedocumenttocontainheader,detailandsummaryinformation.
∙DoNOTrepeatasegmenttypeinanIDocDefinition
∙Usetheparent-childrelationshipwhenyouaregoingtopermitseveralentriesofthesametypeinoneIDoc.Example:
Thefollowingdiagramshowsprocessingoneemployeeatatime.Ifyouwanttosupportmultipleentriesofemployeesthentheseconddiagramshowshowtosetuptheparent-childrelationship
∙Avoidhavingtoomanymandatorysegments.HavingextramandatorysegmentsreducesthereusabilityoftheIDoc.
∙Makesurethatthesegmentsarelessthan1000bytes.Iftheyarebiggerthan1000,trytosplitthem.
∙CombineIDocsegmentsthatarefunctionallysimilarintoonesegmentwheneverpossible.
∙CreatesegmentsthatcanbeusedbyotherIDoc.
FormattingGuidelines
∙Datafieldsinasegmentcancontainonlyalphanumericvalues.
DataTypes
Description
CHAR
CharacterString
CLNT
Client
CUKY
CurrencyKey,refrencedbyCURRfields
DATS
DateField(YYYYMMDD)storedaschar(8)
LANG
LanguageKey
NUMC
Characterfieldwithonlydigits
TIMS
TimeField(HHMMSS),storedaschar(6)
∙Fieldsshouldbeleftaligned.Characterfieldsareautomaticallyleftaligned,butnumbervalueswhenassignedtoacharacterfieldarepaddedwithspacesontheleft.Thesespacesmustberemovedfromthefieldsprogrammaticallyusingthecondensecommand.
∙Dataisnotcasesensitive.
∙Negativevaluesareindicatedbyaminussignafterthevalue.Therefore–123iswrittenas123-.
∙Numberswithfractionalvaluesuseaperiodtorepresentthedecimalpoint.
∙Floating-pointnumbersalsouseaperiodtorepresentthedecimalpoint.
∙Noformattingisusedtoseparatevaluesinthethousands.E.g29,000.0029000.00
NowthatyouhavecoveredthebasicrequirementforcreatinganewIDoc,letsmoveontotheactualprocess.ThefollowingfivestepswillguideyoutosuccessfullycreatingaNewIDoc.However,beforemovingaheadmakesureyouhavecreatedaDevelopingClasstostoreallyourobjectsandsaveeverythingasLOCAL.(SeeAppendixAforcreatinganewdevelopingclass.)
1.1DataAnalysis
Analyzethedatathatneedstobeexchangedbetweentwosystems.Itissuggestedthatyoufollowatop-downapproachifyouarestatingatabusiness-documentlevelandabottom-upapproachatthefieldlevel.
Breakthedocument(fieldsfunctionallyrelated)intosegments.GroupthesefieldsintosegmentsgroupsandarrangetheminanIDoctype.Identifyanyparent-childrelationship.AfterthisyouarenowreadytobuildyourbasicIDoctype.
AnalysisofourCasebringsoutthefollowing:
∙Reportisdividedintothreeparts:
Header,Detailsandsummary.Rightawayweknowthatwewillneedatleastthreesegments.
∙Headerandsummarywillhaveonlyoneentrywhereasweekdetail’shasmultipleentries.
∙Theweeklydetailscanfurtherbedividedintotwo.
→Weeknumber,hoursworked,hourlyrate
→Clientsite,workdescription
Thisisbecauseanemployeecanworkmultipletimesinthesameclientsitebutthereverseisnottrue.Anemployeecannotworkatmultipleclientsitesatonetime.
∙HereisanIDoctyperepresentationoftheflatfilestructure.
ZEMP_MNT_RPT01
Z1EMP_HD(M,1,1)
Z1WK_DET(O,1,99999)
Z1CL_DET(O,1,1)
Z1SUMRY(O,1,1)
M-MandatoryMinimum
O-OptionalMaximum
IDocTypeSegments
∙Therewillbefoursegmentsthatwewillhavetocreate.TheheaderismadeMandatorybecauseaMonthlyreportwillnotmakesensewithouttheemployeesbasicinformationandalsoallowsthereusabilityoftheIDocifonlytheEmployeeinformationneedstobesentout.
∙Thearrangementofthesegmentsshowsthatthereisaparent-childrelationshipbetweenZ1WK_DETandZ1CL_DET.Thissignifiesthatthechildsegmentcannotexistwithouttheparentandiscommonlyusedfortextsegments.
∙OnlyZ1WK_DETisassignedtoamaximumof99999range.Thisshowsthatthisdatarecordwilloccurmultipletimes.AndZ1CL_DETisassignedoncebecauseitisdependentoftheweeklydetail.
1.2CreateDataElements
Inthepreviousstepweanalyzedourscenarioanddefinedwhatneedstobecreated.Inordertocreatesegmentswefirstneedtomakesurethatalltherequireddataelementsexist.IfSAPdataelementsdonotmatchthenwewillneedtocreatenewones.Onlyinraresituationanewelementsneedstobecreated.Example:
TheFuturePricefield(ZKPRS)intheE1MBEWMsegmentusesdatatypeCHAR12insteadofZKPRS.ThisisbecauseZKPRSisCURR(Currency)whichisnotallowedinasegmentdefinition.(See1.3CreateSegmentfortheformattingguidelinesforsegment).
1.3CreateSegment
WearenowreadytocreatethesegmentsasalltherequiredDataElementsarealreadycreated.Butfirstcheckifthereareanyexistingthatwecanuse.Inourcasewewillhavetocreatefournewsegments.Followthesestepstosuccessfullycreateanewsegment.(Pleaseconsulttheguidelinesabovebeforeattemptingtocreateanewsegment).Technically,asegmentisimplementedinthreephysicallyseparatepieces.
∙
SegmentType
∙
Seeabovefornamingconvention
SegmentDefinition
∙SegmentDocumentation
Stepstocreateanewsegment
1.GototransactionWE31(segmenteditorusedtocreateorchangeasegment).EnterthenameforyourSe