Application Development 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: 

two methods with the same name in one class

Former Member
0 Kudos

Hi Guys,

I would like to ask you for help as I do not know how to get from the following situation.

By mistake I managed to create in one class two methods with the same name. I deleted one of those methods. However the whole class is stell in error after validation and the error message says 'method x has already been implemented'.

Do you have any idea what steps i need to do to remove the whole method at all. I cannot see it in the list of methods under the class.

Many thanks in advance,

Jan

6 REPLIES 6

uwe_schieferstein
Active Contributor
0 Kudos

Hello Jan

You may have a look at table TMDIR which contains the class methods. Perhaps you find two records which have a different index yet the same method name. If so then try delete one of the duplicated entries.

Regards

Uwe

0 Kudos

Thanks for the advise. But unfortunately there is only one entry in the table.

Basically now I can see in the class only one method x. When I validate the class it gives error that the method x has already been implemented. And when I click on the message it says that Method x does not exist.

Maybe I can try to remove the other method with name x. But I am a bit afraid that it will not solve the problem.

Any ideas how to solve this? Due to this I cannot move forward.

many thanks,

Jan

0 Kudos

HI

Please confirm that you deleted the method from the definition as well as implementation part of the class.

Thanks

Lalit Gupta

0 Kudos

Hi,

Can you please advise me where to delete it from the implementation part?

Tahnks,

Jan

0 Kudos

Hi

First of all I want to know that where you created your class, In SE24 or in any programm.

if in SE24, then go to se24 open that class go to methods tab and check if that method name accurs at two places, if not, then

click on that method and check the code.

or if in a program.

then you must have defined like

class <class name> definition.

public section

method <method name>

endclass.

class <class name> implementation.

method <method name>

code for that method.

endclass.

It might be possible you have set the implementation part twice for that particular method, So please check and delete one implementation for that method.

Thanks

Lalit Gupta

SuhaSaha
Advisor
Advisor
0 Kudos

Did you perform these actions (from the "Menu Functions"):

1. Utilities --> Clean Up --> Method Includes (basically select the one which is relevant in your case).

2. Utilities --> Regenerate Sections.

BR,

Suhas