Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OOP's

rahul2000
Contributor
0 Likes
978

Dear all,

When should one go for object oriented programming...Also i am new in OOPs..how should i start about it?

Also can anyone tell me which books to study from ABAP certification...i know there are TAW10 and TAW12...but how to find out which are the latest releases of this books

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
821

Hi,

What is Object Orientation?

In the past, information systems used to be defined primarily by their functionality: data and functions were kept separate and linked together by means of input and output relations.

The object-oriented approach, however, focuses on objects that represent abstract or concrete things of the real world. These objects are first defined by their character and their properties which are represented by their internal structure and their attributes (data). The behaviour of these objects is described by methods (functionality).

Objects form a capsule which combines the character to the respective behaviour. Objects should enable programmers to map a real problem and its proposed software solution on a one-to-one basis.

Typical objects in a business environment are, for example, ‘Customer’, ‘Order’, or ‘Invoice’. From Release 3.1 onwards, the Business Object Repository (BOR) of SAP Web Applicaton Server ABAP has contained examples of such objects. The BOR object model will be integrated into ABAP Objects in the next Release by migrating the BOR object types to the ABAP class library.

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.

Objects

Objects are instances of classes. They contain data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.

Classes

Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes.

Object References

In a program, you identify and address objects using unique object references. Object references allow you to access the attributes and methods of an object.

In object-oriented programming, objects usually have the following properties:

Encapsulation

Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.

Inheritance

You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.

Polymorphism

Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.

Uses of Object Orientation

Below are some of the advantages of object-oriented programming:

· Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques.

· In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required.

· Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components.

· In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase.

Achieving these goals requires:

· Object-oriented programming languages

Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency of object-oriented programming depends directly on how object-oriented language techniques are implemented in the system kernel.

· Object-oriented tools

Object-oriented tools allow you to create object-oriented programs in object-oriented languages. They allow you to model and store development objects and the relationships between them.

· Object-oriented modeling

The object-orientation modeling of a software system is the most important, most time-consuming, and most difficult requirement for attaining the above goals. Object-oriented design involves more than just object-oriented programming, and provides logical advantages that are independent of the actual implementation.

This section of the ABAP User’s Guide provides an overview of the object-oriented extension of the ABAP language. We have used simple examples to demonstrate how to use the new features. However, these are not intended to be a model for object-oriented design. More detailed information about each of the ABAP Objects statements is contained in the keyword documentation in the ABAP Editor. For a comprehensive introduction to object-oriented software development, you should read one or more of the titles listed below.

Further Reading

There are many books about object orientation, object-oriented programming languages, object-oriented analysis and design, project management for OO projects, patterns and frameworks, and so on. This is a small selection of good books covering the most important topics:

· Scott Ambler, The Object Primer, SIGS Books & Multimedia (1996), ISBN: 1884842178

A very good introduction to object orientation for programmers. It provides comprehensive explanations of all essential OO concepts, and contains a procedure model for learning OO quickly and thoroughly. It is easy to read and practical, but still theoretically-founded.

· Grady Booch, Object Solutions: Managing the Object-Oriented Project, Addison-Wesley Pub Co (1995), ISBN: 0805305947

A good book about all of the non-technical aspects of OO that are equally important for effective object-oriented programming. Easy to read and full of practical tips.

· Martin Fowler, UML Distilled: Applying the Standard Object Modeling Language, Addison-Wesley Pub Co (1997), ISBN: 0201325632

An excellent book about UML (Unified Modeling Language - the new standardized OO language and notation for modeling). Assumes knowledge and experience of object orientation.

· Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns. Elements of Reusable Object-Oriented Software, Addison-Wesley Pub Co (1998), ISBN: 0201634988

Provides a pattern, showing how recurring design problems can be solved using objects. This is the first big pattern book, containing many examples of good OO design.

· James Rumbaugh, OMT Insights: Perspectives on Modeling from the Journal of Object-Oriented Programming, Prentice Hall (1996), ISBN: 0138469652

A collection of articles addressing the many questions and problems of OO analysis and design, implementation, dependency management, and so on. Highly recommended.

Notes

If you are new to object-orientation, you should read Scott Ambler’s ‘The Object Primer’ and then acquire some practical experience of your own. You should definitely use the CRC techniques described by Ambler and Fowler for object-oriented analysis and design. After this, you should learn UML, since this is the universal OO analysis and design notation. Finally, you should read at least one book about patterns.

