管理信息化SAP實(shí)施sap學(xué)習(xí)講義_第1頁(yè)
管理信息化SAP實(shí)施sap學(xué)習(xí)講義_第2頁(yè)
管理信息化SAP實(shí)施sap學(xué)習(xí)講義_第3頁(yè)
管理信息化SAP實(shí)施sap學(xué)習(xí)講義_第4頁(yè)
管理信息化SAP實(shí)施sap學(xué)習(xí)講義_第5頁(yè)
已閱讀5頁(yè),還剩19頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

管理信息化SAP實(shí)施sap學(xué)習(xí)講義Day2YourFirstABAP/4ProgramBeforeProceedingExploringtheDevelopmentEnvironmentDiscoveringProgramTypesoDefiningReportsoDefiningDialogProgramsDiscoveringReportComponentsoDiscoveringtheProgramRuntimeObjectoIntroducingProgramNamingConventionsCreatingYourFirstProgramExploringtheSourceCodeEditoroUsingtheEditor:InitialScreenoExploringtheFunctionalityoftheSourceCodeEditorGettingHelpoObtainingF1HelpoObtainingR3LibraryHelpFindingYourDevelopmentObjectsIntroducingtheR/3DataDictionaryoExploringTablesandStructuresoDisplayingaTableorStructureDefinitionoDisplayingDataintheTableoDeterminingDisplayedFieldsUnderstandingABAP/4SyntaxoIntroducingtheselectStatementoUnderstandingTableWorkAreasoIntroducingthewhereClauseoWorkingwithSystemVariablesoUsingtheChainOperatoroUsingtheselectsingleStatementoCommentingCodeandFormalDocumentationSummaryQ&AWorkshopoQuizoEditorExercisesoProgrammingExercisesAfteryoupletethischapter,youshouldbeableto:CreateandmodifysimpleABAP/4programs.UsestandardfunctionsintheABAP/4editor.UseF1andR/3Libraryhelpfunctions.FindyourprogramsusingtheObjectBrowserandtheeditor.DisplayatableanditscontentsusingtheDataDictionary.Usethetablesandselectstatements.Chainstatementstogetherusingthechainoperator.Addmentsanddocumentationtoyourprograms.BeforeProceedingBeforeproceeding,youshould:BefortablewithaprogramminglanguagesuchasC,COBOL,orVisualBasic.Toobtainthefullbenefitfromthisandallfollowingchapters,youshouldalsohavetwoormoreyearsofpreviousdevelopmentexperience.SetupyourinterfaceasremendedinDay1inthesection"TheInterfaceMenu,"ifyouhavenotdonesoalready.PerformtheinstallprocedurefortheScreenCamsontheCD-ROM.TheinstallprocedureisdescribedinthefilefoundintherootdirectoryoftheCD-ROM.ManyoftheproceduresinthisbookaredemonstratedusingScreenCams.ScreenCamsarelikemovies;theyshowaseriesofscreens,includingkeystrokesandmousemovements,withadescriptivevoiceover.TheycanbefoundontheCD-ROMthateswiththisbook.SeethefilefoundintherootdirectoryoftheCD-ROMformoreinformation.ExploringtheDevelopmentEnvironmentAdevelopmentobjectisanythingcreatedbyadeveloper.Examplesofdevelopmentobjectsareprograms,screens,tables,views,structures,datamodels,messages,andincludes.TheR/3systemcontainstoolsforcreatingandtestingdevelopmentobjects.ThesetoolsarelocatedintheR/3DevelopmentWorkbench.Toaccessanydevelopmenttool,yougototheworkbench.Theworkbenchcontainsthesetoolstohelpyoucreatedevelopmentobjects:TheABAP/4programeditorwhereyoucancreateandmodifyABAP/4sourcecodeandotherprogramponentsTheDataDictionarywhereyoucancreatetables,structures,andviewsTheDatamodelerwhereyoucandocumenttherelationshipsbetweentablesTheFunctionlibrarywhereyoucancreateglobalABAP/4functionmodulesThescreenandmenupainterswhereyoucancreateauserinterfaceforyourprogramsThefollowingtestingandsearchtoolsarealsoavailable:theABAP/4DebuggertheSQLtracetoolusedtotuneSQLstatementstheruntimeanalyzerforoptimizingyourprogram'sperformanceawhere-usedtoolforimpactanalysisaputer-aidedtesttoolforregressiontestingarepositorysearchtoolforfindingdevelopmentobjectstheWorkbenchOrganizerforrecordingchangestoobjectsandpromotingthemintoproductionAlldevelopmentobjectsareportable,meaningthatyoucancopythemfromoneR/3systemtoanother.Thisisusuallydonetomoveyourdevelopmentobjectsfromthedevelopmentsystemtotheproductionsystem.Ifthesourceandtargetsystemsareondifferentoperatingsystemsorusedifferentdatabasesystems,yourdevelopmentobjectswillrunas-isandwithoutanymodification.ThisistrueforallplatformssupportedbyR/3.(Foralistofsupportedhardwareandoperatingsystems,refertoTable1.1.)DiscoveringProgramTypesTherearetwomaintypesofABAP/4programs:reportsdialogprogramsDefiningReportsThepurposeofareportistoreaddatafromthedatabaseandwriteitout.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,andsoaremoreplexattheprogramlevel.Theycancontainanynumberofscreens,andthescreensequencecanbechangeddynamicallyatruntime.Oneachscreen,youcanhaveinputfields,outputfields,pushbuttons,andmorethanonescrollablearea.DiscoveringReportComponentsABAP/4reportsconsistoffiveponents(showninFigure2.2):Figure2.2.TheponentsofanABAP/4program.SourcecodeAttributesTextelementsDocumentationVariantsOnlythesourcecodeandprogramattributeponentsarerequired.Therestoftheponentsareoptional.AlldevelopmentobjectsandtheirponentsarestoredintheR/3database.Forexample,thesourcecodeforareportisstoredindatabasetabledd010s.DiscoveringtheProgramRuntimeObjectABAP/4programsareinterpreted;theyarenotpiled.Thefirsttimeyouexecuteaprogram,thesystemautomaticallygeneratesaruntimeobject.Theruntimeobjectisapre-processedformofthesourcecode.However,itisnotanexecutablethatyoucanrunattheoperatingsystemlevel.Instead,itrequirestheR/3systemtointerpretit.Theruntimeobjectisalsoknownasthegeneratedformoftheprogram.Ifyouchangethesourcecode,theruntimeobjectisautomaticallyregeneratedthenexttimeyouexecutetheprogram.IntroducingProgramNamingConventionsThepanyyouworkforisacustomerofSAP.Therefore,programsthatyoucreateatyourpanyarecalledcustomerprograms.CustomerdevelopmentobjectsmustfollownamingconventionsthatarepredefinedbySAP.Theseconventionsarecalledthecustomernamerange.Forprograms,thecustomernamerangeistwotoeightcharacterslongandtheprogramnamemuststartwiththeletteryorz.SAPreservesthelettersathroughxfortheirownprograms.Pleasetakeamomentnowtochooseaunique3-characteridentifierforyourprograms.Withinthisbook,I'llrefertothisidentifierasyourhandle.Itmustbeginwithayorz.Forexample,youmightusetheletterzfollowedbyyourtwoinitials.Thenotationwillindicatewhereyoushoulduseyourhandle.Forexample,ifyouchosezkgandyouseethedirection"Enteraprogramnameofabc,"youwouldenterzkgabc.Iremendthatasyougothroughthisbook,youshoulduseyourhandleasthefirstthreecharactersofalldevelopmentobjectsyoucreate.Ifyoudo,theywillbeeasytorecognizelater,andeasytofind.Theprogramnamingconventionsadoptedforthisbookareasfollows:Sampleprogramsfromthetextofchaptersfollowtheconventionztxccnn,whereccisthechapternumberandnnisasequentialnumberfrom01to99.Programnamesusedinexercisesfollowtheconventionztyccnn,whereccisthechapternumberandnnisasequentialnumber.Theprogramnameforthesolutionwillbeztzccnn.UtilityprogramsprovidedontheCD-ROMfollowthenamingconventiony-xxxxxx,wherexxxxxxisthenameoftheutility.Thesetupprogramthatcreatesdevelopmentobjectsandloadsthemwithdatafortheexercisesiscalledy-setup.Ifnecessary,itcanbere-runatanytimetorestoretheexercisedatatoitsoriginalcondition.Toremoveallthedevelopmentobjectsanddatacreatedbythesetupprogramfromthesystem,runy-uninst.SeethefileontheCD-ROMformoreinformation.CreatingYourFirstProgramWhatfollowsisadescriptionoftheprocessyouwillfollowtocreateaprogram.WhenyousignontoR/3tocreateyourfirstABAP/4program,thefirstscreenyouseewillbetheSAPmainmenu.Fromthere,youwillgototheDevelopmentWorkbench,andthentotheeditor.Youwillenteraprogramname,andcreatetheprogram.ThefirstscreenyouwillseewillbetheProgramAttributesscreen.There,youmustentertheprogramattributesandsavethem.Youwillthenbeallowedtoproceedtothesourcecodeeditor.Inthesourcecodeeditor,you'llentersourcecode,saveit,andthenexecutetheprogram.StarttheScreenCam"HowtoCreateYourFirstProgram"now.Followthisproceduretocreateyourfirstprogram.HelpwithmonproblemsisgivenintheTroubleshooterthatfollowsit.Ifyouhavetroublewithanyoneofthesteps,don'tforgettoconsulttheTroubleshooter.1.FromtheR/3mainmenu,selectthemenupathTools->ABAP/4Workbench.AscreenwiththetitleABAP/4DevelopmentWorkbenchisdisplayed.2.PresstheABAP/4Editorbuttonontheapplicationtoolbar.TheABAP/4Editor:InitialScreenisdisplayed.3.IntheProgramfield,typetheprogramname0201.4.PresstheCreatebutton.TheABAP/4:ProgramAttributesscreenisdisplayed.Thefiel

