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

Call methods

Former Member
0 Likes
854

I have a program that has several statements starting with this CALL_METHOD_* and then some parameters. Is this the same as PERFORM Z_TEST_1(Para1, para2,etc..).

For example, CALL_METHOD_CHECK_ALL 'DOC_TYPE' DOC_TYPE ZTABLE1-fielda_A.

Where can find source code for these CALL_METHOD statements?

What are the CALL_METHOD statements?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
811

Is there Help.sap.com link for OO and call methods?

5 REPLIES 5
Read only

Former Member
0 Likes
811

WE call methods of a class using the CALL METHOD statement.

If you will double click on this method name you will be navigated to class and there you can search for your method.

Further , you can also check the class documentation for purpose of methods.

Hope you understand it.

Read only

Former Member
0 Likes
811

The CALL METHOD is a key word for calling the OO methods.

We have global classes (created using SE24 transaction) and local classes (using SE38), which contains the collection of methods and attributes.

The method is a block of code which will have the business logic (like Subroutine as you mentioned) and the attributes are the parameters wherein you will inport/ export the data.

The above said methods in the class will be called using the keyword "CALL METHOD".

Before calling the method, we need to create an Object for the class. (If it is a static class we can call the method using the class name itself)

TYPES: obj1 TYPE REF TO zcl_sample.

CREATE OBJECT obj1

EXPPORTING

IMPORTING

EXCEPTIONS.

(while creating the method, the special method constructor will be called)

After the creation of the method, we need to call the method like the below,

CALL METHOD obj1->add

EXPORTING

IMPORTING

The above method is call as "Instance Method"

Static method does not require any method.

CALL METHOD zcl_sample=>add

Hope you understand.

Rgds,

Benu

Read only

Former Member
0 Likes
812

Is there Help.sap.com link for OO and call methods?

Read only

Clemenss
Active Contributor
0 Likes
811

Hi Sam,

if this code

CALL_METHOD_CHECK_ALL 'DOC_TYPE' DOC_TYPE ZTABLE1-fielda_A.

comes from your program it must be a macro call. Double-click on the word CALL_METHOD_CHECK_ALL and you get to the macro definition. Then check F1 online help on macros.

And next time,please use the above <_> code button after selecting code with the mouse. This enables the reader to know what is ABAP code and what is freestyle writing.

Regards,

Clemens