At the beginning of a large OO project, the question immediately arises as to the sequence in which things should be done, which phases should be finished at what time, how to divide up and organize the development work, how to minimize risks, how to assemble a good team, and so on and so forth. Many of the best practices of project management have had to be redefined for the object-oriented world, and the opportunities that this has produced are significant. For further information about how to use OO in project management, see Grady Brooch’s book ‘Object solutions’, or the chapter entitles ‘An outline development process’ from Martin Fowler’s book.

There are, of course, many other good books about object orientation. The above list does not claim either to be complete, or necessarily to recommend the best books available.

Thanks&regards,

sravani

5 REPLIES 5
Read only

Former Member
0 Likes
821

hi,

we use oops where we need to specify the data belongs to particular function.here each function will have data belonging to it.but in procedure oriented programming. u can't say which data belongs to which function. the data is accesed globally by all functions.

in oops we have

encapsulation: datahiding by using public, private, protected

polymorphism: one name many functions

inheritance: herte sub class gets the propertie of base class. u need not develope everything from scratch.

the base class can be used as reference and u can even enhance the properties of subclass

ABAP IS PROCEDURE ORIENTED

ABAP OBJECTS which is an extension of ABAP is object oriented

regards,

sreelakshmi

Read only

Former Member
0 Likes
822

Hi,

What is Object Orientation?

In the past, information systems used to be defined primarily by their functionality: data and functions were kept separate and linked together by means of input and output relations.

The object-oriented approach, however, focuses on objects that represent abstract or concrete things of the real world. These objects are first defined by their character and their properties which are represented by their internal structure and their attributes (data). The behaviour of these objects is described by methods (functionality).

Objects form a capsule which combines the character to the respective behaviour. Objects should enable programmers to map a real problem and its proposed software solution on a one-to-one basis.

Typical objects in a business environment are, for example, ‘Customer’, ‘Order’, or ‘Invoice’. From Release 3.1 onwards, the Business Object Repository (BOR) of SAP Web Applicaton Server ABAP has contained examples of such objects. The BOR object model will be integrated into ABAP Objects in the next Release by migrating the BOR object types to the ABAP class library.

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.

Objects

Objects are instances of classes. They contain data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.

Classes

Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes.

Object References

In a program, you identify and address objects using unique object references. Object references allow you to access the attributes and methods of an object.

In object-oriented programming, objects usually have the following properties:

Encapsulation

Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.

Inheritance

You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.

Polymorphism

Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.

Uses of Object Orientation

Below are some of the advantages of object-oriented programming:

· Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques.

· In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required.

· Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components.

· In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase.

Achieving these goals requires:

· Object-oriented programming languages

Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency of object-oriented programming depends directly on how object-oriented language techniques are implemented in the system kernel.

· Object-oriented tools

Object-oriented tools allow you to create object-oriented programs in object-oriented languages. They allow you to model and store development objects and the relationships between them.

· Object-oriented modeling

The object-orientation modeling of a software system is the most important, most time-consuming, and most difficult requirement for attaining the above goals. Object-oriented design involves more than just object-oriented programming, and provides logical advantages that are independent of the actual implementation.

This section of the ABAP User’s Guide provides an overview of the object-oriented extension of the ABAP language. We have used simple examples to demonstrate how to use the new features. However, these are not intended to be a model for object-oriented design. More detailed information about each of the ABAP Objects statements is contained in the keyword documentation in the ABAP Editor. For a comprehensive introduction to object-oriented software development, you should read one or more of the titles listed below.

Further Reading

There are many books about object orientation, object-oriented programming languages, object-oriented analysis and design, project management for OO projects, patterns and frameworks, and so on. This is a small selection of good books covering the most important topics:

· Scott Ambler, The Object Primer, SIGS Books & Multimedia (1996), ISBN: 1884842178

A very good introduction to object orientation for programmers. It provides comprehensive explanations of all essential OO concepts, and contains a procedure model for learning OO quickly and thoroughly. It is easy to read and practical, but still theoretically-founded.

· Grady Booch, Object Solutions: Managing the Object-Oriented Project, Addison-Wesley Pub Co (1995), ISBN: 0805305947

A good book about all of the non-technical aspects of OO that are equally important for effective object-oriented programming. Easy to read and full of practical tips.

· Martin Fowler, UML Distilled: Applying the Standard Object Modeling Language, Addison-Wesley Pub Co (1997), ISBN: 0201325632

