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

ABAP-Object oriented programming

Former Member
0 Likes
768

Hi,

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

Thanks

Chandra

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
705

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
Read only

Former Member
0 Likes
705

Hi,

Give me your mail id.

Thanks,

Anitha

Read only

0 Likes
705

chandra.dodda@gmail.com

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
705

HI,

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

Regards,

sesh

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
706

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

Read only

Former Member
0 Likes
705

Hi Chandra,

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

Award points if found useful.

Regards

Indrajit

Read only

Former Member
0 Likes
705

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