Save info   Get password
Home Submit your blog Edit Account Rules RSS-Archive Contact


OOPS AT A GLANCE
2008-04-17 04:54:50
Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world.A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.ObjectsAn object is a section of source code that contains data and provides services. The data forms the attributes of the object. The services are kno


OOPS ABAP 1
2008-04-17 04:54:25
Information systems used to be defined primarily by their functions: data and functions were stored separately and linked using input-output relationships.Object orientation focuses on objects that represent either abstract or concrete things in the real world. They are first viewed in terms of their characteristics, which are mapped using the object’s internal structure and attributes (data). The behavior of an object is described through methods and events (functionality).Objects form capsules containing the data itself and the behavior of that data. Objects should enable you to draft a software solution that is a one-to-one mapping of the real-life problem area.Consistency throughout the software development processThe “language” used in the various phases of software development


OOPS ABAP 2
2008-04-17 04:53:53
UML notation:The slide depicts two ways of representing classes. In the first, the class is represented by its name, attributes and methods, in the second, the name only is used. UML also offers you the option of omitting the either the attribute or the method part.ABAP Objects events are not represented in class diagrams.A class diagram describes the elements contained in the model and their various static relationships. There are two basic forms of static relationships:­ Associations (for example, a flight customer books a flight)­ Generalization/specialization (for example a cargo plane and a passenger plane are planes)Classes can also be shown with their attributes and methods in the class diagrams.An association describes a semantic relationship between classes. The specific relatio


OOPS ABAP 3
2008-04-17 04:52:55
The object in the above model has two layers: an outer shell and an inner core. Users can only see the outer shell, while the inner core remains hidden (the internal status of an object can only be seen within the object itself).Public components (outer shell): the outer shell contains the components of the object that are visible to users, such as attributes (data), methods (functions) and events. All users have direct access to these components. The public components of an object form its external point of contact.Private components (inner core): the components of the inner core (attributes, methods and events) are only visible within the object itself. The attributes of an object are generally private. These private attributes of an object can only be accessed using the methods of that


OOPS ABAP 4
2008-04-17 04:52:26
In this context, abstractions are a simplified representations of complex relationships in the real world. An actually existing object is abstracted to the significant dimensions that are to be mapped. Insignificant details are left out in order to aid understanding of the overall system.This example concerns airplanes. Software for airlines and software for an airport’s hangar management contain different abstractions (classes) for these objects.A class can contain very different objects depending on the abstraction.A class is a description of a number of objects that have the same structure and the same behavior. A class is therefore like a blueprint, in accordance with which all objects in that class are created.The components of the class are defined in the definition part. The compo


OOPS ABAP 5
2008-04-17 04:51:59
Methods are internal procedures in classes that determine the behavior of an object. They can access all attributes in their class and can therefore change the state of an object.Methods have a parameter interface that enables them to receive values when they are called and pass values back to the calling program.In ABAP Objects, methods can have IMPORTING, EXPORTING, CHANGING and RETURNING parameters as well as EXCEPTIONS. All parameters can be passed by value or reference.You can define a return code for methods using RETURNING. You can only do this for a single parameter, which additionally must be passed as a value. Also, you cannot then define EXPORTING and CHANGING parameters. You can define functional methods using the RETURNING parameter (explained in more detail below).All input p


OOPS ABAP 6
2008-04-17 04:51:31
If you want to keep several objects from the same class in your program, you can define an internal table, which might, for example, only consist of one column with the object references for this class.You can work with the objects using the internal table within the loop.If a class defines object references to a second class as attributes (in the above example: left_wing, right_wing), then only these object references will be stored in the objects belonging to that class. The objects in the second class have their own identity.Public attributes can be accessed from outside the class in various ways:Static attributes are accessed using =>.Instance attributes are accessed using ->. Every object behaves in a certain way. This behavior is determined by its methods. There are three types of m


OOPS ABAP 7
2008-04-17 04:50:27
Inheritance is a relationship in which one class (the subclass) inherits all the main characteristics of another class (the superclass). The subclass can also add new components (attributes, methods, and so on) and replace inherited methods with its own implementations.Inheritance is an implementation relationship that emphasizes similarities between classes. In the example above, the similarities between the passenger plane and cargo plane classes are extracted to the airplane superclass. This means that common components are only defined/implemented in the superclass and are automatically present in the subclasses.The inheritance relationship is often described as an “is-a” relationship: a passenger plan is an airplane.Inheritance should be used to implement generalization and specia