An excellent book about UML (Unified Modeling Language - the new standardized OO language and notation for modeling). Assumes knowledge and experience of object orientation.

· Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns. Elements of Reusable Object-Oriented Software, Addison-Wesley Pub Co (1998), ISBN: 0201634988

Provides a pattern, showing how recurring design problems can be solved using objects. This is the first big pattern book, containing many examples of good OO design.

· James Rumbaugh, OMT Insights: Perspectives on Modeling from the Journal of Object-Oriented Programming, Prentice Hall (1996), ISBN: 0138469652

A collection of articles addressing the many questions and problems of OO analysis and design, implementation, dependency management, and so on. Highly recommended.

Notes

If you are new to object-orientation, you should read Scott Ambler’s ‘The Object Primer’ and then acquire some practical experience of your own. You should definitely use the CRC techniques described by Ambler and Fowler for object-oriented analysis and design. After this, you should learn UML, since this is the universal OO analysis and design notation. Finally, you should read at least one book about patterns.

At the beginning of a large OO project, the question immediately arises as to the sequence in which things should be done, which phases should be finished at what time, how to divide up and organize the development work, how to minimize risks, how to assemble a good team, and so on and so forth. Many of the best practices of project management have had to be redefined for the object-oriented world, and the opportunities that this has produced are significant. For further information about how to use OO in project management, see Grady Brooch’s book ‘Object solutions’, or the chapter entitles ‘An outline development process’ from Martin Fowler’s book.

There are, of course, many other good books about object orientation. The above list does not claim either to be complete, or necessarily to recommend the best books available.

Thanks&regards,

sravani

Read only

Former Member
0 Likes
821

Hai.

check this.

OOPs ABAP uses Classes and Interfaces which uses Methods and events.

If you have Java skills it is advantage for you.

There are Local classes as well as Global Classes.

Local classes we can work in SE38 straight away.

But mostly it is better to use the Global classes.

Global Classes or Interfaces are to be created in SE24.

SAP already given some predefined classes and Interfaces.

This OOPS concepts very useful for writing BADI's also.

So first create a class in SE 24.

Define attributes, Methods for that class.

Define parameters for that Method.

You can define event handlers also to handle the messages.

After creation in each method write the code.

Methods are similar to ABAP PERFORM -FORM statements.

After the creation of CLass and methods come to SE38 and create the program.

In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.

Example:

REPORT sapmz_hf_alv_grid .

  • Type pool for icons - used in the toolbar

TYPE-POOLS: icon.

TABLES: zsflight.

  • To allow the declaration of o_event_receiver before the

  • lcl_event_receiver class is defined, decale it as deferred in the

  • start of the program

CLASS lcl_event_receiver DEFINITION DEFERRED.

*----


  • G L O B A L I N T E R N A L T A B L E S

*----


*DATA: gi_sflight TYPE STANDARD TABLE OF sflight.

  • To include a traffic light and/or color a line the structure of the

  • table must include fields for the traffic light and/or the color

TYPES: BEGIN OF st_sflight.

INCLUDE STRUCTURE zsflight.

  • Field for traffic light

TYPES: traffic_light TYPE c.

  • Field for line color

types: line_color(4) type c.

TYPES: END OF st_sflight.

TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.

DATA: gi_sflight TYPE tt_sflight.

*----


  • G L O B A L D A T A

*----


DATA: ok_code LIKE sy-ucomm,

  • Work area for internal table

g_wa_sflight TYPE st_sflight,

  • ALV control: Layout structure

gs_layout TYPE lvc_s_layo.

  • Declare reference variables to the ALV grid and the container

DATA:

go_grid TYPE REF TO cl_gui_alv_grid,

go_custom_container TYPE REF TO cl_gui_custom_container,

o_event_receiver TYPE REF TO lcl_event_receiver.

DATA:

  • Work area for screen 200

g_screen200 LIKE zsflight.

  • Data for storing information about selected rows in the grid

DATA:

  • Internal table

gi_index_rows TYPE lvc_t_row,

  • Information about 1 row

g_selected_row LIKE lvc_s_row.

*----


  • C L A S S E S

*----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING

e_object e_interactive,

handle_user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

ENDCLASS.

----


  • CLASS lcl_event_receiver IMPLEMENTATION

----


CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_toolbar.

  • Event handler method for event toolbar.

CONSTANTS:

  • Constants for button type

c_button_normal TYPE i VALUE 0,

c_menu_and_default_button TYPE i VALUE 1,

