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

Code completion particular not working

Former Member
0 Likes
1,292

Hello,

in my program there are serveral internal classes. Each class has its own include file. Code completion seems not working for internal classes in other include files.

example:

lcl_class1 in includec01   (first included)

     class-methods static1_1

     methods method1_1

lcl_class2 in includec02   (second included)

     class-methods static1_1

     methods method1_1

problem:

  • While development in lcl_class2 there are no code completion for lcl_class1.
  • No code completation for lcl_class1=>static1_1
  • but if you declarate "data lo_myclass type ref to lcl_class1." code completion is working fine for public member methods and attributes in the same file.

    In Functiongroups all working fine.

    Best Regards

    Markus Bauernschmitt

    ----------------

    Und da hier eh die meisten deutschsprachig sind und mein Englisch grausam ist, nachfolgend die Erklärung nochmal auf deutsch.... 😉

    In meinen Programmen findet die Codevervollständigung keine interne Klassen aus vorangegangenen include Dateien. Dadurch werden weder die Klassen selbst noch die statischen Methoden angezeigt. Gebe ich eine statische Methode ein und möchte die Hilfe anzeigen (F2) erscheint die Fehlermeldung "Codeinformationen sind nicht verfügbar".

    Dieses Problem tritt nicht auf, falls die Deklaration einer Variablen in der gleichen Include Datei erfolgt.

    • Deklaration einer Variablen in der aktuellen Include Datei -> Dokumentation der öffentlichen (nicht statische) Methoden und Attribute funktioniert
    • Zugriff auf öffentliche (statische oder nicht statische) Methoden und Attribute von globalen Variablen (deklariert in einer anderen Datei) funktioniert dagegen nicht.

    Es sind nur anscheinend nur Programme betroffen. Bei Funktionsgruppen (getestet am Beispiel "ldemo_cr_car_rental_screen") trat der Fehler nicht auf.

    7 REPLIES 7
    Read only

    dilorenzo
    Participant
    0 Likes
    1,174

    Hi Markus,

    I think the local classes are for small programs ("quick and dirty").

    If your solution is so complex, that you feel it must be in separate files, why don't you create global classes?

    Regards,

    Dominik

    *********************

    Und damit Du mich auch gut verstehst

    Ich glaube, lokale Klassen sind eher für kleine Programme gedacht.

    Wenn es aber so komplex wird, dass Du meinst es in verschiedene Includes aufteilen zu müssen, warum erstellst Du keine globalen Klassen?

    Read only

    Former Member
    0 Likes
    1,174

    Hi Dominik,

    thank you for your answer. The internal classes are already simple and lightweight. In my understanding of OO I keep classes private as possible and so I create this specific "one program helper classes" in the smallest reasonable scope.

    However, this is a architektur decission. But the pivotal question is: Why working this kind of code completion in function groups but not in programs.

    Some additional information.

    - Code completion working in "START-OF-SELECTION."

    - In Functiongroup includes (Testcase lcl_class1 show as public type and lcl_class2 show as local public class.

    Best regards

    Markus

    Read only

    0 Likes
    1,174

    Hi Markus,

    I also had this problem when extending one of these old programs with many includes.

    And I thought about the reason, why SAP did not support it.

    And then I thought, that maybe SAP does not want us to create programs with includes but to program with global classes.

    But maybe one of the SAP ADT team can enlight us here

    Best regards,

    Dominik

    Read only

    Former Member
    0 Likes
    1,174

    Hi Markus,

    I just tried to reconstruct your scenario and everything works fine for me: Eclipse Luna, current ADT plugins (fetched from update-site) and backend is on 7.40 SP05 release.

    The syntax check is working and the code completion works in all includes and the main program.

    What release do you use?

    Thank you & best regards

    Martin

    Read only

    0 Likes
    1,174

    Hi Martin,

    Luna Service Release 1a (4.4.1)

    ABAP Development Tools for SAP NetWeaver Version: 2.36.3

    SAP Backend:   NW 7.40 SP06

    ---- edit ---

    Perhaps the problem is adt detect this class as "open type" instead of "local public class". A screenshot is attached.

    Best regards

    Markus

    Read only

    0 Likes
    1,174

    Hi again,

    I proved again and found out that I am working with version 2.36.2. Maybe the newer release has got an defect. In "my version" both classes are shown in the correct way and are accessible like expected.

    Maybe can help?

    Best regards,

    Martin

    Read only

    0 Likes
    1,174

    Hi,

    just a quick update. I spoke with one of the main developers of the ABAP code completion. He will shine some light into this issue asap.

    cheers

    Thomas