OOPS ABAP 8
2008-04-17 04:49:53
One of the significant principles of inheritance is that an instance from a subclass can be used in every context in which an instance from the superclass appears. This is possible because the subclass has inherited all components from the superclass and therefore has the same interface as the superclass. The user can therefore address the subclass instance in the same way as the superclass instance.Variables of the type “reference to superclass” can also refer to subclass instances at runtime.The assignment of a subclass instance to a reference variable of the type “reference to superclass” is described as a narrowing cast, because you are switching from a view with more detail to a view with less detail.The description “up-cast” is also used.What is a narrowing cast used for


OOPS ABAP 9
2008-04-17 04:49:28
CAST:One of the significant principles of inheritance is that an instance from a subclass can be used in every context in which an instance from the superclass appears. This is possible because the subclass has inherited all components from the superclass and therefore has the same interface as the superclass. The user can therefore address the subclass instance in the same way as the superclass instance.Variables of the type “reference to superclass” can also refer to subclass instances at runtime.The assignment of a subclass instance to a reference variable of the type “reference to superclass” is described as a narrowing cast, because you are switching from a view with more detail to a view with less detail.The description “up-cast” is also used.What is a narrowing cast use


OOPS ABAP 10
2008-04-17 04:48:55
POLYMORPHISM :Objects from different classes (lcl_cargo_airplane and lcl_passenger_airplane in the above example ) can be stored in an internal table consisting of references to the superclass (lcl_airplane in the above example, and then processed identically (polymorphically) (see next slide).What coding is actually executed when estimate_fuel_consumption is called depends on the dynamic type of the plane reference variable, that is, it depends on which object from which (sub)class plane points to.You can use polymorphism to write programs that are generic to a high degree and that do not even need to be changed if use cases are added. In the simple example above, this means that, should a further subclass be added, for example, for airplanes that fly in space, the above coding would not


OOPS ABAP 11
2008-04-17 04:48:14
INTERFACES :In ABAP Objects, interfaces are implemented in addition to and independently of classes. Interfaces exclusively describe the external point of contact of a class, but they do not contain their own implementation part.Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task. The user never actually knows the providers, but communicates with them through the interface. In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required (this is polymorphism using interfaces).The above example shows two users: the document library and the file browser. Both define the tasks that poten


OOPS ABAP 12
2008-04-17 04:47:37
COMPOUND INTERFACE :Changes to an interface usually invalidate all the classes implementing it.ABAP Objects contains a composition model for interfaces. A compound interface contains other interfaces as components (component interfaces) and is therefore a summarized extension of these component interfaces. An elementary interface does not itself contain other interfaces.One interface can be used as a component interface in several compound interfaces.UML only deals with the specialization/generalization of interfaces. This relationship is represented by a dotted line with a three-sided arrow from the specialized to the generalized interface.Compound interfaces in ABAP Objects can always be seen as specializations of their component interfaces and represented as such in UML.In a compound in


OOPS ABAP 13
2008-04-17 04:47:01
EVENTS :By triggering an event, an object or a class announces a change of state, or that a certain state has been achieved.In the above example, the airplane class triggers the event ‘touched_down’. Other classes subscribe to this event and process it. The air-traffic controller marks the plane as landed on the list, the pilot breathes a sigh of relief and the passenger, Mr. Miller, applauds.Note:The events discussed here are not ABAP events such as INITIALIZATION,START-OF-SELECTION, and so on.Events link objects or classes more loosely than direct method calls do. Method calls establish precisely when and in which statement sequence the method is called. However, with events, the reaction of the object to the event is determined by the triggering of the event itself.Events are most o


OOPS ABAP 14
2008-04-17 04:46:24
GLOBAL CLASSES/INTERFACES:Local classes/interfaces are only known within the program in which they are defined and implemented.Local classes/interfaces are not stored in the Repository (no TADIR entry). There is no “global” access to these classes/interfaces (for example, from other programs).If a local class is implemented in an include which is then embedded in two different programs, then references to the “same” class still cannot be exchanged at runtime. Two classes that do not conform to type are created at runtime.Unlike local in program classes/interfaces, global classes/interfaces can be created and implemented using the ABAP Workbench Tool Class Builder or transaction SE24. These classes/interfaces are then available to all developers.Global class and interface names shar


OOPS ABAP 15
2008-04-17 04:45:51
SUMMARY AND OUTLOOK :In the early stages of programming history, in the 1970s and 1980s, the principle aim was to write programs that were correct and robust.A program is considered correct if it does exactly what is said in the program specification. A program is considered robust if it can react appropriately to (user) errors and does not just crash immediately.As programs grew in scope and complexity, more attention began to be paid to the possibilities of extensibility and re-usability, in order to avoid constantly having to re-invent the wheel.Extensibility is the facility to enhance an existing program by adding new functions, while still using it in the same context.Re-usability, on the other hand, is when a program or part of a program is taken out of its own context and recycled i


ABAP ALV IN BRIEF
2008-05-12 13:17:36
ABAP List Viewer The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV). Using ALV, we can have three types of reports: 1. Simple Report 2. Block Report 3. Hierarchical Sequential Report There are some func


