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: 

ADT refactoring error "References in Transactions found. Refactoring is impossible."

Sandra_Rossi
Active Contributor
369

Hi experts,

I tried to rename a method of a global class, and I get the error "References in Transactions found. Refactoring is impossible." No information found in the forum.

The only transaction codes I have created are not directly linked to the global class. One starts a report which runs a method of this class. The two other ones are linked to methods of a completely-empty class. So I don't see why there would be a problem with refactoring.

Any idea what is the issue, how to solve? (okay I guess I'll have to go for the deletion of transaction codes or any other workaround).

I'm using ADT 3.30.2 with ABAP 7.57 SP 0 (on premise).

Thanks!

1 ACCEPTED SOLUTION

tosgross
Advisor
Advisor
275

Hi Sandra,

The Rename Refactoring relies on the Where-Used List of the object to determine if renaming is supported. An error like the one you're seeing will appear if the object is referenced in an Where-Used List entry where Rename is not supported. This is currently the case with class methods referenced in Transactions. Hence, the error pop-up is working as intended, and you'll unfortunately need to manually rename and maintain the method name in this case.

However, when a transaction is solely executing a report which employs a method of a class you wish to rename, the renaming should indeed be supported and not cause the error you've reported. This does appear to be a bug - perhaps with the Where-Used List.

Unfortunately, I have been unable to reproduce the issue on our systems. If you want us to look deeper, we would either need a detailed guide from you on reproducing the bug, or alternatively, you could open a ticket using the Refactoring component (BC-DWB-AIE-REF).

The simplest solution/workaround for now seems to be to rename the references manually.

Best Regards

4 REPLIES 4

matt
Active Contributor
275

I've encountered this a few times. Fortunately I've been able to do a simple search replace to get around it.

Sandra_Rossi
Active Contributor
275

matthew.billingham Thanks. Yes, renaming manually is the simplest way. I explored the other workaround by changing the 3 transaction types to remove the links with ABAP report and class, and I could then rename the method.

But honestly, I still don't understand the SAP logic to decide "refactoring is impossible", because there was absolutely no direct link between the transaction codes and the concerned class, except that the transaction is using an empty class which is not referred by any program (the where-used list of the class shows nothing).

I created another empty class which has exactly the same all default properties as the other empty class (as far as I could see), and no error when renaming after I have linked one transaction code to this class instead of the other class. So it seems SAP has kept some information on the "past life" of the other empty class which prevented the refactoring. I tried to delete object directory entries, reassigning packages, deleting, recreating with same name, clear SAP buffers and shared memory, check transport requests and cross reference tables, nothing helped. Looks like a bug somewhere.

tosgross
Advisor
Advisor
276

Hi Sandra,

The Rename Refactoring relies on the Where-Used List of the object to determine if renaming is supported. An error like the one you're seeing will appear if the object is referenced in an Where-Used List entry where Rename is not supported. This is currently the case with class methods referenced in Transactions. Hence, the error pop-up is working as intended, and you'll unfortunately need to manually rename and maintain the method name in this case.

However, when a transaction is solely executing a report which employs a method of a class you wish to rename, the renaming should indeed be supported and not cause the error you've reported. This does appear to be a bug - perhaps with the Where-Used List.

Unfortunately, I have been unable to reproduce the issue on our systems. If you want us to look deeper, we would either need a detailed guide from you on reproducing the bug, or alternatively, you could open a ticket using the Refactoring component (BC-DWB-AIE-REF).

The simplest solution/workaround for now seems to be to rename the references manually.

Best Regards

0 Kudos
275

Thanks Tosha. I renamed manually, that was quick. I couldn't reproduce with brand new transaction code and global class, so I prefer to give up right now, but thanks for proposing opening a ticket, I'll keep it in mind if the case happens again.