2008 Apr 07 8:30 AM
Hi!
I need simple step-by-step procedure for defining a local class ( having 1 function only) in ABAP
2008 Apr 07 10:33 AM
----
CLASS lcl_class DEFINITION
----
*
----
CLASS lcl_class DEFINITION.
PUBLIC SECTION.
METHODS fm.
ENDCLASS. "lcl_class DEFINITION
----
CLASS lcl_implementation DEFINITION
----
*
----
CLASS lcl_class IMPLEMENTATION.
METHOD fm.
CALL FUNCTION 'FM'.
ENDMETHOD. "fm
ENDCLASS. "lcl_implementation DEFINITION
This is basic structure, which can be defined in an include (top include for data declaration), or some where local in your report / method.
You can use this class be instantiating it (CREATE OBJECT) and then call the method via the instance like this:
DATA: lr_object TYPE REF TO lcl_class.
START-OF-SELECTION.
CREATE OBJECT lr_object.
CALL METHOD lr_object->fm.
2008 Apr 07 10:38 AM
hi
you can also look here
[http://help.sap.com/saphelp_nw70/helpdata/en/c3/225b6554f411d194a60000e8353423/frameset.htm]
regards
2008 Apr 07 3:40 PM
--
CLASS zclass_floc DEFINITION .
PUBLIC SECTION .
CLASS-METHODS : handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column .
ENDCLASS .
--
CLASS zclass_floc IMPLEMENTATION .
METHOD handle_double_click .
PERFORM handle_double_click USING e_row e_column e_row_number .
ENDMETHOD .
ENDCLASS .
reward if useful
regards,
preet
2008 Apr 07 5:51 PM
Hi Noman,
Look at [ABAP Objects Examples Wiki Page|https://wiki.sdn.sap.com/wiki/x/Aq] on [ABAP Objects Wiki Section|https://wiki.sdn.sap.com/wiki/x/o5k],
there is a lot of useful stuff like [ABAP Objects - Creating your First Local Class - Defining Components|https://wiki.sdn.sap.com/wiki/x/OKg].
Also Look at [ABAP Objects Library|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=abap+objects&cat=sdn_all] there is a lot of samples.
Don't forget to close this Thread when your question be answered !
Regards,
Marcelo Ramos
2008 Apr 11 9:19 AM
hi,
go througghthis link , with screen shots.
http://saptechnical.com/Tutorials/OOPS/GlobalCopies/FromLocalClass.htm
Do Reward Points If Usefull to u.
Regards
Fareedas