Application Development 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: 

ABAP-Object oriented programming

Former Member
0 Kudos

Hi,

I need sample code from basics to complex scenarios( ABAP Object oriented programming).

Thanks

Chandra

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link.I am explaining steps for creating alv using OOPS concept.This will help you to understand the basic concepts.

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-7StepstocreateOOPSALV(forbeginners)

OOPS ALV

standard pgms

ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course

ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course

DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects

DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen

DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects

DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration

DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects

DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects

DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen

6 REPLIES 6

Former Member
0 Kudos

Hi,

Give me your mail id.

Thanks,

Anitha

0 Kudos

chandra.dodda@gmail.com

0 Kudos

HI,

Goto transaction ABAPDOCU and there you can see lots of explaination and example for ABAP objects.

Regards,

sesh

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link.I am explaining steps for creating alv using OOPS concept.This will help you to understand the basic concepts.

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-7StepstocreateOOPSALV(forbeginners)

OOPS ALV

standard pgms

ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course

ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course

ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course

DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects

DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen

DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects

DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration

DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects

DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects

DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen

Former Member
0 Kudos

Hi Chandra,

Check the transaction ABAPDOCU, you will get sample codes there.

Award points if found useful.

Regards

Indrajit

Former Member
0 Kudos

hi chandra,

see this might help you,

simple example

local class is build in se38.

example of the same

class zcl_emp DEFINITION.

public section.

types : begin of t_emp,

no type i,

name type string,

end of t_emp.

methods:

constructor

importing zemp_no type i

zemp_name type string,

display_employee.

class-methods:

display_no_of_employee.

protected section.

class-data:g_no_of_employee type i.

private section.

data: g_employee type t_emp.

endclass.

class zcl_emp implementation.

method constructor.

g_employee-no = zemp_no.

g_employee-name = zemp_name.

g_no_of_employee = g_no_of_employee + 1.

endmethod.

method display_employee.

write:/'employee', g_employee-no ,g_employee-name.

endmethod.

method display_no_of_employee.

write:/ 'no of employee is', g_no_of_employee .

endmethod.

endclass.

*******

include zas_class.

data: g_empl1 type ref to zcl_emp, " declaration of object.

g_empl2 type ref to zcl_emp.

start-of-selection.

*initialization.

create object g_empl1

exporting zemp_no = 1

zemp_name = 'james'.

create object g_empl2

exporting zemp_no = 2

zemp_name = 'bond'.

call method g_empl1->display_employee.

call method g_empl2->display_employee.

call method g_empl2->display_no_of_employee.

hope this will help you

anuj