c_menu TYPE i VALUE 2,

c_separator TYPE i VALUE 3,

c_radio_button TYPE i VALUE 4,

c_checkbox TYPE i VALUE 5,

c_menu_entry TYPE i VALUE 6.

DATA:

ls_toolbar TYPE stb_button.

  • Append seperator to the normal toolbar

CLEAR ls_toolbar.

MOVE c_separator TO ls_toolbar-butn_type..

APPEND ls_toolbar TO e_object->mt_toolbar.

  • Append a new button that to the toolbar. Use E_OBJECT of

  • event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.

  • This class has one attribute MT_TOOLBAR which is of table type

  • TTB_BUTTON. The structure is STB_BUTTON

CLEAR ls_toolbar.

MOVE 'CHANGE' TO ls_toolbar-function.

MOVE icon_change TO ls_toolbar-icon.

MOVE 'Change flight' TO ls_toolbar-quickinfo.

MOVE 'Change' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD.

METHOD handle_user_command.

  • Handle own functions defined in the toolbar

CASE e_ucomm.

WHEN 'CHANGE'.

PERFORM change_flight.

  • LEAVE TO SCREEN 0.

ENDCASE.

ENDMETHOD.

ENDCLASS.

*----


  • S T A R T - O F - S E L E C T I O N.

*----


START-OF-SELECTION.

SET SCREEN '100'.

&----


*& Module USER_COMMAND_0100 INPUT

&----


MODULE user_command_0100 INPUT.

CASE ok_code.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


MODULE status_0100 OUTPUT.

DATA:

  • For parameter IS_VARIANT that is sued to set up options for storing

  • the grid layout as a variant in method set_table_for_first_display

l_layout TYPE disvariant,

  • Utillity field

l_lines TYPE i.

  • After returning from screen 200 the line that was selected before

  • going to screen 200, should be selected again. The table gi_index_rows

  • was the output table from the GET_SELECTED_ROWS method in form

  • CHANGE_FLIGHT

DESCRIBE TABLE gi_index_rows LINES l_lines.

IF l_lines > 0.

CALL METHOD go_grid->set_selected_rows

EXPORTING

it_index_rows = gi_index_rows.

CALL METHOD cl_gui_cfw=>flush.

REFRESH gi_index_rows.

ENDIF.

  • Read data and create objects

IF go_custom_container IS INITIAL.

  • Read data from datbase table

PERFORM get_data.

  • Create objects for container and ALV grid

CREATE OBJECT go_custom_container

EXPORTING container_name = 'ALV_CONTAINER'.

CREATE OBJECT go_grid

EXPORTING

i_parent = go_custom_container.

  • Create object for event_receiver class

  • and set handlers

CREATE OBJECT o_event_receiver.

SET HANDLER o_event_receiver->handle_user_command FOR go_grid.

SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.

  • Layout (Variant) for ALV grid

l_layout-report = sy-repid. "Layout fo report

*----


  • Setup the grid layout using a variable of structure lvc_s_layo

*----


  • Set grid title

