‎2006 Jul 18 1:01 PM
Hi Experts,
I am new to Object orientedABAP.
Can any body tell me how to call a built-in class and method in to my ABAP report with some example?
Regards
‎2006 Jul 18 1:10 PM
go to pattern and choose ABAP object patterns.
Enter object name,method name and class name.
To call object
enter class name and object name.
Reward points if helpful.
Naveen
‎2006 Jul 18 1:07 PM
‎2006 Jul 18 1:12 PM
Hi Thanks.
Points are given.
Whare to create object for the class?
After creating object for that calss we need to call that method by clicking Pattern button?
‎2006 Jul 18 1:15 PM
You can create the object/instance of the class in the program (report / dialog program) where you want to make that call. Even the CREATE OBJECT also can be done using the pattern
Once that is done use the instnace name and the class name to get the pattern of the method.
Regards,
Ravi
‎2006 Jul 18 1:20 PM
Hi Ravi,
This is how u can create object!!
DATA: container TYPE REF TO cl_gui_custom_container,
tree TYPE REF TO cl_gui_simple_tree.
CREATE OBJECT container
EXPORTING
container_name = 'CUSTOM'.
IF sy-subrc <> 0.
MESSAGE e009(zvikalp).
ENDIF.
CREATE OBJECT tree
EXPORTING
parent = container
node_selection_mode = cl_gui_simple_tree=>node_sel_mode_single.
IF sy-subrc <> 0.
MESSAGE e014(zvikalp).
ENDIF.
Other than this u also need to register events. and define the calss in the top include as shown-
----
CLASS lcl_tree DEFINITION
----
........ *
----
CLASS lcl_tree DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : catch_dbl FOR EVENT node_double_click OF
cl_gui_simple_tree IMPORTING node_key.
ENDCLASS.
----
CLASS lcl_tree IMPLEMENTATION
----
........ *
----
CLASS lcl_tree IMPLEMENTATION.
METHOD catch_dbl.
g_event = 'NODE_DOUBLE_CLICK'.
g_node_key = node_key.
ENDMETHOD.
ENDCLASS.
Hope this helps u.
Regards,
Seema.
‎2006 Jul 18 1:09 PM
hi,
Tcode -> SE24. Give the class name cl_http_client->
Display. You will find a list of methods that are implemented in that class.
call method cl_http_client=>create_by_url
exporting
url = wf_string
importing
client = http_client
exceptions
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
others = 4.
create_by_url is a <b> STATIC </b> method. So, we used => as operator. If we want to access <b>INSTANCE</b> methods, we have to use -> operator.
Regards,
Sailaja.
‎2006 Jul 18 1:10 PM
go to pattern and choose ABAP object patterns.
Enter object name,method name and class name.
To call object
enter class name and object name.
Reward points if helpful.
Naveen
‎2006 Jul 18 1:11 PM
Ref : http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
you could find examples as well. In se38 also you could find it. or SE24 => where used list.
rgds,
TM.
‎2006 Jul 18 1:15 PM
Hi Ravi,
In Object Oriented There is you 1st make local class define all the and then implement event in it than in PBO set handler. and the class is:
Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes.
Object References
‎2006 Jul 18 1:17 PM
Hi,
Please check the transaction ABAPDOCU...wherein u will have all the things in the ABAP Objects folder.
Or else go to the transaction DWDM for demo of many examples. Take any example and look the source code. You will come to know.
Regs,
Venkat Ramanan N
‎2006 Jul 18 1:23 PM
check the Program <b>" BCALV_GRID_VERIFY"</b>
it will be helpfull for u.
‎2006 Jul 18 1:25 PM
Hi,
If it solves your problem award with maximu points.
Regs,
Venkat Ramanan N
‎2006 Jul 18 2:22 PM
Hi,
Have a look at these good links-
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
Mark useful answers.
Regards,
Tanuja.