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

ABAP Objects : calling one method from another class

Former Member
0 Likes
2,334

Hi,

Can you please tell me how to call method from one class or interfce to another class.The scenario is

I have one class CL_WORKFLOW_TASK, this class have interface IF_WORKFLOW_TASK & this interface have method IF_WORKFLOW_TASK~CLOSE. Now my requirement is ,

There is another class CL_WORKFLOW_CHAIN ,this class have interface IF_WORKFLOW_CHAIN & this interface have method IF_WORKFLOW_CHAINCLOSE_ALL_PREDECESSORS. Now i have to write my code in this method but i have to use IF_WORKFLOW_TASKCLOSE method for closing the task.

Can you please give me the code for the above .

Please waiting for reply.

2 REPLIES 2
Read only

Former Member
0 Likes
815

Hi,

You can use the concept of INHERITANCE in this scenario.By using this concept, you can call all the public and protected methods of class CL_WORKFLOW_TASK in the required calss CL_WORKFLOW_CHAIN as per your requirement.

Go through the Introdctory(INHERITANCE) programming from this SAPHELP link.

http://help.sap.com/saphelp_nw70/helpdata/en/1d/df5f57127111d3b9390000e8353423/content.htm

I hope, it will help in you inresolving your problem.

by

Prasad GVK.

Read only

Former Member
0 Likes
815

Hi Mehul,

you should create an object of the IF_WORKFLOW_TASK implementing class i.e. CL_WORKFLOW_TASK.

then you can call the close method with this object. Isn't it? Because interface mehods are always public and will be visible.

Hope this helps!

Regards!

Sandip