Demo on Workflow using Classes.docx
- 文档编号:8237831
- 上传时间:2023-01-30
- 格式:DOCX
- 页数:14
- 大小:1.22MB
Demo on Workflow using Classes.docx
《Demo on Workflow using Classes.docx》由会员分享,可在线阅读,更多相关《Demo on Workflow using Classes.docx(14页珍藏版)》请在冰豆网上搜索。
DemoonWorkflowusingClasses
DemoonWorkflowusingClasses
ByRichaGupta,SpartaConsultingfrom Link
Purpose
TodevelopworkflowusingOOPSconceptinsteadofusingstandardBusinessObject.
NOTE:
Beforefollowingthisdocument,onemusthaveabasicknowledgeofOOPSConcepts.
StepstofollowtouseClassesinWorkflow
HowtoCreateCustomClass
HerewewillbecreatingacustomclassforMATERIAL.
Gototransaction SE24 andcreateacustomizedclass.
Nextthepopupappearswhereweneedtomentionthedetailasfollows:
Saveitandtheclassiscreated.
NowtheclassistoimplementIF_WORKFLOWinterface.Forthisgotothe
tabanddeclaretheIF_WORKFLOWastheinterfacethereandpressEnter;twosub-interfacesappear:
BI_OBJECT and BI_PERSISTENT.SavetheClass.
TheZCL_TESTclassnowcontainstheexistingmethodsofIF_WORKFLOWinterface.
Also,2newinterfaceswillbeautomaticallyaddedonceyouaddIF_WORKFLOWinterfaceintheclassasshownbelow:
EachmethodoftheIF_WORKFLOWInterfacehasitsdistinctfunctionality,whichisdiscussedbelow.
BI_PERSISTENT~FIND_BY_LPORMethod:
Here,tocreateobject,constructorofclassneedstobeimplementedasfollows:
Here,SET_ATTRIBUTESmethodiscalledwhichwillbeimplementedasfollows:
BI_PERSISTENT~LPORMethod:
BI_PERSISTENT~REFRESHMethod:
Ifwedonotneedthemethodinourclass,thenweneedonlytocarryouta“dummy”implementation(withoutfurthercoding)toavoidprogramerrorswhenthesystemcallsthemethod.
BI_OBJECT~DEFAULT_ATTRIBUTE_VALUEMethod:
BI_OBJECT~EXECUTE_DEFAULT_METHODMethod:
BI_OBJECT~RELEASEMethod:
Now,theattributesneedtobedevelopedtoimplementabovemethodsareasfollows:
Totriggertheworkflowusingeventofclass,wemustalsocreateaneventoftheclass.Todothis,gotoEVENTStab,andtherecreateaneweventCREATEDasshownbelow:
Beforeimplementingabovemethods,alocaltypeneedstobecreated.Todothis,clickonLOCALTYPESasshownbelow:
Nowwritethebelowcode:
HowtouseClassinaWorkflow
Here,theworkflowneedstobetriggeredassoonasamaterialiscreated.Andthenaworkitemshouldgotoinitiatortoeditthesamematerial.
GotoSWDDtocreateanewworkflow.
ClickonBasicDataTab:
GiveanabbreviationandShortDescriptiontoworkflowasfollows:
NowclickonSTARTEVENTStabandspecifythefollowingstandardeventofthestandardclass:
NowgobackandrightclickinbetweentheWORKFLOWSTARTEDandWORKFLOWCOMPLETED.
SelectCREATE.Alistofavailablesteptypeswillbedisplayedasfollows:
SelectACTIVITYfromthislist.Thefollowingscreenwillappear:
Specifythefollowingdetailshere:
ClickonBindingtab.Bindingwillbeasfollows:
Clickontaskdescription.Automaticallyfollowingdetailswillshow:
Clickonthegreenbuttonforbindingaboveandconfirmthebindingsmustbeasfollows:
SETAGENTASSIGNMENT:
ClickonyellowbuttoncomingbesidesAgentAssignment:
ClickonATTRIBUTES:
SelectGeneralTaskandclickonTRANSFER
HowtotriggereventofClass
Totriggereventofaclass,weneedtocallmethodRAISEofstandardclassCL_SWF_EVT_EVENT.Thismethodcanbecalledinauserexit,BAdi,oracustomreportdependingontherequirement.
Inourcase,wearecallingthemethodinaBAdi‘BADI_MATERIAL_CHECK’.
ThemethodinwhicheventwillberaisedisCHECK_DATA.
CreateanewcustommethodRAISE_EVENTintheclassimplementedforBAdi.
Followingmethodwillbecalledtoraiseevent:
Activateclassandgoback.
NowgoinCHECK_DATEmethodandwritethebelowcode:
Output
Createanewmaterial.Todothis,gotoMM01.
PressEnterandthefollowingscreenwillappear:
SpecifytheabovedetailsandpressEnter.Onthenextscreen,enterthefollowingdetails:
ClickonSAVE
button.
Assoonasthematerialgetscreated,theworkflowwilltriggerasshownbelowintheworkflowlog:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Demo on Workflow using Classes
![提示](https://static.bdocx.com/images/bang_tan.gif)