Beruflich Dokumente
Kultur Dokumente
Lecturer: Andr Bgelsack, UCC Technische Universitt Mnchen Author: Valentin Nicolescu, Andr Bgelsack
ABAP Course Andr Bgelsack, Valentin Nicolescu 1
Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrckliche schriftliche Genehmigung durch HCC TU Mnchen nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden. Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint und SQL Server sind eingetragene Marken der Microsoft Corporation. IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX, S/390, AS/400, OS/390 und OS/400 sind eingetragene Marken der IBM Corporation. ORACLE ist eine eingetragene Marke der ORACLE Corporation. INFORMIX-OnLine for SAP und Informix Dynamic ServerTM sind eingetragene Marken der Informix Software Incorporated.
UNIX, X/Open, OSF/1 und Motif sind eingetragene Marken der Open Group.
Citrix, das Citrix-Logo, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, MultiWin und andere hier erwhnte Namen von Citrix-Produkten sind Marken von Citrix Systems, Inc. HTML, DHTML, XML, XHTML sind Marken oder eingetragene Marken des W3C, World Wide Web Consortium, Massachusetts Institute of Technology. JAVA ist eine eingetragene Marke der Sun Microsystems, Inc. JAVASCRIPT ist eine eingetragene Marke der Sun Microsystems, Inc., verwendet unter der Lizenz der von Netscape entwickelten und implementierten Technologie. SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP, mySAP.com und weitere im Text erwhnte SAP-Produkte und -Dienstleistungen sowie die entsprechenden Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und anderen Lndern weltweit. MarketSet und Enterprise Buyer sind gemeinsame Marken von SAP Markets und Commerce One. Alle anderen Namen von Produkten und Dienstleistungen sind Marken der jeweiligen Firmen. Die Verwendung der Screenshots wurde mit dem jeweiligen Eigner abgesprochen.
ABAP Course
Agenda
1. 2. ABAP Objects Business Server Pages Maintenance and execution Usage of BAPIs in BSPs HTMLB Model View Controller
ABAP Course
ABAP Course
ABAP Course
Show_speed
Car_Gear_change_up
Car_Gear_change_down
Stop
Gear_change up Gear_change_down
ABAP Course
ABAP Course
Inheritance
Attributes:
Inheritance
Methods:
Class Car
Attributes: Manufacturer No. of wheels No. of seats Methods: Create Show attributes Used seats
Methods:
Instance static
Instance methods/attributes exist for each instance of a class (e.g. method get colour, as each instance has its own colour) Static methods/attributes exist only once for all instances (e.g. listing of all instances of a class)
ABAP Course
Declaration of a class
Classes can be created using ABAP Editor or Class Builder Separation of definition and implementation of a class Definition includes the declaration of all components of a class (e.g. methods, attributes..) Implementation includes the coding for all methods of a class
ABAP Course
10
Definition of a class
CLASS <Class name> DEFINITION. PUBLIC SECTION. METHODS: <Method1> IMPORTING <Import <Import CLASS-METHODS: <Method2> DATA: <Variable1> CLASS-DATA: <Variable2> PRIVATE SECTION. METHODS: CLASS-METHODS: DATA: CLASS-DATA: ENDCLASS.
ABAP Course
11
Implementation of a class
CLASS <Class name> IMPLEMENTATION. METHOD <Method name>. ABAP-Code ENDMETHOD. ENDCLASS.
ABAP Course
12
ABAP Course
13
Constructor
Explicitly or implicitly defined method constructor used for creating new instances Automatically called by CREATE OBJECT In case of missing implementation simply a new instance is created In case of explicit implementation within the PUBLIC SECTION additional steps can be executed when creating new instances (e.g. setting of default values)
ABAP Course
14
Example constructor
PUBLIC SECTION METHODS: constructor IMPORTING im_name type string im_planetype type string. CREATE OBJECT r_plane EXPORTING im_name = Munich im_planetype=747.
ABAP Course
15
ABAP Course
16
ABAP Course
17
ABAP Course
18
SAP System 2
RFC
IMPORTING
BSP
This example: Call of an external BAPI Other possible examples: Call of an internal BAPI
ABAP Course
19
ABAP Course
20
Call example
ABAP Course
21
ABAP Course
22
ABAP Course
23
ABAP Course
24
Query of the Last changed on date (lastmodified) of user master-adm Output is assigned to variable tmp_moddat
ABAP Course
25
ABAP Course
26
ABAP Course
27
HTMLB
Extension of HTML by SAP HTML-Business HTML-Business for Java HTML-Business for ABAP HTMLB is used e.g. for Enterprise Portal
ABAP Course
28
HTMLB
<%@page language="abap" %> <%@extension name="htmlb" prefix="htmlb" %> <htmlb:content design="design2003" > <htmlb:page title=My BSP" > <% data: vari type i. %>
<html> <head> <title>My BSP</title> <% data: vari type i. %> </head> <body> <%--This is a comment --%> <% vari = 5 %> In this coding following value is assigend to variable vari: <%= vari %> <br> Thats it.
</body> </html>
<%--This is a comment --%> <% vari = 5. %> In this coding following value is to variable vari: <%= vari. %> <br> Thats it using HTMLB. </htmlb:page> </htmlb:content>
assigend
ABAP Course
29
HTMLB Statements
<%@extension name="htmlb" prefix="htmlb" %>
Begin of content-tags with explicit design definition Standard designs: design2003, design2002 and classic Design2003 can be used only for MS IE Version 5.5 or higher
<htmlb:page title="Meine BSP" >
Begin of page-tags with definition of title for BSP Explicit <head> tag is not required any more Explicit <body> tag is not required any more
</htmlb:page> </htmlb:content>
ABAP Course
31
ABAP Course
32
Button for sending forms Important: onClientClick raises event, in this case: onInputProcessing(htmlbevent) Event is called onInputProcessing Event_id is called: htmlbevent
ABAP Course
33
HTMLB - Eventhandler
Events are defined in the Eventhandler!
ABAP Course
34
HTMLB RadioButtons I
Radiobuttons
<htmlb:radioButtonGroup id = "myID" columnCount = "2" > <htmlb:radioButton id = "RBGenderFemale" text = "female" tooltip = "I am female" disabled = "false" /> <htmlb:radioButton id = "RBGenderMale" text = "male" tooltip = "I am male (and this button is disabled)" disabled = "true" /> </htmlb:radioButtonGroup>
HTMLB RadioButtons II
<htmlb:radioButtonGroup id = "myID" columnCount = "2" > <htmlb:radioButton id = "RBGenderFemale" text = "female" tooltip = "I am female" disabled = "false" /> <htmlb:radioButton id = "RBGenderMale" text = "male" tooltip = "I am male (and this button is disabled)" disabled = "true" /> </htmlb:radioButtonGroup>
36
HTMLB - Layout
RadioButtons
TabStrips
TableView
ABAP Course
37
SAP System
BSP
SAP System
Model Controller View
ABAP Course
38
No direct call
DO_REQUEST
Model ZCL_BSP_MYMVCTEST
Attribute NAME
View view_test.htm
Application logic
ABAP Course Andr Bgelsack, Valentin Nicolescu 40
ABAP Course
41
ABAP Course
42