BPC-Custom Process Chain
BPC-Custom Process Chain
SAP Product Name: SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver Applicable Product Versions: Last Updated: 7.0 06/22/2009
Copyright 2007 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C , World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data
contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP How-to Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP products. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings (Code) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.
TableofContents 1 Scenario..................................................................................................................1 2 3 Introduction ...........................................................................................................1 TheStepByStepSolution ......................................................................................2 3.1 3.2 3.3 3.4 3.5 3.6 4 4.1 CreatetheProcessTypeClass.........................................................................2 CreatetheFunctionalClass.............................................................................7 CreatetheCustomProcessType ..................................................................11 CreatetheCustomProcessChain .................................................................13 CreatethePackagefromtheBPCExcelClient..............................................24 TestthePackage............................................................................................29 ProcessTypeClassImplementations ............................................................37
Appendix ..............................................................................................................37 4.1.1 SET_PC_TYPE..........................................................................................37 4.1.2 IF_RSPC_TRANSPORT~GET_TLOGO .......................................................37 4.1.3 IF_RSPC_MAINTAIN~MAINTAIN ............................................................37 4.1.4 IF_RSPC_MAINTAIN~GET_HEADER........................................................38 4.1.5 IF_RSPC_GET_VARIANT~GET_VARIANT ................................................38 4.1.6 IF_RSPC_GET_VARIANT~WILDCARD_ENABLED.....................................38 4.1.7 IF_RSPC_GET_VARIANT~EXISTS.............................................................38 4.1.8 IF_RSPC_EXECUTE~EXECUTE .................................................................39 4.1.9 IF_RSPC_EXECUTE~GIVE_CHAIN............................................................40 4.2 FunctionalClassImplementations ................................................................40 4.2.1 CONSTRUCTOR.......................................................................................40 4.2.2 IF_UJD_TASK~PROCESS..........................................................................41 4.3 DataManagerDynamicScripts .....................................................................42 4.3.1 ScriptforDirectoryZip...........................................................................42
1 Scenario
Withinthisscenario,wewillshowhowtocreateacustomBPCprocesschaininSAP BusinessObjectsPlanningandConsolidation,versionforSAPNetWeaver
2 Introduction
TheDataManagermoduleinSAPBusinessObjectsPlanningandConsolidation,versionforSAP NetWeaver,utilizesSAPNetWeaverProcessChains,andprovidesawayforbusinessusersto executethesechainsviaDataManagerpackages. TheBPCproducthasaframeworkwhichprovidestheabilitytoextenditsfunctionalityby implementingcustomprocesstypesandcustomprocesschainsleveragingtheABAP programminglanguage. WewilldemonstratehowtocreateABAPclasseswhichleveragetheexistingframework,howto createthecustomprocesstypebasedontheseclasses,andhowtocreatetheprocesschain,in theNetWeaverbackendsystem.WewillalsoshowhowtocreatetheDataManagerpackage fromtheBPCExcelClient.InthisHowToguidewewillfocusontheframeworkimplementation andnotontheactualfunctionalityofthecustomprocesstypeandprocesschain.Inthis example,wewillcreateacustomprocesschainwhichallowstheusertozipadirectoryinthefile servicemoduleofBPC.WewillusetheTransformationFilesdirectoryspecifically.Thereason forthisisbecausethisdirectoryonlycontainsfileswhicharenotstoredlikedatafilesforData Manager.ZippingofdatafilesforDataManageriscurrentlynotasupportedfunctionoftheBPC fileserviceAPIs.
3 TheStepByStepSolution
ThisHowToguidecontainsinstructionsforcreatingthetwoABAPclasseswhicharerequired whenbuildingthecustomBPCprocesstype.BasicABAPObjectsprogrammingknowledgeis requiredtocompletethisHowToguide.Itisassumedthatthereaderunderstandsobject orientedconceptsaswell,astheyrelatetoABAPObjects.
3.1 CreatetheProcessTypeClass
TheProcessTypeclassisaframeworkclasswhichwillbereferencedbytheprocess type,whichiscreatedinalaterstep.Thisclassleveragessomeexistinginterfaceswhich allowittobefittedintotheBPCframeworkdirectly.Thisclasswillhandletheprocess typevariantprocessing.Thatis,whentheprocesstypeisincludedintoaprocesschain, thecodeexecutedtherein,allowsyoutocreateaprocesstypevariant,aswellasallows youtosetprocesstypevariantparametersforthiscustomprocesstype.Thisclasswill alsocalltheunderlyingfunctionalclasswhichperformstheactualfunctionoftheprocess type.TheFunctionalclasswillbecreatedinthenextstep.
1. LogontotheNetWeaversystem,and gototransactionSE24.Enterthe nameoftheprocesstypeclass.Existing BPCprocesstypeclassesuseasimilar namingconvention.Itissuggestedto usethissamenamingconventionfor customBPCprocesstypesaswell.The namingconventionforstandard objectsisCL_UJD_BPC_<meaningful name>.Sointhisexample,nameitas ZCL_UJD_BPC_DIRZIP,forDirectory Zip.ClicktheCreatebutton.
4. Addthefournewinterfacesasshowin theimagetotheright.
5. ClickontheMethodstab.Notice thatnewmethodshavebeenadded. Inthefollowingsteps,wewillcreate theimplementationofthesemethods. Allsourcecodecanbefoundinthe AppendixA. 6. Firstweneedastaticmethodcalled SET_PC_TYPE.Thismethodwillsetthe processtypename.Itisimportantthat thisvalueisthesameasthenameof theprocesstypewhichwillbecreated later.Inthisexample,wewilluse ZBPCDIRZIP.Createthisprivatestatic methodandprovideits implementation.Noticeinthis method,wewillsimplycalla frameworkmethodoftheclass CL_UJD_CUSTOM_TYPE.Mostofthe methodimplementationsinthisnew class,willcallframeworkmethods. Thesourcecodemaybecopiedfrom section4.1.1inAppendixA. 7. Doubleclickonthe IF_RSPC_TRANSPORT~GET_TLOGO method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.2inAppendixA.
8. Doubleclickonthe IF_RSPC_MAINTAIN~MAINTAIN method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.3inAppendixA. 9. Doubleclickonthe IF_RSPC_MAINTAIN~GET_HEADER method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.4inAppendixA. 10. Doubleclickonthe IF_RSPC_GET_VARIANT~GET_VARIANT method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.5inAppendixA. 11. Doubleclickonthe IF_RSPC_GET_VARIANT~WILDCARD_E NABLEDmethod.Enterthesource codeasshownintheimagetothe right.Thesourcecodemaybecopied fromsection4.1.6inAppendixA. 12. Doubleclickonthe IF_RSPC_GET_VARIANT~EXISTS method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.7inAppendixA.
13. Doubleclickonthe IF_RSPC_EXECUTE~EXECUTEmethod. Copythesourcecodeforthismethod fromsection4.1.8inAppendixA. Noticethereisareferencevariable definitiononline8foraclassthatwe havenotcreatedyet.Sothisclasswill notpassasyntaxcheckatthispoint. Alsonoticeonline20,hereagainthe processtypenameZBPCDIRZIPisused. Thisneedstobeexactlythesameas theprocesstypewhichwewillcreate inalaterstep.Theimagetotheright doesnotrepresentallofthecodeof thismethod,soremembertocopyit fromsection4.1.8inAppendixA. 14. Doubleclickonthe IF_RSPC_EXECUTE~GIVE_CHAIN method.Enterthesourcecodeas shownintheimagetotheright.The sourcecodemaybecopiedfrom section4.1.9inAppendixA. 15. Finally,savethisclass.Againitwillnot activateduetoareferencetoaclass whichisnotyetcreated.
3.2
CreatetheFunctionalClass
TheFunctionalclassistheclasswhichwillbecalledbytheprocesstypeclass,and implementsallofthefunctionalcodeoftheprocesstype.Inotherwords,itexecutesall ofthecodewhichwilldowhattheprocesstypeismeanttodo.Forexample,inthis scenario,itwilltriggerthecodewhichwillzipadirectoryintheBPCfileservice.When buildingthisclass,thereismuchmorefreedomcomparedtotheProcessTypeclass. Basically,youneedtoimplementtheCONSTRUCTORmethodtoretrieveparameters,and thenimplementtheIF_UJD_TASK~PROCESSmethodwhichwillperformthefunctionality. Youmay,ofcourse,createanyprivatemethodstosupportyourfunctionality.The IF_UJD_TASK~PROCESSmethodwillthenbecalledbytheBPCprocesstypeclasswhich wascreatedinthepreviousstep.
1. FromSE24,enterthenameofthe functionalclass.ExistingBPCfunctional classesuseasimilarnaming convention.Itissuggestedtousethis samenamingconventionforcustom BPCprocesstypesaswell.Thenaming conventionforstandardobjectsis CL_UJD_<meaningfulname>.Sointhis example,nameitasZCL_UJD_DIRZIP, forDirectoryZip.Thenameofthis functionalclassisusuallythesameas theprocesstypeclass,withoutthe _BPC_part.ClicktheCreate button. 2. Inthefollowingdialog,enterthe description.Thisclassmustbepublic, andmarkedasfinal.ClicktheSave button.
3. Inthefollowingscreen,clickonthe InterfacesTab.Addthe IF_UJD_TASKinterfaceandhitEnter. 4. SwitchtotheAttributestab,and entertheattributesshowninthe imagetotheright.DO_CONFIGwill holdtheconfigurationobjectwhichis imported,andDO_CONTEXTwillhold thecontextobject.Thesearerequired bytheframework.
5. Therewillbetwoparameterswhich willbeimplementedinthedata manageruserinterfacelateron.Create twomoreprivateinstanceattributesas shownintheimagetotheright. D_SRC_DIRandD_TRG_FILE,both typedasCHAR255.Theseattributes willholdtheparametervaluesfrom thedatamanagerpackage. 6. SwitchtotheMethodstaband createtheCONSTRUCTORmethodfor thisclass.
9. Clickonthe iconandenterthe sourcecodefortheCONSTRUCTOR method.Addsomecodetogetthe parametersfromtheDO_CONFIG objectandsetthevaluetothespecific attributesoftheclass.Noticetheuse oftheliterals,SRC_DIRandTRG_FILE. Thesearetheparameterswhichwillbe definedlaterinthedatamanager packageaswellastheprocesstype variantwhenbuildingtheprocess chain.Itisimportanttousethese sameliteralvalues.Thesourcecode maybecopiedfromsection4.2.1in AppendixA.
10. Next,createtheimplementationfor theIF_UJD_TASK~PROCESSmethod. Thismethodwillbecalledbythe processtypeclassandperformthe actualfunctionalityoftheprocess type.Inourexample,thismethodwill taketheparametersretrievedinthe CONSTRUCTORmethodandcallthe fileserviceAPItocreateaZIPfilefora directory.Notalltherequiredcodefor thismethodisshownintheimageto theright,socopyitfromsection4.2.2 inAppendixA.
3.3
CreatetheCustomProcessType
1. GototransactionRSPC.ClickSettings MaintainProcessTypes.
2. Thisisthestandardtablemaintenance screenforprocesstypes.Clickthe icon.ThenclicktheNewEntries button. 3. Inthisscreen,enterthenameofthe processtype,nameitasZBPCDIRZIP.It isveryimportantthatyouusethis nameasthisisthenameusedwhen creatingtheprocesstypeclassinthe previousstep.Enterthedataas shownintheimagetotheright.Make suretosetthePossibleEventslist boxasProcessendssuccessfulor incorrect.TheIDfielddefinesthe iconwhichwillbeusedforthisprocess type.Afterenteringallthedatashown intheimagetotheright,clickthe icon.Atransportrequestforthenew customprocesstypemayberequired, simplycreateoneusingyourcustomer icontogo package.Thenclickthe back.Clickthe onceagaintogo backtotheinitialscreenofRSPC.
4. FromtheinitialscreenofRSPC,open theBusinessPlanning& Consolidation:Systemnodefromthe treeontheleftanddoubleclickonone oftheprocesschains.Doingso,will iconto changetheprocesstype nowbeactive.Clickthisicontoview theprocesstypes.
3.4
CreatetheCustomProcessChain
1. Nowclicktheprocesschains icon togobacktothelistofprocesschains. 2. Clickthecreate icononthe applicationtoolbartocreateanew processchain. 3. Inthisdialogbox,enterthenameof theprocesschain.Nameitas ZBPC_DIRZIP,andenterthedescription asBPC:DirectoryZip.Thenclickthe icon. 4. Inthisdialogbox,clickthe iconto createthestartprocessvariant. Eachprocesschainneedsto implementitsownuniquestart processvariant. 5. Inthisdialogbox,enterthenameof theprocessvariantas ZBPC_DIRZIP_START,andthe descriptionasBPC:DirectoryZip Start.Finally,clickthe icon.
9. Nowthatthevarianthasbeencreated, clickthe icontoinsertitinthe customprocesschain. 10. Youshouldnowseethestartprocess inthelayouttotherightofthescreen. 11. TheBPCprocesschainsusea frameworkwhichrequirescertain standardBPCprocesstypesbe inserted,inorderfortheprocesschain toworkcorrectlyintheBPCData Managertool.TheModify Dynamicallyprocesstypeisoneof theserequiredtypes.Clickonthe icon.UndertheBPC processtype ProcessTypesnode,addtheModify Dynamicallyprocesstypetothe processchain,byselectingitfromthe treeontheleftanddraggingand droppingitintothelayoutontheright. 12. Inthedialogbox,selectthe /CPMB/MODIFYvariantforthis processtypeandclickthe 13. Aninformationmessagewillappear, answerNo. 14. Theprocesstypehasnowbeenadded tothelayoutontherightsideofthe screen.Theprocesschainlayout shouldnowlooklikethis. icon.
15. Next,createalinkbetweenthesetwo processtypesbyselectingtheStart processtype,andrightclickingand selecting,ConnectWith Modify Dynamically BPC:ModifyProcess TypeVariantValue. 16. Theprocesstypesarenowlinked together. 17. Next,addthestandardprocesstype ORfromtheGeneralServicesnode inthetreeontheleft,tothelayouton theright,byselectingitanddragging anddroppingitintothelayoutonthe right. 18. Clickthe iconinthefollowing dialogboxtoadditintotheprocess chain. 19. Thelayoutisthenupdatedwiththe newprocesstype.
20. Next,createalinkbetweenthe ModifyDynamicallyprocesstype, andtheORprocesstype,byright clickingonModifyDynamically,and choosingConnectwith OR and thentherandomnumberidentifier. 21. Adialogboxforerrorhandlingactions willappear.Choosetheradiobutton forerrorsandclickthe icon.
22. Theprocesschainnowlookslikethis.
23. Beforeaddingthecustomprocesstype whichwilldomostofthefunctional work,insertonelastprocesstype whichisneededfortheBPCprocess chainframework.GobacktotheBPC Processtypesnodeanddragand droptheBPC:ClearBPCTables processtypeintothelayoutonthe right.
24. Inthenextdialogbox,enterthename ofthevariantas/CPMB/CLEARand clickthe 25. Aninformationmessagewillappear, answerNo. 26. Theprocesshasnowbeenaddedto thelayoutontheright. 27. Next,createalinkbetweentheOR processtypeandtheClearBPC Tablesprocesstypebyselectingand rightclickingontheORprocesstype, andselecting,Connectwith Clear BPCTables clearthetempdata. icon.
28. Theprocesschainnowlookslikethis. 29. Finally,addthefinalprocesstypeto theprocesschain.Draganddropthe processtypeforBPC:DirectoryZip intothelayout. 30. Inthefollowingdialogbox,clickthe icontocreatetheprocessvariant. 31. Enterthenameoftheprocessvariant asZBPC_DIRZIPandthedescriptionas BPC:DirectoryZip.Thenclickthe icon.
Clickthesave togoback.
35. Next,createalinkfromtheModify DynamicallyprocesstypetotheBPC: DirectoryZipprocesstypeby selectingandrightclickingonthe ModifyDynamicallyprocesstype, andchoosing,Connectwith BPC: DirectoryZip BPC:DirectoryZip.
36. Inthefollowingdialogbox,makesure theradiobuttonforsuccessfulis markedandclickthe 37. Next,createalinkfromtheBPC: DirectoryZipprocesstypetothe ClearBPCTables:processtypeby selectingandrightclickingonthe BPC:DirectoryZipprocesstypeand choosing,Connectwith ClearBPC Tables clearthetempdata. 38. Inthefollowingdialogbox,markthe radiobuttonforalwaysandclickthe icon. 39. Inthenextdialogbox,simplychoose Connect. icon.
40. Thecompletedprocesschainshould nowlooklikethis. 41. Checktheprocesschainbyclickingthe icon.Allprocesstypesshouldshow iconto asgreen.Finallyclickthe activatetheprocesschain. 42. Amessagesayingthattheprocess chainhasbeensavedasactivewill thenappearinthestatusbar.
43. Clickonthe icontoreturntothe processchains.Thenclickthe icon torefreshtheprocesschainlist.The newprocesschainshouldnowshowin thetreetotheleft.Itshouldcurrently beundertheNotAssignednode. Assignthisprocesschaintooneofthe BPCgroups,byselectingthenew processchain,undertheNot Assignednode,andclickingthe icon. 44. Enterthenameofthegroupas /CPMB/BPCandclickthe 45. Clickthe icontosaveandactivate icon.
3.5
CreatethePackagefromtheBPCExcelClient
4. Inthisdialog,packagesarecreated.In thiscase,wewanttocreatethe packageforournewlycreatedprocess chain,ZBPC_DIRZIP.SelecttheSystem Administrationpackagegroup,and clickthe package. 5. Clickthe iconnexttotheinput fieldforProcessChain. 6. SelecttheBPC:Planningand Consolidation:Systemgrouponthe left,andthenselecttheZBPC_DIRZIP processchainontheright.Finallyclick theSelectbutton. icon,tocreateanew
7. Continuecreatingthepackage,and enterthepackagenameas ZipDirectory,andthedescriptionas ZipDirectory.Alsocheckboth checkboxesunderTaskType.Finally clicktheAddbutton. 8. NowclicktheSavebutton.A messagewillappearstatingthatthe packagehasbeensavedsuccessfully, andthedialogwillclose. 9. Fromtheactionpane,onceagainclick theManagepackages(organizelist) linktogobackintothepackage maintenancescreen.
10. SelecttheSystemAdministration folderfromtheleft,thenselectthe ZipDirectorypackagefromthelist, andrightclickonit.ChooseModify Packagefromthecontextmenu. 11. Inthefollowingdialog,clickthe icontoviewthepackage. 12. TheDataManagerPackageand DynamicScriptEditorwillthenbe launched.Herethelookandbehavior ofthedialogscreenofthepackagecan beconfigured.Forexample,thedialog boxshouldhaveaninputfieldforthe directoryandaninputfieldforoutput filepath.ClicktheAdvancedbutton atthetoptolaunchtheeditor.
13. Enterthetextintotherightsideofthe windowandclicktheOkbutton. RefertotheAppendix4.3.1foratext versionofthiscoding. 14. Controlisthenpassedbacktothe previousdialog,clicktheSave button. 15. Controlisthenpassedbacktothe previousdialog,clicktheSave button. 16. Finally,atthelastdialog,clickSave onelasttime.Amessagesayingthat thepackagehasbeensaved successfullywillappear.
3.6
5. ClicktheUponelevelbuttoninthe dialog.SelecttheExamplesfolder underTransformationFilesdirectory. Noticethatthisuserinterfacedoesnot allowpointingtoaspecificdirectory, butonlytoasinglefile.Aworkaround forthisistogiveadummyfilename here.ThenclickOpen. 6. Controlisthenpassedbacktothe RunPackagedialog.Noticeherethat thedirectoryisnowpointingtothe dummy.zipfile.
7. Nextsimplyremovethedummy.zip partfromthefilepath.Thiswillspecify thatwewanttoziptheentirecontents oftheExamplesdirectory. 8. Enterthepathandfilenameofthe outputzipfile.ClicktheUponelevel button,thenchoosetheExamples folderundertheTransformationFiles directory,andenterthefilenameas Examples.zip.Finally,clickthe Savebutton.TheresultingZIPfile willbeplacedinthesamedirectory whichisbeingzipped.
12. Checkthestatusofthepackageand makesureitiscompletedsuccessfully. ThenclickClosetoclosethedialog. 13. Thenewlycreatedpackagehasbeen executedsuccessfully,andtheresults cannowbechecked.Inthisexample, wecanchecktoseeifthefilehasbeen created,anddownloaditfromfile servicetothePC,andviewthezipped contents.GobacktotheNetWeaver systemviaSAPguiandruntransaction UJFS.Browsetothedirectorynode. Noticethatthenewexamples.zipfile nowexists.Theexistenceofthefile meansthatyourcustomprocesstype hasbeentriggeredsuccessfully.
14. Rightclickonthefileandchoose DownloadDocument. 15. Inthisdialog,chooseNo.Itis alreadyinzipformat,wedontneedto zipitagain. 16. Choosethefilepathtodownloadto, giveafilenamewitha.zipextension andclicktheSavebutton.
4 Appendix
4.1
4.1.1
ProcessTypeClassImplementations
SET_PC_TYPE
method IF_RSPC_TRANSPORT~GET_TLOGO. CALL METHOD SET_PC_TYPE. CALL METHOD CL_UJD_CUSTOM_TYPE=>IF_RSPC_TRANSPORT~GET_TLOGO EXPORTING I_VARIANT = I_VARIANT I_OBJVERS = I_OBJVERS IMPORTING E_TLOGO = E_TLOGO E_OBJNM = E_OBJNM. endmethod.
4.1.3
IF_RSPC_MAINTAIN~MAINTAIN
method IF_RSPC_MAINTAIN~MAINTAIN. CALL METHOD SET_PC_TYPE. CALL METHOD CL_UJD_CUSTOM_TYPE=>IF_RSPC_MAINTAIN~MAINTAIN EXPORTING I_VARIANT = I_VARIANT I_T_CHAIN = I_T_CHAIN I_DISPLAY_ONLY = I_DISPLAY_ONLY IMPORTING E_VARIANT = E_VARIANT E_VARIANT_TEXT = E_VARIANT_TEXT. endmethod.
4.1.4
IF_RSPC_MAINTAIN~GET_HEADER
method IF_RSPC_MAINTAIN~GET_HEADER. CALL METHOD SET_PC_TYPE. CALL METHOD CL_UJD_CUSTOM_TYPE=>IF_RSPC_MAINTAIN~GET_HEADER EXPORTING I_VARIANT = I_VARIANT I_OBJVERS = I_OBJVERS IMPORTING E_VARIANT_TEXT = E_VARIANT_TEXT E_S_CHANGED = E_S_CHANGED E_CONTREL = E_CONTREL E_CONTTIMESTMP = E_CONTTIMESTMP. endmethod. 4.1.5 IF_RSPC_GET_VARIANT~GET_VARIANT
method IF_RSPC_GET_VARIANT~GET_VARIANT. CALL METHOD CL_UJD_CUSTOM_TYPE=>IF_RSPC_GET_VARIANT~GET_VARIANT EXPORTING I_TYPE = I_TYPE I_VARIANT = I_VARIANT I_T_CHAIN = I_T_CHAIN I_T_SELECT = I_T_SELECT I_OBJVERS = I_OBJVERS IMPORTING E_VARIANT = E_VARIANT E_VARIANT_TEXT = E_VARIANT_TEXT. endmethod.
4.1.6
IF_RSPC_GET_VARIANT~WILDCARD_ENABLED
4.1.7
IF_RSPC_GET_VARIANT~EXISTS
4.1.8
IF_RSPC_EXECUTE~EXECUTE
METHOD if_rspc_execute~execute. DATA: lo_config lo_factory lo_actor lo_error l_uid lo_dir_zip TYPE TYPE TYPE TYPE TYPE TYPE REF TO cl_ujd_config, REF TO cl_ujd_task_factory, REF TO zcl_ujd_bpc_dirzip, REF TO cx_root , sysuuid_25, REF TO zcl_ujd_dirzip.
CALL FUNCTION 'RSSM_UNIQUE_ID' IMPORTING e_uni_idc25 = l_uid. e_instance = l_uid. TRY. CREATE OBJECT lo_config EXPORTING i_variant = i_variant i_type = 'ZBPCDIRZIP' i_jobcount = i_jobcount it_processlist = i_t_processlist i_logid = i_logid it_variables = i_t_variables. CALL METHOD lo_config->init. CALL METHOD cl_ujd_custom_type=>add_task_name_msg EXPORTING io_config = lo_config. CREATE OBJECT lo_factory. CREATE OBJECT lo_actor EXPORTING io_task_factory = lo_factory io_config = lo_config if_check_abort = abap_true. CALL METHOD lo_factory->init EXPORTING io_config = lo_config io_actor = lo_actor. lo_actor->if_ujd_actor~init( ). CREATE OBJECT lo_dir_zip EXPORTING io_config = lo_config. CALL METHOD lo_actor->if_ujd_actor~set_task EXPORTING io_task = lo_dir_zip. CALL METHOD lo_actor->if_ujd_actor~execute. CALL METHOD cl_ujd_custom_type=>reset_log. e_state = 'G'.
CATCH cx_root INTO lo_error. TRY. CALL METHOD cl_ujd_custom_type=>set_error_status EXPORTING io_config = lo_config. CALL METHOD cl_ujd_custom_type=>write_exception_log EXPORTING io_exception = lo_error. CATCH cx_root INTO lo_error. e_state = 'R'. ENDTRY. e_state = 'R'. ENDTRY. ENDMETHOD.
4.1.9
IF_RSPC_EXECUTE~GIVE_CHAIN
4.2
4.2.1
FunctionalClassImplementations
CONSTRUCTOR
METHOD constructor. DATA: lv_value TYPE ujd_runparam-value. do_config = io_config. do_context = cl_uj_context=>get_cur_context( ). do_config->if_ujd_config~get_parameter( EXPORTING i_parameter = 'SRC_DIR' IMPORTING e_parameter_value = lv_value ). d_src_dir = lv_value. do_config->if_ujd_config~get_parameter( EXPORTING i_parameter = 'TRG_FILE' IMPORTING e_parameter_value = lv_value ). d_trg_file = lv_value. ENDMETHOD.
4.2.2
IF_UJD_TASK~PROCESS
METHOD if_ujd_task~process. DATA: lo_file_service_mgr TYPE REF TO cl_ujf_file_service_mgr. DATA: lo_exception TYPE REF TO cx_static_check. DATA: lv_doc_content TYPE uj_doc_content. DATA: lt_doc_dir TYPE ujf_t_char255. FIELD-SYMBOLS: <ls_doc_dir> LIKE LINE OF lt_doc_dir. CLEAR et_message. CLEAR es_data. CLEAR ef_success. * Add the directory to the importing table APPEND INITIAL LINE TO lt_doc_dir ASSIGNING <ls_doc_dir>. <ls_doc_dir> = d_src_dir. TRY. * Create the file service object cl_ujf_file_service_mgr=>factory( EXPORTING is_user = do_context->ds_user i_appset = do_context->d_appset_id RECEIVING r_manager = lo_file_service_mgr ). * build zip file for the directory lo_file_service_mgr->get_zipped_document( EXPORTING it_doc_dir_table = lt_doc_dir i_incl_subdir_struct = abap_true IMPORTING e_doc_content = lv_doc_content ). * Create the new zip file based on the newly created content lo_file_service_mgr->put_document( EXPORTING i_docname = d_trg_file i_compression = abap_true i_splice_zip = abap_false i_doc_content = lv_doc_content ). * Set success ef_success = abap_true. CATCH cx_static_check INTO lo_exception. ef_success = abap_false. CALL FUNCTION 'UJ0_CONV_EX2MSG' EXPORTING io_exception = lo_exception IMPORTING et_message_lines = et_message. ENDTRY. ENDMETHOD.
4.3
4.3.1
DataManagerDynamicScripts
Script for Directory Zip
PROMPT(INFILES,%SOURCEFOLDER%,"Please enter a directory",) PROMPT(OUTFILE,%TARGETFILE%,"Please enter an output path and file name",) TASK(ZBPC_DIRZIP,SRC_DIR,%SOURCEFOLDER%) TASK(ZBPC_DIRZIP,TRG_FILE,%TARGETFILE%)