ALV DOCUMENTATION COMPLETE
2008-05-12 13:15:51
ALV (ABAP LIST VIEWER):Sap provides a set of ALV (ABAP LIST VIEWER) function modules, which can be put into use to embellish the output of a report.This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.In such cases, this set of ALV functions c


LESSON 34 ALV GRID CONTROL
2008-05-12 13:12:25
ALV GRID CONTROL:This task is performed by the SAP Control Framework.The R/3 System allows you to create custom controls using ABAP Objects. The application server is the Automation Client, which drives the custom controls (automation server) at the front end.If custom controls are to be included on the frontend, then the SAPGUI acts as a container for them.Custom controls can be ActiveX Controls


ALV IN BRIEF
2008-05-12 13:11:00
IntroductionHere is the definition for ALV from SAP Help: “The ALV Grid control is a flexible tool for displaying lists.The tool provides common list operations as generic functions and can be enhanced by self-defined options.”The ALV Grid control is used to build non-hierarchical, interactive, and modern-design lists. As a control, it is a component that is installed on the local PC.The ALV G


ALV REPORT SAMPLE CODE CONTACT RENEWAL DETIALS
2008-05-12 13:09:05
*----------------------------------------------------------------------** Contract Renewal Details **----------------------------------------------------------------------************************************************************************** Description: The contract details of the customers in a particular ** sales area are displayed.


REPLACE COMMENTARY IN ALV
2008-05-12 13:08:21
1 IntroductionThe ALV provides Events, which allows users to add information to the List at different rendering time points.Goals of the ALV Form:• UI independent information for rendering• The information is displayed in agreement with the SAP agronomical guidelineThe base Element of the ALV Form is the abstract class CL_SALV_FORM_ELEMENT.This base Element (CL_SALV_FORM_ELEMENT) describes the


ALV WITH POV SAMPLE CODE
2008-05-12 13:06:22
****EXECUTABLE PROGRAM ON ALV****REPORT Y_MALVPOV .****TABLE WORK AREATABLES:KNA1,VBAK.***SELECTION SCREEN***PARAMETERS:P_KUNNR LIKE KNA1-KUNNR DEFAULT 1001.SELECT-OPTIONS:S_VBELN FOR VBAK-VBELN.****DEFINE INTERNAL TABLE***DATA:BEGIN OF IT_ITAB OCCURS 0, VBELN LIKE VBAK-VBELN, END OF IT_ITAB.***DEFINE INTERNAL TABLE WITH HEADER LINE****DATA:IT_JTAB LIKE VBAK OCCURS 0 WITH HEADER LINE.****PROVI


ALV HIRACHICAL REPORT SAMPLE CODE
2008-05-12 13:05:45
TYPE-POOLS: slis.TABLES : ekko, ekpo.DATA : BEGIN OF i_ekko OCCURS 0, ebeln LIKE ekko-ebeln, ernam LIKE ekko-ernam, bsart LIKE ekko-bsart, var1, END OF i_ekko.DATA : BEGIN OF i_ekpo OCCURS 0, ebeln LIKE ekpo-ebeln, ebelp LIKE ekpo-ebelp, matnr LIKE ekpo-matnr, aedat LIKE ekpo-aedat, var2, END OF i_ekpo.DATA : BEGIN OF i_final OCCURS 0, ebeln LIKE ekk


