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

Error: Method is not declared or inherited in class

Former Member
0 Likes
12,415

Hi,

I have created one utility class ZCL_ABAP_REPORT_UTILITIES with different methods. Initially, I have created 3 methods and moved to production successfully. Later created a new method 'M1'(Transport T1) and moved to QA system and then created another new method 'M2'(Transport T2) and moved to QA system. Till then it is fine. Due to some urgency, we have moved T2 TR to production and the T2 TR got failed due to transport sequence issue. To fix this issue, we have tried to move the TR T1 to production and it went failed with error "Method 'M2 is not declared or inherited in class "ZCL_ABAP_REPORT_UTILITIES".

I have captured all the methods in the new TR and tried to move to production, it still got the same error. I'm stuck here and couldn't resolve the error.

Can you please help in resolving this issue. Issue is in production, so can't clean up the errors using Utilities->Clean Up->Method Includes.

Please suggest any other alternatives in resolving the issue ASAP.

Thanks,

Saleem.


1 ACCEPTED SOLUTION
Read only

pokrakam
Active Contributor
8,188

The easiest way out of these is to transport the whole class. Create a TR and manually add it as R3TR / CLAS / ZCL...

Hi,

I have created one utility class ZCL_ABAP_REPORT_UTILITIES with different methods. Initially, I have created 3 methods and moved to production successfully. Later created a new method 'M1'(Transport T1) and moved to QA system and then created another new method 'M2'(Transport T2) and moved to QA system. Till then it is fine. Due to some urgency, we have moved T2 TR to production and the T2 TR got failed due to transport sequence issue. To fix this issue, we have tried to move the TR T1 to production and it went failed with error "Method 'M2 is not declared or inherited in class "ZCL_ABAP_REPORT_UTILITIES".

I have captured all the methods in the new TR and tried to move to production, it still got the same error. I'm stuck here and couldn't resolve the error.

Can you please help in resolving this issue. Issue is in production, so can't clean up the errors using Utilities->Clean Up->Method Includes.

Please suggest any other alternatives in resolving the issue ASAP.

Thanks,

Saleem.


12 REPLIES 12
Read only

pokrakam
Active Contributor
8,189

The easiest way out of these is to transport the whole class. Create a TR and manually add it as R3TR / CLAS / ZCL...

Read only

Former Member
0 Likes
8,188

In my new TR i have captured all the methods. Please find the below screen shot. But from the Transport Object I dont find entry R3TR / CLAS / ZCL. Is this the reason my issue not resolved? Do i have to maintain manually "R3TR / CLAS / ZCL." in my transport request?

Read only

matt
Active Contributor
8,188

You ask:

Do i have to maintain manually "R3TR / CLAS / ZCL." in my transport

Mike has already said

Create a TR and manually add it as R3TR / CLAS / ZCL...

Read only

pokrakam
Active Contributor
0 Likes
8,188

See Matthew's answer.Just add the entry as I described to an empty transport, nothing more, nothing less.

Read only

Former Member
0 Likes
8,188

Hi Mike,

Thanks a lot, I'm able to solve the class issue by maintaining manually "R3TR / CLAS / ZCL." in my new transport. However, when I re-import old error TR1(which has only method M1) new method(M2) got deleted and TR went into error again. Can you please suggest how to resolve these error TR's.

TR1-->Method M1

TR2-->Method M2

Really appreciate your suggestions.

Thanks,

Saleem.

Read only

matt
Active Contributor
0 Likes
8,188

What EXACTLY are the contents of each transport?

Read only

Former Member
0 Likes
8,187

Here the TR details: TR1 and TR2. I have initially moved TR2 to production before TR1 and so caused an issue.

As suggested by you, I have captured my class manually in TR R3TR / CLAS / ZCL..." and moved, so my class issue got resolved. But when i re-imported my TR1 it overrides the whole class and went into an error saying that method 'CREATE_XLS_FROM_ITAB' is not declared or inherited in class "ZCL_ABAP_REPORT_UTILITIES" though this method doesn't exist in my TR1.

TR1:

TR2:

Read only

8,187

It works exactly how it's designed to work.
TR1 contains an outdated version of your Class, without the declaration of your M2, so, when you move it into Production, the declaration of M2 is overwritten with the "old" TR1 version.

You have 2 choices:

1-Import in Production TR1, TR2 and the new manual TR3 you created (there is the option to do that in STMS): in this way you take everything to production and you have no more problems.

2-Create a new TR4, type Transport of Copies, and attach the TR1, TR2, TR3 to it, bring TR4 to production, forget the other three TRs

Read only

pokrakam
Active Contributor
8,187

As Simone already explained, this is as designed. If you follow up the failed transport with another TR containing the complete class R3TR/CLAS/ZCL_ABAP_REPORT_UTILITIES, you should end up in a consistent state. No further action required.

Read only

matt
Active Contributor
8,187

That's to be expected. You're overwriting the public section of the fixed class with the old public section which doesn't have that method.

There is no way to import TR1 so that it doesn't produce an error.

Read only

Former Member
0 Likes
8,187

Thanks Mike, Matthew, and Simone for your suggestions. I have created new TR(Transport of copies) and captured all the existing TR's and my class is now in the consistent state. But my client wants to make those earlier TR's in green status. He doesn't want any TR in rc=8 status. 😞

For this, I have retrieved the older version of my class and moved all the previous error TR's in sequence. Now TR's went into production without any issues.

Thank you so much for all your support on this issue.

Read only

matt
Active Contributor
8,187

Hmm. Your client needs education. What matters is a consistent system... Not green imports. That's just spending money for no reason.