You are on page 1of 190

UnderstandingSAPR/3 ATutorialforComputerScientists FlorianMatthesStephanZiemer TechnicalUniversityHamburg-Harburg,Germany http://www.sts.tu-harburg.de/ f.matthes March1998(R1.0.

Abstract SAPisthemarketleaderforintegratedbusinessadministrationsystems,anditsSAPR/3 productisacomprehensiveenterpriseresourceplanningsoftwaresystemwhichintegrates modulesfor

nance,materialmanagement,salesanddistribution,etc.Despiteitsinternationalcommerc ialsuccess, themodels,languagesandarchitectureofthissystemaretoalarge degreeunknowntocomputerscientists. Thegoalofthistutorialistopresentthedistributedsystemarchitecture,thedatamodel, thedatabaseprogramminglanguage,thetransactionandprocessmodelandthesystemevolutio nconceptsofSAPR/ 3fromacomputerscienceperspectiveandtorelatethemtoestablisheddatabaseanddistribut edsystemconcepts. ThepresentationwillhelpattendeesunderstandhowSAPR/ 3relatestotheirownresearchanddevelopmentworkandwillprovidea well-structuredfoundationforafurtherstudyofSAPR/3'sinnovativesystemconcepts.

Contents 1SAPR/3:Past,PresenceandFuture 3 2TheIntegratedR/3Repository 4 2.1IntegratedAnalysis,DesignandImplementation.................4 2.2CoexistenceofMultipleR/3Clients........................4 2.3ApplicationandSystemEvolution.........................4 2.4RunningExample:FMAreasandFundsCenters.................7 3EnterpriseModelingwithR/3 7 3.1DataModeling:EntitiesandRelationships....................8 3.2FunctionalDecomposition:R/3Modules......................9 3.3ProcessModeling:R/3ReferenceModelandEPCs................9 4ObjectsoftheR/3DataDictionary 11 4.1DataModeling:SelectedDataDictionaryObjects................12 4.1.1DomainsandDataElements........................12 4.1.2TablesandStructures............................12 4.1.3Views.....................................13 ows............................14 4.2ProcessModeling:Work 5ProgrammingwithABAP/4andtheDynProConcept14 5.1Implementation-OrientedDataDictionaryObjects................14 5.1.1DataTypesandTypeGroups........................14 5.1.2LockObjects.................................16 5.1.3Matchcodes..................................16 5.2ProgrammingintheLarge:DevelopmentClassObjects.............16 5.2.1R/3Transactions...............................18 5.2.2Reports....................................18 5.2.3FunctionModules..............................18 5.2.4Messages...................................19 5.2.5AreaMenus..................................19 5.2.6OtherDevelopmentClassObjects.....................19 5.3ProgrammingintheSmall:ProgramObjects...................20 5.3.1GUIStatus..................................20 5.3.2Dynpros{ElementsofInteractiveTransaction..............21 5.3.3AnExampleofanR/3DynPro.......................21 5.3.4ComponentsandAttributesofDynPros..................23 5.3.5CharacteristicsofABAP/4.........................25 6CustomizingR/3:ConceptsandTechniques 26 6.1Customizing:TheProcedureModel........................26 6.2Customizing:TheImplementationGuide.....................27 6.3CustomizingR/3...................................28 6.4SystemEvolution...................................28

7R/3'sProcessandSystemArchitecture 28 7.1Client/ServerArchitecture..............................28 7.2ProcessArchitecture.................................29 7.3ExternalGateways..................................31 AOverview:R/3TerminologyandConcepts 31 BSourceCodeofFM22,DynPro100 32 FurtherReading 38

1SAPR/3:Past,PresenceandFuture ThePastThecompanySAP,Walldorf,Germany,wasfoundedin1972by

veIBMprogrammers. Theircorebusinessideawastobuildoneprogramsuitableformanycompanies insteadofwritingessentiallythesamebusinesssoftwareagainandagainfordierentcompanie s. Thesystemabstractsfromtheneedsofaconcretecompanyandimplementsthe processesofagenericcompany. The'R'inR/3standsfor'realtime'whichmeansthatthesystemisinteractiveandnot basedonbatchprocessing.'3'meansthatitisthethirdmajorversionoftheprogram,though therehasneverbeenasystemcalled'R/1'.R/3wasintroducedin1992andbytheendof1995 morethan5,200R/3systemswereinstalledworldwide.ThelatestreleaseofR/3is4.0(Feb 1998).ThereisstillanumberofR/2installations,butSAPintendstomovethiscustomer basistoR/3. R/3isapackageofstandardinternationalbusinessapplicationsforareassuchasFinancialA ccounting, Controlling,LogisticsandHumanResources.R/3providesanenterprise solutionforalltheseapplicationareasinadistributedclient/serverenvironment.UsingR /3, acompanycanmanage

nancialaccountingaroundtheworld,receiveandtrackordersfor goods,andorganizeandretrieveemployeeinformationandrecords,amongmanyotherfeatures . ManyFortune500companiesandhigh-techcompanies(includingAmericanAirlines, Chevron,IBM,MercedesandMicrosoft)runtheirbusinesseswithR/3.Thesystemisavailableo nmanyhardwareplatformsandformanyoperatingsystems( Unix/NT). TouseR/3foraconcretecompany,itisnecessaryto'customize'R/3tosuitthespeci

c needs.Thiskindofsoftwareiscalled'standardbusinesssoftware'orstandardERPsoftware (enterpriseresourceplanning).Ideally,acustomizedR/3installationcanfollowtheevolu tionofR/ 3(takingintoaccountnewtaxorlawregulations,newcurrencies,etc.)without additionaldevelopmenteort. TheFutureHottechnicaltopicsforthefutureevolutionofR/3are[ SAPHome1997 . componentization(customerswillbeabletoinstallandevolveindependentreleasesofR/3 modules),businessobjectsandBAPIs(newlydevelopedclientapplicationswritteninJava, VisualBasic,Delphietc.willhavestable,semantically-richAPIstotheR/3backend),theR/ 3 BusinessEngineer(customizationwilltakeplaceatahigherabstractionlevelthanscreensa nd tables),andOOABAP(afully-upward-compatibleextensionofABAP/4withlatebinding andaformofinheritance). ThePresenceR/3initscurrentrelease4.0isamassiveclient/serverdevelopmentand applicationsystemwhichusesrelationaldatabases(Oracle,ADABAS-D,Informix,...)asits back-end.Cooperationbetweenfunctionstakesplacebyatraditional,tightdatabaseintegr ation. In1994,R/3alreadycomprised7.000.000linesofcode,100.000functioncalls,20.000 distinctfunctions21.000reports,17.000menude

nitionsand14.000functionmodules[ Bundesministeriumf urForschungundTechnologie1994] .Thereare500developersworkingon thecoreR/3system,itssizegrowsannuallybyanestimated10percent.Eachcustomerhas toinstallthefullR/3applicationwhichconsumesseveralGBondiskexcludinganyactual businessdata. TherestofthistuorialgivesyouanideaofthefollowingtechnologiesunderlyingR/3 whicharealsothebasisforR/3'sfuturedevelopment. TheintegratedR/3repository EnterprisemodelingwithR/3 ObjectsoftheR/3datadictionary Programminginthelarge Programminginthesmall CustomizingR/3:conceptsandtechniques R/3'sprocessandsystemarchitecture OMTclassdiagrams(similartoUMLclassdiagrams)areusedforconceptualmodeling purposes[ Rumbaughetal.1991;FowlerandScott1997] .

2TheIntegratedR/3Repository SimilartoaDBMS,R/3reliesheavilyonmeta-datadescribingitsowndatastructures, ows).Consistencybetweenthemeta-dataandthe functions(modules)andprocesses(work actualdataispreservedeithermanuallyorautomaticallybythedevelopmenttools.Using theR/3RepositoryInformationSystem,developerscanaccessandbrowse(textual,tabular andgraphicalrepresentionsof)repositoryobjects.Thissectionprovidesabird-eyeviewof therepositoryanditsmajorconceptualentities(seeFig.4). 2.1IntegratedAnalysis,DesignandImplementation R/3usesthreelevelsofabstractiontodescribethemappingbetween'real-worldentities'an d R/3systementities.Ateachlevel,aprocessview,afunctionviewandadataviewcanbe distinguished.Theseviewsareconnectedratherloosely. Atthetopmostlevel,theanalysislevel,adescriptionofR/3isgiven.Processesare modeledwithEPCs(Event-controlledProcessChains)whichdescribehowbusinessprocesses arecarriedoutusingR/3.AnEPCconsistsofseveralstatesandactionsanddescribesside eectslikeinformingsomeonethatanactionhastakenplace. FunctionsaredescribedintermsofR/3modules,eachmoduleservingaspecialfunctional purposewithinthecompany.Forexample,themoduleHR(humanresources)helpstomanage thestadata. SAPandR/3useSERM(StructuredEntityRelationshipModel)fordatamodeling.SERM wasinventedbySAPbutiscloselyrelatedtothecommonentityrelationshipmodel. owswhichare Atthesecondlevel,thedesignlevel,processesaremodeledwithwork user-de

nedEPCs.Thereisnonotationtospeci

yfunctionsatthislevel.Thedatamodel oftheanalysislevelismappedtorelationaltablesandforeignkeysatthislevel.Adata dictionaryanddatadictionarytoolshelptomaintaintheassociationbetweenSERM-entities (andrelationships)andrelationaltables. Atthelowestlevel,theimplementationlevel,processesareimplicit(transactionsequence sconsistingoffunctionsworkingontables). FunctionsarerepresentedasABAP/4 programsandreports.DataismodeledbySQLtablesandABAP/4variables.ABAP/4is theprogramminglanguageofR/3coveredinSec.5. Virtuallyallpartsoftherepositoryare,likeanyotherinformationinR/3,storedinthe underlyingSQLdatabase. Figure1showstheconceptsandlanguagesateachlevel.Figure2showsthemainobjects ofeachlevel.Figure3enumeratesthemodulesshippedwithR/33.0. 2.2CoexistenceofMultipleR/3Clients AnR/3installationispartitionedintodierentclients.Aclientisabusinessentitylike asubsidiary.Clientshaveseparatedataforcustomizingandapplicationdata.Theyshare customizing-independentdatalikemetadataandglobalcompanysettings.Onlydatacanbe client-dependent.Allmeta-data,e.g.tablede

ntions,aregloballyde

ned.Client-dependent dataisachievedbyaddingacertain

eldtoatablede

ntionofatablewhichistohold client-dependentdata.Foreachrowofthetable,this

eldholdsthenumberoftheclientto whichtherowbelongs. InausualR/3systemseveralclientsexistlikethedefaultclient(number0000),adevelopmen tclient, atestingclientandacustomizingclient.Theclientusedforactualbusiness processingshouldbeinaseparatesystemtoavoidsideeectsbychangesofglobalsettings (seealsoFig.5). 2.3ApplicationandSystemEvolution Applicationandsystemevolutioninthepresenceofpersistentdataisaseriousproblemtobe solvedbystandardbusinesssoftware.Updateshavetobeperformedona\live"systemand customizingadjustmentsshouldbepreservedacrossreleases.Moreover,nameclashesbetwee n customizationcodeandnewlydevelopedcodeofthestandardsystemhavetobeavoided. atforeachobjecttype.Forexample,tablesmust InR/3,thenamespaceisglobaland havesystem-wideuniquenames,butaprogramobjectcanhavethesamenameasatable.

$QDO\VLV OHYHO 'HVLJQ OHYHO ,PSOHPHQWDWLRQ OHYHO (YHQW FRQWUROOHG SURFHVV FKDLQ(3&

6$30RGXOH 6$36(50 %XVLQHVV (QJHQHHULQJ 'DWD 'LFWLRQDU\ 'HYHORSPHQW FODVV $%$3 64/ ` UHDOZRUOG ` ` 55HSRVLWRU\ 'DWD'LFWLRQDU\ 3URFHVV 9LHZ )XQFWLRQ 9LHZ 'DWD 9LHZ $QDO\VLV OHYHO 'HVLJQ OHYHO ,PSOHPHQWDWLRQ OHYHO (YHQW FRQWUROOHG SURFHVV FKDLQ(3&

6$30RGXOH 6$36(50 %XVLQHVV (QJHQHHULQJ 'DWD 'LFWLRQDU\ 'HYHORSPHQW FODVV $%$3 64/ ` UHDOZRUOG ` ` 55HSRVLWRU\ 'DWD'LFWLRQDU\ 3URFHVV 9LHZ )XQFWLRQ 9LHZ 'DWD 9LHZ Figure1:ConceptsandLanguagesoftheR/3Repository $QDO\VLV OHYHO 'HVLJQ OHYHO ,PSOHPHQWDWLRQ OHYHO (YHQW )XQFWLRQ (QLW\ 5HODWLRQVKLS :RUNIORZ 7DEOH 'RPDLQ )RUHLJQNH\ 7UDQVDFWLRQ 3URJUDP 5HSRUW $%$3 YDULDEOH 64/WDEOH `3URFHVV 9LHZ )XQFWLRQ 9LHZ 'DWD 9LHZ 0DQXDO7RRO VXSSRUWHG &RQVLVWHQF\ PDLQWHQDQFH

EHWZHHQOHYHOV` 5HDOZRUOG 0DQXDO ` ` 55HSRVLWRU\ Figure2:ObjectsoftheR/3Repository

0DLQWDLQHG E\ 6$3 &RQVXOWDQW &RPSDQ\ 3URJUDPP REMHFWV &XVWRPL]LQJ GDWD $SSOLFDWLRQ GDWD 6\VWHP5 'DWD REMHFWV ),+5756'00334030,6:)36&2$0 Figure3:LogicalPartitionofR/3intoModules 'HYHORSPHQWFODVV REMHFW 'DWD GLFWLRQDU\ 5HSRVLWRU\ 2EMHFW $%$3 GLFWLRQDU\ REMHFW 1DPH $SSOLFDWLRQ 6WDWH 7UDQVSRUW &RQVLVWVRI 2ZQHU &RQVLVWV &RQVLVWV'HYROSPHQWFODVV 7UDQVSRUW 0DLQWDLQHG E\ 6$3 &RQVXOWDQW &RPSDQ\ 3URJUDPP REMHFWV &XVWRPL]LQJ GDWD $SSOLFDWLRQ GDWD 6\VWHP5 'DWD REMHFWV ),+5756'00334030,6:)36&2$0 Figure3:LogicalPartitionofR/3intoModules 'HYHORSPHQWFODVV REMHFW 'DWD GLFWLRQDU\ 5HSRVLWRU\ 2EMHFW $%$3 GLFWLRQDU\ REMHFW

1DPH $SSOLFDWLRQ 6WDWH 7UDQVSRUW &RQVLVWVRI 2ZQHU &RQVLVWV &RQVLVWV'HYROSPHQWFODVV 7UDQVSRUW Figure4:TheR/3Repository

5V\VWHP FRQWDLQLQJ VKDUHG GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD 5V\VWHP FRQWDLQLQJ VKDUHG GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW ZLWK VHSHUDWH GDWD &OLHQW. . EXVLQHV. HQWLW. L. WK. 5. V\VWHP. Figure5:TheNotionofClientsinR/3 Therearethousandsofnamedobjectsofallkindsandcombinedwithastrictlimitationof length(approx.8characters),thenamesarebynomeansself-explanatory.Toworsenthe situation,EnglishandGermannamesandabbreviationsaremixed. SAPdecidedtoleavethe'namerange'ofallobjectswithanamethatstartseitherwitha

YoraZtocustomerobjects.Thereareexceptionsfromthisruleleadingtosomeconfusion. SAPguaranteesthattherewillbenonameclasheswithR/3objectswhenanewreleaseis installed. Theexampleofthenamespacedilemmashowswhathappenstomanysystemsthathave grownintime:Everywhereinthesystemonecan

ndlegacyobjectsthatnobodydaresto removeor inthiscase -darestorenamefortheconsequencesarelargelyunpredictable. 2.4RunningExample:FMAreasandFundsCenters Throughoutthistutorial,thefollowingtinyfragmentof

nancialmanagementwillbeused toillustatetechnicalaspectsofR/3. FMarea:A

nancialmanagementarea(FMarea)isthecommercialorganizationalunit, withwhichcommitmentaccountingisconducted. FundsCenter:Afundscenterisacommercialresponsibilityareatowhichabudgetis assigned[ SAPAG1996] . AfundscentermustbeassignedtoexactlyoneFMarea,severalfundscenterscanbe assignedtothesameFMarea.AfundscentercannotexistwithoutthesuperordinatedFM area.See[ SAPAG1996] formoredetails. Figure6describesFMareaandfundscenterusingtheOMTnotation. Inauniversitycontext,FMareascouldbethedepartsment,likethedepartmentofcomputersci ence, andthefundscenterscouldrepresentworkgroupswhichhavetheirownbudget. 3EnterpriseModelingwithR/3 ThepurposeofEPCsandthedatamodelistodocumentthebusinessprocessesandthe conceptualdataobjectsR/3implements.

)LQDQFDOPDQDJHPHQWDUHD )XQGVFHQWHU )LQDQFLDOPDQDJHPHQWFHQWHU)0DUHD