ALV LIST DISPLAY SAMPLE CODE
2008-05-12 13:04:56
TYPE-POOLS:SLIS.TABLES:EKKO.SELECT-OPTIONS:SO_EBELN FOR EKKO-EBELN.DATA:BEGIN OF IT_EKKO OCCURS 0, EBELN LIKE EKKO-EBELN, "PURCHASE DOCUMENT NUMBER BUKRS LIKE EKKO-BUKRS, "COMPANY CODE BSTYP LIKE EKKO-BSTYP, "PURCHASE DOCUMENT CATEGORY BSART LIKE EKKO-BSART, "PUCHASE DOCUMENT TYPE END OF IT_EKKO.*FIELD CATALOG TABLE DECLARATION.DATA:I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WIT


ALV LAYOUT DISPLAY SAMPLE CODE
2008-05-12 13:03:33
TYPE-POOLS:slis.TABLES:ekko.SELECT-OPTIONS:so_ebeln FOR ekko-ebeln.PARAMETERS: VARIANT LIKE DISVARIANT-VARIANT.DATA:BEGIN OF it_ekko OCCURS 0, ebeln LIKE ekko-ebeln, "PURCHASE DOCUMENT NUMBER bukrs LIKE ekko-bukrs, "COMPANY CODE bstyp LIKE ekko-bstyp, "PURCHASE DOCUMENT CATEGORY bsart LIKE ekko-bsart, "PUCHASE DOCUMENT TYPE END OF it_ekko.*FIELD CATALOG AND EVENT CATALOG


ALV BLOCK SAMPLE REPORT
2008-05-12 13:02:59
TYPE-POOLS: slis.TABLES : ekko, ekpo.DATA : BEGIN OF i_ekko OCCURS 0, ebeln LIKE ekko-ebeln, ernam LIKE ekko-ernam, bsart LIKE ekko-bsart, var1, END OF i_ekko.DATA : BEGIN OF i_ekpo OCCURS 0, ebeln LIKE ekpo-ebeln, ebelp LIKE ekpo-ebelp, matnr LIKE ekpo-matnr, aedat LIKE ekpo-aedat, var2, END OF i_ekpo.DATA : BEGIN OF i_final OCCURS 0, ebeln LIKE ekk


ALV CHECK BOXES SAMPLE CODE
2008-05-12 13:02:08
REPORT zalv5 NO STANDARD PAGE HEADING.*Description-----------------------------------------------------------** TOPICS INTRODUCED:* 1. Learn about the ‘Standard’ PF-Status that comes as default.* 2. Exclude function codes from ‘Standard’ PF-Status and customize it.*----------------------------------------------------------------------*TYPE-POOLS: slis.DATA: BEGIN OF i_data OCCURS 0,qmnum L


ALV INTERACTIVE REPORT SAMPLE CODE
2008-05-12 13:00:12
TYPE-POOLS: SLIS.*type declaration for values from ekkoTYPES: BEGIN OF I_EKKO,EBELN LIKE EKKO-EBELN,AEDAT LIKE EKKO-AEDAT,BUKRS LIKE EKKO-BUKRS,BSART LIKE EKKO-BSART,LIFNR LIKE EKKO-LIFNR,END OF I_EKKO.DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,WA_EKKO TYPE I_EKKO.*type declaration for values from ekpoTYPES: BEGIN OF I_EKPO,EBELN LIKE EKPO-EBELN,EBELP LIKE EKPO-EBELP,MATNR LIKE EKP
Read more: INTERACTIVE

ALV DOUBLE CLICK SAMPLE CODE
2008-05-12 12:59:14
REPORT ALVINTERSAMPLE NO STANDARD PAGE HEADING LINE-SIZE 650.TYPE-POOLS: SLIS.*type declaration for values from ekkoTYPES: BEGIN OF I_EKKO,EBELN LIKE EKKO-EBELN,AEDAT LIKE EKKO-AEDAT,BUKRS LIKE EKKO-BUKRS,BSART LIKE EKKO-BSART,LIFNR LIKE EKKO-LIFNR,END OF I_EKKO.DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,WA_EKKO TYPE I_EKKO.*type declaration for values from ekpoTYPES: BEGIN OF I_EK


Page 1 of 5 « < 1 2 3 > »
eXTReMe Tracker