dscontainingquestionmarksarerequired.5.TypeMyFirstABAP/4ProgramintheTitlefield.Bydefault,thecontentsofthisfieldw

illappearatthetopofthelist.6.Type1intheTypefield.A1indicatestheprogramisareport.7.Typeanasterisk(*)intheApplicationfield.ThevalueintheApplicationfieldindic

atestowhichapplicationareathisprogrambelongs.Thepletelistofvaluescanbeobtainedb

ypositioningyourcursoronthisfieldandthenclickingonthedown-arrowtotherightofit.F

orexample,ifthisprogrambelongstoInventorymanagement,youwouldputanLintheApplicat

ionfield.Sincethisisasimpletestprogram,Ihaveusedanasterisktoindicatethatthispro

gramdoesnotbelongtoanyparticularapplicationarea.8.TickmarktheEditorLockcheckbox.EnablingEditorlockwillpreventchangestothepr

ogrambyanyoneotherthanthecreator.Foryourexercises,tickmarkthisboxtosafeguardyou

rprogramsfromaccidentalmodificationbyothers.However,youshouldnotusethistolockac

tualdevelopmentprograms.Itwillpreventotherprogrammersfrommaintainingthemlater.9.Tosavetheprogramattributes,presstheSavebuttonontheStandardtoolbar.TheCrea

