SWO1创建BO.docx
《SWO1创建BO.docx》由会员分享,可在线阅读,更多相关《SWO1创建BO.docx(9页珍藏版)》请在冰豆网上搜索。
SWO1创建BO
SAPBusinessObjectTypes
Skiptoendofmetadata
∙
∙Attachments:
15
∙Addedby SaumyaGovil,lasteditedby AlonMizrahi onNov02,2011 (viewchange)
∙showcomment
Gotostartofmetadata
1. BusinessObjectType-AnIntroduction
BusinessObjectRepositoryisanobjectorientedapproachusedtomodelBusinessObjectsandprocesses.ItisacollectionofBusinessObjecttypesandInterfacetypesandalsotheircomponentslikeattributes,methodsandevents.
BusinessObjecttypeisarepresentationofanybusinessentityinanSAPsystem.Exampleofentitycouldbeanemployee,purchaseorder,etc.
ABOtypeincludesboththedataoftheentityandthefunctionsitperforms.DataisstoredinformofBOattributesandfunctionsinformofBOmethods.ThuswecanunderstandBOasanobjectorientedapproachtomodelbusinessentitiesandprocesses.
2. RoleofBusinessObjecttypes
BusinessObjecthasthefollowingfunctions:
a. BOreducesthecomplexityoftheSAPsystembydividingitintosmallerunits.
b. AtBOlevel,non-SAPsystemscancommunicatewithSAPsystem.ThiscanbedoneusingBAPIs.
c. BOenablesvariousbusinesscomponentstocommunicatewitheachother.
d. BOtypesactsasentrypointstodataandfunctionsforanSAPSystem.
e. BO'scanbeusedinbusinessworkflows,ALEandRFC.
3. BusinessObjectProperties
Eachbusinessobjecthasthefollowingproperties:
a. ObjectTypeID -Itisusedforinternalidentificationofthebusinessobject.
b. ObjectName -Itisusedforexternalidentificationofthebusinessobject.UsingthispropertyexternalsystemcaninteractwithSAPsystem.
c. SuperType -ItistheparentobjectfromwhichallthecomponentsoftheBOareinherited.
d. Name -ItisadescriptivenameoftheBO.
e. Description -Itisabriefdescriptionofthebusinessobjecttype.
f. Application -TheapplicationcomponenttowhichtheBObelongsto.
g. Program -ProgramthatwillcontaintheABAPcodeoftheBO.
4. ComponentsofaBusinessObject
Thereare5componentsofabusinessobject:
a. KeyFields
Ø Canbeacombinationofoneormorefields
Ø Isaspecificationofuniqueobjectkey-toaccessaspecificinstanceofaBO
Ø Isareferencetounderlyingapplicationtable
Ø Mustbecharacterbased
Ø ValuesetwhencreatingaBOinstanceorbyamethod
Ø Canbereadfromoutside.Cannotbechangedfromoutside
Ø Maximumlengthofconcatenatedkeyfieldcanbe70characters
b. Attributes
Ø PropertiesandcharacteristicsofaBO
Ø Canbereadfromoutside.Cannotbechangedfromoutside
Ø Canbesingle-lineormulti-line
Ø Canbeinstanceindependent(static)orinstancedependent
Typesofattributes:
• Virtual-Setbyamethod/BOprogramwhenaccessed
• DBfield-Loadedfromthedatabasewhenaccessed,basedonthekeyfields
c. Events
Ø IndicatestheoccurrenceofastatuschangeofaBO
Ø Canhaveparameters andexceptionslikemethods
Ø HavelistenersoutsidetheBO.E.g.Workflow
d. Methods
Ø ThesearefunctionsthatencapsulatesthefunctionalitiesofaBO
Ø Canbesynchronousorasynchronous
Ø Canbeinstanceindependentorinstancedependent
Ø Canhaveparameters(mandatory/optional,single/multi-line,import/export/both)andexceptions
Ø TheABAPimplementationcanbe:
• Afunctionmodule
• ABAPI
• Atransaction
• Adialogmodule(Obsolete)
• Areport
• OtherABAPforms(Directimplementation,ABAPclassmethods,systemprogrametc.)
Typesofmethods:
• Synchronous-Resultisreturneddirectlytothecallingprogram.
• Asynchronous-Resultcanbereturnedtothecallingprogramonlythroughanevent.
e. InterfaceTypes
Ø LikemodelsforBOTypes
Ø Donothaveanykeyfields
Ø Cannotbeinstantiated
Ø Donothavedevelopmentstatuses
Ø Canbeinherited-substituteformultipleinheritance
Ø Canhaveimplementation
Ø ABOTypecaninheritoneormoreinterfaces
Ø MethodsdefinedinaninterfacecanberedefinedinaBOType
Ø TheinterfaceIFSAP anditsmethodsExistenceCheckandDisplayareinheritedbyallBOTypesbydefault
5. BusinessObjectStatutes
ThefollowingarethedifferentdevelopmentstatusesofaBO/BOComponent:
a. Modeled -Onlydefined(themethodanditssignature)
b. Implemented -ABAPimplementationisdone,canbeusedfortestingorinternaluse
c. Released -Methodreadytobeused
d. Obsolete -Attribute/Method/Eventnottobeusedanymore
Youcan checkthestatusoftheBusinessObjectbyclickingonthe'Basicdata'button(capsign).Itliststhedetailsofthecreated/openBOwiththedetailsofthesupertype,status,name,descriptionandtransportdata,etc.
6. CreatingaBusinessObject
BusinessObjectBuilderisthetoolusedforcreating,implementingandtestingbusinessobjecttypes. Themenupathtoaccessitis:
Tools->BusinessFramework->BAPIDevelopment->BusinessObjectBuilder.
Transaction'SWO1'canalsobeusedforthesame.
a. GototransactionSWO1(BusinessObjectBuilder).
b. InputthenameoftheZ-businessobjectandclickon'Create'.
c. Selectthe'Supertype'.
d. Enterdetailsofpropertiesofthebusinessobjectlikeobjecttype,objectname,description,programnameandapplication.
e. ClickontheCheckButton.
f. BOwouldgetcreatedandthedefaultstructurewouldbeasbelow:
g. Gotothe'BasicData' buttonorclickCtrl+Shift+F1toviewthebasicdataoftheBO.
h. Inthe'Methods'tab,createanewmethodbyclicking'New'button orF5.
i.Clickon'Parameters'button orclickCtrl+Shift+F7toaddparameterstothemethod.
j. Clickon'Program'button orclickCtrl+Shift+F3toaddcodetotheprogram.Atemplateofthemethodwouldbegenerated.Addthesourcecodeinthemethod.
k. Savethemethodandsetitsreleasestatusto'Implemented'.
l. ChangethestatusoftheBOto'Implemented'.
m. GeneratetheBO.
n. ChangethestatusoftheBOto'Released'tomakeitreadyforuse.
o. Toseethedetailsoftheexceptions,clickon'Exceptions'button orclickCtrl+Shift+F8.
p. ToseethelistoferrorsnavigatetoGoto->Errorlist.