sap学习资料

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

38Day2YourFirstABAP/4ProgramBeforeProceedingExploringtheDevelopmentEnvironmentDiscoveringProgramTypesoDefiningReportsoDefiningDialogProgramsDiscoveringReportComponentsoDiscoveringtheProgramRuntimeObjectoIntroducingProgramNamingConventionsCreatingYourFirstProgramExploringtheSourceCodeEditoroUsingtheEditor:InitialScreenoExploringtheFunctionalityoftheSourceCodeEditorGettingHelpoObtainingF1HelpoObtainingR3LibraryHelpFindingYourDevelopmentObjectsIntroducingtheR/3DataDictionaryoExploringTablesandStructuresoDisplayingaTableorStructureDefinitionoDisplayingDataintheTableoDeterminingDisplayedFieldsUnderstandingABAP/4SyntaxoIntroducingtheselectStatementoUnderstandingTableWorkAreasoIntroducingthewhereClauseoWorkingwithSystemVariablesoUsingtheChainOperatoroUsingtheselectsingleStatementoCommentingCodeandFormalDocumentationSummaryQ&AWorkshopoQuizoEditorExercisesoProgrammingExercisesAfteryoucompletethischapter,youshouldbeableto:CreateandmodifysimpleABAP/4programs.UsestandardfunctionsintheABAP/4editor.UseF1andR/3Libraryhelpfunctions.FindyourprogramsusingtheObjectBrowserandtheeditor.DisplayatableanditscontentsusingtheDataDictionary.39Usethetablesandselectstatements.Chainstatementstogetherusingthechainoperator.Addcommentsanddocumentationtoyourprograms.BeforeProceedingBeforeproceeding,youshould:BecomfortablewithaprogramminglanguagesuchasC,COBOL,orVisualBasic.Toobtainthefullbenefitfromthisandallfollowingchapters,youshouldalsohavetwoormoreyearsofpreviousdevelopmentexperience.SetupyourinterfaceasrecommendedinDay1inthesectionTheInterfaceMenu,ifyouhavenotdonesoalready.PerformtheinstallprocedurefortheScreenCamsontheCD-ROM.Theinstallprocedureisdescribedinthereadme.txtfilefoundintherootdirectoryoftheCD-ROM.ManyoftheproceduresinthisbookaredemonstratedusingScreenCams.ScreenCamsarelikemovies;theyshowaseriesofscreens,includingkeystrokesandmousemovements,withadescriptivevoiceover.TheycanbefoundontheCD-ROMthatcomeswiththisbook.Seethereadme.txtfilefoundintherootdirectoryoftheCD-ROMformoreinformation.ExploringtheDevelopmentEnvironmentAdevelopmentobjectisanythingcreatedbyadeveloper.Examplesofdevelopmentobjectsareprograms,screens,tables,views,structures,datamodels,messages,andincludes.TheR/3systemcontainstoolsforcreatingandtestingdevelopmentobjects.ThesetoolsarelocatedintheR/3DevelopmentWorkbench.Toaccessanydevelopmenttool,yougototheworkbench.Theworkbenchcontainsthesetoolstohelpyoucreatedevelopmentobjects:TheABAP/4programeditorwhereyoucancreateandmodifyABAP/4sourcecodeandotherprogramcomponentsTheDataDictionarywhereyoucancreatetables,structures,andviewsTheDatamodelerwhereyoucandocumenttherelationshipsbetweentablesTheFunctionlibrarywhereyoucancreateglobalABAP/4functionmodulesThescreenandmenupainterswhereyoucancreateauserinterfaceforyourprogramsThefollowingtestingandsearchtoolsarealsoavailable:theABAP/4DebuggertheSQLtracetoolusedtotuneSQLstatementstheruntimeanalyzerforoptimizingyourprogram'sperformanceawhere-usedtoolforimpactanalysisacomputer-aidedtesttoolforregressiontesting40arepositorysearchtoolforfindingdevelopmentobjectstheWorkbenchOrganizerforrecordingchangestoobjectsandpromotingthemintoproductionAlldevelopmentobjectsareportable,meaningthatyoucancopythemfromoneR/3systemtoanother.Thisisusuallydonetomoveyourdevelopmentobjectsfromthedevelopmentsystemtotheproductionsystem.Ifthesourceandtargetsystemsareondifferentoperatingsystemsorusedifferentdatabasesystems,yourdevelopmentobjectswillrunas-isandwithoutanymodification.ThisistrueforallplatformssupportedbyR/3.(Foralistofsupportedhardwareandoperatingsystems,refertoTable1.1.)DiscoveringProgramTypesTherearetwomaintypesofABAP/4programs:reportsdialogprogramsDefiningReportsThepurposeofareportistoreaddatafromthedatabaseandwriteitout.Itconsistsofonlytwoscreens(seeFigure2.1).Figure2.1:Theselectionscreenandtheoutputscreen.Thefirstscreeniscalledtheselectionscreen.Itcontainsinputfieldsallowingtheusertoentercriteriaforthereport.Forexample,thereportmayproducealistofsalesforagivendaterange,sothedaterangeinputfieldswouldappearonthereport'sselectionscreen.Thesecondscreenistheoutputscreen.Itcontainsthelist.Thelististheoutputfromthereport,andusuallydoesnothaveanyinputfields.Inourexample,itwouldcontainalistofthesalesthatoccurredwithinthespecifieddaterange.Theselectionscreenisoptional.Notallreportshaveone.However,allreportsgeneratealist.Inthisbook,youwilllearnhowtocreatereportprograms.DefiningDialogProgramsDialogprogramsaremoreflexiblethanreports,andsoaremorecomplexattheprogramlevel.Theycancontainanynumberofscreens,andthescreensequencecanbechangeddynamicallyatruntime.Oneachscreen,youcanhaveinputfields,outputfields,pushbuttons,andmorethanonescrollablearea.DiscoveringReportComponentsABAP/4reportsconsistoffivecomponents(showninFigure2.2):41Figure2.2.ThecomponentsofanABAP/4program.SourcecodeAttributesTextelementsDocumentationVariantsOnlythesourcecodeandprogramattributecomponentsarerequired.Therestofthecomponentsareoptional.AlldevelopmentobjectsandtheircomponentsarestoredintheR/3dat

1 / 27
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功