Skip to Content
author's profile photo
Former Member

ABAP-Object oriented programming

Hi,

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

Thanks

Chandra

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Posted on Jun 27, 2007 at 06:20 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 27, 2007 at 06:19 AM

    HI,

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

    Regards,

    sesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jun 27, 2007 at 06:14 AM

    Hi,

    Give me your mail id.

    Thanks,

    Anitha

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jun 27, 2007 at 06:48 AM

    Hi Chandra,

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

    Award points if found useful.

    Regards

    Indrajit

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 09:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded