PRINT2.docx
《PRINT2.docx》由会员分享,可在线阅读,更多相关《PRINT2.docx(10页珍藏版)》请在冰豆网上搜索。
PRINT2
ABAP/4Dictionary
ObjectivesChapter2
IntegrationintoABAP/4Workbench(Active)
⏹TheABAP/4Dictionaryisanactive,integralcomponentoftheABAP/4DevelopmentWorkbench.AnychangemadeintheDictionarybecomeseffectiveatonceintherelevantABAP/4programsandscreens.
⏹ThebasisforthisistheinterpretivenatureoftheR/3Systems.TheinterpreterdoesnotoperatedirectlyontheoriginalcodeofanABAP/4programorscreen,butinterpretsagenerated,internalrepresentation.
⏹WhenchangesaremadeintheABAP/4Dictionary,automaticpost-generationofthisinternalrepresentationguaranteesthattheinterpreterisalwaysworkingwiththelatestdata.
BasicDictionaryObjects
⏹ThebasicdatadefinitionobjectsintheABAP/4Dictionaryaretables,domainsanddataelements.Domainsdescribethetechnicalattributesoftablefields(e.g.fieldtype,fieldlength),whiledataelementscontainthesemanticdefinition(e.g.shortdescription).
⏹Fieldsarenotindependentobjectsandcanonlybemaintainedwithintables.Theypresupposetheexistenceofadataelement.
⏹Adataelementpresupposestheexistenceofadomain.
⏹DomainscanbedefinedwithoutfurtherreferencetootherDictionaryobjects.
DualLevelDomainConcept
⏹IntheABAP/4Dictionary,twotypesofobjectsareusedfordatadefinitionpurposes.Thesearetechnicaldomains(knownasdomainsintheR/3System)andsemanticdomains(knownasdataelementsintheR/3System).
⏹Thedomainisthecentralobjectusedtodescribetheattributesofabusinessobject.Itdescribesafield’svaluerangewhichisdefinedbyspecifyingformalattributessuchasexternalformatandlengthandbyspecifyingfixedvaluesoravaluetable.
⏹Thedataelementisthesemanticobject.Itdescribespreciselythepurposeofadomaininaparticularbusinesssettingforthefieldswhichdependonit.
⏹Forexample,thetablefieldsFORCURAM(tableSBOOK)andPRICE(tableSFLIGHT)belongtothesamedomainS_PRICE.Todistinguishtheiractualbusinessapplication,thefieldFORCURAMusesthedataelementS_F_CUR_PRandthefieldPRICEusesthedataelementS_PRICE.However,bothfieldsbelongtothesamedomainbecausetheyarecurrencyfieldsandthushavesimilartechnicalatttributes.
TransparentTables
⏹WhenithasbeenactivatedintheABAP/4Dictionary,atransparenttableisautomaticallycreatedinthedatabase.Thisprocesstranslatesthedatabase-independentdescriptionofthetableintheABAP/4Dictionaryintothelanguageofthedatabasesystembeingused.
⏹ThedatabasetablehasthesamenameasthetableintheABAP/4Dictionary.ThefieldsalsohavethesamenamesinboththedatabaseandintheABAP/4Dictionary.ThedatatypesintheABAP/4Dictionaryareconvertedtothecorrespondingdatatypesofthedatabasesystem.
⏹AsofRelease3.0,thesequenceoffieldsintheABAP/4Dictionarycanvaryfromthesequenceoffieldsinthedatabase.Thisallowsyoutoinsertnewfieldswithouthavingtoconvertthetablebyperformingaphysicalreorganization.Whenaddingnewfields,theadjustmentismadebychangingthedatabasecatalog(ALTERTABLE).Anewfieldisappendedtothedatabasetable,regardlessofitspositionintheABAP/4Dictionary.
CreatingTransparentTables
⏹ByactivatingatableoftypeTRANSPintheABAP/4Dictionary,youautomaticallycreatethetableviathedatabaseutilityinthedatabase.
⏹Onlycomplexdatabaseoperationssuchastableconversionsmustbeperformeddirectlyviathedatabaseutility.Simpleoperations,suchascreatingobjects,canbeperformedautomaticallybyactivatingtheobjectsintheABAP/4Dictionary.
⏹Inthedatabaseutility,youcancontrolthedatabaseobjectswithananalysistool.
Structures
⏹Besidesdefiningtablesstoredinthedatabase,youcanalsodefinethestructureofdatawhichoccurswhenperformingcalculationsinprograms,orwhenpassingdatabetweenprograms,globallyintheABAP/4Dictionary.Thiskindofdefinitionisknownasastructure.
⏹Structuresdonotcorrespondtoobjectsinthedatabase.
⏹StructuresaredefinedandactivatedintheABAP/4Dictionary.TheycanthenbeaddressedbyABAP/4programsliketablesdeclaredintheTABLESstatement.
⏹Whiledatacanbepermanentlystoredintransparenttablesinthedatabase,datainstructuresexistsonlyduringtheruntimeofaprogram.
⏹Structuresareusedinparticularfordefiningdataattheinterfaceofmodulepoolsandscreens,aswellasforassigningthetypestotheparametersofreusablefunctionmodulesorsubroutines.
⏹Definingstructurescentrallymeansthatyoucanchangethemcentrally.TheactiveABAP/4Dictionarythenensuresthatanymodificationsaremadeinalltheplacesconcerned.
CreatingStructures
⏹Todefineastructure,yougointotheObjectBrowserandproceedasfollows:
-UnderSingleobjects,selectDictionaryobjects.
-OntheDictionaryobjectsscreen,selectStructure.
⏹Onthenextscreen,youcanenterthefieldnamesofyourstructureandspecifythenameofanexistingdataelement(ordefineanewone)whichpointstoadomain.
⏹Whencheckedandfoundtohavenoerrors,thestructureissavedandactivatedandisreadyforuse.
AggregatedObjectsintheABAP/4Dictionary:
Views
⏹‘Aggregated’meansconsistingofseveralcomponents.IntheABAP/4Dictionary,aggregatedobjectsareobjectswhichcomefromseveraldifferenttransparenttables.
⏹Viewsareapplication-specificviewsofdifferentABAP/4Dictionarytables.
⏹ViewsallowyoutogatherinformationfromthefieldsofdifferenttablesandpresentittousersintheformtheyrequirewhenworkingwiththeR/3System.
⏹ViewsaremainlyusedforprogrammingwithABAP/4andforF4onlinehelp.
Summary(Chapter2)
Exercises(Chapter02)
ExercisesChapter2:
ABAP/4Dictionary
%Nameofyourstructure:
ZCA##
##:
Groupnumber
Task:
DefineanABAP/4Dictionarystructure(youwillusethisinalaterexercise).
Thestructureshouldconsistofthefollowingfields:
FieldnameDataelement
--------------------------------------------------------------------------------
CARRIDS_CARR_ID
SEATSMAXS_SEATSMAX