ebook img

Web Dynpro ABAP for Practitioners PDF

479 Pages·2013·29.36 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Web Dynpro ABAP for Practitioners

Ulrich Gellert Ana Daniela Cristea Web Dynpro ABAP for Practitioners Second Edition Web Dynpro ABAP for Practitioners ThiSisaFMBlankPage Ulrich Gellert (cid:129) Ana Daniela Cristea Web Dynpro ABAP for Practitioners Second Edition UlrichGellert AnaDanielaCristea c/oS+PLIONAG c/oCellentAG Heddesheim,Germany Karlsruhe,Germany ISBN978-3-642-38246-8 ISBN978-3-642-38247-5(eBook) DOI10.1007/978-3-642-38247-5 SpringerHeidelbergNewYorkDordrechtLondon LibraryofCongressControlNumber:2013944196 ©Springer-VerlagBerlinHeidelberg2010,2013 Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpart of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionor informationstorageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilar methodologynowknownorhereafterdeveloped.Exemptedfromthislegalreservationarebriefexcerpts inconnectionwithreviewsorscholarlyanalysisormaterialsuppliedspecificallyforthepurposeofbeing enteredandexecutedonacomputersystem,forexclusiveusebythepurchaserofthework.Duplication ofthispublicationorpartsthereofispermittedonlyundertheprovisionsoftheCopyrightLawofthe Publisher’s location, in its current version, and permission for use must always be obtained from Springer.PermissionsforusemaybeobtainedthroughRightsLinkattheCopyrightClearanceCenter. ViolationsareliabletoprosecutionundertherespectiveCopyrightLaw. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexempt fromtherelevantprotectivelawsandregulationsandthereforefreeforgeneraluse. While the advice and information in this book are believed to be true and accurate at the date of publication,neithertheauthorsnortheeditorsnorthepublishercanacceptanylegalresponsibilityfor anyerrorsoromissionsthatmaybemade.Thepublishermakesnowarranty,expressorimplied,with respecttothematerialcontainedherein. Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) Foreword TakingAlbertEinstein’squoteasamotto—“Exampleisn’tanotherwaytoteach, itistheonlywaytoteach”—ourtargetwastocreateabookforexplainingstepby steptheWebDynproABAPtothereader.Assistedbypracticalexamples,youwill learnmoreandmoreaboutWebDynproABAP,fromchaptertochapter.Moreover, theconnectionswithotherareasarealsopointedoutbypracticalexamples. In Chap. 1, we present the place and role of Web Dynpro within the SAP NetWeaverplatform.So,westartwiththelayersoftheSAPNetWeaverplatform, we continue with the importance of the Application Platform layer, and we con- clude with the place and role of Web Dynpro (ABAP and Java) within the ApplicationServerABAPand,respective,ApplicationServerJava. Chapter2presentstheSAPEasyAccess,highlightingsomeaspectsfoundinour everydaywork.So,weshowhowtochangethestandardsettings,howtoaddinthe Favoriteslistthefrequentlyusedtransactions,andhowtocreateaShortcutonthe Desktop. InChap.3,wedescribethemodalitytocreatingaWebDynprocomponent.We explain,throughexamples,alltheelementsofaview,andweshowyouhowtouse theABAPDebuggertodiagnosetheapplication. Chapter 4 gives attention to the ABAP Dictionary, where all the development objects are created. These ones are the basis for all our examples. With this knowledge,youwillbeabletoeasilycreateWebDynproapplications. InChap.5,wepresentthecontextnodesandattributes,explainingtheirimpor- tanceforWebDynpro.Weconsiderthepossibilitiestocreate,use,fillinwithdata, andreadthecontents. InChap.6,wegointodetailswithdatabinding,contextmapping,andinterface methods. This chapter starts with the presentation of the mechanism used to manipulate data between context attributes and user interface (UI) elements, the mechanism called, inWeb Dynpro,“databinding.” We continue with the mecha- nism of sharing data among the various controllers, which is realized by using different variants of context mapping. Finally, we highlight the importance of the interfacemethodsrequiredtoaccessthem“cross-component.” v vi Foreword Chapter7coverstheviewcontrollermethods,beginningwithsomeexamplesof Hook methods and ending with user-defined methods and event handler methods. Each method is explained by an example. The main purpose of this chapter is to present the role and the modality to use the various methods generated by the Frameworkandthemodalitytorealizeourownmethods. Chapter8illustratesthelayoutoftheUIelements.Here,wearegoingtopresent thevarioustypesofexistentlayoutsandthemodalitytousethem,eitherinastatic orinadynamicvariant. In our largest chapter (Chap. 9), we describe in detail the user interface (UI) elements. The UI elements that we can use in Web Dynpro ABAP are divided in variouscategories.Inthischapter,wearegoingtopresentsomeoftheUIelements, dividedinthecategoriesofaction,selection,layout,complex,graphic,andintegra- tion. Each UI element will be illustrated by an example, showing the modality of usingiteitherinastaticorinadynamicvariant. Chapter10includesmessagesandexceptions.Westartwiththecreationofthe necessary classes (Message Class, Exceptions Class, and Assistance Class). For each of the two variants (messages and exceptions), we present two possible implementation scenarios. Therefore, we start with the modality to create the texts of messages and exceptions, and we conclude with the modality of using themtocreatesolidapplicationsthatcatchexceptionsandinformtheuserthrough messages. Chapter 11 is about creating Multilanguage Applications on the levels of interfaces and master data. So, the applications we realize are going to be easily internationalized without it being necessary to recode them but only to translate somecentralizedstrings.Forthis,wehavetorespectsomerules,asfollows:using thetoolsofferedbytheABAPWorkbench,establishinganinitiallanguageforour project, and avoiding to enter language-specific texts in the codification of the businesslogic. InChap.12,wepresentseveralWebDynpromodels.Weshowyounotonlyhow to use an Assistance Class, a Web Service, or a BAPI, but also how to create multicomponent applications congruent with the MVC (Model View Controller) designpattern. Chapter13coverstheABAPListViewer(ALV)andtheSelectOptions(SOs). WestartagainwithsimpleexamplesandbuildthemuptoanALVoutputconfigu- rationincombinationwithSOs. Chapter 14 is dedicated to the POWER lists. We will explain, through an example, how we can use the Personal Object Work Entity Repository(POWER) listtosearchwithSelectOptionsandtodisplayinALVtablescertaindatawithout it being necessary to use the components Web Dynpro SALV_WD_TABLE and WDR_SELECT_OPTIONS. We will also learn the main transactions we have to usetocustomizethePOWERlist,wewillimplementtheso-calledfeederclass,and wewillusethestandardWebDynprocomponentPOWL_UI_COMPtointegratea POWER list into a self-created Web Dynpro component. In this chapter, we will alsolearnhowtousethehistoryfunctiontobeabletoprotocolallthechangesmade byauseronthedatabaserecords. Foreword vii Chapter 15 covers the creating of modal windows and external windows. In this respect,wewillusethefourmethodsoftheinterfaceIF_WD_WINDOW_MANAGER, creatinganexampleforeachmethod.Wewillbeginwiththecreationofsimpledialog boxesthatcontainonlytext,thencreatepop-upwindowsthatcontainUIelements,use an external Web Dynpro component to create a modal window, and finally create externalwindows. Chapter 16 presents through an example the way we can use the Web Dynpro applicationparametersandSharedObjectstocommunicatebetweenaWebDynpro ABAPapplicationandaBSP(BusinessServerPages)application.Incasewehave totransmit,betweenthetwotechnologies,datathatarenotsensitive,wecanusethe WebDynproapplicationparameters.Incasewetransmitsensitivedata,ordatanot suitable for transmission in a URL, or we need a large amount of data to be transmitted, it is advisable to use Shared Objects. First of all, we will create a verysimpleBSPapplicationthatwillcommunicatewithaWebDynproapplication usingtheWebDynproapplicationparameters.Attheendofthepresentchapter,we will use the Shared Objects to create the communication between a Web Dynpro ABAPapplicationandaBSPapplication.Incaseyoudonotneedacommunication withtheBSPtechnology,thischapterisalsointerestingbecauseitshowshowwe canusetheWebDynproapplicationparametersandtheSharedObjects. Chapter 17 mainly focuses on learning how to create and send Multilanguage emailsbyusingWebDynproABAP.Here,wewillusealsothetransactionsSOST (SAPconnectSendRequest)andSO10(SAPscriptStandardsText). Chapter18 describes the integration ofWeb Dynproapplicationsinto the SAP NetWeaver Portal. The portal offers many possibilities to create its content, from wizards and templates to applications developed in Web Dynpro ABAP or Web DynproJava.OurscopeistointegrateintotheportalacreatedWebDynproABAP application.Afterthis,wecreateaWebDynprocomponentthatcansendaportal event and another Web Dynpro component that can react to a portal event, and, finally,weintegratethecreatedapplicationsintheportal. Thenextchapter(Chap.19)isaboutWebDynproandauthorizations.Basedon theRBAC(Role-BasedAccessControl)pattern,wearegoingtopresenttheSAPR/ 3role-basedauthorizationmode.Accordingtoit,ausercandisposeofanumberof roles,whichgrantstohim/hertheauthorizationtoaccesscertainresourcesfromthe system.Inthisrespect,wewillcreatethedevelopmentobjectsrequiredtograntto the user the possibility to access the records from a database, and we will use, in Web Dynpro ABAP, the declaration AUTHORITYCHECK to verify the current user’s authorization. At the end of this chapter, we will give some tips and tricks from the praxis. We will show how to authorize the access to the Web Dynpro applicationsandhowtogiveaccesstospecificpartsofanapplication. In our last chapter (Chap. 20), we would like to show how the Mind Map can help you to learn Web Dynpro ABAP easier and faster. We have created a Mind Mapbasedonthesubjectspresentedinthisbook.FromtheUIelementstotheHook methods and component reuse, this well-structured Mind Map helps us to learn faster the Web Dynpro ABAP and, at the same time, to imprint in mind the main elementsrequiredtolearnthistechnology. viii Foreword The examples in our book have been developed on a SAP system with SAP NetWeaver 7.1 and Support Package 8. From SAP Developer Network (SDN) (http://www.sdn.sap.com), you can download a free-of-charge SAP NetWeaver Trial Version with ABAP and SAP GUI for testing. With this Trial Version, you cancreatemostofourexercises.Youwillalsofindmostoftheconfigurationsteps at SDN. To use the SAP interactive forms by Adobe, you need both NetWeaver Trial Versions (ABAP and Java), because Adobe Document Service (ADS) is an integralpartoftheSAPNetWeaverJavaversion.Additionally,youneedtheAdobe LiveCycle Designer from the SAP Service Marketplace. The configuration steps requiredinthiscaseareshownintheSAPPRESSbookSAPInteractiveFormsby Adobe by Hauser et al. To be able to work with the portal, you need the SAP NetWeaverJavaTrialVersion.IntheSAPPRESSbookDeveloper’sGuidetoSAP NetWeaverPortalApplicationsbyBanneretal.,youwillfindallthesoftwareand hardwarerequirements,alongwiththeconfigurationsteps. The creation of a book takes time. Many discussions with students and developers made us think about writing a practical book on the Web Dynpro ABAP subject. The most important issue was to guide the reader step by step, withpracticalexamples.Manyweekends,holidays,andeveningswereinvestedin thisbook,andthepositivefeedbackofourcolleaguesalwaysgaveusnewenergy. Acknowledgments WewouldliketothankourproofreadersDieterSchmittandHeinz-JurgenGebhardt (S+P LION AG); Memmer Manfred, Oliver Gilbert, and Thilo Klopfer (Cellent AG);andMihaelaOsaci(PolytechnicUniversityofTimis¸oara–Romania). Theiradvicesandcommentshelpedusalot. UlrichGellertIwouldliketothankallmycolleaguesofS+PLIONAGfortheir useful input during the project. I also would like to thank my father, Gerhard Gellert,who unfortunately died too early. He introduced me to the world of ITin 1983,andourcompanycouldneverbecomewhatitiswithouthim.Specialthanks gotomymother,GabrieleGellert.Shehasbeensupportingmeuntiltoday,andshe is the heart of our company. Especially I would like to thank my lovely wife CarmenandmychildrenAlexaandMarcfortheirsupportduringtheproject. Dr. Ana Daniela Cristea I give special thanks to my colleagues from Cellent AG, to Thomas Muschalik (NWCON Technology Consulting), and to S+P LION AGfortheirgreatsupport.Takingthisopportunity,Iwouldliketothankthespecial personswhoguidedmealongthewaytoadoctoraldegree,OctavianProsteanand Mircea Vladutiu. Notto forget the people who encouraged me topublish my first books and articles, Aron Poanta and Caius Panoiu, thanking them for their useful advices. Last but not least, I would like to thank my family and friends who supportedmewholeheartedly. Theygave methetimeIneededtobeoneofthose whowrotethisbookforyou. I would like to share the joy of creating this book with my mother, Sabina Cristea. Unfortunately, she suddenly left us, before she could get a copy of this book. Therefore, I dedicate my work in this book to my mother, a special person whoImisseveryday. ix

Description:
Web Dynpro ABAP, a NetWeaver web application user interface tool from SAP, enables web programming connected to SAP Systems. The authors’ main focus was to create a book based on their own practical experience. Each chapter includes examples which lead through the content step-by-step and enable t
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.