7KH)0DUHDLVWKHFRPPHUFLDORUJDQL]DWLRQDOXQLWZLWKLQZKLFKFRPPLWPHQWDFFRXQWLQJLV FRQGXFWHG )XQGVFHQWHU $IXQGVFHQWHULVDFRPPHUFLDOUHVSRQVLELOLW\DUHDWRZKLFKDEXGJHWLVDVVLJQHG )LQDQFDOPDQDJHPHQWDUHD )XQGVFHQWHU )LQDQFLDOPDQDJHPHQWFHQWHU)0DUHD

7KH)0DUHDLVWKHFRPPHUFLDORUJDQL]DWLRQDOXQLWZLWKLQZKLFKFRPPLWPHQWDFFRXQWLQJLV FRQGXFWHG )XQGVFHQWHU $IXQGVFHQWHULVDFRPPHUFLDOUHVSRQVLELOLW\DUHDWRZKLFKDEXGJHWLVDVVLJQHG Figure6:FMAreaandFundsCenterinOMT 3.1DataModeling:EntitiesandRelationships TheDataModelisaviewonthecompanyfromadatapointofview.Therearetwotypesof objectsinthemodel. Entity:Anentityrepresentsrealdataliketheexistingfundscentersinacompany.Inthe graphicalnotationentitiesarenotedasboxes. Relationship:Describesrelationshipsbetweenentities.InR/3terminology,arelationshi p is hierarchical,ifthekeyofoneentity,thesocalleddependententity,dependson exactlyoneotherentity,thesocalledsourceentity.Thisistheequivalenttoa foreignkeyconstraintintherelationaldatamodel.Inthegraphicalnotationthisis notedwithanarrowfromthesourceentitytothedependententity.Thedependent entityisontherighthandsideofthesourceentityandthearrowpointstotheleft edge. aggregating,ifthekeyofthedependententitydependsonmorethanonesource entity. referential,ifnon-key

eldsofadependententitydependonothersourceentities. Thisistheequivalenttoaforeignkeyrelationshipwithnon-key

eldsintherelationalmodel. Inthegraphicalnotationsucharelationshipisnotedasanarrow pointingtothelowerorupperedgeofthedependententity.Again,thedependent entityisontherighthandsideofthesourceentity. an'isa'relationship,ifoneentityisaspecialinstanceofanotherentity.E.g.,the entity'Bill'isaspecialinstanceoftheentity'person'. Arelationshiphasacardinalityconstraint: 1:1eachentityofthesourceentitytypehasexactlyonedependententity.Notedbya singlearrow. 1:Ceachentityofthesourceentitytypehasatmostonedependententity,notedbya singlearrowwithacrossingline. 1:Neachentityofthesourceentitytypehasatleastonedependententity.Notedbya doublearrow.

5 5HIHUHQWLDO + +LHUDUFKLFDO $ $JJUHJDWLQJ ,VD 5 5HIHUHQWLDO + +LHUDUFKLFDO $ $JJUHJDWLQJ ,VD Figure7:TypesofRelationshipsintheSAPSERMDataModel 1:CNeachentityofthesourceentitytypecanhaveanynumberofdependententities. Notedbyadoublearrowwithacrossingline. TherecannotbeadirectN:Mrelationshipbetweenentitiesinthedatamodel! agsto Entitieshavesomeadditionalattributes,likeauniqueentitytypenumberand indicatewhetherthedataischangedduringcustomizingorduringnormalsystemoperation andwhethertheunderlingimplementationisatableoraview.SeeFig.7andFig.8. Figure9isanexcerptfromthedatamodelforFMareasandfundscenters.ThefullR/3 datamodeldocumentedthroughthisnotationisdistributedbySAPashugeposterswhich areseveralsquaremetersinsize. 3.2FunctionalDecomposition:R/3Modules R/3consistsoflarge-grainsub-applications,socalledmodulescorrespondingtotheclassi calfunctionalstructureofacompany. ExamplesareFinancialManagement(FI),Materials Management(MM)andsoon.Theseapplicationsworkwiththeshareddataandarehighly interrelatedwhichmakesitvirtuallyimpossibletouseorcustomizeonemoduleinisolation.

SAPiscurrentlydeveloping\topdown"aso-calledbusinessframeworkbasedonthe notionofbusinesscomponents.Abusinesscomponentexposesitsfunctionalitybymeansof business-objects(withstableBAPIs)tootherbusinesscomponentsandtothird-partyclient applications. Businessobjectswillhelptoclosethelargesemanticgapbetweentheratherlow-level ABAP/4functionmodulesthathaveevolved\bottomup"overthepastdecadesanda problem-orientedviewonR/3asacollectionoflogicalcomponentsthathavetobecustomized, deployedandintegratedwithnon-SAPsoftwarecomponents. 3.3ProcessModeling:R/3ReferenceModelandEPCs

TheR/3ReferenceModelisarepresentationofR/3usinggraphicalmodels.Itdescribes variousaspectsoftheR/3software,i.e.,thesupportedbusinessprocesseswiththeirpossib le variants,dataandorganizationalstructures.

