cancel
Showing results for 
Search instead for 
Did you mean: 

ADT: Is it possible to convert local class to global class?

Peter_Inotai
Active Contributor

Hi,

In SE24 there is a possibility to convert a local class to a global class, however I cannot find any possibility in ADT. Is there something similar?

In quick assistant there is no relevant suggestion.

OK, in the end everything is text and manually copy and paste is possible, but I hoped a more elegant way.

Thanks,

Peter

FredericGirod
Active Contributor

does not work for me, even if the class start with a Z

Peter_Inotai
Active Contributor
0 Kudos

@frdric.girod: Thanks for the info

Accepted Solutions (1)

Accepted Solutions (1)

uenal
Employee
Employee
0 Kudos

Hi Peter,

with the on premise release 2021 there is a Quick Assist available for creating a global copy of a local class or interface in ADT:

Creating a Global Copy of Local ABAP Classes or Local ABAP Interfaces

Here is a list of the available Quick Assists for ADT:
https://help.sap.com/docs/ABAP_PLATFORM_NEW/c238d694b825421f940829321ffa326a/3ece8c7a5da142138408c8a...

Regards,

Ünal

Peter_Inotai
Active Contributor
0 Kudos

Hi Ünal,

Thanks for the info.

Best regards,

Peter

Peter_Inotai
Active Contributor
0 Kudos

I've tried it in the ABAP cloud version (SAP_BASIS 7.88 SP0003) and it worked fine.

Answers (1)

Answers (1)

pokrakam
Active Contributor

I was not aware this is possible in SE24...

But it's not much effort. One tip is to rename your local class to the intended global class name using ADT first, then all the usages will be refactored automatically. Create global class, cut/paste, done.

Peter_Inotai
Active Contributor

Thanks for the info.

In SE24 you can do it from menu Object type -> Import -> Local classes in programs

Actually I like if you have multiple local classes, then you can select the one(s) you want to convert.

pokrakam
Active Contributor

Interesting, I somehow missed that or it came along after I started using ADT.

But I just tried it and it really seems more trouble than it's worth. For starters it can only do classes from reports - I tend to write more local classes in global classes. The second issue is that it leaves the local class in place, it just does a copy. So all dependent code still needs to be refactored.