Skip to Content
0
Former Member
Feb 11, 2010 at 11:47 AM

Using OO Abap programming optimally

20 Views

Dear experts,

I developed a report purely on Object Oriented concepts.It works really fine.

Now my requirement is that in one of my module pool program i want to retrieve some data from that report itself

and show in my Input help. I deliberately made this report OO as i had anticipated that it will be required to me in future.

Now time has come.I want to call some method of the defined class.It is at this point that i am ignorant how to do.

Methodi want to call from different program is that

fetch_lc_info ()

Let me explain you the structure of program which i am willing to call.

[code]

report zsammrp01.

include zdata_definitions. //I definitions

include zselect_lc_params. // selection screen

start-of-selection.

include zmainlc. //main logic

  • Class Declarations

data : ob_get_all_lcinfo type ref to get_lc_details.

data: ob_alv_print type ref to alvprint.

  • Perform functionalities

end-of-selection.

create object ob_get_all_lcinfo.

ob_get_all_lcinfo->fetch_lc_info( ).

create object ob_alv_print.

ob_alv_print->print_details( ).

end-of-selection.

[/code]

Let me show the zmainlc where i defined classes.

[code]

class get_lc_details definition.

public section.

methods: fetch_lc_info.

endclass.

class get_lc_details implementation.

method fetch_lc_info.

select aebeln aebelp bekgrp awerks amenge ameins

bbedat amatnr atxz01 anetwr bwaers bwkurs anetpr azztest azzlcbt blifnr

from ekko as b inner join ekpo as a on

( aebeln = bebeln ) into table t_all_lcs where b~bsart like 'IM%'.

some other manipulation on this table done..............

endmehod.

[/code]