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

Java package concept in ABAP Objects

Former Member
0 Likes
390

Hi, just a question on grouping of classes in ABAP Objects.

In Java, you can group classes by "package" to avoid

namespace collision, my question, in ABAP Objects, how

do you group classes to avoid namespace collision?

I know that there is package concept in SAP/ABAP but it

is different concept in Java.

Thanks in advanced for your reply.

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
347

Hello

Every global class has to be assigned to a package within SAP. However, the package name is not (yet) part of the identification, thus there is <b>no package concept in ABAP</b> like in Java.

Also, method names are unique irrespective of their interface. Thus, an ABAP class cannot have the same method (name) several times.

Regards

Uwe

Read only

former_member183804
Active Contributor
0 Likes
347

Hello One and Lonley,

the package concept in ABAP and Java is quite different. In java the package name is part of the development object in ABAP not. So any class pool name is global unique. In combination with the restriction on 30 chars this leads often to somehow cryptic names.

The only way to escape this somehow is the excessive use of local classes. That mean classes defined within main programs. If you are on 7.00 you may check FuGr SAPLSAUNIT_TREE_CTRL_LISTENER for this technique.

Best Regards

klaus