& 0 &0 (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVH[DFWO\RQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVDWPRVWRQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVDWOHDVWRQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHFDQKDYHDQ\QXPEHURIGHSHQGHQWHQWLWLHV Figure8:CardinalitiesofRelationshipsinSAPSERM $9 &XUUHQF\ 5 5 + 9 $9$9 /DQJXDJH )LQDQFLDO 0DQDJHPHQW $UHD )XQGV&HQWHU (QWLW\QXPEHU *HQHUDOO\XVHGGDWD 9LHZ & 0 &0 (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVH[DFWO\RQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVDWPRVWRQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHKDVDWOHDVWRQHGHSHQGHQWHQWLW\ (DFKHQWLW\RIWKHVRXUFHHQWLW\W\SHFDQKDYHDQ\QXPEHURIGHSHQGHQWHQWLWLHV Figure8:CardinalitiesofRelationshipsinSAPSERM $9 &XUUHQF\ 5 5 + 9 $9$9 /DQJXDJH )LQDQFLDO 0DQDJHPHQW $UHD )XQGV&HQWHU (QWLW\QXPEHU *HQHUDOO\XVHGGDWD 9LHZ Figure9:ExcerptformtheR/3DataModelforFMAreas

QHZ)XQGVFHQWHU WREHFUHDWHG FKRRVH VXSHURUGLQDWHG IXQGVFHQWHU )0DUHD H[LVWV FKRRVH UHVSRVLEOH SHUVRQ FKRRVH IXQG FKRRVH )0DHUD QHZ)XQGVFHQWHU FUHDWHG QHZ)XQGVFHQWHU WREHFUHDWHG FKRRVH VXSHURUGLQDWHG IXQGVFHQWHU )0DUHD H[LVWV FKRRVH UHVSRVLEOH SHUVRQ FKRRVH IXQG FKRRVH )0DHUD QHZ)XQGVFHQWHU FUHDWHG Figure10:EPCtocreateanewfundscenter IntheR/3ReferenceModel,businessprocessesthatcanbeexecutedintheR/3System aredescribedgraphicallyaseventcontrolledprocesschains(EPCs).AnEPCuseseventsto showthelogicalandchronologicalrelationshipsbetweenR/3Systemfunctions[ SAPAG1996 . usingthefollowinggraphicalelements: Function:describeswhatistobedone.Thesymbolisahexagon. Events:describingwhenthingsaretobedoneoratwhichstagetheprocessissofar.The symbolisaroundedbox. Organizationunittype:describeswho(whichpartofthecompany)isinvolved.Thesymbolisan ellipse. Informationobject:describeswhatkindofinformationisneededorproduced. Figure10showsaconcreteexampleofanEPCtocreateanewfundscenter.

EPCsarenotintegratedintothesysteminastrictsense.Theyarepurelyinformational. ThereisnoguaranteethatagivenEPCisimplementedatall. ThesemanticsofEPCsarede

nedonaninformalbaseonly.Onecan

ndmanycontradictionsandirregularitiesinmanyEPCspublishedbySAPandothers. Eortsarebeing madetoformalizeEPCssotheycanbecheckedautomaticallyforinconsistencies. 4ObjectsoftheR/3DataDictionary Atthedesignlevelthedatamodelsoftheanalysislevelarebroughttoamoretechnicallevel. Furthermore,thedesignlevelisthelinkbetweentheactualimplementationandtheanalysis model. Themaintoolatthedesignlevelisthedatadictionary,holdingallmeta-dataofthe systemandthecompany'sdata.TheobjectsstoredintheDataDictionary(DDic)canbe groupedintothreegroups:

datamodelingelements,i.e.tables,views,dataelementsanddomains

groupeddatatypes,coveredinsection5

systemorientedelements,coveredinsection5.

+DVFKHFNWDEOH 'GLFREMHFW 'RPDLQ7DEOH 'DWD HOHPHQW 6WDWH 1DPH )LHOG 'HILQHVYDOXHV 9LHZ 7\SH -RLQFRQG +DVFKHFNWDEOH 'GLFREMHFW 'RPDLQ7DEOH 'DWD HOHPHQW 6WDWH 1DPH )LHOG 'HILQHVYDOXHV 9LHZ 7\SH -RLQFRQG Figure11:DataModelingElementsintheR/3DataDictionary ThedatadictionaryitselfisconceptuallyandtechnicallyapartoftheintegratedR/3 repository. 4.1DataModeling:SelectedDataDictionaryObjects TheR/3datamodeladdsseveralconceptstotheclassicalrelationaldatamodeltobetter meetthemodelingandstoragerequirementsofABAP/4applicationsandtoalsofacilitate schemaevolution. 4.1.1DomainsandDataElements Adomainisabasicelementsthathidesthetechnicalrepresentationofapieceofdata.It isbasedonanexternaltype.E.g.,thedomainFICTRisasequenceoffourcharacters,the domainFISTLisasequenceofsixteencharacters.Theexternaltypeisinbothcasesthetype 'character'. DomainsbasedontheexternaltypesCURRorQUANaretreatedinaspecialway. DomainsbasedonCURRandQUANdescribeacurrencyamountoraquantity.Therehave tobetables,providedbythesystemorbythecustomer,thatcontainallvalidcurrenciesor

quantityunits,theyarecalledreferencetables.A

eldofatablebasedonCURRorQUAN mustrefertoanappropriate

eldofareferencetable,thereference

eld.Thereference

eld itselfisbasedoneithertheexternaltypeCUKY(currencykey)orUNIT.Itdeterminesthe actuallyusedcurrency,e.g.dollarorDM,orunit,respectively. Adataelementdescribesthebusinessmanagementuseofadomain.Onecanthinkofa dataelementasasemanticdomain.Forexample,thedataelementFIKRSdescribeFMareas andusesthedomainFICTR.ThedataelementFMFICTRdescribesafundscenterandusesthe domainFISTL. 4.1.2TablesandStructures ThetableconceptofR/3issimilartotherelationconceptintherelationalmodelofdata. AnR/3tableconsistsofoneormore

elds.These

eldscaneitherbede

neddirectlyby enumerationorbyreferencetothe

eldsofanothertableorofastructure.Astructureis

similartoatable,butitdoesnotcontainanydata(itisarecordtype,seealsoFig.14).By de

ning

eldsthroughareferencetoanotherstructureortable,subsequentschemade

nitions arepropagatedautomaticallyfromthebasetablestoapplicationtablesanddatastructures.

eldofatablehasanameandanassociateddataelement.A

eldcanrefertoasocalled\ checktable"whichde

nesaforeignkeyrelationship.However,thesystemdoesnot guaranteereferentialintegrityautomatically.TheactualR/3applicationcodehastotake careofthat. Dependingontheintendeduseofatable,itcanberealizedindierentwaysinthe database.Atablecanbe transparent(beingrealizedasanidenticalSQLtable. apooltable(everyrowofthetableissavedwithotherrowsofotherpooltablesinthe sameSQLtable. aclustertable(thewholetableissavedasonerowofanSQLtable). Tablesfornormalusearetransparent,tableswithonlyafewrows,whichneednotto beaccessedfromoutsidethesystem,canbepooltables.Clustertablesarenormallyused forlanguage-dependenttables,e.g.atablethatholdsadescriptionofanobjectinvarious languages. Itisalsopossibletode

neforeignkeys.Thereferring

eldmustbebasedonthesame domainasthe

eldreferredto.Thecardinalityofaforeignkeyrelationship(seeFig.8)can beset,thisisshownintheDataModeler,ifappropriateentitiesforthetableshavebeen de

ned. Foreignkeysareimportant,becausethesystemoftenusessocalledprimaryandsecondary tables.Asecondarytableislinkedviaaforeignkeyrelationshiptoaprimarytable.The referringtableisthesecondarytable,thereferredtableistheprimarytable. Thetechniqueofcustomizingincludesandappendstructuresareusedtomodifythestructureo fstandardtableshesearetablesprede

nedinthesystemas'hooks'forsystemextensions. CustomizingincludesarespecialtablesnamedCI*(btw.anexceptiontotherulethat thenamerangeforcustomersisY*andZ*),whichareincludedbystandardtables. Thisistooercustomersthechancetochangeastandardtableandtoensurethatthe changesarepropagatedtosubsequentupgradesofthesystem.Customizingincludesare deliveredemptyandcanbe

lledduringthecustomizingprocess. Appendstructuresarestructuresassignedtoexactlyonetable.Theappendstructure referstothetable,notviceversa.Thetabledoesnot'know'thatithasastructure assigned.TheDataDictionaryknowsthatandpropagateschangestothetablewhen necessary.Thistechniqueshouldbeusedtochangeastandardtablewhennocustomizing includesareprovidedforthatstandardtable. Itisnotrecommended,thoughpossible,tochangestandardtablesdirectly.Thestandard tablescouldbechangedwiththenextupdateleadingtothelossofthechangesmadebythe customer. 4.1.3Views Viewsprovidearestrictedviewondatastoredinadatabase.InR/3,aviewconsistsofone primarytableandanynumberofsecondarytables. Inanadditiontothewell-knownconceptofviewsintherelationalmodel,R/3supports fourtypesofviews: Databaseview:Adatabaseviewistheequivalenttoaviewintherelationalmodelofdata. Ifthereismorethanonetableinvolved,theaccessisalwaysreadonly.Viewsofthistype areusedfrequentlytorepresentanentityintheDataModeler. Projectionview:Aprojectionviewhidessomecolumnsofatable(aprojection).The hiddencolumnswillnotbesentformthedatabasetotheapplicationserver,reducing thedatavolumetobetransported(seealsoSec.7).

Helpview:Ahelpviewshowsfurther

elds(columns)ofatable,whenauseristospecify avalueinaforeignkey

eldandrequestshelpforvalidinputs.Therecanbeatmost onehelpviewpertable.Matchcodesareamoreadvancedtechniquetoachievethesame goal. Maintenanceviews:Maintenanceviewsenableabusiness-orientedapproachtolookingat data,whileatthesametime,makingitpossibletomaintainthedatainvolved.The datacanbemaintainedbythecustomizingtransactions[ SAPAG1996] . ows 4.2ProcessModeling:Work R/3allowstheusertode

owsontopofR/3transactions.Thetechnique nebusinesswork usedisthesameastheoneusedforEPCs(seeSec.3). owprovidestechnologiesandtoolsforprocessingandcontrolling SAPBusinessWork cross-applicationprocessesautomatically.Thisinvolvesprimarilythecoordination ofthepersonsinvolved theworkstepsrequired thedatatobeprocessed(businessobjects. Itsmainaimsaretoreducethroughputtimesandthecostsinvolvedinmanagingbusiness processesandtoincreasetransparencyandquality[ SAPAG1996] . 5ProgrammingwithABAP/4andtheDynProConcept Attheimplementationlevel,theactualbusinessprocessesareimplemented.Allapplication s 4th arewritteninABAP/4(AdvancedBusinessApplicationProgrammingLanguage,generation), theR/3programminglanguage.Theuser-frontendiswritteninABAP/4aswelland canbecustomizedandutilizedasfarasrequired.ThecompletefunctionalityofR/3,includin gtheABAP/ 4compiler,isaccessibleinABAP/4programsmaking,e.g.,thegenerationof programsondemandpossible. 5.1Implementation-OrientedDataDictionaryObjects 5.1.1DataTypesandTypeGroups R/3supports

vekindsofdatatypes: Externaltypes:Theyarethefoundationofalltypesandhaveanequivalentrepresentation inSQL.Anyobjectthathastopersistmustbeconvertedtoacorrespondingobjectof anexternaltype.Table12showstheexistingexternaltypes. ABAP/4datatype:EveryABAP/4variableisbasedonanABAP/4datatype.Thetypes oatingpoint),I(integer), are:C(character),N(numericcharacter),P(packednumer),F( X(hexadecimalnumber),T(time)andD(date).Allexternaltypeshaveacorresponding de

nitionusingABAP/4datatypes. Headerlinetype:Thisisanaggregatedtype.Inmostcasesitisde

nedbyreferringdirectlytoastructure, whichistheequivalentconceptintheDataDictionary.Header linesareusedtode

nevariableswhicharenecassarytoexchangedatabetweenABAP/4 andthedatabase,theyserveasbuers. Internaltabletype:Aninternaltableisusedtostoredataduringtheexecutionofan ABAP/4program(moreprecisely:duringtheexecutionofanR/3transaction).Internal tablesarenotpersistent.Ifthedatahastopersistitmustbeinsertedintoadatabase table. Typegroupsarecollectionsofuser-de

neddatatypesorconstantsinABAP/4code.They arestoredinthedatadictionaryforcross-programuse.

ExternaltypeDescription outputlength INT11byteinteger,unsigned 3 INT22byteinteger,usedaslengthdescriptionfor LRAWandLCHAR 5 INT44byteinteger,signed 10 oatingpointnumber FLTP 16 TMStime(HHMMSS)as6characters[CHAR(6)]6 DATSdate(YYYYMMDD)asCHAR(8)8 CLNTclientnumber 3 ACCPaccountperiod(YYYYMM)6 CHARsequencesofcharacters <256 NUMCnumericalcharacters <256 LCHARsameasLRAWbutwithcharacters<65536 RAWsequenceofbytes <255 LRAWsequenceofbytesbeginningwithanINT2as length

eld <65536 DECdecimal <18 CURRcurrency

eld,realizedasDEC<18 CUKYkeyforacurrency 5 LANGlanguagekey 1 QUANquantity

eld <18 UNITkeyforaquantity

eld 2or3 Figure12:ExternalTypesinR/3 ([WHUQDO W\SH 'DWDW\SH 7\SH JURXS 'RPDLQ %DVHG RQ )LHOG 1DPH +HDGHU OLQH ,QWHUQDO WDEOH $%$3 GDWDW\SH )LHOG V\PERO 64/W\SH 3URMHFWHGWR ''LFREMHFW Figure13:DataTypesintheDataDictionary

5.1.2LockObjects Lockobjectsguaranteetheconsistencyofthedatabasewhenmanyusersworkonthesame data.Alockobjectcanlockoneprimarytableandseveralsecondarytables.Therelationship between(implicit)databaselocksandexplicitlockobjectoperationsisexplainedinSec.5. 3.5. Thelockmodecontrolsthemethodbywhichtheusersaregrantedconcurrentaccessto shareddatarecords(identi

edbytheirprimarykey).Thesystemsupportsthefollowinglock modes: E(Exclusive,cumulative):Thismodemeansthatlockeddatamayonlybedisplayedor processedbyasingleuseratthesametime.Theuserowningthelockcanrequestthe lockagain. S(Shared):Thismodemeansthatseveraluserscansimultaneouslydisplaythesamedata. Arequestforanothersharedlockisacceptedevenifitisrequestedbyanotheruser.A callforanexclusivelockisrejected. X(Exclusivebutnotcumulative):AlockoftypeXcanbecalledonlyonce.Anyother callforsuchalockisrejected,eveniftheuserholdingthelockcalls. Thelockmodecanbede

nedseparatelyforeachtableinthelockobject.Whenacallfor alockoccurs,acorrespondingentryisinsertedintothelocktableofthesystem[ SAPAG 1996] . SpecialABAP/4code,asocalledfunctionmodule,isgeneratedautomaticallyforevery lockobject.AnABAP/4programcallsthefunctionmoduletorequestalock.Ifthelockis rejected,anexceptionisthrown. 5.1.3Matchcodes Intherelationaldatamodel,tuplesareidenti

edbytheir(key)values.Forperformance reasons,mostR/3tableshaverathershort,arti

cially-createdkeys,calledid-attributesin R/3. Usingid-attributesimprovessystemperformancebutunfortunatelytheyalsoappearin interactiveforms.Usersareoftenrequestedtoidentifyatuplebygivingitsid-attribute,e .g., whenprocessinganincomingorderthecustomeraddressisrequestedandtheuserhasto typeinthecustomer-id.Thepurposeofmatchcodesistohelptheuser

ndtheinformation bydisplayingnon-identifyingattributes,whichareuselessforthesystembutmeaningfulto humans.Intheexamplegiven,amatchcodecoulddisplayexistingcustomer-idsandadditional information,suchasname,streetandcity. Amatchcodeidenti

esaprimarytable,inwhichtherequestedattributeiscontained,and itcanhavesecondarytablestoalsodisplayassociatedattributes(

elds)ofothertables.Furthermore, amatchcodecanbeusedtodisplaydierentsetsofattributes,eachsetconstitutes asocalledmatchcode-id. Matchcodesshouldnotbeconfusedwithdatabaseindices[ SAPAG1996] : Amatchcodecancontain

eldsfromseveraltables.Anindexcontains

eldsfromonly onetable. Matchcodescanbebuiltonthebasisofbothtransparenttablesstoredintheunderlying databaseandusingthespecialtabletypespoolandcluster. Thematchcodestructurecanberestrictedbystipulatingselectionconditions. MatchcodescanbeusedasentryaidsinthecontextoftheR/3helpsystem. 5.2ProgrammingintheLarge:DevelopmentClassObjects Adevelopmentclassisasetoflogicallyrelateddevelopmentobjects.Suchasetofobjects couldbe,forexample,allobjectsnecessarytomanipulatefundscenters.Figure15and16 explaintheconceptofdevelopmentclassobjectsusingOMTnotation.

/RFN REMHFW 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 'GLFREMHNW 6WDWXV 7DEOH 0DWFK FRGH REMHNW ,' 6HOHFW FRQGLWLRQ 3URMHFWLRQ 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 6WUXFWXUH'DWD HOHPHQW 1DPH )LHOG 1DPH )LHOG $SSHQGV ,QFOXGHV,QFOXGHV /RFN REMHFW 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 'GLFREMHNW 6WDWXV 7DEOH 0DWFK FRGH REMHNW ,' 6HOHFW FRQGLWLRQ 3URMHFWLRQ 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 6WUXFWXUH'DWD HOHPHQW 1DPH

)LHOG 1DPH )LHOG $SSHQGV ,QFOXGHV,QFOXGHV Figure14:Implementation-OrientedConceptsoftheDataDictionary 3URJUDPREMHFW7UDQVDFWLRQ/RJLFDO GDWDEDVH &RGH $XWKRUL]DWLRQ REMHFW 9HUVLRQ 0HVVDJH 1XPEHU 'HYHORSPHQWFODVVREMHFW *HQHUDWH 0HVVDJH FODVV )XQFWLRQPRGXOH )81&7,21322/

,QWHUIDFH )XQFWLRQ JURXS 5HSRUW 5(3257352*5$0

8VHV 6WDUWV Figure15:DevelopmentClassObjects(1.

'HYHORSPHQWFODVVREMHFW *HQHUDWH &$77SURFHGXUH$UHDPHQX'LDORJER[%XVLQHVV HQJHQHHULQJ REMHNW :RUNIORZ'DWDPRGHO *8,VWDWXV ,QWHUIDFH 3URJUDPPREMHNW 8VHV 7UDQVDFWLRQV &DOOV 6(7*(7 SDUDPHWHU 'HYHORSPHQWFODVVREMHFW *HQHUDWH &$77SURFHGXUH$UHDPHQX'LDORJER[%XVLQHVV HQJHQHHULQJ REMHNW :RUNIORZ'DWDPRGHO *8,VWDWXV ,QWHUIDFH 3URJUDPPREMHNW 8VHV 7UDQVDFWLRQV &DOOV 6(7*(7 SDUDPHWHU Figure16:DevelopmentClassObjects(2. 5.2.1R/3Transactions AnR/3transactioncoversalogicalprocessinR/3(e.g.,generatingalistofcustomers, ightreservationforacustomer,executinga changingtheaddressofacustomer,bookinga program).Fromtheuser'spointofviewitrepresentsaself-containedunit.Intermsofdialog programming,itisacomplexobjectwhichconsistsofamodulepool,screens,etc.andis calledwithatransactioncode[ SAPAG1996] . ItishelpfultothinkofanR/3transactionasonebasicbusinessprocesswhichcannot beinterruptedorandhastobeexecutedinanallornothingfashion.R/3transactionsare thereforesometimescalledlogicalunitsofwork(LUW).ALUWcaninvolvemorethanone databasetransaction(DB-TA). R/3transactionscanbeprogrammedtocomplywiththeACIDcondition(Atomity ConsistencyIsolationDurability).Thisisachievedbypostponingallactualdatabasechang es anR/3transactionhastoperformuntiltheendoftheR/3transactionandthenperforming allchangesatomicallywithinonedatabasetransaction.Moreover,manyR/3transactionare

programmedtoworkonprivatein-memorycopiesofdatareadatomicallyatthebeginofthe R/3transactionfromthedatabase. Tocoordinatemanyusersworkingwiththesamedata,lockobjectsmustbeused.Lock objectslockthedatathemomenttheyarecalledandreleaseitbydefaultwhentheR/3 transactionis

nishedandallthechangesinthedatabasehavebeencomitted.Pleasenote thatthedataislockedatthetimetheuserworkswiththedatawhichcanbemuchaheadof thetimewhentheactualchangeinthedatabaseiscarriedout. 5.2.2Reports ReportsareABAP/4programs.Theywillbeexplainedinmoredepthintheafollowing subsectiononABAP/4. 5.2.3FunctionModules AfunctionmoduleisaroutineinABAP/4.Inaddition,ithasaninterfacewhichisstoredin theDataDictionary.Theconceptoffunctionmodulesisoneofthemostimportantconcepts inR/3.Therearedierentkindsoffunctionmodules,calledprocesstypes:

Normal:Thefunctionmodulecanbecalledfrominsidethesystemonly.Databasetransactionsa reperformedimmediately. RFCsupported:ThefunctionmodulecanbecalledviaRFC(remotefunctioncall)from applicationsoutsideoftheR/3system. Updatewithstartimmediately:Thedatabasetransactionsaredelayeduntilthenext 'COMMITWORK'event.Shouldadatabasetransactionfail,retryingispossible.This iscalled'V1-booking'. Updateimmediately:Thedatabasetransactionsaredelayeduntilthenext'COMMIT WORK'event.Shouldadatabasetransactionfail,retryingisnotpossible.Thisisalso called'V1-booking'. Updatewithstartdelayed:Thedatabasetransactionsareperformed(booked)afterall V1-bookingshavebeenperformed.Thisiscalleda'V2-booking'. Sammellauf:ThedatabasetransactionscanbebookedwithotherV2-bookingsatonetime. Thisiscalleda'V2-booking'. Socalled'batchinput'canbeprovidedbythecallerofanRFC.Thisisdatastored inspecialtablesandthesysteminterpretsthedataasinteractiveinputforthesystem. Withbatchinputeverythingthatcanbedoneinteractivelycanbecontrolledfromclient applications. Afunctiongroupisasetoflogicallyrelatedfunctionmodules.Afunctionlibrarystores allfunctionmodulesandallowstosearchforspeci

cmodules. 5.2.4Messages AmessageinR/3isastring.Messagesarepromptedtotheuserinamodaldialog.Dialogs aredisplayedinseparatewindows.Everymessagehasauniquenumberinthemessageclass itiscontainedin.Amessageclassisacollectionofmessageswhichareusedinthesame program.Nevertheless,itispossibleforaprogramtousemultiplemessageclasses. R/3supports

vetypesofmessages: Error(E):Theusermadeaninvalidinputandassoonasheorshehasacknowledgedthe message,isforcedtoreentertherequiredinformation. Warning(W):Theusermayhavemadepossiblyinvalidinput,butcandecide,whetherto reentertheinformationorwhethertoproceed. Information(I):Theuserhastoacknowledgethemessageandcanproceed. Success(S):Thismessageisnotdisplayedinamodaldialog,butinthebottomlineofthe nextscreen.Amessageofthistypeispurelyinformationalanddoesnotneedtobe acknowledged. Abort(A):Acriticalerrorhasoccurred,are-enteringoftheinformationisnotpossible. ThecurrentR/3transactionisaborted.Inmostcases,technicalreasonscausethiskind ofmessagetobeprompted. Messageclassesaremaintainedwithaspecialtool,intermsofABAP/4thistoolisan interactivereport.Messagesshouldbelanguagesensitive,ofcourse.Thelanguageischosen dynamically,basedoncustomizationanduserlogininformation. 5.2.5AreaMenus Asstatedbefore,ABAP/4programscanusethefullfunctionalityoftheR/3frontend, includingmenus.AnareamenuisamenuwhichtriggersR/3transactions.Areamenuscan callanyR/3transactionde

nedinthesystem.AreamenusarenotassignedtoanABAP/4 programandareinvokedbyatransactioncode. 5.2.6OtherDevelopmentClassObjects Logicaldatabasesareusedtowritereports.Theyconsistofoneormoredatabasetable(s), whicharelinkedbyuser-de

nedconditions.Logicaldatabasessimplifyreportingbutdo notaddtrueexpressivepower.

3URJUDPREMHFW 7UDQVDFWLRQ &RGH *OREDO GDWD '\Q3UR 1XPEHU7\SH 7\SH9HUVLRQ ,PSRUWV &DOOV /RJLFDO GDWDEDVH 0RGXOHSRRO LQ$%$3 3%2 PRGXOH 3$, PRGXOH 6XEURXWLQH )RUP

*8, VWDWXV *8, WLWOH &RGH 6FUHHQ 6WDUWVZLWK '\Q3URILHOG 'DWDH[FKDQJHE\HTXDOLW\RIQDPHV ([HFXWHV )ORZORJLF 3URJUDPREMHFW 7UDQVDFWLRQ &RGH *OREDO GDWD '\Q3UR 1XPEHU7\SH 7\SH9HUVLRQ ,PSRUWV &DOOV /RJLFDO GDWDEDVH 0RGXOHSRRO LQ$%$3 3%2 PRGXOH 3$, PRGXOH 6XEURXWLQH )RUP

*8, VWDWXV *8, WLWOH &RGH 6FUHHQ 6WDUWVZLWK '\Q3URILHOG 'DWDH[FKDQJHE\HTXDOLW\RIQDPHV ([HFXWHV )ORZORJLF Figure17:ProgramObjectsinR/3 Dialogboxesaredialogs,whichareusedquiteofteninthesystem.Itispossibletode

nenewdialogboxesortouseprede

ned,standardizeddialogboxes.Severalkindsof standarddialogboxesareavailable[ KretschmerandWeiss1997] :Con

rmationprompt dialogboxes,dialogboxesforchoosingamongalternatives,dataprintdialogboxes,and textdisplaydialogboxes. SET-/GET-parametersareusedtoexchangedatabetweenR/3transactions.Theirmain purposeistosetvaluesforinput

eldsonthescreen. CATT-procedures(ComputerAidedTestToolprocedures)areproceduressubmittedto theR/3CATTtoolwhichhelpdeveloperstotestnewlydevelopedcode,customized partsofthesystemetc.withtestdata(simulatingbatchoruserinput). 5.3ProgrammingintheSmall:ProgramObjects Aprogramobject(seeFig.17)consistsofamodulepool,writteninABAP/4,oneormore DynPros,andsomeGUIstati.Aprogramobjectcanalsouseatmostonelogicaldatabase, theprogramobjectwillthenbeareport. owlogicandcancallothersubroutines,called TheABAP/4modulesarecalledbythe owlogic.Modulesandformscanhavetheir forms,whichcannotbeinvokeddirectlybythe ownlocaldataandhavefullaccesstoallglobalvariables.Theglobalvariablescanbeused forinternalpurposesandaretheinterfacetoalldatabaseobjects. ThedataexchangebetweenDynPro

eldsandABAP/4variablesisdoneautomatically. Beforeascreenisdisplayed,thePBOmodules

llABAP/4variables,whichhavethesame nameastheDynPro

elds,withtheappropriatedata.TheDynProinterpreterthentransfers thedataintotheDynPro

eldsandafterinput,ittransfersthedatabackintotheABAP/4 variables. 5.3.1GUIStatus AGUIstatusdescribeswhichmenubarandbuttonsshouldbevisibletotheuseratacertain pointintime. Themenubarisacontainerformenus.Twomenusarealwayspresent:Thesystemmenu andthehelpmenu.Menusthemselvescancontainmenuitems,e.g.'Quit',whichtrigger

*8,VWDWXVREMHFW )XQFWLRQNH\ DVVLJQPHQW 0HQXEDU7RROEDU $SSOLFDWLRQ WRROEDU 0HQX 0HQXLWHP 5HIHUHQFHV &RGH )XQFWLRQNH\ &RGH )XQFWLRQNH\ &RGH *8,VWDWXV &RGH *8,VWDWXVREMHFW )XQFWLRQNH\ DVVLJQPHQW 0HQXEDU7RROEDU $SSOLFDWLRQ WRROEDU 0HQX 0HQXLWHP 5HIHUHQFHV &RGH )XQFWLRQNH\ &RGH )XQFWLRQNH\ &RGH *8,VWDWXV &RGH Figure18:GUIStatusObjectsinR/3 actionsorfurthersubmenus,like'CreateObject...',whichleadtoothermenusandmenu items.Amenucancascadeuptoadepthofthreelevels Thetoolbariscontainerforapplication-independentbuttons,theapplicationtoolbaris acontainerforapplicationdependentbuttons. 5.3.2Dynpros{ElementsofInteractiveTransaction TounderstandtheprogrammingconceptofR/3itisnecessarytounderstandthemodelfor interactiveprograms.R/3ismainlyevent-driven,eventscanbetriggeredbythesystemitsel f orbytheuser. Themodelisessentiallyscreen-oriented,thefollwoingcycleisprocessedforeveryscreen called(DynPro,seeFig.19andFig.20):

1.Atthebeginningofthecycle,everythingattachedtothePBO(ProcessBeforeOutput. eventisexecuted.Inmostcasesthiswillbeactionstopreparedatatobepresentedto theuser. 2.Next,theuserdoestheactualinput. 3.Dependingonhowtheuserterminatedtheinput, additionalinformationisdisplayed, anothertransactionisexecuted, theEXIT-COMMAND-eventistriggered, thePAI(ProcessAfterInput)eventistriggered,whichisthenormalcase. 4.Theactionsassignedtothetriggeredeventareperformed. 5.3.3AnExampleofanR/3DynPro avor'ofprogramminginteractivetransactionsinR/3,theDynPro100ofthe Toillustratethe' functiongroupFM22willbediscussed.Thefunctiongroupprovidesfunctionalitytomaintain fundscenters,likethetransactionFM2I,whichcreatesanewfundscenter.Othertransaction s areFM2S(showsanexistingfundscenter)andFM2U(updates/changesanexistingfunds

$%$3 PRGXOH '%7$ '\Q3UR$ 3%2 HYHQW $%$3 PRGXOH '%7$ $%$3 PRGXOH '%7$ $%$3 PRGXOH '%7$ '\Q3UR$ 3$, HYHQW '\Q3UR% 3%2 HYHQW '\Q3UR% 3$, HYHQW WLPH '\Q3UR$'\Q3UR% $%$3 PRGXOH '%7$ '\Q3UR$ 3%2 HYHQW $%$3 PRGXOH '%7$ $%$3 PRGXOH '%7$ $%$3 PRGXOH '%7$ '\Q3UR$ 3$, HYHQW '\Q3UR% 3%2 HYHQW '\Q3UR% 3$, HYHQW WLPH '\Q3UR$'\Q3UR% Figure19:TheR/3ModelforInteractiveTransactions

([HFXWH 3%2 PRGXOHV 7UDQVIHUGDWD IURP$%$3 YDULDEOHVLQWR '\Q3URILHOGV 3URFHVV VFUHHQ *LYH KHOS /HDYHWR WUDQVDFWLRQ $7(;,7 &200 $1' ([HFXWH 3$, PRGXOHV 1H[W 3%2 6XE URXWLQHV 0(66$*( W\SH(" )" /RFNFHUWDLQ '\Q3URILHOGV 2.&2'( W\SH(" 2.&2'( W\SH7" )" 6XE URXWLQHV 7UDQVIHUGDWDIURP '\Q3URILHOGVLQWR $%$3YDULDEOHV Figure20:StatesoftheR/3DynProInterpreter

Figure21:TransactionFM2I,DynPro100 center).ItisverycommoninR/3tohavethesethreetransactions(insert/show/update)for agivenobjecttype. InDynPro100(seeFig.21),theuserhastotypeinthefundscenter(Finanzstelle)and thesuperordinatedFMarea(Finanzkreis)heorshewantstoinsertorupdateorlookat.This meansthatDynPro100issharedbymultipletransactions.Thefullsourcecodecanbefound inappendixB. 5.3.4ComponentsandAttributesofDynPros ADynPro(DynamicProgram)consistsofseveralcomponents[ SAPAG1996] : DynProattributesincludetheDynPronumber,thenumberoftheDynProthatshould followitbydefault,andsomeotherattributes. Screenlayoutspeci

eswhich

eldsshouldappearintheDynProandwhere Fieldattributesarepropertiesofeach

eldintheDynPro. Flowlogicspeci

eswhichABAP/4routinesshouldbecalledfortheDynPro. ThesecomponentswillbeexplainedusingtheexampleofDynPro100,TransactionFM2I (insert). DynProAttributes AttributeValueExplanation ProgamSAPLFM22toeveryfunctiongroupthereexistsaprogram objectnamedSAPL... Number100thisisDynPronumber100 OriginalLanguageDthelanguagetheDynProhasoriginallybeencreatedin, inthiscaseiswascreatedinGerman Description...shortdescriptionofwhattheDynProdoes TypenormalthisisanormalDynPro,nospecialfunctionality NextDynPro100bydefaultthenextDynProexecutedwillbethe Dynpro100

PROCESSBEFOREOUTPUT. MODULED0100INDEPENDENT. MODULED0100MODIFYSCREEN. MODULED0100SETPF-STATUS. PROCESSAFTERINPUT. MODULED0100EXITATEXITCOMMAND. CHAIN. FIELD:IFMFCTR-FIKRS,IFMFCTR-FICTR. *checkforillegalcharacters MODULECHECKSONDERZEICHEN. *storekeyofFMareainagobalvariable MODULED0100DBKEYNOTICE. *istheuserentitledtodothetransaction. MODULEAUTHORITYCHECK *setalockonthetableFMFCTR,holdingthefundscenters MODULEFMFCTRENQUEUE. *readattributesoffundscenter MODULEFMFCTRLESEN. ENDCHAIN. *setnextDynProtobeexecuted FIELDOKCODEMODULED0100OKCODE.

Figure22:FlowLogicofDynPro100,ProgramSAPLFM22 ScreenLayoutThescreenlayoutisdesignedwithaspecialtool,thescreenpainter.The required

eldsareinsertedandplacedonthescreen.Thismaskwillbeusedlaterbythe DynProinterpreter. FieldAttributes FieldNameTypeFormatLengthRemark IFMFCTR-FIKRSTextCHAR15stringliteral'Finanzkreis'. IFMFCTR-FIKRSI/OCHAR4input

eldforFMareaassociated withmatchcodeFIKRStoassist user-input IFMFCTR-FICTRTextCHAR15stringliteral'Finanzstelle' IFMFCTR-FICTRI/OCHAR10input

eldforfundscenterassociatedwithmatchcodeFISTtoassistuserinput OKCODEOK functionreturncode(menuselection, abort,.... TheOK-

eldservesaspecialpurpose:Buttonsareidenti

edbyafunctioncode.Whenever abuttonispressed,userinputisterminatedandthefunctioncodeofthebuttonisstoredin theOK-

eld.Wheninputisterminatedbypressingthereturn-key,thevalueoftheOK-

eld isSPACE. owlogicconsistsofkeywordsidentifyingthebeginningofasectionto FlowLogicThe beprocessedatanevent,modulecallsanderrorhandling. owlogicinFig.22:themoduleD0100INDEPENDENTiscalledafterthe Considerthe PBOeventhasoccurred.ThemoduleD0100EXITiscalledwhentheuserwantstoexitthe currenttransaction,themoduleD0100OKCODEiscalledatthePAIeventandtheinput isvalid.

CALLFUNCTION'ENQUEEFMFCTR' EXPORTING FIKRS=GFIKRS FICTR=GFICTR EXCEPTIONS FOREIGNLOCK=1 SYSTEMFAILURE=2

Figure23:InvocationofaLockingObject Whenanerrormessageisissued,all

eldsenumeratedbytheFIELD-commandcanbe reentered.TheCHAIN-ENDCHAIN-commandde

nesablockinwhichtheFIELD-COMMAND isvalid. 5.3.5CharacteristicsofABAP/4 SomeoftheABAP/4charcteristicsare: ABAP/4codeisinterpreted thesyntaxremindstheuserofCOBOLandBASIC thesyntaxiscontext-sensitive morethan200key-wordsinversion3.0C,withanincreasingtendency littleorthogonality. Fromacomputerscientist'spointofview,thelanguageisveryold-fashionedandnotwelldesi gned. ItssizeandcomplexityhasgrownintimeandSAPwasnotable,ordidnotwant to,redesignthelanguage.Thishasledtoalanguagefullofcontradictionsandirregularitie s. Nevertheless,inABAP/4therearesomeconceptsworthhavingacloserlookat.Foradetailed introductiontoABAP/4see,e.g., [ KretschmerandWeiss1997] , [ Curran1996a] or[ Matzke 1996] . ConsistentDe

nitionsofABAP/4variablesandDDicObjectsAmajorproblemofeveryprogrammabledatabasesy stemistokeepthede

nitionsofprogramvariables consistentwiththede

nitionsmadeinthedatabase,inthecaseofR/3theDataDictionary. InR/3,variablescanbede

nedwiththe'LIKE'-operator,whichhastheform'variable LIKEDDicobject'.ThiscausestheABAP/4interpretertolookupthede

nitionofthe DDicobjectandtousethatde

nitionfortheABAP/4variables.Forexample,theABAP/4 statement'DATAGFIKRSLIKEFM01-FIKRS.'(include

leLFM22DEC)de

nesavariablecalledGFIKRSwhichhasthesamede

nitionasthe

eldFIKRSinthetableFM01. SinceABAP/4isinterpreted,everytimethevariableGFIKRSisde

ned,itusesthesame de

nitionasthe

eldFM01-FIKRSintheDataDictionary. TheLIKE-operatorcanbeusedwithanyDDicobject,especiallytablesandstructures. Thisisveryimportant,becausewhennew

eldsareaddedorthede

nitionof

eldsarealtered, olderprogramsusingthetableorstructurewillstillwork.Otherwisetheprocessofcustomiz ingwouldnotonlyincludethealteringoftablesbutalsothealteringofallapplicationsusin g thesetables.Thiswouldobviouslynotbefeasible. LockingofDatabaseTablesToguaranteedataconsistency,databasetablesmustbe lockedthemomenttheyareused.Asdescribedbefore,thisisdonebylockingobjectsand thesystemautomaticallygeneratesfunctionmodulestorequest(enqueue)andtoendalock (dequeue).Figure23showsanexamplefortheinvocationofalockingobject. InABAP/4,databasetablescannotbelockeddirectly,alllockingmustbedonevialockingobje cts. Again,theindirectionpaysowhende

nitionsordependenciesintheData Dictionaryarechanged.Oldprogramswillstillworkafteralockingobjecthasbeenchanged.

MODULED0100MODIFYSCREEN. LOOPATSCREEN. "/if((Feldname='Finanzkreis')und(TAistabh angig). IF((SCREEN-NAME='IFMFCTR-FIKRS'. AND(FLGCALLD=CONDEPENDANTTA)). "/FelddientnurzurAnzeige SCREEN-INPUT=0."/'0A'inHEX MODIFYSCREEN. ENDIF."/SCREEN-NAME ENDLOOP."/SCREEN. ENDMODULE."/D0100 MODIFYSCREEN

Figure24:DynamicScreenModi

cation PersistenceTheunderlyingSQLdatabaseisthepersistentstoreforABAP/4.Inaddition, ABAP/4canhandle

les,butthisisrecommendedfortemporarydataorinformation interchangewithotherprogramsonly. ABAP/4usesabuilt-indialectofSQL,thesocalledOpenSQLlanguage.OpenSQLis similartostandardSQL,therearesomemodi

cationsduetothetightintegrationinABAP/4. ItisalsopossibletousetheSQLlanguageoftheunderlyingdatabase,thelanguageis calledNativeSQL.ItisnotwisetouseNativeSQL,fortheapplicationsmaynotbeusable inotherR/3systems. DynamicScreenModi

cationDierentgroupsofusersareinterestedinthesame objects,buttheyallwanttomanipulateitfromtheirpointofview.Databasestakethatinto accountbyviews,R/3allowstochangethescreenmaskduringexecution.Thisisdoneina PBOmoduleliketheoneshowninFig.24. 6CustomizingR/3:ConceptsandTechniques CustomizingisamethodintendedforimplementingR/3(atSAP),enhancingofR/3,undertaking areleaseupgradeorasystemupgrade. R/3providesaproceduremodel,theworkbreakdownstructureforimplementationand enhancementofR/3. R/3providestoolsforsystemcon

gurationandthenecessarydocumentation. R/3providesthecustomizingprojectwhichgivestheusertoolsformanagement,processingan devaluationofhisorherimplementationorenhancementprojects. R/3givescon

gurationrecommendationsandtoolstoenablethis R/3helpstotransfertheSystemcon

gurationfromthedevelopmentenvironmentinto theproductionenvironment. R/3containsasetoftoolsforsystemupgradesandreleaseupgrades. 6.1Customizing:TheProcedureModel Theproceduremodelisthebasicelementofcustomizing.Theaimoftheproceduremodel isastructuredorganizationoftheR/3implementation[ SAPAG1996] .Itisahigh-level descriptionofwhatistobedone. Theproceduremodelconsistsoffourphases: 1.Organizationandconceptualdesign.Thefocuswhencreatingtheconceptualdesign istousetheR/3referencemodeltohelptoworkouthowtheR/3businessapplication componentssupportthecompany'sprocessesandfunctions.Otherstepsare,e.g.,to traintheprojectteamandtodesigninterfacesandenhancements.

Figure25:CustomizingR/3:TheProcedureModel 2.Detaileddesignandsystemsetup.Theresultofthephase'DetailingandImplementation'is thecheckedcompanyspeci

capplicationsystemwhichwillbereleasedfor phase3(productionpreparation). 3.Preparationsforgoinglive.Theresultofthe'ProductionPreparation'phaseisa checkedandreleasedproductionsystem. 4.Productiveoperation.Theresultofthephase'Production'istheorganizationand executionofacontinuousoptimizationandsupportoftheproductiveoperation. Figure25showsthesestepsoftheproceduremodelasde

nedforR/33.0C[ SAPAG 1996] . 6.2Customizing:TheImplementationGuide Theimplementationguide(IMG)describeswhathastobedoneconcretelyandisrelatedto theactualcustomizingproject.Furthermore,itcontainsthenecessarysequenceofactiviti es andtheusercanstarttheappropriatecustomizingtransactions.TheIMGisthecentral elementofthecustomizingprocess. Ofcourse,thereneedtobedierentIMGsfordierentcompaniesandprojects.SAP introducedfourlevelsofIMGs[ SAPAG1996] : TheSAPReferenceIMGcontainsdocumentationonallthebusinessapplicationcomponentssupp liedbySAP. TheEnterpriseIMGisasubsetoftheSAPReferenceIMGandcontainsdocumentation forthosecomponentstobeimplementedonly. ProjectIMGsareEnterpriseIMGsubsetscontainingjustthedocumentationforEnterprise IMGcomponentstobeimplementedinparticularCustomizingprojects UpgradeCustomizingIMGsarebasedeitherontheEnterpriseIMGoronaProjectIMG andshow,foragivenreleaseupgrade,allthedocumentsthatarelinkedtoarelease note. IMGsarecreatedbytheexecutionofspecialR/3transactions.

6.3CustomizingR/3 Customizingisrealizedby

llingindataintocertaincustomizingtablesorleavingthemwith thedefaultdata.R/3standardmodulesreacttocustomizingdata,standardcodeshouldnot bechanged.InsomeABAP/4modules,R/3provides'gateways'touser-de

nedABAP/4 functions.Obviouslythisisrestrictedtoforeseencasesonly.Butwithintheimplementatio n processitmayprovenecessarytoaddadditionalfunctionalitytothesystemwhereno'gateway s'orcustomizingisprovided. Theonlywayistowriteprogramswhicharehighlylinked withstandardcode,whichcanleadtotroublewhenSAPdecidestochangesomeofthe standardcode. AbigproblemduringR/3customizationisto

ndoutwhichR/3modules(FI,TR, HR,...)andfunctionsprovidetherequiredfunctionality.Forexample,inordertoimplement budgetcontrolling,free-lanceemployeesaremodeledbestassuppliers. Thebasictop-down-approachtosolvecustomizationproblemsconsistsofthefollowing steps: 1.readthefunctionaldescriptionofamoduleintheR/3documentationonahighlevel 2.readthedocumentation'FunctionsinDetail',providedbyR/3 3.analyzetheEPCs 4.analyzethedatamodel 5.checkthefunctionalitywithappropriatetestingdata. Customizingisatime-consumingprocesswhichinvolvesalotofreadingandexperimentation. Thesheeramountofdocumentationforcustomizingandtheproblemof

ndingout therequiredinformationandfunctionsisamajorobstacletoquicklyintroduceR/3intoan enterprisewithalreadyestablishedbusinessrulesandbusinesspractice. 6.4SystemEvolution InanR/3system,thereexistsexactlyoneoriginalobjectandanynumberofcopies.The WorkbenchOrganizertakescarethatnocopiesofanobjectcanbechanged.Topropagate changesoftheoriginalobjectinthesystem,thesocalledtransportsystemisused.Itreplace s outdatedcopiesoftheoriginalobjectwithnewcopies. Thetransportsystemisusedforasystemupgradeaswell.Allchangesaretransported fromtheR/3originalobjectsintoclient0,thedefaultclient.Fromthere,thechangescan betransportedtotherequireddestinationinthesystem.Developmentclassesarethebasic objectsthatcanbetransported. 7R/3'sProcessandSystemArchitecture DespitethefactthatR/3usesrelationaltechnologyandaclient/serverarchitecture,manyo f itsprocessanddistributionconceptsclearlyshowtheirorigininR/2'scentralizedmainfra me world. 7.1Client/ServerArchitecture EveryR/3Systemconsistsofthreetiersorlayers: Presentationlayer:Thegraphicaluserinterface(SAPGUI)isrunonthislayer.Noappli cationlogicisprocessed.SAPGUIdoesnotadheretothestyleguidelinesofitshost system. Applicationlayer:Thislayerexecutestheapplicationlogic,likeDynProsandABAP/4 modules.Itsendsthedatatobepresentedtotheusertothepresentationlayer. Databaselayer:Thislayerholdsthesystem-widedatabaseandthecentralbookingprocess. Allthreelayersmustexist,buttheymaybeononecomputer.In'normal'R/3systems,the layerswillbeonseparatecomputers.Figure26showsthethreelayersandthecommunication betweenthemostimportantcomponents(exampletakenfrom[ Willetal.1996] ).

:LQGRZ PDQDJHU 6$3*8, SURFHVV 6$3*8, SURFHVV 6$3*8, SURFHVV 'LVSDWFKHU'\Q3URSURFHVVRU $%$3LQWHUSUHWHU :RUNSURFHVV '\Q3URSURFHVVRU $%$3LQWHUSUHWHU :RUNSURFHVV &HQWUDO ERRNLQJ SURFHVV 5'%06 3& ;7HUPLQDOV 3UHVHQWDWLRQVHUYHU $SSOLFDWLRQVHUYHU 'DWDEDVHVHUYHU :LQGRZ PDQDJHU 6$3*8, SURFHVV 6$3*8, SURFHVV 6$3*8, SURFHVV 'LVSDWFKHU'\Q3URSURFHVVRU $%$3LQWHUSUHWHU :RUNSURFHVV '\Q3URSURFHVVRU $%$3LQWHUSUHWHU :RUNSURFHVV &HQWUDO ERRNLQJ SURFHVV 5'%06 3& ;7HUPLQDOV 3UHVHQWDWLRQVHUYHU $SSOLFDWLRQVHUYHU 'DWDEDVHVHUYHU Figure26:Thethree-tieredR/3SystemArchitecture TCP/IPisusedasthecommunicationprotocolwithinR/3.WithLU6.2itispossibleto communicatewithIBMmainframes.Fig.27,adaptedfrom[ Buck-EmdenandGalimow1997] , showstheuseofnetworkprotocolsbyR/3. Ontopofthecommunicationprotocol,apresentationprotocolisusedfordataexchange betweenthepresentationlayerandtheapplicationlayer.ThisSAPprotocolminimizesthe amountofdatatobeexchangedforaswitchfromthecurrentscreentothenextandduring

bulkdatadisplay. RemoteSQLisusedtoexchangedatabetweenthedatabaseandtheapplicationlayer. 7.2ProcessArchitecture AsdepictedinFig.28,anR/3systemconsistsofatleastonepresentationserver,atleast oneapplicationserverandexactlyonedatabaseserver.R/3doesnotsupportdistributed databases.SAPclaimsthatdistributeddatabasesarenotsafeenoughforpracticaluse. Everyapplicationserverconsistsofonemessageserverwhichhandlesthecommunication withothersystemservers.TherecanbeatmostonegatewayserverinanR/3system,which handlesthecommunicationwithothersystems,eitherotherR/3systemsorsystemsform othervendors. Thecentralelementofanapplicationserveristhedispatcherwhichcontrolstheworkprocess es. Thedispatcherassignsthejobstotheappropriateworkprocess. Theworkprocesses(WP)dotheactualwork,havingtheirowntaskhandler,DynPro processor,ABAP/4processoranddatabaseinterface.OnecanimagineaWPas'R/3ina nutshell',beingspecializedonspecialjobs. owlogic.At DialogWPs:ExecuteDynProsandABAP/4moduleswhicharecalledinthe thebeginningofabasiccycle,thedispatcherassignstherequestbythepresentation servertoanidleDialogWP,whichthendoesallpreparationsforscreenoutput,like executingtheABAP/4modulesassignedtothePBOevent.Aftertransmittingthenew screenlayouttothepresentationserver,theDialogWPisidleagain.Whentheuser hasendedtheinput,thedispatcherwillagainlookforanidleDialogWPtoexecutethe requestedactions. BatchWPs:BatchWPsareusedinsteadofDialogWPswhentheinputisabatchinput.

5)&UHPRWHIXQFWLRQFDOOV

&3,&6$3LPSOHPHQWDWLRQ

$33& /8 7&3,3 ; (WKHU QHW 7RNHQ ULQJ (WKHU QHW 7RNHQ ULQJ $SSOLFDWLRQ OD\HU 3UHVHQWDWLRQ OD\HU 6HVVLRQ OD\HU 7UDQVSRUW OD\HU 1HWZRUN OD\HU 'DWD/LQN OD\HU 3K\VLFDO OD\HU Figure27:CommunicationProtocolsSupportedbyR/3 3UHVHQWDWLRQVHUYHU$SSOLFDWLRQVHUYHU'DWDEVHVHUYHU 'LVSDWFKHU*DWHZD\VHUYHU0HVVDJHVHUYHU :RUNSURFHVV 5V\VWHP 5)&UHPRWHIXQFWLRQFDOOV

&3,&6$3LPSOHPHQWDWLRQ

$33& /8 7&3,3 ; (WKHU QHW 7RNHQ ULQJ (WKHU QHW 7RNHQ ULQJ $SSOLFDWLRQ OD\HU 3UHVHQWDWLRQ OD\HU 6HVVLRQ OD\HU 7UDQVSRUW OD\HU 1HWZRUN OD\HU 'DWD/LQN OD\HU 3K\VLFDO OD\HU Figure27:CommunicationProtocolsSupportedbyR/3 3UHVHQWDWLRQVHUYHU$SSOLFDWLRQVHUYHU'DWDEVHVHUYHU 'LVSDWFKHU*DWHZD\VHUYHU0HVVDJHVHUYHU :RUNSURFHVV 5V\VWHP Figure28:R/3ProcessArchitectureinOMTNotation

:RUNSURFHVV 'LDORJ 6SRRO %DWFK (QTXHXH %RRNLQJ 7DVNKDQGOHU '\Q3UR SURFHVVRU $%$3 SURFHVVRU 'DWDEDVH LQWHUIDFH 0HVVDJH :RUNSURFHVV 'LDORJ 6SRRO %DWFK (QTXHXH %RRNLQJ 7DVNKDQGOHU '\Q3UR SURFHVVRU $%$3 SURFHVVRU 'DWDEDVH LQWHUIDFH 0HVVDJH Figure29:R/3WorkProcesses SpoolWPs:Theydotheinternalspooling,likeprintingortransferringdatatothedatabase. EnqueueWPs:AnEnqueueWPisspecializedonthelockingofDDicobjects. 7.3ExternalGateways R/3hastechnicalinterfacestoexternalsystemsatvirtuallyalllayers. Presentationlayer:IntelligentTerminal Applicationlayer:Files,CPI-C,RFC,OLE(Windowsonly),email,EDI,BusinessAPI Databaselayer:ODBC,RemoteSQL. Theinterfacestotheapplicationlayerhavedistinctcontrolpossibilities,e.g.: DataimportDataexportControlfromoutsideControlof externalSoftware FilesXX RFCXXXX OLEXXXX ODBC, remoteSQL XX ThebestwaytointeractwithR/3onaprogramtoprogrambaseistheRFCmechanism forithasfullcontrolandisplatform-independent.FunctionmodulescanbecalledviaRFCs, theyproveagaintobeausefulconcept.BAPIsarenothingelsethanconventionalRFCs.

AOverview:R/3TerminologyandConcepts Figure30summarizestheR/3client/serverarchitecturebymeansofanOMTdiagram. Figure31givesanoverviewofallconceptualR/3objectsmentionedinthistutorialand showstheirstaticrelationships.

3UHVHQWDWLRQVHUYHU$SSOLFDWLRQVHUYHU'DWDEVHVHUYHU 'LVSDWFKHU*DWHZD\VHUYHU0HVVDJHVHUYHU :RUNSURFHVV 5V\VWHP 'LDORJ 6SRRO %DWFK (QTXHXH %RRNLQJ 7DVNKDQGOHU '\Q3UR SURFHVVRU $%$3 SURFHVVRU 'DWDEDVH LQWHUIDFH 0HVVDJH 3UHVHQWDWLRQVHUYHU$SSOLFDWLRQVHUYHU'DWDEVHVHUYHU 'LVSDWFKHU*DWHZD\VHUYHU0HVVDJHVHUYHU :RUNSURFHVV 5V\VWHP 'LDORJ 6SRRO %DWFK (QTXHXH %RRNLQJ 7DVNKDQGOHU '\Q3UR SURFHVVRU $%$3 SURFHVVRU 'DWDEDVH LQWHUIDFH 0HVVDJH Figure30:R/3Architecture BSourceCodeofFM22,DynPro100 ThecompletesourcecodecanbefoundintheprogramSAPLFM22(Release3.0).Thecode givenhereisasubsetwhichisexecutedbyDynPro100.Thereadershouldgetanimpression ofwhatABAP/4programslooklike. Theoriginalcomments(andseveralvariablenames)areinGermanandhavebeentranslated. *Programheader FUNCTION-POOLFM22MESSAGE-IDFI. ... *----------------------------------------------------------------------* DEC-includelocaltabledataandfield-symoboldefinitions

*----------------------------------------------------------------------INCLUDELF M 22DEC. ... *----------------------------------------------------------------------* Interaltables *----------------------------------------------------------------------* Internaltableforfundscenterusedfordatastorageduring *transactionprocessingandtopropagatedatafromonDynprotothe *next DATA:BEGINOFI_FMFCTROCCURS10. INCLUDESTRUCTUREIFMFCTR. DATA:ENDOFI_FMFCTR. *Backupofnon-updatedvalue DATA:BEGINOFI_OLD_FMFCTR. INCLUDESTRUCTUREIFMFCTR. DATA:ENDOFI_OLD_FMFCTR. ... TABLES:

'HYHORSPHQW FODVV REMHFW 'DWD GLFWLRQDU\ 5HSRVLWRU\ 2EMHFW $%$3 GLFWLRQDU\ REMHFW 1DPH $SSOLFDWLRQ 6WDWH 7UDQVSRUW &RQVLVWV RI 2ZQHU &RQVLVWV &RQVLVWV 'HYROSPHQW FODVV 7UDQVSRUW +DV FKHFN WDEOH 7DEOH 'DWD HOHPHQW 1DPH )LHOG 'HILQHV YDOXHV ([WHUQDO W\SH 'DWD W\SH 7\SH JURXS 'RPDLQ %DVHG RQ )LHOG 1DPH +HDGHU OLQH ,QWHUQDO WDEOH $%$3 GDWD W\SH )LHOG V\PERO 64/ W\SH 3URMHFWHG WR /RFN REMHFW 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 0DWFK FRGH REMHNW ,' 6HOHFW FRQGLWLRQ

3URMHFWLRQ 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 6WUXFWXUH $SSHQGV ,QFOXGHV 1DPH )LHOG 9LHZ 7\SH -RLQFRQG 3ULPDU\ WDEOH 6HFRQGDU\ WDEOH 7UDQVDFWLRQ 3URJUDP REMHFW /RJLFDO GDWDEDVH &RGH $XWKRUL]DWLRQ REMHFW 9HUVLRQ 0HVVDJH 1XPEHU 0HVVDJH FODVV )XQFWLRQ PRGXOH )81&7,21322/

,QWHUIDFH )XQFWLRQ JURXS 5HSRUW 5(3257352*5$0

8VHV 6WDUWV ,PSRUWV 'LDORJ ER[ %XVLQHVV HQJHQHHULQJ REMHNW :RUNIORZ 'DWD PRGHO ,QWHUIDFH 6(7 SDUD )XQFWLRQ NH\ DVVLJQPHQW 0 0 0H &RGH *OREDO GDWD '\Q3UR 1XPEHU 7\SH &DOOV 0RGXOH SRRO LQ $%$3 3%2 PRGXOH 3$, PRGXOH 6XEURXWLQH )RUP

*8, WL WOH &RGH 6FUHHQ 6WDUWV ZLWK '\Q3UR ILHOG 'DWD H[FKDQJH E\ HTXDOLW\ RI QDPHV ([HFXWHV )ORZ ORJLF Figure 31: Overview of the R/3 Terminology

"/ FM area FM01, "/TextforFMarea FM01T, "/Fundscenter FMFCTR, "/InternaltableforDynprofieldsoftheFundscenter IFMFCTR. *structurefoafundscenter DATA:BEGINOFFFMFCTR. INCLUDESTRUCTUREIFMFCTR. DATA:ENDOFFFMFCTR. DATA: "/FMareaidentification G_FIKRS LIKEFM01-FIKRS, "/Fundscenteridentification G_FICTR LIKEFMFCTR-FICTR, "/Transactioncode G_TCODE LIKESY-TCODE, "/Flagtosignalthatthetransaction/functionmodulehasbeen "/calledindepndently FLG_CALLD LIKESY-CALLDVALUE0. ... MODULED0100_MODIFY_SCREEN. *----------------------------------------------------------------------* *DynamicscreenmodificationforDynpro0100: * *-truncatetheoutputsizeofthefieldFMareato10characters* *-disableinputtotheFMareaidentificationfieldifthe * * screeniscalledfromwithinanothertransaction * *----------------------------------------------------------------------* "/LoopoverallfieldsdefinedfortheDynpro LOOPATSCREEN. IF((SCREEN-NAME='IFMFCTR-FIKRS'. AND(FLG_CALLD=CON_DEPENDANT_TA)). "/FelddientnurzurAnzeige SCREEN-INPUT=0. "/'0A'inHEX MODIFYSCREEN.

ENDIF."/SCREEN-NAME ENDLOOP."/SCREEN. ENDMODULE."/D0100_MODIFY_SCREEN ... MODULED0100_EXIT. *----------------------------------------------------------------------* * Functionscalledifthethecurrentprocessingisterminated* * withoutexecutingthechecksofthePAImodules. * * LEAVETOTRANSACTIONreleasesalllocksheldbythetransaction* *----------------------------------------------------------------------* "/getthereturncodedeterminedbytheuser "/indicatethatprocssingcancontinue SAV_OK_CODE=OK_CODE. CLEAROK_CODE. "/Evaluatethesavedreturncode

CASESAV_OK_CODE. "/ENDE=quit WHEN'ENDE'. SETSCREEN0. LEAVESCREEN. "/EINS=branchtotransaction"createfundscenter" WHEN'EINS'. "/branctothistransaction LEAVETOTRANSACTIONTR_FICTR_INS. ENDCASE. ENDMODULE."/D0100_EXIT ... *checkforspecialcharacters: MODULECHECK_SONDERZEICHENINPUT. FIELD-SYMBOLS<F>. IFSY-TCODE=TR_FICTR_INS ORSY-TCODE=TR_FICTRHI_MNTN. IFIFMFCTR-FICTRCACON_SONDERZEICHEN. ASSIGNIFMFCTR-FICTR+SY-FDPOS(1)TO<F>. MESSAGEE669WITH<F>. ENDIF. ENDIF. ENDMODULE. "CHECK_SONDERZEICHENINPUT ... MODULED0100_DB_KEY_NOTICE. *keepkeyoftheFMarea CONDENSEIFMFCTR-FIKRSNO-GAPS. G_FIKRS=IFMFCTR-FIKRS. "/storetheFMcenter CONDENSEIFMFCTR-FICTRNO-GAPS. G_FICTR=IFMFCTR-FICTR. "/ifcalledfromanothertransaction(hereagraphicaldisplayofanFMarea. IF(FLG_CALLD=CON_INDEPENDANT_TA). "/initializevariablesusingvaluespassedfromtheprecedinggraphicaldisplay

SELECTSINGLE* FROMFM01 WHEREFIKRS=G_FIKRS. "/storeobjectnumberoftheFMarea G_FMA_OBJNR=FM01-OBJNR. "/setaflagtoforceaninsertionwithoutacopyinalater "/processingstage FLG_COPY=CON_NEIN. "/initializevariable(sic!. CLEARG_REF_FICTR. ENDIF. ENDMODULE."/D0100_DB_KEY_NOTICE ... MODULEFMFCTR_ENQUEUEINPUT."/callafunctiontolockthefundscenter PERFORMFMCTR_ENQUEUE. ENDMODULE."/FMFCTR_ENQUEUE FORMFMFCTR_ENQUEUE. "/if(creationorupdateofafundscenter.

CHECK((G_TCODE=TR_FICTR_INS. OR(G_TCODE=TR_FICTR_UPD)). "/requestalockforthisfundscenter CALLFUNCTION'ENQUEUE_EFMFCTR' EXPORTING FIKRS=G_FIKRS FICTR=G_FICTR EXCEPTIONS FOREIGN_LOCK=1 SYSTEM_FAILURE=2. CASESY-SUBRC."/exceptionhandling(->informuser. WHEN1."/alreadylockedbyanotheruser(FOREIGN_LOCK. MESSAGEE641WITHG_FICTR. WHEN2."/SYSTEM_FAILURE MESSAGEA521WITHG_FICTR. ENDCASE."/SY-SUBRC ENDFORM."/FMFCTR_ENQUEUE ... MODULEFMFCTR_LESEN. PERFORMFMFCTR_LESEN."/callafunctiontoreadthefundscenter ENDMODULE."/FMFCTR_LESEN. FORMFMFCTR_LESEN. DATA:L_FMFCTR_EXISTSLIKECON_JA."/Fundscenteralreadyexists IF(G_TCODE=TR_FICTR_UPDORG_TCODE=TR_FICTR_SHOW). PERFORMFMFCTR_LESEN_UPDUSINGG_FIKRS "/VALUE G_FICTR "/VALUE CHANGINGL_FMFCTR_EXISTS."/VALUE ELSE. PERFORMFMFCTR_LESEN_INSUSINGG_FIKRS "/VALUE G_FICTR "/VALUE FLG_COPY "/VALUE G_REF_FICTR."/VALUE ENDIF."/G_TCODE ENDFORM."/FMFCTR_LESEN.

FORMFMFCTR_LESEN_INSUSINGVALUE(P_FIKRS. VALUE(P_FICTR. VALUE(P_COPY. VALUE(P_REF_FICTR). ... IF(L_FMFCTR_EXISTS=CON_JA)."/ErrormessageandstaywithinthisDynpro MESSAGEE642WITHP_FIKRSP_FICTR. ... ENDFORM."/FMFCTR_LESEN_INS ... MODULED0100_OK_CODEINPUT. *----------------------------------------------------------------------* *EvaluateusercommandsofDynPro100 * *----------------------------------------------------------------------* "/getthereturncodedeterminedbytheuser "/indicatethatprocssingcancontinue SAV_OK_CODE=OK_CODE. CLEAROK_CODE.

"/evaluatethesavedreturncode CASESAV_OK_CODE. "/ENTER WHENSPACE. "/BranchtosuccessorDynPro200 SETSCREEN200. LEAVESCREEN. ENDCASE. ENDMODULE."/D0100_OK_CODE

References Bancroft1996:Bancroft,N.H.ImplementingSAPR/3.PrenticeHall,EnglewoodClis, NewJersey,1996. Buck-EmdenandGalimow1997:Buck-Emden,R.andGalimow,J.TheClient/ServerTechnologyoft heSAPR/ 3System.Addison-WesleyPublishingCompany,1997. Bundesministeriumf ForschungundTechnologie1994:Bundesministeriumf Forschung ururundTechnologie.InitiativezurFrderungderSoftware-Technologie.InWirtschaft,Wis senschaftundTechnik, August1994. Curran1995:Curran,T.A.ABAP/4DevelopmentWorkbench.Technicalreport,TCMan agementInc.,Oderstrasse28,81677Munich,Germany,January1995.Alsoavailablethrough SAPAG,Neurottstrasse16,69190Walldorf,Germany. Curran1996a:Curran,T.Client/ServerDevelopmentWithSAP'sABAP/4Development Workbench3.0.PrenticeHall,EnglewoodClis,NewJersey,1996. Curran1996b:Curran,T.UsingSAP,sR/3ClientServerBusinessProcessBlueprintTool. PrenticeHall,EnglewoodClis,NewJersey,1996. deBrianandother1996:Brian,Garethdeandother.IntroductiontoABAP/4Programming forSAP.AsapWorldConsultancy,1996. FowlerandScott1997:Fowler,M.andScott,K.UMLDistilled-ApplyingtheStandard ObjectModelingLanguage.Addison-WesleyPublishingCompany,1997. H.1997:H.,Muneer.DesigningandImplementingSAPR/3.Sybex,1997. Hernandez1997a:Hernandez,J.AdministeringSAP.APProfessional,1997. Hernandez1997b:Hernandez,J.TheSAPR/3Handbook.McGrawHill,1997. KretschmerandWeiss1997:Kretschmer,R.andWeiss,W.DevelopingSAP'sR/3Applicationswit hABAP/ 4.Sybex,1997.

Matzke1996:Matzke,B.ABAP/4-DieProgrammiersprachedesSAP-SystemsR/3. Addison-WesleyPublishingCompany,1996. Rumbaughetal.1991:Rumbaugh,J.,Blaha,M.,Premerlani,W.,Eddy,F.,andLorensen, W.,editors.Object-OrientedModelingandDesign.PrenticeHall,EnglewoodClis,New Jersey,1991. SAPAG1996:SAPAG.OnlineDocumentationSAPSystemR/3,Release3.0C.Technical report,SAPAG,Neurottstrasse16,69190Walldorf,Germany,March1996. SAPHome1997:WWWHomePageoftheSAPAG,Germany.http://www.sap-ag.de/, 1997. Schuessler1997:Schuessler,T.IntegratingSAP'sR/3withVisualBasicandOLE.Sybex, 1997. Taylor1996:Taylor,R.UsingSAPR/3-SpecialEdition.QueCorp,1996. Willetal.1996:Will,L.,Hienger,Ch.,Strassenburg,F.,andHimmer,R.R/3Administration. Addison-WesleyPublishingCompany,1996.

You might also like