Chapter 2 - ABAP Dictionary - Data Dictionary - DDIC - 1 - SAP ABAP - Hands-On Test Projects With Business Scenarios
Chapter 2 - ABAP Dictionary - Data Dictionary - DDIC - 1 - SAP ABAP - Hands-On Test Projects With Business Scenarios
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Recent
Topics
Tutorials
NEXT
PREV
Highlights
Chapter 3: ABAP Dictionary/Data Dictionary/DDIC
2
CHAPTER2
Settings
Feedback
ABAPDictionary/DataDictionary/DDIC1
Sign Out
ABAPDictionary,datadictionary,dictionary,andDDICaresynonymous
terms.DDICacontractionofdatadictionarywillbeusedthroughout
thisbook.TheDDICisamultifacetedfacilitythatisasubstantialfeature
oftheABAPDevelopmentWorkbenchenvironment.
AnydevelopmentalactivityinvariablyusesDDICobjects.Thischapter
Settings
10 days left in your trial. Subscribe.
Feedback
andthenextonelistandidentifyDDICobjectsthatwillbecoveredin
subsequentchapters.Thischapteralsodescribesthemajorattributesof
theDDIC,introducestheDDICDataTypes,andteachesthereaderto
Sign Out
createDomains,DataElements,andTransparentTablesthroughhands
onexercisesframedinasimplebusinessscenario.
NoteThewordobjectisusedinthisbookinitsnaturallanguage
meaningofthing.ObjectwillnotbeusedinthecontextofOOPunless
explicitlystated.
ABAPDictionary:InitialScreen
TonavigatetothescreenformaintainingandviewingDDICobjects
fromtheSAPEasyAccessscreen,enterthetransactioncodeSE11inthe
Enjoy Safari? Subscribe Today
commandfield.Alternatively,youcanalwaysnavigatefromtheSAP
EasyAccessmenutree.AscreenshotoftheABAPDictionary:Initial
ScreenisshowninFigure21.(ThetermABAPDictionaryisusedhereto
matchthewindowtitleinFigure21.Throughoutthisbook,theterm
DDICwillbeusedbydefault).
Figure21.ABAPDictionary:Initialscreen
AcompletelistofDDICobjectsfollows.Thenonstruckitemsinthelist
arecoveredinthischapterandthenextone.Thestruckoutitemsinthe
listwillbecoveredinsubsequentchaptersasdetailedbelow,afterthe
readerhasacquiredprerequisiteknowledge.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
1/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
ViewTableStructureDefinitionsoftheSAPDeliveredVBRKand
VBRPTables
YouwillbeusingtheVBRKandVBRPtablesfrequentlyinthehandson
programmingexercises,soletsviewthestructureofthesetable
definitionsasafirstexposuretotheDDICobjectdatabasetable.Toview
theVBRKstructuredefinitions,clickontheDatabaseTableradiobutton,
enterthetablenameVBRK,andclickonthe
Displaybuttonor
functionkeyF7.ThestructuredefinitionsoftheVBRKdatabasetableare
displayedasshowninFigure22.
Figure22.StructuredefinitionsoftheVBRKdatabasetable
TheVBRKtableconsistsof97fields.TheVBRPtableconsistsof190
fields.YoucanlocateafieldbyitsnamebyusingtheFindbutton.
FunctionalmoduletablesintheSAPenvironmenttypicallyconsistof
morethan100fields.
Thesetablesstoredataofcustomerbills.Asinglebillmightconsistof1or
nnumberofitems.Thebill(calledBillingDocumentinSAPparlance)
informationislocatedintwotables.Onetable,designatedtheheader
table,containstheheaderinformationofthebill,withonerowforeach
bill.Thesecondtable,designatedtheitemtable,containstheitem
informationofthebill,withasmanyrowsasthenumberofitemsineach
bill.
DDICAttributes
TheprimeattributesoftheDDICaredescribedinthefollowingsections.
Metadata
TheDDICcanbeviewedasmetadata(dataaboutdata)thatresidesinthe
SAPdatabasealongwiththemetadatamaintainedbythedatabase
(Figure23).
Figure23.ThetwodistinctsetsofmetadataintheSAPdatabase:
DatabasemetadataandDDICmetadata
StandardizationandUniformity
SAPECCERPVersion6.0hasmorethan70,000tablesinitsdatabase.
Initially,SAPR/2versionshadmanyfewertablesintheirdatabase
typicallyonlyafewthousand.Yetwheneverthenumberoftablesina
databaserunsintothousands,twoissuesneedtobeaddressedinthe
designandmaintenanceofthedatabase:standardizationand
uniformity.
Standardization:Whenadatabasehasthousandsoftables,afield
suchascustomercodemightoccurinmultipletables.Andinthis
manner,manymorefieldswouldbeoccurringinmultipletables.Any
fieldoccurringintwoormoretablesmusthaveidenticaltypeandlength
inallitstableoccurrences.Thisenforcementofstandardizationonfields
occurringinmultipletablesisimplementedthroughtheDDICobject
Domain,graphicallyrepresentedinFigure24.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
2/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure24.Afieldoccurringintwotablesshouldhaveidentical
datatypeandlengthinboth
Uniformity:Thenameofafieldinatableisthetechnicalnameforit
usedbytechnicalpersonnelanddevelopers.Itisnotexpectedtomake
sensetoanenduser.Whenafieldappearsonascreen,however,itmust
carryafieldlabelthatwillmakesensetotheenduser.
Anexample:ThefieldnameofacustomercodeintheSAPdatabasetable
KNA1isKUNNR,whichwouldmeannothingtoendusers.Forauser
loggedinEnglish,thefieldKUNNRshouldappearonthescreenwitha
labelsuchasCustomerCodeandsimilarlyforuserswhoareloggedin
inotherlanguages.Whenagivenfieldappearsonmultiplescreens,care
mustbetakentoensurethatthelabelisuniformacrossscreensfora
givenloginlanguage.Theserequirementsareimplementedthroughthe
DDICobjectDataElement(Figure25).
Figure25.Fieldnamesshouldappearidenticallyacrossdifferent
screens
OpenSQLandtheDataDefinitionLanguage
SAPsupportsthefollowingdatabases,amongothers:Oracle,Microsoft
SQLServer,Informix,ADABAS,IBMDB/2,andSybaseASE.Inthe
ABAPprograms,SQLcommandsarecommonlywritteninSAPOpen
SQLratherthanintherespectivedatabasesSQLlanguages.As
mentionedintheClientCodePerspectivessectionofChapter1,Open
SQLenablesportability.OpenSQLusestheDDICasaninterfaceand
reference.ForOpenSQLtooperateonatable,atablestructure
definitionmustexistintheDDIC.Ifatableexistsinthedatabaseas
databasemetadatabutnodefinitionexistsintheDDICasDDIC
metadata,thetableisnonexistenttoOpenSQL.IntheABAP
Workbench,tabledefinitionsarenotcreatedusingtheSQLscriptofthe
respectivedatabase,suchasCREATETABLE.TheDDICprovidesan
interfacetocreateanddefinedatabasetables.WhenaDDICtable
structuredefinitionisactivatedforthefirsttime,theobjectscreatedin
theABAPWorkbenchenvironmentareactivatedsuchthatadatabase
tabledefinitionisautomaticallycreatedatthebackenddatabase,
resultingintwodefinitionsforthegiventableonerelatedtotheDDIC
andtheothertothebackenddatabasesownmetadata.Likewise,views
(includingdatabaseviewsandprojectionviews)donothavetobecreated
withSQLscriptbecauseinterfacesexistintheDDICenvironmentto
createthem.TheDDICalsohasinterfacetocreatesecondaryindexes.
Allthesetasksarehandledinatypicaldatabaseenvironmentsuchas
Oraclethroughthedatadefinitionlanguage(DDL).Inthiscontext,one
mightviewtheDDICasservingthefunctionoftheDDL.
DDICObjectReferencesinABAPPrograms
VariousobjectsintheDDICenvironmentcanbereferencedinABAP
programs.TheDDICiscalledtheglobalarea.TheobjectsintheDDIC
areglobaltoallABAPprograms.DatainABAPprogramscanbedeclared
byreferencetoDDICglobalobjects.ThedeclareddatainABAP
programsreferringtoDDICobjectsinherittheattributesoftheseDDIC
objects.DDICobjectsthatcanbereferencedinABAPprogramsto
declaredataare(1)tables,(2)views,(3)structures,(4)
table/view/structurefields,(5)tabletypes,(6)typegroups,and(7)data
elements.TheuseofDDICobjectstodeclaredatainABAPprogramswill
bedemonstratedinthecodingofABAPprogramsbeginninginChapter
4.
DataControlLanguage
IntheSAPenvironment,anentityandtransactiondataresidein
multipletables.Suppose,forinstance,thatcustomerinformationresides
in20tables.Ifauserisoperatingonacustomerbyinsertionorupdate,
therowscorrespondingtothiscustomerinallthe20tablesneedtobe
lockedtousersotherthantheonewhoinitiatedtheinsertorupdate
operation.Anydatabasesupportsonlylockingorunlockingattable
levelautomaticlockingorunlockingatanentitylevelwheredata
residesinmultipletablesisnotsupported.Toaccommodatethe
automaticlockingorunlockingofrowsinmultipletables,SAPoffersits
ownlockingorunlockingmechanismthroughtheDDICobject:Lock
Object.TheDDICtherebyservesasadatacontrollanguage(DCL).
SearchHelps/PopupSelectionLists
IntheSAPenvironmentpopuplistsareavailableatappropriatescreen
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
3/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
fieldsfortheusertomakeaselectionfromthelistinsteadofmanually
enteringfielddata.ThesepopupselectionlistscanbecreatedasSearch
HelpobjectsintheDDIC.Otherwisethesepopupselectionlistswould
havetobeprovidedthroughprogramcode.Alsothepopupselectionlists
orSearchHelpscreatedintheDDICenvironmentcanbeusedonfields
ofmultiplescreens.TheDDICcircumventsthenecessityofwriting
programcodeandenablesthereusabilityofSearchHelpobjects(Figure
26).
Figure26.SearchHelppopuplist
DataTypesintheDDIC
ThepredefinedDDICdatatypesavailablearelistedinTable21.
Table21.DDICDataTypes
DataType
Description
Initial
Value
ACCP
Accountpostingperiod
ASCII
(YYYYMM,fixedlength6
zeroes
bytes)
CHAR
Characterstring,canstore1
Spaces
character/byteinnon
Unicodeand1character/two
bytesin16bit
Unicode(lengthcanvary1
255)
CLNT
CUKY
Clientcode(3digitnumberin
ASCII
3bytes)
zeroes
Currencycode/key,
Spaces
referencedbytypeCURR
fields(fixedlength5)
CURR
Currencyfield,internal
Binary
storage&outputsameastype
zeroes
DEC
DATS
DEC
FLTP
Datefield(YYYYMMDD,
ASCII
fixedlength8bytes)
zeroes
Numericfieldwithcomma,
Binary
decimal,andsigninoutput.
zeroes
Floatingpoint,maximum
Binary
accuracyupto16digits
zeroes
Exponentrange.From10
+307
308
to10
Fixedlengthof
8bytes
INT1
1byteinteger,unsigned
Binary
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
4/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
INT2
number(value0255)
zeroes
2byteinteger,tobeused
Binary
onlyforlengthfieldbefore
zeroes
fieldsoftypesLCHR&
LRAW
INT4
4byteinteger,integer
Binary
numberwithsign.Canstore
zeroes
numbersbetween
2177483647to2177483648
LANG
Languagecode/key(1byte)
Spaces
LCHR
Longcharacterstring,
Cannotbe
requiresaprecedingINT2
set
typefield
LRAW
NUMC
Longbytestring,requiresa
Cannotbe
precedingINT2typefield
set
Characterstringwithonly
ASCII
digits09(lengthcanvary1
zeroesfor
255bytes)
length<
33.Length
Normallyshouldbeusedfor
>32,
codes(employeecodeetc.)
cannotbe
set
PREC
QUAN
PrecisionofaQUANtype
Binary
field
zeroes
Quantityfield,internal
Binary
storage&outputsameastype
zeroes
DEC
RAW
RAWSTRING
Uninterpretedsequenceof
Cannotbe
bytes
set
ByteStringofVariable
N/A
Length
SSTRING
ShortCharacterStringof
N/A
VariableLength
STRING
CharacterStringofVariable
N/A
Length
TIMS
VARC
Timefield(HHMMSS),
ASCII
(Fixedlengthof6bytes)
zeroes
Longcharacterstring,not
N/A
supportedfromRel.3.0
onwards
UNIT
Unitkeyreferencedby
Spaces
QUANfields(length3)
AlltheDataTypeslistedinTable21withthedescriptionsareself
explanatory.DataTypesDEC,CURR,andQUANarefurtherelaborated
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
5/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
uponbelow.
TheInitialValuecolumnindicateswhatisstored,ifnovalueisassigned
toafield.
DataTypeDEC
Twodecimaldigitsarestoredinonebyte.(Likemaximum99ina
byte)
Halfabyteisreservedforstorageofsign.
Amaximumof31decimaldigits(digitsbefore+afterdecimal)are
supported.
Thelengthcanvarybetween116bytes.
Thenumberofdigitsafterdecimalcanbespecified,bydefaultis0.
Amaximumof16digitsafterdecimalisallowed.
Decimal(.)isnotstoredseparately,butwillappearduringoutput.
Thousandseparators(i.e.,commasafterthousand,millionand
billion)willappearbydefaultduringoutputlikeforothernumeric
types(i.e.,CURR,FLTP,INT4,andQUAN).Commasaremadeto
appearwithnumericDataTypestoenablethemtobediscerned
easily.Considerthenumber1000000visvis1,000,000with
million,thousandseparator,.Thelatterisvisuallyeasierto
discern.
DataTypesCURR,QUAN
FieldswithDDICDataTypeCURRareusedtostorecurrencyamounts.
TheinternalstorageofDataTypeCURRisidenticaltoDataTypeDEC.
Thecurrencyamountsareincompleteinformation.Whethertheamount
orfigureisU.S.Dollars,Euros,GreatBritainPounds,etc.,istobe
includedtomaketheinformationcomplete.(Whatcurrency?)Inthe
DDICDataTypeCUKYthecurrencykeyorcodecanbestored.SoDDIC
DataTypesCURR,CUKYgoestogether.IfaDDICstructuredefinition
containsafieldofDataTypeCURR,thisfieldmustpointtothe
correspondingCUKYfield(calledreferencefieldinDDICenvironment).
HowDataTypesCURR,CUKYgotogetherissimplifiedbelow:
Amount(DataTypeCURR)10000Currency(DataTypeCUKY)
USD
InternalstorageofDDICDataTypeQUANisidenticaltoDataType
DEC.OnsimilarandparallellinesofDDICDataTypesCURR&CUKY,
theDDICDataTypesQUANandUNITwillexisttogether.Inventory
quantitiesarestoredinDataTypeQUANfields.Thequantitiesbeing
incompleteinformation,whetherthequantitiesarenumbers,dozens,
kilograms,tons,etc.(unitofmeasureorUOMforshort)willhavetobe
incorporatedtomaketheinformationcomplete.Theunitofmeasure
information(unitcode)iscontainedinafieldDataTypeUNIT.IfaDDIC
structuredefinitioncontainsDataTypeQUAN,thisfieldmustpointtothe
correspondingUNITfield.Asimplificationisgivenbelow:
Quantity(DataTypeQUAN)100UOM(DataTypeUNIT)TON
ToseeanexampleoftheCURR,CUKY&QUAN,UNITfieldsinthe
DDICenvironment,youcannavigatetothetablestructuresofSAP
functionalmoduletablesVBRK(billingdocumentheader)andVBRP.
(Billingdocumentitems).
VBRKTable
TheheadertableVBRKcontainsthedocumentsheaderinformation
(documentNo.,documentdate,documenttype,customercode,NetValue
inDocumentCurrency(DataTypeCURRfield),documentcurrency
(DataTypeCUKYfield),etc.Inthetablestructure,selectthetab
Currency/QuantityFields.
InthetableVBRK,theNetValueinDocumentCurrencyfield(DataType
CURR)isNETWR.ThecolumnsReferenceTable,ReferenceFieldof
thisfieldcontainVBRKandWAERKrespectively.Itmeansthatthe
correspondingCUKYfieldisinthetableVBRKandthefieldnameis
WAERK.ThetablenamewhereDDICDataTypeCUKYfieldislocatedis
containedinReferenceTable,andfieldnameiscontainedinReference
Field.
VBRPTable
TheitemtableVBRPcontainsthedocumentsitemsinformation
(materialcode,salequantity(DataTypeQUAN),salesunitofmeasure
(DataTypeUNIT),amountfortheitem(DataTypeCURRfield),etc.
InthetableVBRP,theitemamountfield(DataTypeCURR)isNETWR
thisistheamountforeachitem,whereasthefieldNETWRinthetable
VBRKisthetotalamountforallitemsinthedocument.Thecolumns
ReferenceTable,ReferenceFieldofthisfieldcontainVBRKand
WAERKrespectively.ItmeansthattheCUKYfieldforDataTypeCURR
fieldNETWR(intableVBRP)isinthetableVBRKandthefieldnameis
WAERK.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
6/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
InthetableVBRP,thesalesquantityfieldisFKIMG(DataTypeQUAN).
ThecolumnsReferenceTable,ReferenceFieldofthisfieldcontain
VBRPandVRKMErespectively.ItmeansthatthecorrespondingUNIT
fieldisinthetableVBRPandthefieldnameisVRKME.
ThecoverageeachoftheDDICobjects:domain,dataelement,and
transparenttablefollow.
DDICObjectDomain
Domainsareforenforcementofstandardizationonfieldsoccurringin
multipletables.Theoretically,anytwoormoretablefieldshavingsame
DataTypeandlengthcanshareorbeassignedthesamedomain.(Ensure
fieldsoccurringinmultipletableshavingsameDataType&length).
VieworExamineanSAPDeliveredDomain
ThepredefineddomainselectedforviewingisECN_COLOR.Onthe
SE11screen,clicktheDomainradiobutton,enterthename
ECN_COLORandclickthedisplaybutton.
ThescreenshotfordomainwiththethreetabsProperties,Definition,
ValueRangeisshown:
Figure27.DomaintabProperties
Therearehundredsofthousandsofpredefineddomainsbeingusedin
SAPdeliveredtablesintheDDIC.
TheShortDescriptionistobemandatorilyenteredforanyobjectcreated
inABAPWorkbench.ThePropertiestabfieldsarecontrolledand
insertedbythesystemexceptforthePackage,whichisassignedbythe
usercreatingtheobject.
Figure28.DomaintabDefinition
UndertheDefinitiontab,intheFormatarea,thefollowingare
assigned:
1. DataType:DDICDataType,(refertoTable21underDDICData
Types)
2. No.Characters:Length(lengthisinpositions/digitsandnotin
bytes)
3. Numberofdecimals.(ApplicabletoDataTypesCURR,QUAN,
DEC,FLTP,only.ForDataTypeFLTPthenumberofdecimalsis
fixed:i.e.,16)
UndertheDefinitiontab,inOutputCharacteristicsarea,thefollowing
canbeassigned:
1. OutputLength:Isassignedbythesystem,itcanbemodifiedif
needed.
2. Convers.Routine:Canbespecified.TheConversionRoutineis
coveredinChapter7entitledModularization.Sign:Fornumeric
fieldsonly.(ApplicabletoDataTypes:CURR,DEC,FLTP,INT4,
QUAN)Bydefault,theseDataTypeswillnotsupportnegative
numbers.Thischeckboxistobeenabledforstoringnegative
numbers.
3. LowerCase:Bydefault,thereisnocasesensitivityforcharacter
storage.DataTypesCHAR,CUKY,LANG,LCHR,STRING,
SSTRINGandUNIT)Ifcasesensitivityisrequired,thischeckbox
istobeenabled.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
7/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure29.DomaintabValueRange
IntheValueRangetab,underSinglevals,youcanentervalues(fixed
Values&Shorttext)asisshownfortheSAPprovideddomain
ECN_COLOR.Ideally,valuesshouldbeenteredherewhen(a)thereare
fewentries(lessthan32),and(b)thesevaluesdonotchangeorchange
veryinfrequently.
Theimplicationofenteringvalueshereisasfollows:whenthisdomainis
assignedtoadataelement,thisdataelementisassignedtoatablefield,
afieldappearingonascreenisreferringtothistablefieldautomatically,
andapopuplistfacilityisavailableforthisscreenfieldtotheuser.The
popuplistwilldisplaythevaluesenteredherewhenausermakesa
selection,theFixedValueselectedwillbeassignedtothescreenfield.
UndertheValueRangetab,inIntervals,youcanentervalidvaluesand
validrangesofvalues.Whenthisdomainisassignedtoadataelement,
thisdataelementisassignedtoatablefieldafieldappearingona
screenisreferringtothistablefield,thevalueswhichcanbeenteredfor
thefieldwillhavetobeintherangeofvaluesenteredhere.
DDICObjectDataElement
(Ensurefieldappearingonmultiplescreenshasthesamefieldlabel).
Dataelementsareforenforcementofuniformity,ensuringthatafield
occurringonmultiplescreenshasthesamelabel.
VieworExamineanSAPDeliveredDataElement
Youwillviewapredefineddataelement:ECN_COLOR.
OntheSE11screen,clicktheDatatyperadiobutton,enterthename
ECN_COLOR,andclickthedisplaybutton.
ThescreenshotfordataelementwiththefourtabsAttributes,DataType,
FurtherCharacteristics,andFieldlabelisshown:
Figure210.DataelementtabAttributes
ThisisthedisplayofSAPprovidedDataelementECN_COLOR.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
8/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure211.DataelementtabDataType
IntheDataTypetab,thefollowingareassigned:
1. ThedefaultfirstmainradiobuttonisElementaryType.Underthis
mainradiobuttontherearetworadiobuttonoptions:
1. DomainAdomaincanbeassignedtodataelements.The
physicalcharacteristics,DataType,andlengthareinherited
fromtheassigneddomain.ThedomainECN_COLORhas
beenassignedtothedataelementECN_COLOR.Apopup
selectionlistisavailable.Onecanenterthepattern(ECN*in
thepresentcontext),andallthedomainsfittingthepattern
willbelistedforselection.
2. PredefinedTypeThisisjustlikeindomain.ADDICData
Typecanbeassignedhere(refertoTable21underDDIC
DataTypes).Thisisequivalenttoshortcircuitingthe
domain,notusingthedomainfacility,andassigningDDIC
DataTypetothedataelement.Thisoptionisrarelyused.
2. ThesecondmainradiobuttonisReferenceType.Underthisthere
aretworadiobuttonoptions:
1. NameofRefTypeAbuiltinclass,interfacecanbe
assignedhere
2. ReferencetoPredefinedTypeAgainaDDICDataTypecan
beassignedhere.(RefertoTable21underDDICData
Types.)
Figure212.DataelementtabFieldLabel
Fieldlabelsortextcanbemaintainedhereinmultiplelanguages.Four
typesoflabelscanbeentered:Short,Medium,Long,andHeading.
Thesetextswillappearaslabelswhenthetablefieldassociatedwiththis
dataelementappearsonscreen.Bydefaultalabelenteredinthefield
Mediumwillappearbutcanbeoverridden.Thelabelinthefield
Headingwillappearwhenthetablefieldassociatedwiththisdata
elementappearsinalistorreport.
InthisDataElementECN_COLOR,thesametextColorhasbeen
enteredinallthefourfields(i.e.,Short,Medium,Long,andHeading).
ThesamescreenloggedintheGermanlanguageDEisshownin
Figure213.
Figure213.DataelementtabFieldLabel[loggedinlanguage
DE]
InFigure213,alllabelsareappearinginGerman,demonstratingthe
multiplelanguagesupportofSAP.Thelabelinthekurz,mittal,lang,and
berschrift(GermanequivalentsofShort,Medium,Long,andHeading)
isFarbe,theGermanequivalentofColor.
DomainandDataElementRelationship
Anexample(demonstrativebutsomewhatcontrived)tobringoutthe
relationshipbetweendomainsanddataelements:Letitbeassumedthat
anenterprisewantstostandardizeinthepayrollapplicationtheamounts
relatedtoallowances.(Variousallowancespaidtoemployeessuchas
houseallowance,conveyanceallowance,etc.)Supposetheyfixthetype
andlengthofallowanceamountsasDDICDataTypeDECandlength5,
2.(Fivedigitsbeforedecimalsandtwodigitsafterdecimalsandatotal
lengthof7digitsor4bytes.)SoadomaincanbecreatedwithDDICData
TypeDECandlength5,2.Thissamedomaincanserveforhouse
allowance,conveyanceallowance,etc.Inthecontextofdataelements,
separatelabelsarerequiredsuchasHouseAllowance,Conveyance
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
9/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Allowance,etc.,forhouseallowanceandconveyanceallowance
respectively.Henceasmanydataelementsneedtobecreatedasthe
numberofallowances.Allthesedataelementswouldbeassignedthe
samedomaincreatedwithDDICDataTypeDEClength5,2.Soadomain
canbeassignedtooneormoredataelements.Therelationshipisshown
herediagrammatically:
Figure214.Domain,DataElementrelationship
DDICObjectTable
TherearethreetypesoftablessupportedintheDDICenvironment:the
transparenttable,thepooledtable,andtheclusteredtable.Forthe
present,ourdetailedcoverageisconfinedtothetransparenttables.The
pooledandclusteredtablesarementionedinpassing.
Forapooledtable,manyrandomtabledefinitionsintheDDICwillgoas
onedefinitioninthedatabasemetadata.Apoolconsistingofmany
pooledtableswillgoasonetabledefinitioninthedatabasemetadata.
Theclusteredtablesprincipleissimilartothatofpooledtable(many
tables)exceptthatthemanyclusteredtabledefinitionsresidingina
clusterarenotonarandombasis.Foralltheclusteredtablestoresidein
onecluster,theclusteredtablesmusthavepartoftheirprimarykey
field/sincommon.
Forthepooledandclusteredtables,thespecialmodeofstorageand
retrievaltechnologyisSAPsproprietytechnology.WithOpenSQL,
pooledandclusteredtablescanbeusedinthesamewayastransparent
tablesSELECT..,INSERT,UPDATE,DELETEwithsome
constraints.
Atablepoolortableclusterisusedexclusivelyforstoringinternal
controlinformation(screensequences,programparameters,temporary
data,andcontinuoustextssuchasdocumentation).All
business/commercialdataarestoredexclusivelyintransparenttables.
Foratransparenttable,foreverytabledefinitionintheDDIC,therewill
beexactlyonecorrespondingtabledefinitionintheinstalleddatabase
metadata.
TransparentTables
ThetablestructuresaredefinedorcreatedintheDDIC.WhenaDDIC
tablestructuredefinitionisactivatedforthefirsttime,atabledefinition
isautomaticallycreatedintherespectivedatabaseinstalledonthe
databaseserver(Oracle,MSSQLServeretal.).Therearetwodefinitions
ofanytableinaSAPdatabase:onecorrespondingtotheDDICandthe
othercorrespondingtotherespectiveinstalleddatabase.Theadditional
definitionofatableaccruesbenefitsandadvantages.Onebenefithas
alreadybeenmentioned:OpenSQLaffordingportabilityofABAP
programs.OpenSQLusesDDICasareferenceandinterface.Thetable
structuresdefinedinDDICofferextrafeaturessuchasCURRCUKY&
QUANUNITfieldscheck,tablebuffering,SearchHelpattachment,
deliveryclass,etc.Thestandardization,uniformity(domain&data
element)isalsoimplementedthroughtheDDICtablemetadata.Inthe
followingtext,transparenttableswillbereferredastables(transparent
isimplicit).
Domain,DataElement,andTableRelationship
Therelationshipofadomaindataelementhasbeenexplainedearlier.
Whentablefieldsarespecifiedduringatabledefinition,adataelement
istobeassignedtoeverytablefield.Inthisway,afieldoccurringin
multipletableswouldbeassignedthesamedataelement,thusensuring
thesamelabelforthefieldonmultiplescreens.Also,sinceadomainis
assignedtoadataelement,afieldoccurringinmultipletableswouldbe
assignedthesamedomainensuringDataTypeandlengthtobethe
same.TherelationshipisshownherediagrammaticallyinFigure215.
Figure215.Domain,DataElement,andTablerelationship
View,ExamineanSAPDeliveredTable
SAPdelivereddomainsanddataelementswereexaminedandviewed.
YouwillviewanSAPdeliveredtable:T005T.Itstoresthetextsof
differentcountries.ThetextsofthecountriesarestoredinalltheSAP
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
10/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
supportednaturallanguages.
DisplayTablethetabs
OntheSE11screen,clicktheDatabasetableradiobutton,enterthename
T005T,andclickthedisplaybutton.Thescreenshotforatablewiththe
fivetabsAttributes,DeliveryandMaintenance,Fields,Entry
help/check,andCurrency/QuantityFieldareshowninFigures216and
217.
Figure216.TabletabAttributes
Figure217.TabletabDeliveryandMaintenance
IntheDeliveryandMaintenancetab,thefollowingareassigned:
1. DeliveryClass:Thiscontrolsthetransportoftabledataduring
installation,upgrade,clientcopy,andtransportationbetween
customersystems.Itisalsousedintheextendedtable
maintenance.
2. DataBrowser/TableViewMaint.:Threeoptionsareavailable:
1. Display/MaintenanceAllowedwithRestrictions:Whenthis
optionisoperative,newentries/rowscannotbecreatedin
thetable,existingentriescannotbeeditedordeleted
throughthetablemaintenancedialogormaintenanceview.
Thetablemaintenancedialogisautomaticallygenerated
whenthetableisactivated.
2. Display/MaintenanceAllowed:Whenthisoptionis
operative,newrowscanbecreatedthroughthetable
maintenancedialogormaintenanceview.Existingentries
canbeedited,viewed,anddeletedthroughthetable
maintenancedialogormaintenanceview.
3. Display/MaintenanceNotAllowed:Whenthisoptionis
operative,thetablemaintenancedialogisnotgenerated
whenthetableisactivated.Newentriescannotbecreated,
andexistingentriescannotbeviewed.
Inthistab,thetablestructurefieldscanbeentered.
1. Field:Fieldnamesstartwithanalphabetletternormallyandthe
restofthecharacterscanbealphanumericwithembedded
underscores(_),andthemaximumlengthofafieldnamecanbe16
characters.
2. CheckboxKey:Theprimarykeyfield/softhetablemusthavethis
checkboxenabled.Allthefieldsconstitutingtheprimarykeymust
occurinthetablestructureinthebeginningandinthesequence
required.
3. InitialValues:Findanelaborateexplanationwhenyoucreate
customtables.
4. Dataelement:Inthiscolumn,thedataelementtobeassignedto
thefieldistobeentered.Apopupselectionlistisavailable.One
canenterthepatternandallthedataelementsfittingthepattern
willbelistedfortheselection.Whenafieldisassignedadata
element,thecolumnsDataType,Length,Decimals,andShort
Descriptionareautomaticallyfilledfromtheselecteddata
element.
OnthetoprightsideofFigure218,underthetabsthereisabuttonwith
thelegendPredefinedType.Thisisatogglebutton.Whenitispressed
(thebuttonpressingchangesitslegendtoDataElement),youcanassign
directlytheDDICDataTypetoatablefieldinsteadofassigningadata
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
11/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
element.Inthiscase,youareshortcircuitingthedataelementand
domain.Youarenotusingthefeaturesofthedomainanddataelement
however,thisisnotadvisable.
Figure218.TabletabFields
Figure219.TabletabEntryhelp/check
Allthecolumnsunderthistabareenteredandcontrolledbythesystem.
1. ForeignKeys(checkbox):Thischeckbox,wheninenabledstate,
indicatesthefieldtobeaforeignkeyorpartofforeignkey(fields
canbedeclaredasforeignkeyorpartofforeignkey).
2. Checktable:Ifthefieldisaforeignkeyorpartofforeignkey,then
thecheckorprimarytablenameisautomaticallyenteredbythe
systeminthiscolumn(i.e.,Checktable).Checktableandprimary
tablearesynonymous.YouwillusethetermChecktable.
3. Originoftheinputhelp:Thisreferstotheoriginofapopuplistfor
thisfieldwhenthisfieldisappearingonthescreen.Thiswillbe
coveredwithintheDDICtopicSearchHelpinthenextchapter.
4. SrchHelp:Thecolumnentrylikeallcolumnsunderthistabis
controlledbythesystemthenameofthesearchhelpifassigned
appearshere.ItwillbecoveredintheDDICtopicSearchHelpin
thenextchapter.
5. Defaults:Checkboxthatindicateswhetherthesetofvaluesofa
domainisrestrictedthroughentryoffixedvalues.
6. Domain:Thenameofthedomainderivedfromthedataelement
assignedtothefieldisenteredbythesystem.
Figure220.TabletabCurrency/QuantityFields
ReferenceTableandRef.field:Thistabwithitstwocolumnsisrelevant
forfieldsofDataTypeCURRandQUANonly.Thesecolumnsareina
disabledstateforfieldtypesotherthanCURRandQUAN.Asdescribedin
thischapter,thesetypesstorethecurrencyamountorquantitynumbers
respectively.
WheneverthereisafieldoftypeCURRinatablestructureorstructure
definition,thecolumnReferencetableforatypeCURRfieldwillhaveto
befilledupwiththenameofthetablestructureorstructurewherethe
typeCUKYfieldisoccurring.AndthecolumnRef.fieldwillhavetobe
filledwiththenameofthetypeCUKYfield.
Similarly,thecolumnReferencetableforatypeQUANfieldwillhaveto
befilledupwiththenameofthetablestructureorstructurewherethe
typeUNITfieldisoccurring.AndthecolumnRef.fieldwillhavetobe
filledwiththenameofthetypeUNITfield.
DisplayTableTechnicalSettings
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
12/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Thisispartofatabledefinition.Yougettothescreenbyclickingthe
applicationtoolbarbuttonTechnicalSettings.Thetechnicalsettings
screenlookslikeFigure221.
Figure221.TableTechnicalSettings
IntheLogicalstorageparametersareaofFigure221:
Dataclass:ThedataclasshasrelevanceonlyforORACLE
andINFORMIXdatabasesystems.Itdefinesthephysical
areaofdatabaseinwhichthetableislogicallystored.
Typicalvaluestobeassignedwhenyouarecreatingatable
inY/ZnamespaceareUSER,USER1,USER6,andUSER7.
SizeCategory:Theassignedsizecategorywilldeterminethe
initialprobablespacerequirementforatableinthe
database.
Bufferingarea:Buffering(selectivediskdataismaintainedin
RAM)isavailablewithOpenSQLtoimproveperformance.An
idealtableforbufferingwouldbesmallsized(afewKB),very
frequentlyaccessed,andrarelyupdated.Notalldatabasebrands
deliverperformanceimprovementwithbuffering.
TherearethreeoptionsunderBuffering:(1)Bufferingnotallowed,
specifyingnobufferingforthetable.(2)Bufferingallowedbutswitched
offthebufferingisswitchedoffbecausetheparticulardatabaseinstalled
doesnotdeliverperformancewithbuffering.(3)Bufferingswitchedon
thebufferingisonbecausetheparticulardatabaseinstalleddelivers
performancewithbuffering.
Bufferingtypearea:Therearethreeoptionsinbufferingtype:
Singlerecordbuff,GenericAreaBuffered,andFullyBuffered.
WithSinglerecordbuff.option,whenarowisfetchedfromadatabase
table,itisretainedinRAM(bufferedarea).Iftheimmediatenext
fetchingofarowfromthesametablereferstothesamerowfetched
earlier,thennodiskoperationtakesplace,anddataistransferredfrom
thebufferedareaofRAM.
GenericAreaBuffered:Partialcontentsofthetableareloadedintothe
buffer.Thebasisonwhichpartialdataisselectedtobeloadedintothe
bufferisexplained.Thedataselectionwillbeelaboratedinthecontextof
anSAPprovidedtableT005T.Thistablestoresallthetexts/namesofall
thecountriesforalltheclientsinstalledandinallthenaturallanguages
installed.ThetablefieldsareasshowninFigure222.
Figure222.FieldsinTableT005T
Thetableisclientdependent.Theprimarykeyinthetableisconsisting
ofthefirstthreefields(MANDT,SPRAS,andLAND1markedasPK).
Whenthisbufferingoptionisoptedfor,youneedtoenteranumberin
thefieldNo.ofkeyfields.Thisnumbercanhaveaminimumvalueof1
andamaximumvalueequaltothenumberoffieldsconstitutingthe
primarykey(inthepresentcontext,3).Ifthisnumberis1,itmeansthe
firstprimarykeyfieldifthenumberis2,itmeansthefirst,second
primarykeyfieldsandsoon.Thenumberindicatestothesystem,for
oneuniquevalueofhowmanyprimarykeyfields,thebufferingdata
shouldbeloaded.Thenumberexistinginthisfieldforthechosentable
(T005T)is2(Figure221).Inthiscontext,itmeanstoloadthebufferwith
aspecifiedvalueoffieldMANDT(firstfield)andaspecifiedvalueoffield
SPRAS(secondfield).Ifyouareloggedintoclient800andlanguageE,
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
13/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
thebufferwillbeloadedwithrowsbelongingtoclient800,andlanguage
E,thoughthetableiscontainingrowsbelongingtoclients000,001(one
oftheseorbothdependingontheinstallationoption),810,811,812,and
languagecodesA,B,C,D,andsoon.Thetotalnumberofrowsinthis
table(forallclientcodes,alllanguagecodes)onoursystemis22,608.
Thenumberofrowsinthistableforclient=800andlanguagecode=E
onoursystemis248.Allthisisbasedontheassumptionofworkingona
typicalIDESserver.
WiththeFullyBufferedoption,alltherowsofthetable(fulltable)are
fetchedintothebufferedarea.Allsubsequentretrievalofrow/swillbe
fromthebufferedarea.
Thebuffersareloadedontheapplicationserver/s.
Logdatachangescheckbox:Ifenabled,changestothedatarowsof
thistablearelogged.
WriteaccessonlywithJAVAcheckbox:Ifenabled,contentsofthe
tablecanbechangedfromwithinJavaonly.
Maintainastransparenttablecheckbox:Thisflagindicatesthata
tableshouldbetransparentandthatthisattributeshouldbekept
evenafterachangeofreleaseoranupgrade.
DisplayTableSettingupForeignKeyRelationships
FromtheTechnicalSettingsscreen,navigatebacktothenormaltable
maintenancescreenbyclickingthestandardtoolbar
buttonor
alternativelypressingfunctionkeyF3.
Forallthetablefield/sthatareforeignkeys(thesefieldsareprimarykey
fieldsinthechecktables),theforeignkeyrelationshipsareestablished.
Theforeignkeyrelationshipsofatablefieldcanbeestablishedorviewed
bypositioningthecursoronthatfieldandclickingonthe
button
(underthetabs).(SeeFigure223).
Figure223.TableProceedtoForeignKeyRelationship
FortheselectedtableT005T,youcanviewtheforeignkeyrelationship
forthefieldSPRAS(languagecode).
ThescreenwouldlooklikethatinFigure224.
Figure224.TableForeignKeyRelationship
ThechecktableforthefieldSPRASisT002.WhentheCheckrequired
checkboxisenabled,valuesenteredinthisfieldinthesecondarytable
willbecheckedforexistenceinthechecktable.Valuesnotexistinginthe
checktablewilltriggeranerrorcondition.
TheCardinalityentriesoperateasfollows:
Thecardinality(n:m)describestheforeignkeyrelationshipasregards
thenumberofpossibledependentrowsinvolved(rowsoftheforeignkey
table)visvisreferredrows(rowsofthechecktable).
1. Fortheleftsideofthecardinalitysignifyingthechecktable:
1. Ifn=1then,foreachdependentrowthereisexactlyonerow
inthechecktable.
2. Ifn=Cthen,therecanberowsintheforeignkeytablethat
donotreferenceanyrowofthechecktable(orphan
dependentrowscanexist).
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
14/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
2. Fortherightsideofthecardinalitysignifyingtheforeignkeytable:
1. Ifm=1,foreachrowinthechecktablethereisexactlyone
dependentrow.
2. Ifm=Cthen,foreachrowinthechecktablethereis,atmost,
onedependentrow.
3. Ifm=Nthen,foreachrowofthechecktablethereisatleast
onedependentrow.
4. Ifm=CNthen,foreachrowofthechecktablethereareany
numberofdependentrows.
YouhaveexaminedandviewedexistingDDICobjectsdomain,data
element,andtransparenttable.TheDDICmetadataismuchmore
complexthandatabasemetadata.Butthen,DDICtabledefinitionis
addressingissuesofstandardization(domain)uniformity,(dataelement)
providingfacilitiessuchasOPENSQLportability,tablebuffering,search
helpattachment,andcheckforCURR&CUKYQUAN&UNITfields,etc.
ScenarioforHandsonExerciseonDomain,DataElement,and
Table
WhenSAPisinstalled,thedatabasetablesandotherobjectsthatget
createdaspartoftheinstallationarecalledSAPdeliveredtablesor
objects.Postinstallation,furtherdatabasetablesorobjectscreatedby
developersarecalledcustomtablesorobjects.
YouwillcreateyourownorcustomDDICobjects:domains,data
elements,andtransparenttables.Thepossibility,inareallifesituation
forcreationofcustomtablesisrare,unlessoneisdevelopinganew
applicationonanABAPplatformordoingalargeenhancement
entailingcreationofnewtables.
Theobjectiveofcreatingcustomtableshereisforbetterunderstanding
oftheSAPtabledefinitions,becomingfamiliarwiththeDDICtable
definitions,andbeingabletorelatetoSAPdeliveredtables.
Lettherebeabusinessscenarioforcreatingcustomtables.Asimple
everydayscenario:Probablyeveryoneofyouhaswalkedintoacasual
restaurant.Andyouhavereceivedandpaidthebillattheendofyour
meal.
AroughformatofatypicalrestaurantbillispresentedinFigure225.
Figure225.Atypicalrestaurantbill
Mapthisbill(businessdocument)anditsrelatedinformationinto
RDBMStables,andthefieldsinthetables.Thisisbeingdonehereinan
intuitive,manualway.Inareallifesituation,withcomplexand
involvedscenarios(manydatabasetablesandmanyfields),youwilluse
somedatadesignerordatamodelertool.
Youwillcallthisstorageofrestaurantbillsanditsrelatedinformationa
restaurantbillingsystem.
TableandTableFields
First,therestaurantbilldatawillhavetoresideintwodatabasetables:
ThetwodatabasetableswillberelatedthroughBillNo.andBillNo.will
beaforeignkeyinthedatabasetableBillsItems.
Youwillhavetwomoredatabasetablesstoringinformationconnectedto
therestaurantbilling:ItemMasterstoringIteminformationandWaiter
MasterstoringWaiterinformation.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
15/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
WaiterNowillbeaforeignkeyindatabasetableBillsHeader.Item
CodewillbeaforeignkeyindatabasetableBillsItems.
EntityRelationshipDiagramRestaurantBillingSystem
Figure226.FourtableERdiagram.PKPrimaryKey.FK
ForeignKey
AssigningDDICDataTypesandLengthstoTableFields
AssigningDDICDataTypesandlengthstothesefieldsisthenextstep.
YouareassigningDataTypeDECtotheamountandquantityfields.A
restaurantdoesnotraisebillsinmultiplecurrencies,sothecurrencycan
beimplicit.Thisrestaurantisservinganddeliveringonlyinnumbers
(i.e.,anumberofpizzasandburgers,etc.).Sotheunitofmeasureforthe
quantityisalsoimplicit.ThetablesandfieldswithDataTypeandlengths
areshowninTables22,23,24,and25:
Thenotation6,2forDataTypeDECis6digitsbeforethedecimalpoint
and2digitsafterthedecimal(atotallengthof8digitsor5bytes).Thisis
notstandardnotationthisiscustomnotation.
TheDataTypesandlengthshavebeenassignedtofieldsbyexperience.
SummaryofDataTypes,Lengths,andListofTablesEntitiesand
Attributes
AsummaryofDataTypesandlengthsinthefourtables(withthefields):
Tocreatetabledefinitionsforthefourtables,youneedtocreatea
minimumof10domains.RecallthatdomainisrelatedtoDataTypeand
length.TwoormorefieldshavingthesameDataTypeandlengthmayor
maynotbeassignedthesamedomain.Inthefourtablescenario,twoor
morefieldssharingsameDataTypeandlengthare:
LetthesamedomainbeassignedforfieldsofthesameDataTypeand
length.(Thisisanarbitrarydecision).
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
16/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Asummarylistofallfieldsinthefourtablescenario(entities&
attributes):
Aseachofthesefieldsmusthavealabelwhenappearingonthescreen,
youneedtocreate17dataelements,1foreachofthesefields.
Youhavetocreate10domains,17dataelements,and4tablesforthe
restaurantbillingsystem.
CreationofDomains,DataElements,andTables
ObjectsNamingConvention,ListingofObjects
BeforeyoucommencethecreationofcustomDDICobjects,letanaming
conventionbeadoptedfortheobjectstobecreatedintheABAP
Workbench.MostoftheobjectscreatedintheABAPWorkbench
environment(notSAPdelivered)havetostartwiththelettersYorZ.In
theDDICenvironment,exceptforlockobjects,allothercustomobject
namesstartwithYorZ.Hence,theobjectsyouareplanningtocreate
(domains,dataelements,tables,andothers)willhavethestartingletter
asYorZ.ThispracticeofstartingtheobjectnameswithlettersYorZisa
basicproceduretoensureseparationofSAPdeliveredobjectsthatexist
justafterSAPinstallationandtheobjectscreatedbySAPcustomersor
otherusersoftheSAPdevelopmentplatform.Itensuresthereisno
conflictofobjectnames,andtheseparationensuresthattheobjects
createdbySAPcustomers(oryou)remainintactduringaversion
upgrade.YouwillbecreatingallobjectsintheABAPWorkbench
environmentstartingwithprefixYCL.Nextyouwillidentifyanobject
withatwodigitchapternumbersuchasCH01,CH02Nextyougive
somemeaningfulsuffixforexample,whenyouarecreatingadomain
ofDataTypeNUMCandlength4,youwouldgiveitaname
YCL_CH02_NUMC4.Youwillnamecustomobjectsinthismanner.
TheDDICobjectsyoucreateshouldstartwithY/Ztherestofthe
charactersinthenamescanbeanycombinationofalphanumeric
characters(AZ&09)withembeddedunderscores(_).Thenamesare
caseinsensitive.ThisissowithalloftheobjectsintheABAPWorkbench.
Normally,adeveloperafterloggingintoSAPsettheCapsLockkeyon.
Thenamespace(maximumcharactersallowedintheobjectname)varies
fromobjecttoobject.Fortablesitis16fordomainsanddataelementsit
is30.
Alistofthe10domainsastheywouldbenamedasperthenaming
conventionisgiveninTable26:
Table26.DomainsList
Alistofdataelementsastheywouldbenamedasperthenaming
conventionisgiveninTable27:
Table27.DataElementsList
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
17/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Alistofthetableswithfields,DataTypes&lengths,dataelementsand
domainsisshowninTables28,29,210,and211.AlltheDDICobjects
havebeengivennamesasyouwouldintheABAPWorkbench
environment.
1. DatabaseTableDescription:BillsHeaderName:
YCL_CH02_BILLH
Table28.
2. DatabaseTableDescription:BillsItemsName:
YCL_CH02_BILLI
Table29.
3. DatabaseTableDescription:WaiterMasterName:
YCL_CH02_WAITM
Table210.
4. DatabaseTableDescription:ItemMasterName:
YCL_CH02_ITEMM
Table211.
StartcreatingtheDDICobjects:10domains,17dataelements,and4
tables.Youhavetocreatedomains,dataelements,andtablesinthat
order.
CreateDomains
FromSAPEasyAccess,gettotheDDICmaintenancescreenSE11,etc.
Selecttheradiobuttonfordomain(fifthradiobuttonfromthetop).
Enterthenameoffirstdomain(i.e.,YCL_CH02_NUMC4).Theinitial
screenwilllookliketheoneshowninFigure227.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
18/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure227.CreateDomainInitialSE11Screen
AfterclickingontheCreatebuttonorpressingthefunctionkeyF5,the
screenwiththeDefinitiontabenabledisopened.
Theenteredfieldsare(1)ShortDescriptionwithDataTypeNUMC,LEN
4,(2)DataTypewithNUMC,and(3)No.Characterswith4.Donotenter
anyvalueinthefieldOutputLengthitwillbegeneratedbythesystem.
Otherfieldsonthisscreenarenotapplicable.
FieldDataTypehasbeenassignedvaluethroughthepopupselectionlist
appearingbypressingfunctionkeyF4orpressingthe
buttonon
thefield.Thepopupselectionlistisappearingontherightsidewithall
ofthe24DDICDataTypes.Whereverpopupselectionlistsare
available,itisgoodpracticetoassignvaluethroughaselectionlistrather
thanmanuallyenteringdata.Tomakeaselectioneitherdoubleclickon
theselectedroworchoosetherowbysingleclick(chosenrowappearsin
yellow,orangecolor),thenclickonthe
button.
ThisisshowninFigure228.
Figure228.CreateDomaintabDefinitionwithfieldsentered
ClicktheValueRangetab.Youareenteringasinglevaluerangeher,
(i.e.,00015000)undertheIntervalsareaofthescreen(bottomareaof
thescreen,seeFigure229).Whenafieldassociatedwiththisdomain
willappearonscreen,itautomaticallycheckstheenteredvalue,and
valuesoutsidetherangewilltriggeranerrorcondition.Youhave
enteredonlyonerangeforthepurposeofillustratingthefeaturerather
thanapracticalnecessity.Inareallifesituation,multiplerangesof
valuesinthisareacanbeenteredaswarrantedbyascenario
requirement.
DonotenteranythinginthisIntervalsareaforotherdomains.
UndertheIntervalsarea,thereisafieldValueTableasshowninFigure
229.YoucanenteraDDICtablenamehere.Whenyouassignthis
domaintoadataelement,assignthisdataelementtoatablefield,and
thistablefieldistobemadeintoaforeignkeyfieldthroughaforeignkey
relationshipthenthesystemwillproposethistableasthedefaultcheck
table.
Figure229.CreateDomainSavedmessageonthestatusbar
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
19/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
ABriefonPackages
Afterenteringthesinglerange,pressthesavebutton.Whenthisisdone,
apopupmodalwindowappearspromptingforthepackagetobeassigned
tothisdomainobject.AnyobjectcreatedintheABAPWorkbench
environmenthastobeassignedapackage.Thepackageconceptexisted
fromtheveryinceptionoftheABAPplatform.Thepackageislikeclient
code:asegregatingparameterfortheobjectscreatedandmaintainedin
theABAPWorkbenchenvironments.IntheSAPimplementation
process,developerswillcreatetheirowncustompackages.Packagescan
bemaintainedandviewedintransactioncodeSE21.Thepackageisa
complexconcept,beyondthescopeofthisbook.Thecoreofthepackageis
thetransportlayerthatspecifiesthepaththeobjectwilltravel
(developmentenvironmenttoquality/testing,etc.).Thetransportlayer
ashasbeenmentionedinthesectionentitledImplementation
EnvironmentsisthepurviewofaBasisAdministrator.WhenSAPstarted
supportingJava,theABAPWorkbenchpackageincorporatedtheJAVA
aspectsasapackage.
Since,mostofyouwilloperateinasinglesystemenvironment,likeSAP
IDESinstalledonalaptopordesktop,andforasubscriptiontoaSAP
IDESserver,theimplementationenvironmentswillnotexist.Thereare
nothree/twosystemlandscapes.Yourobjectswillnotmoveorbe
transportedfromoneimplementationenvironmenttoanotherbecause
nootherimplementationenvironmentsexistfortheobjectstobe
transportedto.Eventhoughyourobjectswillnotundergotransport,they
needtobeassignedapackage.Inthislearningphase,youcanusethe
SAPdeliveredpackage$TMP.IfyouassignthispackagetoanABAP
Workbenchobject,youcannottransportthisobject.ThisSAPdelivered
package$TMPisdesignatedasapackagetobeassignedtolocalobjects
(i.e.,theobjectsarelocaltotheenvironmentwheretheyarecreatedand
cannotbetransportedtootherenvironments).
DomainCreationContinued
Onthemodaldialogboxpromptingforthepackage,clickonthe
button.ThesystemwillassigntheSAP
deliveredpackage$TMPtothedomain.Thescreenshotappearsasin
Figure230.
Figure230.CreateDomainEnterValueRangeIntervals,
assignpackage$TMP
AnABAPWorkbenchobjectwheneveritiscreatedandifsubsequently
changedoreditedwillbecheckedforinconsistencies.Youcandothisby
clickingthe
buttonontheapplicationtoolbaroralternatively
pressing<Ctrl>+<F2>keys(combinationofCtrl&F2keys,+indicating
combination).Ifinconsistenciesexistintheobject,thiswillthrowan
errormessageonthestatusbar.Thisshouldbeinvestigatedandfixed.
ForinstanceifyouhadenteredanumberinthedomainfieldDecimal
Places,itwouldhavedisplayedanerrormessage.Decimalsplacesare
notapplicabletotheDDICDataTypeNUMC.
Afterasuccessfulcheckforobjectconsistency,thesystemwilldisplaya
messageonthestatusbarasappearinginFigure231.
Figure231.CreateDomainSuccessfulcheckforconsistency,
messageonstatusbar
Onceanobjecthaspassedtheconsistencycheck,itneedstobeactivated.
Theactivationofanobjectgeneratesaruntimeversion.Anobjecthasto
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
20/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
beinanactivatedstatetobeusable.Inthepresentcontext,ifthe
domainsarenotactive,theycannotbeassignedtodataelements.
Theactivationisdonebypressingthe
buttonoralternatively
pressing<Ctrl>+<F3>keys.Thescreenafterobjectactivationwill
appearasinFigure232.
Figure232.CreateDomainActivation
Inasimilarmanner,youcancreatethenineotherdomainsofa
restaurantbillingsystem.
WhencreatingdomainsofDDICDataTypeDEC,rememberforDEC6,
2,therewillatotalof8digits:6digitsbeforedecimalpositionand2
digitsafterdecimalposition.Sointhefieldsonthedomainscreen:No.
Characters8shouldbeenteredDecimalPlaces2shouldbeentered.
FordomainsofDDICDataTypeCHAR,ifcasesensitivityisdesired(i.e.,
storageofbothupper,lowercaseofalphabets),clickonthecheckboxwith
labelLowerCaseonthedomainscreen.
ForthefieldTITLE,inthecorrespondingdomain,youwillusetheSingle
ValsAreaoftheValueRangetab.Therestaurantbillingsystemis
makingprovisionforwaitersaswellaswaitresses.Whenthedatafor
themisstored,theTITLEfieldcancontainvaluessuchasMR.,MS.,
MRS.,etc.,youwillenterthesepossiblevaluesinSingleValsareaofthe
ValueRangetabofdomain.WhentheTITLEfieldappearsonthescreen,
theuserhasthefacilityofapopupselectionlist.Thispopupselectionlist
willdisplayallthevaluesenteredinthisSingleValsareaofValueRange
tab.Ideallyyoushouldentervaluesinthisareawhenthenumberof
entriesarefew(lessthan32)andtheentriesdonotchangeovertimeor
changerarely.Inthepresentcontext,thetitlesbywhichpeopleare
addressedinEnglishlanguagearenotgoingtochangeinforeseeable
future.AscreenshotoftheValueRangetabforthedomain
YCL_CH02_CHAR10(domainforfieldTITLE)isshowninFigure233.
Figure233.CreateDomainSingleVals
YouwillbemakingmultiplerowentriesinmanysituationsofABAP
Workbenchobjectsmaintenance.Inallthesesituations,youwillhave
thefacilityofthisuserinterfacethatenablesyoumakeoneormorerow/s
selection,copy,cut,paste,anddeletewiththebuttonsshowninthe
Figure234.Youcaninsertrowsaswellarowwillbeinsertedwhere
yourcursorispositioned.
Figure234.MultipleRowManipulation
Ifyouhavecreatedall10domainsandactivatedthem,youwouldliketo
viewtheseasalistwithjustthenamesofdomainsappearinginthelist.
Forthis,gototheABAPDictionaryInitialScreenSE11.Selectthe
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
21/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
domainradiobutton.Enterthepatternofyourdomainnames(i.e.,
YCL_CH02_*indomainfieldoftheSE11screenandpressthefunction
keyF4).ThisisappearinginFigure235.Youareindicatingtothe
systemtofilteroutalldomainswhosenamesstartwithYCL_CH02_and
produceapopupselectionlist.Youshouldseeascreenliketheone
appearinginFigure236.
Figure235.CreateDomainGetoverviewofdomainscreated
Figure236.CreateDomainOverviewofdomainscreated
Thelistappearswithanameandshortdescription.Iftheshort
descriptionisappearingasblank,thecorrespondingdomainisinan
inactivestate.TheListappearsinalphabeticascendingorder.
Editing/Changingdomains
Ifyouneedtoperformanychangestodomains,youcandosoby
selectingtheDomainradiobuttonandenteringthenameofthedomain
youwanttochangeintheDomainfield.(Alternatively,youcangetthe
listofdomainsyoucreatedbyenteringthepatternintheDomainfield,
pressingfunctionkeyF4,andmakingaselectionfromthelist).Clickon
theChangebuttonorpressfunctionkeyF6.Performthechanges,save,
andreactivatethedomain.Aftereditinganyobject,thechangedversion
oftheobjectisinaninactivemode.Thechangedversionneedstobe
activatedtoenableitsusage.Takecaretodothis.
CreateDataElements
OntheSE11ABAPDictionary:InitialScreen,selecttheradiobuttonData
type(thirdradiobuttonfromthetop).Enterthenameofthefirstdata
elementtobecreated(i.e.,YCL_CH02_BILL_NO.).(Table27isalistof
dataelementstobecreatedwiththerespectivelabelsandassigned
domains.)PresstheCreatebuttonorfunctionkeyF5.Thefollowing
screenwillappear:
Figure237.CreateDataElementsOpeningScreen
YoucancreateoneofthethreeDDICobjectslistedhere:Dataelement,
Structure,andTabletype.Fornow,youwanttocreateaDataelement,
whichisthedefaultoption.Sopressthe<Enter>keyandyouwillbe
presentedwiththedataelementscreen,withtheDataTypetab,see
Figure238.Youwillentertheshortdescription(likeforallobjectsinthe
ABAPWorkbenchenvironment).Nextyouneedtoassigntheappropriate
domain(YCL_CH02_NUMC4)tothisdataelement.Assignthisthrough
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
22/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
thepopupselectionlist.Afilteredlistofthedomainsyoucreatedcanbe
madetoappearbyenteringthepatternYCL_CH02*inthedomainfield
andpressingthefunctionkeyF4.ThisisshowninFigure238.
Figure238.CreateDataElementTab:DataType
Havingassignedthedomain,clickontheFieldLabeltab.(Youareby
passingtheFurtherCharacteristicstab.)
IntheFieldLabeltab,youneedtoenterthescreenlabelsforthefieldto
whichthisdataelementwillbeassignedinthetablessubsequentlywhen
youcreatetables.Thereisaprovisionforfourlabels(i.e.,Short,
Medium,Long,andHeading.Youmustmakeadistinctionbetweenthe
firstthreeandthelast.Thefirstthreewill
BillNo.:1234
IncaseofHeadingFieldvaluewillappearunderfieldlabel.The
Headingservesascolumnorfieldheadingwhenthisfieldisoutputon
screenorprinterlike
BillNo.
1234
Inthiscontext,whenthedatalengthisverysmall(likeinthecaseof
WaiterNo.orTableNo.oflength2),thelabelintheheadingshouldnot
betoolong.Thereshouldbeanattempttomakethelabelforheading
cryptic.
Formostpart(evenintheSAPdelivereddataelements),thesamelabel
isenteredinallthethree(i.e.,Short,Medium,andLong).Letthesame
labelbeenteredinthesethreefields:Short,Medium,andLongaswell
astheheading.
ThescreenshotwithenteredlabelsisshowninFigure239.
Figure239.CreateDataElementtabFieldLabel
Therearetwosetoffields:LengthandFieldLabel.Donotenterany
valuesintheLengthfield.Thesystemgeneratesthelengths
automaticallyafteryouenterthelabelsandsavethem.Subsequently,if
youwanttochangealabelresultinginanincreaseinlabellength,then
youhavetomanuallyadjusttheLengthfield(notveryuserfriendly).
Youcancreatelabelsinotherlanguagesbyclickingonmenubaroption
GotoandsuboptionTranslation.
Whenyouarefinishedwiththelabelentry,clickthesavebutton.The
systemwillpromptforpackageassignment.AssigntheSAPdelivered
package$TMPorclickontheLocalObjectbutton.
Performaconsistencycheckbyclickingonthe
buttonorpress
<Ctrl>+<F2>keys.Iftheconsistencycheckiswithouterrors,activatethe
dataelementbyclickingthe
buttonorpressingthekeys<Ctrl>+
<F3>keys.
AscreenshotofactivateddataelementYCL_CH02_BILL_NOisshown
inFigure240.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
23/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure240.CreateDataElementActivatedDataElement
Inasimilarmanner,create,check(consistency),andactivatethe
remaining16dataelements.Havingcreatedallthe17dataelements,
youcanhaveareviewlistofthem.IntheSE11openingscreen,ABAP
Dictionary:InitialScreen,enabletheDatatyperadiobutton(thirdfrom
thetop)enterthepatternYCL_CH02_*intheDatatypefieldandpress
thefunctionkeyF4.AscreenliketheshowninFigure241willappear,
promptingforaspecifiedDatatype.ClickonthebuttonSearchforData
Elements.
Figure241.CreateDataElementPromptforselectionofData
typeoflist
AlistliketheoneinFigure242willappear.Thelistisappearingwith
nameandshortdescription.Iftheshortdescriptionisappearingblank,
thecorrespondingdataelementisinaninactivestate.TheListis
appearinginalphabeticascendingorder.
Figure242.CreateDataElementReviewList
EditingorChangingdataelements:Ifyouneedtoperformanychanges
todataelements,youcandosobyselectingtheDatatyperadiobutton
andenteringthenameofthedataelementyouwanttochangeinthe
Datatypefield.(Alternatively,youcangetthelistofdataelementsyou
createdbyenteringthepatternintheDatatypefield,pressingfunction
keyF4,andmakingaselectionfromthelist.)ClickontheChangebutton
orpressfunctionkeyF6.Performthechangessaveandreactivatethe
dataelement.Aftereditinganyobject,theeditedversionoftheobjectis
inaninactivemode.Theeditedversionneedstobeactivatedtoenable
itsusage.
CreateTables
Nowthatyouhavetherequireddomainsanddataelementscreatedand
activatedforthefourtables,youarereadytocreateyourcustomtables.
Youwillfirstcreatethetableswithouttheforeignkeys(i.e.Waiter
Master:YCL_CH02_WAITM,ItemMaster:YCL_CH02_ITEMM).You
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
24/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
willthencreateBillsHeader:YCL_CH02_BILLHandBillsItems:
YCL_CH02_BILLI.
Tables28,29,210,and211canbereferredwhilecreatingthem.
IntheSE11openingscreenABAPDictionaryInitialScreen:clickon
theDatabasetableradiobutton.Enterthetablename
YCL_CH02_WAITM,pressbuttonCreateorfunctionkeyF5.The
DeliveryandMaintenancetabscreenwillappearasshowninFigure2
43.
InthefieldDeliveryClass,pressthefunctionkeyF4forapopup
selectionlist.SelectthevalueG,themostappropriateandprotected
againstSAPupgrade.TheassignedvalueGsignifiesanSAPcustomer
tablethatwillnotbeoverwrittenordisturbedwhentheSAPversion
upgradetakesplace.
Figure243.CreateTabletabDeliveryandMaintenance
InthefieldDataBrowser/TableViewMaint.,adropdownlistis
available.SelecttheoptionDisplayMaintenanceAllowed.Withthis
optionyoucancreate,edit,delete,andviewdatainthetablethroughan
automaticallygenerateddialogboxoramaintenanceview.(SAPDDIC
supportsfourtypesofviews.Oneofthemismaintenanceview.)Ifyou
lookupthisfieldofanySAPdeliveredtablesuchasVBRK,etc.,thisfield
isassignedthevalueDisplayMaintenanceAllowedwithRestrictions.
Thismeansthatthetabledatacanbeviewed,butcreation,editing,and
deletionoperationscannotbeperformedonthetabledatathroughthe
automaticallygenerateddialogboxoramaintenanceview.Forthe
customcreatedtables,youwouldliketobeabletocreate,edit,delete,
andviewdata.Hencetheoption:DisplayMaintenanceAllowed.
Next,ClickontheFieldstab.Hereyouneedtoenterthenameofthe
fieldsandassignthecorrespondingdataelements.ThefieldsDataType
andlengthsarederivedfromthecorrespondingdomainsassignedtothe
dataelements.RefertothesectionentitledDomain,DataElement,and
TableRelationship.
ThefieldsinatablearenotDDICobjects.Theyarepartoftheobjects.So
normallytheyneednotstartwiththelettersYorZ.Inaspecificcontext
theyshouldstartwiththelettersYorZ.Thisspecificcontextisnot
explicitlycoveredinthisbook.Thefieldnameshavetostartwithan
alphabet,subsequentpositionscanbeacombinationofalphanumeric
characterswithembeddedunderscores(_).Themaximumlengthofa
fieldnameis16characters.
Theprimarykeyfieldshavetoappearatthebeginning.Thecheckbox
underKeyistobeenabledtomakeafieldasaprimarykeyfield.
SofillinthefieldnamesstartingwithWAITER_NO.Enablethecheck
boxfieldKeytodesignatethisfieldWAIT_NOasaprimarykeyfield.
Whenyoupopulateatableanddonotenterdatainsomefields,the
systemautomaticallyincorporatesinitialvaluesinthesefields(i.e.,the
systemtakescareofthenullvalueissue).Theinitialvalueisdependent
ontheDDICDataTypeofthefield.RefertothelastcolumnofTable21.
Togiveexamples:ifoneofthefieldsisofDataTypeNUMCandnodata
isenteredinthisfield,ASCIIzeroes(ASCIIcodeforzerois01100100or
64)isstored.
Theinitialcheckboxforprimarykeyfieldsiscontrolledbythesystem.
Whetheryouenableitordisableit,itgetsenabledwhenyouactivatethe
table.Thissystemisallowingoneinitialvalueforprimarykeyfield/s.
ConsideringthecontextofthetableYCL_CH02_WAITM,youcanomit
enteringvaluesintheprimarykeyfieldsarowwillbecreatedwith
primarykeyfieldsequaltoinitialvalue/s.Inthetable
YCL_CH02_WAITM,thesystemwillallowcreationofonerowwithfield
WAIT_NOequalto00.
Theenablingordisablingoftheinitialcheckboxfornonprimarykey
fieldshasrelevanceinthecontextofmodificationofthetablestructure
subsequentlyoninsertionofnewfields.Ifthischeckboxisenabled,the
systemwillfillthefieldswithinitialvaluesorelsetheywillbenull
valuesinsuchfields.
AssignthedataelementYCL_CH02_WAIT_NO.Donotkeyinthese
dataelementsmanually.InsteadkeyinthepatternYCL_CH02*inthe
fieldDataelementandpressfunctionkeyF4foraselectionlist.Thisis
showninFigure244.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
25/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure244.CreateTableAssigningDataElementtoaField
fromSelectionList
Inasimilarmanner,entertheotherfields,andassigndataelementsto
them.Afterallthefieldshavebeenenteredanddataelementsassigned
tothem,thescreenwillappearlikethatinFigure245.
Figure245.CreateTableFieldswithDataElementsassigned
Foreachfield,TheDataTypes,lengths,anddecimalsareappearing
automatically,derivedfromthedomainassignedtothecorresponding
dataelement.
SomeolderSAPversionsmightshowtheselengthstobezero.The
lengthswillappearonlyaftertableactivation.Atthisstage,savethe
object,assignthepackage$TMP,etc.
ThenexttabEntryhelpcheckismaintainedbythesystem.Ifafieldisa
foreignkeyfieldinthistable,theForeignKeycheckboxfieldwouldbe
enabledandthenameofthechecktablewillappearinthefieldCheck
table.Youwillseethisforthetablescontainingforeignkeyfields
(YCL_CH02_BILLHandYCL_CH02_BILLI).Inthecasefortablefield
TITLE,inputhelpwithfixedvaluesisappearinginthefieldOriginofthe
inputhelp.Ifasearchhelpisattachedtothetablefield,itsnamewill
appearinthefieldSrchHelp.(Searchhelpiscoveredinthenextchapter,
Chapter3)TheDefaultcheckboxfieldisenablediffixedvalueshave
beencreatedinthedomain.ThisissoforthetablefieldTITLE.Thelast
columnorfieldinthistab,Domaincontainsthenameofthedomain.The
EntryhelpchecktabscreenshotisshowninFigure246.
Figure246.CreateTabletabEntryhelpcheck
ThelasttabonthescreenCurrency/QuantityFieldsismeanttoassigna
referencetableandreferencefieldtotheDDICDataTypesCURRand
QUANfields.AsyoudonothaveanytablefieldsofDDICCURRand
QUANintherestaurantbillingsystem,youwillnotbeusingthistab.
TableTechnicalSettings:Youneedtoassigntechnicalsettingsnext.Click
ontheapplicationtoolbarbuttonTechnicalSettingorfromthemenubar
Goto,andselecttheoptionTechnicalSetting.TheTechnicalSetting
screenisshowninFigure247.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
26/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure247.CreateTableTechnicalSettings
Youareassigningvaluestotwofields.TheDataclasssignifiesaphysical
areainthedatabase.PressthefunctionkeyF4andassignvaluesof
patternUSER*,andthephysicalareaforusersofSAP.
ThefieldSizecategoryisforinitialallocationofdiskspace.Assignthe
value0fromthepopupselectionlistavailable.Donotplantocreatetoo
manyentriesorrowsinthetables:thevalue0willsuffice.Savethe
TechnicalSettings.
EnhancementCategory
Youneedtoperformonemoretasksbeforeyoucanactivateyourtable
thisisspecifyingtheenhancementcategory.Itisnotadvisabletomodify
structuredefinitionsoftheSAPdeliveredtables.Fieldscanbeaddedto
SAPdeliveredtablesthroughtheconceptofEnhancements.Thisisan
advancedtopicnotcoveredinthisbook.Thefourtablesyouarecreating
arecustomtables.Youcanmodifytheirstructuredefinitionsasyouwant,
subjecttosomeconstraints.Soyouneednotprovideforfuture
enhancementofthetables.Thisistobeindicatedtothesystem.From
menubarExtras,selecttheoptionEnhancementCategory.An
informationmessagepopupwillappear,andthenpress<Enter>.Next,
apopupscreenwillappearliketheoneinFigure248.
Figure248.CreateTableAssignEnhancementCategory
SelectorclickontheradiobuttonCannotBeEnhanced(sinceyoudonot
wantaprovisionfortablesenhancement).ClickonthebuttonCopy.This
willassigntheEnhancementCategorytothetable.
Performtheconsistencycheckforthetable,andpressthe
buttonor
press<Ctrl>+<F2>keys.Iftheconsistencycheckiswithouterrors,
activatethetablebyclickingthe
buttonorpressingthekeys
<Ctrl>+<F3>keys.Iftheconsistencycheckresultsinerrors,investigate
theerrors,fixthem,andthenactivate.
DatabaseMetadata
WhenaDDICtabledefinitionisactivatedfortheveryfirsttime,the
systemwillcreatethetabledefinitioninthedatabase.Thetable
definitionthenisreadyforcreationorinsertionofdata.
InasimilarmannercreatethetablesYCL_CH02_ITEMM,
YCL_CH02_BILLH.
CreatingForeignKeyRelationshipTable:YCL_CH02_BILLH,Field
WAIT_NO
CreatethetableYCL_CH02_BILLH,fillinallthetabs,createTechnical
SettingsthenassignEnhancementCategoryandsave.
InthetableYCL_CH02_BILLH,thefieldWAIT_NOisaforeignkey
field,andforthisfield,thisistheforeignkeytable.Soyouneedto
establisharelationshipbetweenthetablesYCL_CH02_WAITMand
YCL_CH02_BILLH.
OntheFieldstab,positionthecursoronthefieldWAIT_NO(youwantto
establishtheforeignkeyrelationshipforthisfield)thenclickonthe
ForeignKeys
button(justabovethedataelementcolumn),anda
popupdialogboxappearsasshowninFigure249.
Figure249.CreateTableEstablishForeignKeyRelationshipfor
fieldWAIT_NO
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
27/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Fillinthefollowingfieldsinthispopupdialogbox:
Shorttextwithmeaningfultext.Foroncethisisoptional.Youare
leavingitblank.
IntheChecktablefield,pressfunctionkeyF4.Alistwillappear
withasingleentryYCL_CH02_WAITMandthenameofthecheck
tablewithwhichyouwanttoestablisharelationship.Thistable
YCL_CH02_WAITMisappearingonthebasisofthecommon
domainoffieldWAIT_NOinboththetablesYCL_CH02_WAITM
andYCL_CH02_BILLH(YCL_CH02_NUMC2).
AfterthefieldChecktableisfilledwiththevaluefromthesingle
entryoftheselectionlist,clickonthebuttonGenerateProposal.
ThiswillfillupthecolumnsChecktable,ChkTabFld,Forkey
table,andForeignKeyField(i.e.,whichfield/sinthechecktable
relatewithwhichfield/sintheforeignkeyorsecondarytable).
IntheScreencheckarea,enablethecheckboxCheckrequired.
Thiswillpreventthecreationofrow/sintheforeignkeytable
withoutacorrespondingrowinthechecktable.(Noorphanrows
areallowedintheforeignkeytable.)
Next,fillinthecardinality1:CN.Thismeansforeveryrowinthe
checktable,therecanbeanynumberofcorrespondingrows
(including0)intheforeignkeytable.
Clickon
buttonatthebottomofthedialogbox,
andtheforeignkeyrelationshipisestablished.
Doaconsistencycheck.(Click
buttonorkeys<Ctrl>+
<F2>)Activatethetable.(Click
buttonorkeys<Ctrl>+<F3>)
CreatingForeignKeyRelationshipsTable:YCL_CH02_BILLI,
FieldsBILL_NO&ITEM_CODE
CreatethetableYCL_CH02_BILLHI,fillinallthetabs,create
TechnicalSettingsassignEnhancementCategoryandsave.
InthetableYCL_CH02_BILLI,thefieldsBILL_NOandITEM_CODE
areforeignkeys,andforthesefieldsthisistheforeignkeytable.Soyou
needtoestablishrelationshipsbetweenthetablesYCL_CH02_BILLH,
YCL_CH02_BILLIandYCL_CH02_ITEMM,andYCL_CH02_BILLI.
First,letarelationshipbeestablishedbetweentables
YCL_CH02_BILLHandYCL_CH02_BILLI.Sopositionthecursoron
theforeignkeyfield(whichalsohappenstobeaprimarykeyfieldinthis
table),andclickontheForeignKeys
button.Thepopupdialogbox
CreateForeignKeyappears.PressfunctionkeyF4inthefieldCheck
tablefortheselectionlistofchecktable/s.Ascreenshotofthisisshown
inFigure250.
Figure250.CreateTableForeignKeyRelationshipforfield
BILL_NO,CheckTableList
Thesystemisproposingtwochecktables:YCL_CH02_BILLHand
YCL_CH02_ITEMM.Thisisobviouslyerroneous.
ThesystemisdoingsobecausethekeyfieldsofthesetablesBILL_NO
andITEM_CODEaresharingthesamedomain(i.e.,
YCL_CH02_NUMC4.Thishasbeendonedeliberatelytohighlightthis
issue.KeyfieldsthathavethesameDDICDataTypeandlengthshould
notsharethesamedomain.
Fornow,youknowthatyoushouldselectthetableYCL_CH02_BILLH
asthechecktable,astheforeignkeyfieldforwhichyouareestablishing
relationshipnowisBILL_NO.
AfterselectingthechecktableYCL_CH02_BILLH,clickonthebutton
GenerateProposal.
ThecolumnsunderForeignKeyFieldswillbefilledup.
EnsuretheCheckrequiredcheckboxisenabled(andtoensurenoorphan
rowsareintheforeignkeytable).
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
28/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Entercardinality1:CN.(Onerowinchecktablecanhave0tomanyrows
inforeignkeytable.
TheCreateForeignKeydialogboxforthefieldBILL_NOwiththe
requiredfieldsfilledupisshownintheFigure251.ClickingontheCopy
buttonwillestablishtheforeignkeyrelationshipforthefieldBILL_NO.
Figure251.CreateTableEstablishForeignKeyRelationshipfor
fieldBILL_NO
OnsimilarlinespositionthecursoronthefieldITEM_CODEandcarry
outthecreationofforeignkeyrelationshipforthefieldITEM_CODE.
ThefilledupdialogboxforforeignkeyrelationshipoffieldITEM_CODE
isshowninFigure252.
Clickingonthe
buttonwillestablishtheforeign
keyrelationshipforthefieldITEM_CODE.
Figure252.CreateTableEstablishForeignKeyRelationshipfor
fieldITEM_CODE
Ifafterestablishingforeignkeyrelationship,youwanttodeleteitfor
somereasonyoucandosobypositioningthecursoronforeignkeyfield,
clickingonthe
button,andclickingonthedelete
willappearbesidethe
buttonthat
buttononthepopupdialog
box.
Doaconsistencycheck.Click
Activatethetable.Click
buttonorkeys<Ctrl>+<F2>)
buttonorkeys<Ctrl>+<F3>
Youhavecreatedallfourtables.Youcanpopulatethetableswithdata.
Youwillfirstpopulatethetableswithouttheforeignkeys,sothatwhen
youcreateentriesinthetableswithforeignkeys,dataisavailableinthe
checktables.
CreateDatainTables
DatainTableYCL_CH02_WAITM
LetthedataentrybestartedwiththetableYCL_CH02_WAITM.Inthe
ABAPDictionaryInitialScreen,selecttheDatabasetableradiobutton.
Enterthetablename(i.e.,YCL_CH02_WAITM).ClickontheDisplay
button.TheDictionary:MaintainTablescreenappears.Fromthemenu
barUtilities,selectTableContents>CreateEntriespath.
AscreenshotofdatacreationforthetableYCL_CH02_WAITMisshown
inFigure253.
Figure253.CreateDatainTableYCL_CH02_WAITM
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
29/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Noticethatthedataelementlabelsareappearingwiththefields.Ifthisis
nothappeningandyouaregettingtablefieldnameslikeWAIT_NO,
etc.,thenclickonthemenubarSettings
UserParameters.AUser
SpecificSettingsdialogboxpopsupasshowninFigure254.Ensurethat
theradiobuttonFieldLabelisenabled(attheverybottom).
Figure254.UserSpecificSettings
Enterdata.ThereisapopupselectionlistavailableforthefieldTITLE.
Thislistssourceofdataisthefixedvaluesofthedomainassociatedwith
thefieldTITLE.Youcantestthatthesystemwillnotacceptanyother
valuesthanthoseoftheselectionlist.
Afterenteringallfields,pressthesavebuttononthestandardtoolbar.
PresstheResetbuttonontheapplicationtoolbartoclearthefieldsfor
thenextrow.
Enterthree/fourwaitersdata.Youcanexitbypressingthe
button
(back/previousscreen)onthestandardtoolbarorbypressingfunction
keyF3.Thisbringsyoutothestructurescreen.Youcanseeorviewthe
tablecontentsbyclickingontheapplicationtoolbar
clickingtheexecute
button,then
buttononthenextscreenapplicationtoolbar.
ThecontentsofthetablewillappearasshownbyscreenshotinFigure2
55.
Figure255.ViewandManipulateDatainTable
YCL_CH02_WAITM
YoucanselectrowsbyclickingontheRowSelectionCheckBoxes.You
canthenviewtherowsonerowatatime:throughapplicationtoolbar
button,changecontentsonerowatatimethroughapplicationtool
bar
button,deleteselectedrowsbyclickingonthemenubarTable
EntryandusingDeleteoptions.Youcancreatenewrows(Waiters)by
clickingontheapplicationtoolbar
button.
Youcanselectallrowsthroughapplicationtoolbar
deselectallrowsthroughapplicationtoolbar
button.Youcan
button.
IfyouwanttonavigatetotheSE11openingscreen,thenpress
buttonthreetimes.
DatainTableYCL_CH02_ITEMM
ThesameprocedureistobeusedasfortableYCL_CH02_WAITM.For
thefieldITEM_CODE,withtheassigneddomainYCL_CH02_NUMC4
(throughdataelement)itwillacceptvaluesintherange00015000.
PressingfunctionkeyF4willshowtherangeofvaluesacceptableinthis
field.YouhadassignedthisrangeofvaluesintheIntervalsareaofthe
ValueRangtabofthedomain.Confirmthatthesystemistriggeringan
errorwhenyouentervaluesoutsidetherangeof00015000.After
enteringafewrows,youcanviewthetablecontentsbyclickingonthe
applicationtoolbar
buttoninthetablestructurescreenandthen
clickingtheexecute
buttononthenextscreenapplicationtoolbar.
Thecontentsofthetablewillappearasshownbythescreenshotin
Figure256.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
30/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure256.ViewandManipulateDatainTable
YCL_CH02_ITEMM
Thescreenshowsthefourcreatedrows.Thisdatacanbemanipulated
throughthedisplay,change,create,etc.,buttonsontheapplication
toolbar.
DatainTableYCL_CH02_BILLH
Letthedatabecreatedinthistablebyadifferentprocedure.Ifanend
user(nondeveloper)wasenteringdataintoatable,hewouldnothave
accesstotheDDICobjectmaintenancescreens.Suchuserscanenter
dataintotablesthroughtransactioncodeSE16.Soenter/NSE16inthe
commandboxandpressthe<Enter>/
button.Thescreenshotof
SE16DataBrowser:InitialScreenisshowninFigure257.
Figure257.SE16/Databrowser:InitialScreenDatainTable
YCL_CH02_BILLH
Thescreenpromptsforthetablename.Thetablename
YCL_CH02_BILLHhasbeenentered.Presstheapplicationtoolbar
buttontocreateentries.Thescreenshotofthedataentryscreenis
showninFigure258.
Figure258.CreateDatainTableYCL_CH02_BILLH[SE16]
ThefieldBILL_NOwasassignedthedomainYCL_CH02_NUMC4.It
willacceptvaluesintherange00015000.ForthefieldBILL_DATE,
whichisDDICDataTypeDATS,pressingfunctionkeyF4popsupa
calendar,andyoucanassignadatefromthiscalendar.Yougetthis
facilityforDDICDataTypeDATS.ThisisshowninFigure259.
Figure259.CalendarforDateSelectionDDICDataType
DATS
IfyoupressfunctionkeyF4intheforeignkeyfieldWAIT_NO,apopup
listappearsdisplayingtheprimarykeyvaluesfromthecorresponding
checktable(YCL_CH02_WAITM).ThisisshowninFigure260.Youcan
makeaselectionfromthislist.Thisfacilityisavailableforanyforeign
keyfieldonthescreen.Thepopuplistwithprimarykeyvaluesisa
rudimentaryselectionlist.Youwouldhavepreferred,inthepresent
context,forthenameofthewaitertoappearintheselectionlist.This
willbepossiblethroughtheDDICobjectSearchHelp.Ifyouenteravalue
inthefieldWAIT_NOotherthanthevaluesinthepopuplist(valuesin
thechecktable),anerrorconditionistriggered.Thisissobecauseyou
hadenabledintheforeignkeydialogboxthecheckboxCheckrequired.
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
31/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
Figure260.PopupListofPrimaryKeyValuesforForeignKey
Fields
Afterenteringdataintoallthefields,save.PresstheResetbuttonto
clearfields.Createafewrows.Whenyouarefinished,clickthe
button(back/previousscreen)onthestandardtoolbarorpressfunction
keyF3toreturntotheSE16openingscreen.
Clicktheapplicationtoolbar
buttontoreviewtheentereddata.A
screenshotoftheentereddataisshowninFigure261.
Figure261.ViewandManipulateDatainTable
YCL_CH02_BILLH
DatainTableYCL_CH02_BILLI
CreatedatainthistablethroughtransactioncodeSE16.
Thescreenpromptsforthetablename.Enterthetablename
YCL_CH02_BILLI.Pressapplicationtoolbar
buttontocreate
entries.ThescreenshotofdataentryscreenisshowninFigure262.
Figure262.CreateDatainTableYCL_CH02_BILLI[SE16]
Afterenteringdataintoallthefields,save.PresstheResetbuttonto
clearfields.IfyouenterBILL_NOandITEM_CODEintheforeignkey
fieldsavalueotherthanthevaluesinthepopuplist(valuesinthecheck
tables),anerrorconditionistriggered.Createafewrows.Whenyouare
finished,clickthe
button(back/previousscreen)onthestandard
toolbarorpressfunctionkeyF3toreturntotheSE16openingscreen.
Clicktheapplicationtoolbar
buttontoreviewtheentereddata.A
screenshotoftheentereddataisshowninFigure263.
Figure263.ViewandManipulateDatainTable
YCL_CH02_BILLI
TherearetwoforeignkeyfieldsinthetableYCL_CH02_BILLI(i.e.,
BILLI_NOandITEM_CODE.Ineachofthesefields,whenyoupress
functionkeyF4,apopuplistwillappear(rudimentaryselectionlist)
displayingtheprimarykeyfieldfromtherespectivechecktables.When
youmakeaselection,theprimarykeyvaluefromthelistisreturnedto
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
32/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
theforeignkeyfieldonthescreen.
InthecaseofthefieldBILL_NO,itwouldbedesirabletohaveaselection
listthatdisplaysBILL_NO,BILL_DATE,WAIT_NO,orTABL_NO
insteadofjusttheBILL_NO.
AndinthecaseofthefieldITEM_CODE,itwoulddesirabletohavea
selectionlistthatnotonlydisplaysITEM_CODE,ITEM_DESC,and
RATE,butassignsthevalueofRATEfieldfromthelistoftheselected
ITEM_CODEtothescreenfield.Thiswillbeimplementedwhenthe
DDICobjectsearchhelpinthenextchapter(Chapter3)iscovered.
YouarenowenteringthedataforthetwotablesYCL_CH02_BILLHand
YCL_CH02_BILLiseparatelythroughseparatedialogboxes.Thetwo
tablescontaindataofthesamecategoryofdocument(i.e.,restaurant
bill).Inreallifescenarios,acomplexABAPprogramwouldbecreatedto
enterdataofbusinessdocumentsthatmaptotwoormoreRDBMStables.
ForeignKeyRelationshipDialogBoxAgain
Whenyouestablishafieldaspartofaforeignkey(multiplefields
constitutingtheforeignkey),youhavetheoptiontoomitfield/sfromthe
checkprocedure.YoucandothisbyenablingtheGenericcheckboxof
thisfieldintheForeignKeyFieldsareaundertheGenerateproposal
button.Theeffectofthisisthatwhenvaluesareenteredintheforeign
keyfields,acheckisperformedwhethertheenteredsetofforeignkey
valuesexistinthechecktablethisfieldisomittedinthecheck.
Similarly,youhavetheoptiontoenteraconstantvaluefortheforeign
keyfieldbyenteringtheconstantvalueinthefieldConstant,nexttothe
Genericcheckbox.Thisconstantvalueshouldbeavalidoneandmust
existinthechecktable
IntheForeignKeyrelationshipdialogboxSemanticattributesarea,(at
thebottom),therearethefourradiobuttons:
NotSpecified
Nonkeyfields/candidates(Theforeignkeyfieldsarenot
partoftheprimarykeyinthecurrenttable)
Keyfields/candidates(Theforeignkeyfieldsarepartofthe
primarykeyinthecurrenttable)
Keyfieldsofatexttable(Iftheprimarykeyofthecurrent
tablediffersfromtheprimarykeyoftheChecktableonlyin
termsofanadditionallanguagecodefield,thisradio
buttonneedstobeenabled)
Theenablingofoneoftheseradiobuttonsalongwiththecardinality
servesdocumentarypurposesonlyexceptintwocontexts:
1. Inatexttable,forthecodefield,theradiobuttonKeyfieldsofa
texttableshouldbeenabled.Thisisoneindicationtothesystem
thatthisisatexttableapartfromtheDDICDataTypeLANGfield
precedingthecodefieldandformingpartoftheprimarykey.
2. Incaseofthetablebeingusedinmaintenance,helpview,the
informationofcardinalityandthesemanticattributesisusedby
thesystem.
Atablewithagenerickeyfieldcouldbelocated.Atablewithaconstant
keyfieldwasnotabletobelocated.
Theabovedescriptionsareinthescreenshot(Figure264).
Figure264.Table:BUT000_TDwithGenericKeyField
CLIENT
TextTables
Shorttexts(textlength<=255characters)arerequiredtobemaintained
intheSAPfunctionalmodulestablesandrelatedtables.Somevery
commoninstances:textsofcurrencynames(tableTCURT),textsof
countrynames,(tableT005T),textsofstate/province/regionnames
(tableT005U),materialdescriptions(tableMAKT),andsoon.These
tablesstoringtextsarecalledtexttables.Thetextshavetobemaintained
inmultiplelanguages.Thusthelanguagecodehastobeapartofthe
primarykeyofthetexttables.Thelanguagecodefieldisassignedthe
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
33/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
DDICDataTypeLANG.Mostofthetexttableshavethelanguagecode
fieldofDataTypeLANGnamedasSPRAS.Andmostofthetexttable
namesendwiththeletterT.
Thesetexttablesareforeignkeytablestotherespectivechecktables
wherethecodesarestored:currencycodes,countrycodes,
state/province/regioncodes,materialcodes,etc.Thesecodefieldsare
foreignkeyfieldsaswellaspartoftheprimarykeyinthetexttables.The
primarykeyfieldsinthetexttablesareintheorderMANDT,<language
codefield>,and<codefield1>[<codefield2>.].Therecanbemorethan
onecodefieldlikeintableT005U(LAND1&BLAND).Onlyclient
dependenttablesarebeingconsidered.
Youcanconfirmthiswiththetablesmentionedearlier:TCURT,T005T,
T005U,andMAKT.
Youcanconfirmoneotherthing.Whenyoubrowsethedataofthecheck
tableofthesetexttables:TCURC/T005/T005S/MARA(eitherinSE11or
SE16),thetextsordescriptionsappearintheloggedinlanguage
automatically.
YoucouldfaceaproblemwithtableT005.Thetextsmightnotappear.If
thisisso,intherestrictiveorfilterdialogboxprecedingthedatabrowser
window,enteravalue>=1000inthefieldWidthofOutputListabovethe
fieldMaximumNo.ofHits.Bydefaultthevaluesinthesetwofieldsis
250and200respectively.Bydefaultthewidthofoutputis250columns,
andthemaximumnumberofrowsoutputis200.Thenumberoffieldsin
thetableT005aremanyalso(65)fieldtitlesareverylong,henceyou
needtheoutputwidthtobe>=1000columns.
Recapitulation:Domains,DataElements,andTables
Youstartedwiththerestaurantbill.Youwantedtostoretherestaurant
billandrelateddataintheSAPsystem.Youidentifiedthefourtablesto
storetherestaurantbillandrelateddata.Youidentifiedfieldsineach
table.YouassignedtheDDICDataTypeandlengthtothesefields.You
identifiedtablerelationships.YoucreatedanERdiagram.
YoumadeasummarylistofDDICDataTypesandlengthsinthefour
tables.YouidentifiedthissummarylistofDDICDataTypesandlengths
asminimumnumberofdomainstobecreated.Youmappedthissummary
listtodomains.
Youmadeasummarylistofthefieldsinthefourtables.Thissummarylist
offields,youmappedtothedataelements.
YouadoptedanamingconventiontocreateDDICobjects.
First,youcreateddomainsnextyoucreateddataelementsandfinally
thetables.
Youcreatedafewentriesineachofthesetablesthroughthetable
maintenancedialogboxgeneratedforeachtableautomaticallywhenthe
tableisactivated.
Youreviewedthedatainthetables.
Thewholeelaborateexercisewasdonetogetafirsthandexposureto
thesethreeDDICobjects.InsteadofcreatingtheDDICobjectsina
randomandhypotheticalfashion,youadoptedasimplerealworld
scenarioandcreatedthesethreeDDICobjectsinthecontextofthe
scenario.
YouwillnowproceedtolearntheothertwoDDICobjectsinthenext
chapter:ViewsandSearchhelps.
_____________
1
ForadetailedtheoreticaltreatmentoftheDDIC,downloadBC
ABAPDictionaryfrom
http://help.sap.com/printdocu/core/print46c/en/data/pdf/bcdwbdic/bcdwbdic.pdf
(http://help.sap.com/printdocu/core/print46c/en/data/pdf/bcdwbdic/bcdwbdic.pdf).
PREV
NEXT
Recommended
/ Queue
/ Recent
/ Topics / Tutorials / Settings / Blog / Feedback / Sign Chapter
Out
3: ABAP Dictionary/Data Dictionary/DDIC 2
Chapter 1: ERP
and SAP
Overview
2016 Safari.
Terms of Service / Privacy Policy
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
34/35
1/5/2016
Chapter2:ABAPDictionary/DataDictionary/DDIC1SAPABAP:HandsOnTestProjectswithBusinessScenarios
https://www.safaribooksonline.com/library/view/sapabaphandson/9781430248040/9781430248033_Ch02.xhtml
35/35