gs_layout-grid_title = 'Flights'.

  • Selection mode - Single row without buttons

  • (This is the default mode

gs_layout-sel_mode = 'B'.

  • Name of the exception field (Traffic light field) and the color

  • field + set the exception and color field of the table

gs_layout-excp_fname = 'TRAFFIC_LIGHT'.

gs_layout-info_fname = 'LINE_COLOR'.

LOOP AT gi_sflight INTO g_wa_sflight.

IF g_wa_sflight-paymentsum < 100000.

  • Value of traffic light field

g_wa_sflight-traffic_light = '1'.

  • Value of color field:

  • C = Color, 6=Color 1=Intesified on, 0: Inverse display off

g_wa_sflight-line_color = 'C610'.

ELSEIF g_wa_sflight-paymentsum => 100000 AND

g_wa_sflight-paymentsum < 1000000.

g_wa_sflight-traffic_light = '2'.

ELSE.

g_wa_sflight-traffic_light = '3'.

ENDIF.

MODIFY gi_sflight FROM g_wa_sflight.

ENDLOOP.

  • Grid setup for first display

CALL METHOD go_grid->set_table_for_first_display

EXPORTING i_structure_name = 'SFLIGHT'

is_variant = l_layout

i_save = 'A'

is_layout = gs_layout

CHANGING it_outtab = gi_sflight.

*-- End of grid setup -


  • Raise event toolbar to show the modified toolbar

CALL METHOD go_grid->set_toolbar_interactive.

  • Set focus to the grid. This is not necessary in this

  • example as there is only one control on the screen

CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0200 INPUT

&----


MODULE user_command_0200 INPUT.

CASE ok_code.

WHEN 'EXIT200'.

LEAVE TO SCREEN 100.

WHEN'SAVE'.

PERFORM save_changes.

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT

&----


*& Form get_data

&----


FORM get_data.

  • Read data from table SFLIGHT

SELECT *

FROM zsflight

INTO TABLE gi_sflight.

ENDFORM. " load_data_into_grid

&----


*& Form change_flight

&----


  • Reads the contents of the selected row in the grid, ans transfers

  • the data to screen 200, where it can be changed and saved.

----


FORM change_flight.

DATA:l_lines TYPE i.

REFRESH gi_index_rows.

CLEAR g_selected_row.

  • Read index of selected rows

CALL METHOD go_grid->get_selected_rows

IMPORTING

et_index_rows = gi_index_rows.

  • Check if any row are selected at all. If not

  • table gi_index_rows will be empty

DESCRIBE TABLE gi_index_rows LINES l_lines.

IF l_lines = 0.

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

textline1 = 'You must choose a line'.

EXIT.

ENDIF.

  • Read indexes of selected rows. In this example only one

  • row can be selected as we are using gs_layout-sel_mode = 'B',

  • so it is only ncessary to read the first entry in

  • table gi_index_rows

LOOP AT gi_index_rows INTO g_selected_row.

IF sy-tabix = 1.

READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.

ENDIF.

ENDLOOP.

  • Transfer data from the selected row to screenm 200 and show

  • screen 200

CLEAR g_screen200.

MOVE-CORRESPONDING g_wa_sflight TO g_screen200.

LEAVE TO SCREEN '200'.

ENDFORM. " change_flight

&----


*& Form save_changes

&----


  • Changes made in screen 200 are written to the datbase table

  • zsflight, and to the grid table gi_sflight, and the grid is

  • updated with method refresh_table_display to display the changes

----


FORM save_changes.

DATA: l_traffic_light TYPE c.

  • Update traffic light field

  • Update database table

MODIFY zsflight FROM g_screen200.

  • Update grid table , traffic light field and color field.

  • Note that it is necessary to use structure g_wa_sflight

  • for the update, as the screen structure does not have a

  • traffic light field

MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.

IF g_wa_sflight-paymentsum < 100000.

g_wa_sflight-traffic_light = '1'.

  • C = Color, 6=Color 1=Intesified on, 0: Inverse display off

g_wa_sflight-line_color = 'C610'.

ELSEIF g_wa_sflight-paymentsum => 100000 AND

g_wa_sflight-paymentsum < 1000000.

g_wa_sflight-traffic_light = '2'.

clear g_wa_sflight-line_color.

ELSE.

g_wa_sflight-traffic_light = '3'.

clear g_wa_sflight-line_color.

ENDIF.

MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.

  • Refresh grid

CALL METHOD go_grid->refresh_table_display.

CALL METHOD cl_gui_cfw=>flush.

LEAVE TO SCREEN '100'.

ENDFORM. " save_changes

chk this blog

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

regards.

sowjanya.b

Read only

Former Member
0 Likes
821

hi,

ABAP OBJECTS which is an extension of ABAP is object oriented

Objects

Objects are instances of classes. They contain data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.

Classes

Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes.

In object-oriented programming, objects usually have the following properties:

Encapsulation.

Inheritance.

Polymorphisim.

Abstraction.

· Grady Booch, Object Solutions: Managing the Object-Oriented Project, Addison-Wesley Pub Co (1995), ISBN: 0805305947

Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns. Elements of Reusable Object-Oriented Software, Addison-Wesley Pub Co (1998), ISBN: 0201634988

these are some of the best books which i can suggest for you to learn object oriented concepts.

Reward if usefull.

Read only

Former Member
0 Likes
821

TAW-10-----ABAP Workbench Fundamentals

TAW12 ABAP Workbench Concept

IF u r a new 1, then u start from taw10 and go 2 taw12....... r if u r familier with abap programming then u can directly study taw12........ taw 10 consiset 2 books taw10 1/2 and 2/2 ........taw 12 consist 3 books taw12 1/3,2/3,3/3............ but this books is useful in certification aspect only.....

reward if it is useful.....