teObjectCatalogEntryscreenisdisplayed.10.PresstheLocalObjectbutton.Theprogramattributesscreenisredisplayed.Inthest

atusbaratthebottomofthescreen,themessage"Attributesforprogramsaved"appears.(Not

e:themessageyouseewillcontaintheprogramnametoo,butsincethisnamewillvaryforeachu

ser,itisleftoutofthetextinthebook.Thisconventionofleavingthedevelopmentobjectna

meoutofthemessagewillbecarriedthroughoutthebook.)11.PresstheSourceCodebuttonontheapplicationtoolbar.TheABAP/4Editor:EditProgr

amscreenisdisplayed.12.ChoosethemenupathSettings->EditorMode.TheEditor:Settingsscreenisdisplayed.13.ChoosetheradiobuttonPCModeWithLineNumbering.14.ChoosetheradiobuttonLowerCase.15.PresstheCopybutton(thegreencheckmark).Youhavenowsavedyoureditorsettings.(Editorsettingsonlyneedtobesetonce.)16.Lookatline1.Ifitdoesnotcontainthestatementreport0201.,typeitnow,asshowninListing2.1.17.Online2,typewrite'HelloSAPworld'.Usesinglequotesandputaperiodattheendoftheline.18.PresstheSavebuttonontheStandardtoolbar.19.Toexecuteyourprogram,choosethemenupathProgram->Execute.AscreenwiththetitleMyFirstABAP/4Programisdisplayed,andthewordsHelloSAPworldarewrittenbelowit.Thisistheoutputofthereport,alsoknownasthelist.Listing2.1YourFirstABAP/4Program1reportztx0201.2write'HelloSAPWorld'.ThecodeinListing2.1producesthisoutput:HelloSAPWorldCongratulations,youhavejustwrittenyourfirstABAP/4program!Toreturntotheeditor,pressthegreenarrowbuttononthestandardtoolbar(ortheF3key).ThesearetheCommonProblemsEncounteredWhileCreatingaProgramandTheirSolutionsSolutionObjectsintheSAPNameRange.Youhaveenteredthewrongprogramname.Yourprogramnamesmuststartwithyorz.PresstheCancskingforakey.Youhaveenteredthewrongprogramname.Yourprogramnamesmuststartwithyorz.PresstheCanc.OntheCreateObjectCatalogEntryscreen,donotenteravalueintheDevelopmentclassfield.PresstheLocalObjectbuttoninstead.ExploringtheSourceCodeEditorInthissectionyouwilllearnhowtoharnessthepoweroftheABAP/4editor.Youwilllearntousetwoscreensinthissection:ABAP/4Editor:InitialScreenABAP/4Editor:EditProgramscreenUsingtheEditor:InitialScreenTheABAP/4Editor:InitialScreenisshowninFigure2.3.Fromthere,youcandisplayorchangeallprogramponents.Forexample,tochangethesourcecodeponent,choosetheSourceCoderadiobuttonandthenpresstheChangebutton.Or,todisplaytheattributesponent,choosetheAttributesradiobuttonandthenpresstheDisplaybutton.Figure2.3.FromtheABAP/4Editor:InitialScreenyoucandisplayorchangeprogram-ponents.hangebutton.Whenyouseeagroupboxenclosingbothradiobuttonsandpushbuttons,theradiobuttonsdeter-minetheponentacteduponPressingtheChangebuttondisplaystheselectedponentinchangemode,whichenablesyoutochangetheponent.ExploringtheFunctionalityoftheSourceCodeEditorFromtheABAP/4Editor:InitialScreen,choosetheSourceCoderadiobuttonandpresstheChangebutton.TheABAP/4Editor:EditProgramscreenisshown,asinFigure2.4.Figure2.4.UsetheABAP/4Editor:EditProgramscreentochange-ponentunctionality.hodicalapproachthatenablesyoutobeefortablewitheachnewscreen.Wheneveryoueacrossanewscreen,slowlyscanthemenuitemsandrwiththefunctionsavailable.ExploringtheStandardToolbarStarttheScreenCam"ExploringtheStandardToolbar"now.TheStandardtoolbarcontrolsareshowninFigure2.5.Figure2.5.ThesearethecontrolsontheStandardtool-barwithintheABAP/4editor.TheStandardtoolbarcontrols(refertoFigure2.3),inorder,are:Enter:PressingtheEnterbuttonhasthesameeffectaspressingtheEnterkey.Itisalsothesplitlinefunction.Tosplitalineofcode,positionthecursoratthepointwhereyouwanttosplitthelineandpressEnter.CommandField:Thisacceptstransactioncodesandvariousothermands.BackandExit:BothreturnyoutotheABAP/4Editor:InitialScreen.Ifyouhaveunsavedchanges,youwillbepromptedtosavethem.Cancel:ReturnsyoutotheABAP/4Editor:InitialScreenwithoutsavingyourchanges.Ifyouhaveunsavedchanges,youwillbepromptedtosavethem.Print:Thiswillprintthesourcecodeofyourprogram.Whenyoupressit,thePrintParametersscreenisdisplayed.Toreceiveyouroutput,besurethatthePrintImmed.checkboxischecked.Find:Providessearchandreplacefunctionality.Whenyoupressit,theSearch/Replacescreenisshown.Amoredetailedexplanationfollowsbelow.FindNext:Thisisahandyshortcutforfindingthenextoccurrenceofastring.FirstPage,PreviousPage,NextPage,andLastPage:Theseenableyoutopageupanddownthroughthesourcecode.Help:DisplaysadialogboxfromwhichyoucanobtainhelpabouttheeditorandABAP/4syntax,amongotherthings.PositionyourcursoronanABAP/4keywordorablanklinebeforepressingtheHelpbutton.Formoreinformation,seethesectiontitled"GettingHelp"laterinthischapter.DON'Tdfield.Otherwise,youwillloseyourchanges.DON'TclosetheeditorwindowbypressingtheXbuttoninthetopright-handcorneUsingFindandReplaceStarttheScreenCam"UsingFindandReplace"now.PresstheFindbuttonontheStandardtoolbarandthesystemwilldisplaytheSearch/Replacescreen(seeFigure2.6).EnterthestringyouwanttofindintotheFindfield.Figure2.6.ThisistheSearch/Replacescreen.Itenablesyoutofindandchangecharacterstringsinyourprogram.Thereareseveraloptionsonthisscreentocontrolthefindprocess:AsaStringwillcauseyourstringtobefoundanywhereintheprogram.AsaWordwillfinditonlyifblanksorpunctuationsurrounditoneithersidewithinthesourcecode.Upper/LowerCasewillmakethesearchcase-sensitive.TheFindfieldhassomeunusualqualities:Tosearchforastringthatcontainsembeddedblanks,simplytypethestringalongwiththeblanksintotheFindfield.Donotenclosethestringinquotes.Ifyoudo,thequoteswillbeconsideredpartofthesearchstring.Toperformawildcardsearch,usethecharacters+and*.+willmatchanysinglecharacter,and*willmatchanystringofcharacters.However,*canonlybeusedasawildcardatthebeginningorendofastring;withinthebodyofastringitdoesnotactasawildcard.Forexample,thesearchstringwo+dwillfindwordorwood;thestringj++nwillmatchjohnorjoan,butnotjan.*anwillfindian,joan,orevenan.Since*embeddedwithinastringdoesn'tactasawildcard,tofindthestringselect*from,typeexactlyselect*from.Noticethatastringhaving*atthebeginningorendproducesthesameresultsasthesamestringwithoutthe*;the*wildcardthereforeisnotparticularlyuseful.-.,:;arespecialcharacters.Ifyourstringstartswithanyofthesecharacters,youmustencloseitwithindelimiters.Youcanchooseanyofthesesamecharactersforadelimiteraslongasitdoesnotappearwithinyoursearchstring.Forexample,:hhbeginswithaspecialcharacter.Tofindthisstring,enter-:hh-or.:hh.or,:hh,or;:hh;.Thecharacter#isalsospecial.Tofindastringcontaining#anywherewithinit,youmustsubstitute##foreach#thatoccursinthestring.Forexample,tofindthestringa#b,usethesearchstringa##b.StarttheScreenCam"SettingtheScopeofaSearchorReplaceFunction"now.Tosetthescopeforasearchorreplacefunction,followthesesteps:1.OntheSearch/Replacescreen,typethestringyouwanttofindintheFindfield.2.ChoosetheInCurrentSourceCoderadiobutton.3.ChoosetheFmCursorradiobuttontobeginthesearchatthecurrentcursorlocation.Alternatively,youcanchoosetheFromLineradiobuttonandenterstartingandendinglinenumbersforthesearch.4.PresstheContinuebutton.Thecursorisplacedtotheleftofthefirstmatchingstring.5.PresstheFindnextbuttontolocatethenextmatchingstring.StarttheScreenCam"HowtoFindAllOccurrencesofaString"now.Tofindalloccurrencesofastring:1.OntheSearch/Replacescreen,typethestringyouwanttofindintheFindfield.2.ChoosetheInProgramradiobutton.3.PresstheContinuebutton.AsummaryoftheoccurrencesfoundisdisplayedontheGlobalSearchInProgramsscreen.4.Double-clickonalinetoseeitinthecontextofthesourcecode.5.PresstheBackbuttontoreturntotheGlobalSearchInProgramsscreen.6.PresstheBackbuttononcemoretoreturntothesourcecodeeditor.StarttheScreenCam"HowtoSearchandReplaceintheSourceCode"now.Tosearchandreplaceinthesourcecode:1.OntheSearch/Replacescreen,typethestringyouwanttofindintheFindfield.2.TickmarkReplaceByandenterareplacementstringintheReplacebyfield.3.PresstheContinuebutton.TheABAP/4Editor:EditProgramscreenisdisplayedwiththecursorpositionedtotheleftofthenextmatchingstring.4.Toreplaceit,presstheReplacebutton.Thestringatthecursorlocationisreplacedandthecursorispositionedatthenextmatchingstring.5.Togotothenextpositionwithoutreplacing,presstheNextHitbutton.Thecursorispositionedatthenextmatchingstring.6.Toreplaceallremainingmatchesfromthecurrentcursorpositiontotheendofthesourcecode,presstheNoConfirmationbutton.StarttheScreenCam"HowtoSearchandReplaceViaaSummaryScreen"now.Tosearchandreplaceviaasummaryscreen:1.OntheSearch/Replacescreen,typethestringyouwanttofindintheFindfield.2.TickmarkReplaceByandenterareplacementstringintheReplacebyfield.3.ChoosetheInProgramradiobutton.4.PresstheContinuebutton.TheGlobalReplaceInProgramsscreenisdisplayedwiththecursorpositionedonthefirstmatchingstring.Alllinescontainingmatchingstringsaredisplayedandthematchingstringsarehighlighted.5.Toreplacethestringatthecursorposition,presstheReplacebutton.Thestringatthecursorlocationisreplacedandthecursorispositionedatthenextmatchingstring.6.Togotothenextpositionwithoutreplacing,presstheNextHitbutton.Thecursorispositionedatthenextmatchingstring.7.Toreplaceallremainingmatchesfromthecurrentcursorpositiontotheendofthesourcecode,presstheNoConfirmationbutton.Ifyoureplacedanystrings,youmustsaveyourchangesbeforereturningtothesourcecodeeditor.Todoso,presstheSavebuttonintheStandardtoolbar,andthenpresstheBackbutton.Ifyouwanttocancelyourchanges,presstheCancelbuttoninsteadoftheSavebutton.ExploringtheApplicationToolbarStarttheScreenCam"ExploringtheApplicationToolbaroftheABAP/4Editor"now.Beforeproceeding,maximizeyourwindow(ifitisnotalready).YoumaynotseethebuttonsatthefarrightoftheApplicationtoolbarifyourwindowissmallerthanthemaximumsize.TheApplicationtoolbarcontrolsareshowninFigure2.7.Figure2.7.TheApplicationtoolbarcontrols.TheApplicationtoolbarcontrols,intheordertheyappearonthetoolbar,areasfollows:Display<->Change:Changesthescreenfromdisplaymodetochangemode.Pressitagaintochangeitbacktodisplaymode.Check:Checksthesyntaxofthecurrentprogram.Where-UsedList:Whenyoupressthisbuttonwhileyourcursorisonanyvariablename,itwilldisplayallthelinesofcodethatuseit.Stack:Displaysthecontentsofthecurrentnavigationstack.Cut:Deletesthelinecontainingthecursorandplacesitinthebuffer.CopyToBuffer:Copiesthecontentsofthelinecontainingthecursortothebuffer.InsertFromBuffer:Insertsthecontentsofthebuffertoanewlineabovethecurrentcursorposition.InsertLine:Insertsablanklineabovethecurrentcursorposition.Select:Selectsasinglelineorablockoflinesformoving,cutting,andpasting.PlaceyourcursoronthefirstlineoftheblockandpressSelect.PlaceyourcursoronthelastlineoftheblockandpressSelectagain.Thelinescontainedintheblockwillturnred.Youcannowcut,copy,orduplicatetheblockofcodethesamewayyoudidforasingleline.Todeselecttheselectedlines,choosethemenupathEdit->Deselect.Undo:Reversesyourlastchange.Onlyonelevelofundoisavailable.ABAP/4Help:ProvideshelpabouttheeditorandaboutABAP/4ingeneral.Pattern:EnablesyoutoinsertanautomaticallygeneratedABAP/4statement.Forexample,toinsertawritestatementthatwritesoutthecontentsofavariablenamedv1,pressthePatternbutton,choosetheWriteradiobutton,presstheContinuebutton,enterthevariablenameintheFldfield,andthenpresstheCopybutton.Awritestatementwillbeinsertedatthecurrentcursorposition.Concatenate:Joinstwolinestogether.Touseit,placeyourcursorattheendofalineandpresstheConcatenatebuttontoconcatenatethenextonetoit.Tosplitaline,positionyourcursorwhereyouwantthesplittooccurandpresstheEnterkey.DuplicateLine:Duplicatesasinglelineoranentireblockofcodeifoneisselected(refertotheSelectbutton,above).MoveLine:Moveslinesleftandright.Tomovealine,putyourcursoratthetargetpositionandpresstheMoveLinebutton.Tomoveawholeblockofcode,marktheblockandplaceyourcursoronthefirstlineoftheblockatthepositiontowhichitshouldbemoved,andthenpresstheMoveLinebutton.Tomoveittotheleft,placeyourcursortotheleftofthebeginningofthelineandpresstheMoveLinebutton.MarkLine:Placesabookmarkonaline.YoucandisplayallmarkedlineswiththemenupathGoto->Markers.UsingCutandPasteclickbetweenwordsorattheendoftheline.Don'tdouble-clickonawordthough;thatwon'twork.AnalternativemethodistoplaceyourInmostWindowsapplications,thereisoneClipboardforcutandpasteoperations.InR/3,therearefiveclipboards.Table2.1describesthemall.Table2.1CutandPasteBuffersHowtoCopytoItHowtoPastefromItPresstheCutorCopybuttonsintheeditorPresstheInsertFromBufferbuttonMenupath:Block/Buffer->CopytoXBufferMenupath:Block/Buffer->InsertXBufferMenupath:Block/Buffer->CopytoClipboardMenupath:Block/Buffer->InsertfromClipboardtoinserttheClipboardcontentsasnprogramatthecursorposition.OrCtrl+Vtopasteovertopoftheexistinglines.WithCen.1-Clickonce2-Ctrl+Y3-Dragandmark4-Ctrl+CInthefirstrowofTable2.2isprogram-specificbuffer,simplycalledthebuffer.Itletsyoucopywithinaprogram.Touseit,placeyourcursoronalineormarkablockandpresstheCut,Copy,orInsertFromBufferbuttons.Thebuffer'scontentsarelostwhenyouleavetheeditor.TheX,Y,andZbuffersareusedtocopycodefromoneprogramtoanother.UsetheBlock/Buffermenutoaccessthem.Althoughtheyarethreeseparatebuffers,theyareallusedinthesameway.Theircontentsareretainedafteryouleavetheeditor,buttheyarelostwhenyoulogoff.TheClipboardisthesameastheWindowsClipboard.UseittocutandpasteintootherWindowsapplicationssuchasMSWordorNotepad.ItisalsousedtocopytextfromF1helpscreens(seethefollowingsectiontitled"GettingHelp").InadditiontothebuttonsontheApplicationtoolbarandthemenus,youcanusestandardWindowsfunctionstoperformcutandpasteoperations.Tohighlightawordorline,dragyourcursoracrossit,orholddowntheShiftkeyandtaptheleftorrightarrowkeys(youcanonlyhighlightonelineatatimeusingthismethod).Tohighlightmultiplelines,clickonceonthescreenwiththemouseandthenpressCtrl+Y.Thepointerwillchangetocrosshairs.Dragthecrosshairstohighlightthesectionyouwanttocopy.PressCtrl+CtocopythehighlightedtexttotheClipboard,orpressCtrl+Xtocut.PastefromtheClipboardusingCtrl+V.UsingOtherConvenientEditorFunctionsTable2.2containsasummaryofmonlyusededitorfunctions.AllfunctionsareaccessedfromtheABAP/4Editor:EditProgramscreenunlessotherwisenoted.Table2.2OtherConvenientProgramandEditorFunctions.ThenplaceitonthelastlineoftheblockandpressF9again.button.soratthepointwherethecodeshouldbeinserted,andpresstheInsertFromBufferbutton.penanewprogramandchoosethemenupathBlock/Buffer->InsertXbuffer.(YoucanalsousetheYandZbuffersthesameway.)d.ThenchoosethemenupathBlock/Buffer->Insertclipboard.t.moved,inthecolumnyouwanttomoveitto.ThenpresstheMoveLinebutton(F6).Tomoveablock,positionyourcursoronthefirstlineandpyisdeletedwhenyousavetheprogram.hesavedcopyanynumberoftimesuntilyousavetheprogram.m->Copy.m->Rename.m->Delete.>Createnewsession.Inthenewwindow,gototheABAP/4Editor:InitialScreen,enterthesecondprogramname,andpresstheDisplayorCies->Splitscreeneditor.EntertwoprogramnamesandpresstheDisplaybutton.Todisplaythefirstdifference,presstheNextDifferies->Splitscreeneditor.PresstheCompareDiff.Systemsbutton.EntertwoprogramnamesandasystemidandpresstheDisplaybutton.sion.Thecurrentprogramissavedintheversiondatabase.rsionmanagement.TheVersionsOfObjectOfTypeREPSscreenisdisplayed.Deselecttheactiveversionandtickmarktheversiontoresttversion.rsionmanagement.TheVersionsOfObjectOfTypeREPSscreenisdisplayed.TickmarktheversionsyouwanttopareandpresstheComparebrinterandtickmarkthePrintImmed.checkbox.GettingHelpStarttheScreenCam"GettingHelp"now.Forapletetutorialontheeditor:1.GototheABAP/4Editor:EditProgramscreen.2.ChoosethemenupathHelp->ExtendedHelp.TheSAPR/3Helpscreenisdisplayed.3.ClickonthetextABAP/4Editor.TheBCABAP/4DevelopmentWorkbenchToolsscreenisdisplayed.4.Clickonanyunderlinedtextforhelponthattopic.Therearetwobasictypesofhelpintheeditor,F1helpandR/3Libraryhelp.F1helpisalsoknownastheABAP/4keyworddocumentation.F1helpdescribesthesyntaxofABAP/4keywordsandgivesexamplesoftheiruse.Itistext-basedandresidesintableswithintheR/3database.R/3Libraryhelpisfarmoreextensiveandcontainsoverviewsofandproceduresforcreatingdevelopmentobjects.ItisWindows-basedhelpandresidesoutsideoftheR/3database,usuallyonaCD-ROM.ObtainingF1HelpF1helpisusefulforlookingupsyntaxandoftencontainsusefulcodesamples.ToobtainF1help:1.GototheABAP/4Editor:EditProgramscreen.2.PlaceyourcursorontheABAP/4keywordyouwanthelpfor.3.PressF1.TheDisplayHypertextscreenisdisplayed.WithinF1help,highlightedwordsarehypertextlinks.Clickingonthemtakesyoutomoreinformation.TIPYoucanusetheFindItutilityontheCD-ROMtofindevenmorecodesamples.Withinthehelpthereareoftencodesamples.Tocutandpastethemintoyourprogram,pressCtrl+Y,andthenmarkablockofcodebydraggingyourcursoracrossitfromthetopleft-handcornertothebottomright-handcorner.LetgoofthemouseandpressCtrl+C.PresstheBackbuttontoreturntotheABAP/4Editor:EditProgramscreenandpasteintoyourprogramusingBlock/Buffer->InsertClipboard.OryoucanpasteovertopofyourcodeusingCtrl+V.(Ctrl+Vdoesn'tpasteintothesource,itpastesontothescreen,soitwon'tpastepastthebottomofthevisiblepage.)ObtainingR3LibraryHelpR/3LibraryhelpisstoredinWindowshelpfiles.Toviewit:1.Fromanyscreen,choosethemenupathHelp->R/3Library.TheR/3SystemOnlineHelpscreenisdisplayed.2.ForhelponABAP/4,clickonthetextBasisComponents.TheBasisscreenisdisplayed.3.ClickonthetextABAP/4DevelopmentWorkbench.TheABAP/4DevelopmentWorkbenchscreenisdisplayed.4.FromhereyoucangetdetailedhelponalmostanyaspectofprogramminginABAP/4.Clickon

thetopicthatyouwanthelpfor.Additionally,helpcanbeobtainedfromtheABAP/4Editor:InitialScreen.Toviewit:1.GototheABAP/4Editor:InitialScreen.2.ChoosethemenupathUtilities->ABAP/4keyworddoc.TheDisplayStructure:ABAP/4-SAP

's4GLProgramLanguagescreenisdisplayed.3.PresstheFindbuttonontheApplicationtoolbar.TheSearchTitlesscreenisdisplayed.4.TypethetextyouwanttofindintheFindfield.5.PresstheContinuebutton.Thefirstlinecontainingthattextishighlighted.6.Double-clickonthehighlightedlinetodisplaymoreinformation,orpresstheContinueSearchbuttonontheStandardtoolbartolocatethenextoccurrence.Helpcanalsobeobtainedfromwithintheeditorwhileyouareeditingthesourcecode.ChoosethemenupathUtil

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論