Import local class to global

Hi,
i try to import local classes to global classes and i have error ,
in the program in se 80 (lcocal) i declare global declaration
like:
TYPE-POOLS icon.
TYPES: ty_fuel TYPE p DECIMALS 2,ty_cargo TYPE p DECIMALS 2.
and after that i declare the local class in includes .. and/// start of selection
where i put it ?
Regards

Hi,
i don't build another program the declaration is in the local progarm,
and i have method that have to use icon ,
where i put this declaration  i try in local types but i have error .
Explicit length specifications are necessary with types C, P, X, N, and
W in the OO context.
Regards

Similar Messages

  • How to export local class to global class in abap ?

    is there any report that can export local class to a global class ?
    thanks !

    Hi,
      you can go to  SE24  and  there you can create a new class with reference to the class already created and your new class will have the same properties as  your local class.

  • Create Global Class Definition using Local Class Source Code

    I would like to be able to automate the creation of global class definitions using source code that is defined in a text file (one example: convert a local class def to a global class def).
    Does SAP deliver this functionality?  (I'm already aware of the various classes that can be used to create global classes and how those classes can be implemented in a program to generate new classes.  I'm hoping to avoid having to create a custom solution.)
    Thanks in advance!

    We have a winner!
    Thanks Rich!
    It's not a 100% solution - I was hoping to be able to generate global classes/interfaces using source code alone, without requiring user intervention.
    It <i>is</i> however, a 90-95% solution because debugging SE24 reveals that by using a combination of the FM's SCAN_ABAP_OBJECTS_CLASSES & SEO_CLIF_MULTI_IMPORT, I should be able to <u>quickly</u> put together that custom application that I was trying to avoid.
    I knew about the existance of SEO_CLIF_MULTI_IMPORT but I did not know about SCAN_ABAP_OBJECTS_CLASSES.  I'm very happy to learn that I'm not going to have to write a parser!

  • Local class - global class

    Hi Friends,
      Can a local class make friend with global class???
      for example i have a local class in se38 editor and this local class should access the private attribute of global class which is there in se24.
    Deepak

    HI Deepak
       Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
    CLASS <name of global class to be tested> DEFINITION LOCAL FRIENDS <name of local ABAP Unit class> in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
    just refer these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm
    local class -> global class
    Regards Rk

  • Policy regarding creating global or local classes?

    Hi!
    What policy do you have regarding creating local or global classes in your company? We have decided to mostly use local classes since there is a risk of reusing global classes (when changing something in the global class after it has been used by several programs etc.) . But on the other side it is much easier to use transaction SE24 than creating all the includes by hand.  Have anyone else made thoughts about this issue?
    Regards, Tine

    Hi,
    The policy is
    <b>Create global class</b> if you want the class to be <b>reused</b>.
    And<b> to avoid problems</b> when you change the class, make sure you change class in such a way that it does not effect the existing user's of the class.
    Like <b>use OPTIONAL parameters</b> when you change method signature, <b>avoid changing method names</b>, <b>instead add new methods</b>.
    You should use local classes only when you are sure that the code there is needed only by your program and nobody else.
    If you keep creating local class's and <b>if two programs need the same class it is redundant to create local class's</b> and if you want a change in the class you have to change in all the places.
    I hope it is clear.
    Regards,
    Sesh

  • Local class as a friend of a global class

    Hi guys,
    I'm just wondering if I could make a local class which is defined in the local section of a global class to its friend. I need this to check private attriutes and methods with abap unit.
    Regards Christian

    Hi Christian,
    Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
    CLASS  in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
    Regards,
    Sükrü

  • Local Class Transaction Code Problem

    Hi friends,
            I have created report program using local class. I have also used selection screen to get input from user. I have created oops transaction code (using se93) for that program.
    Problem is selection screen is not displayed when program is executed using tcode.
    I think logically it not possibel to display the selection screen. Is it true?. OR
    What Should I do?.
    Next Question is, I have also created  global class from my report program. But i cant able to find my class in se24.
    I have done following things.
      1) imported a local class from my report prg. ( In pop up screen that class icon(circle shaped icon) shown in gray colour)
      2) Assigend New class name starting with 'Z'.
      3) Selected overwrite existing class checkbok.
      4) selected import icon.
          'Import Completed Succesfully' message appeared. Still i am not able to find my class.
         Kindly provide answers.
    Thanks In Advance,
    S.Senthil

    Hi senthil kumar ,
    u can display the selection screen and secondly try to create your report in module pool type,
    and when also check if the class is activated or not and then check in se24,
    if still the issue remains
    let me know...
    thanks
    ravi

  • Problem with local class, static private attribute and public method

    Hello SDN,
    Consider the following situation:
    1) I have defined a LOCAL class airplane.
    2) This class has a private static attribute "type table of ref to" airplane (array of airplanes)
    3) A public method should return the private static table attribute
    Problems:
    a) The table cannot be given as an EXPORTING parameter in the method because TYPE TABLE OF... is not supported and I get syntax errors. I also cannot define a dictionary table type because it is a local class.
    b) The table cannot be given as a TABLES parameter in the method because TABLES is not supported in the OO context.
    c) The table cannot be given as an EXPORTING parameter in the method defined as LIKE myStaticAttribute because my method is PUBLIC and my attribute is PRIVATE. ABAP syntax requires that all PUBLIC statements are defined before PRIVATE ones, therefore it cannot find the attribute to reference to with LIKE.
    I see only 2 solutions:
    a) Never ever use local classes and always use global classes so that I might define a dictionary table type of my class which I can then use in my class.
    b) Make the attribute public, but this goes against OO principles, and isn't really an option.
    Am I missing anything here, or is this simply overlooked so far?

    Hello Niels
    Since your class is local and, thus, only know to the "surrounding" application is does not really make sense to make it public to any other application.
    However, if you require to store instances of your local classes in internal tables simply use the most generic reference type possible, i.e. <b>OBJECT</b>.
    The following sample report shows how to do that. Furthermore, I believe it also shows that there are <u><b>no </b></u>serious inconsistency in the ABAP language.
    *& Report  ZUS_SDN_LOCAL_CLASS
    REPORT  zus_sdn_local_class.
    " NOTE: SWF_UTL_OBJECT_TAB is a table type having reference type OBJECT
    *       CLASS lcl_airplane DEFINITION
    CLASS lcl_airplane DEFINITION.
      PUBLIC SECTION.
        DATA:    md_counter(3)             TYPE n.
        METHODS: constructor,
                 get_instances
                   RETURNING
                     value(rt_instances)   TYPE swf_utl_object_tab.
      PRIVATE SECTION.
        CLASS-DATA: mt_instances    TYPE swf_utl_object_tab.
    ENDCLASS.                    "lcl_airplane DEFINITION
    *       CLASS lcl_airplane IMPLEMENTATION
    CLASS lcl_airplane IMPLEMENTATION.
      METHOD constructor.
        APPEND me TO mt_instances.
        DESCRIBE TABLE mt_instances.
        md_counter = syst-tfill.
      ENDMETHOD.                    "constructor
      METHOD get_instances.
        rt_instances = mt_instances.
      ENDMETHOD.                    "get_instance
    ENDCLASS.                    "lcl_airplane IMPLEMENTATION
    DATA:
      gt_instances      TYPE swf_utl_object_tab,
      go_object         TYPE REF TO object,
      go_airplane       TYPE REF TO lcl_airplane.
    START-OF-SELECTION.
      " Create a few airplane instance
      DO 5 TIMES.
        CREATE OBJECT go_airplane.
      ENDDO.
      gt_instances = go_airplane->get_instances( ).
      CLEAR: go_airplane.
      LOOP AT gt_instances INTO go_object.
        go_airplane ?= go_object.
        WRITE: / 'Airplane =', go_airplane->md_counter.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe<u></u>

  • When is it best to use Local Classes..?

    Hi All,
           We all know that a global class creation is very helpful wherein the class can be reused by multiple programs.In contrast when is it best to use a local class within the program...?
    Can anyone please share the sample scenarios where we need to make use of a local class...?
    Cheers
    Nishanth

    Hi Nishanth,
    First of all, there will be a few cases when creating a local class in your program is mandatory. For example,
    if you're using an ALV Grid on your screen using the OO Approach, then you <b>must</b> declare a class locally in
    your program if you want to handle the events. You cannot use a subroutine in this case.
    Secondly, if you are looking for an explanation that is more introductory in nature, then the ABAP Programming
    help has got some good documentation. Here are the links which explain the concepts with an example as a
    transition from function groups to classes -
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Regards,
    Anand Mandalika.

  • MB_MIGO_BADI and use of local class of SAPLMIGO

    Hello
    I used the BADI MB_MIGO_BADI and methode LINE_MODIFY to change all i want on the ITEM. That's OK and all is working.
    But, because there is  a but...I'd like to check if the item fields are input fields, invisible fieds, etc, etc , exactly like on a loop at screen for example.
    For this, SAP use in standard in SAPLMIGO a local class named lcl_migo_screenmodification ( in include LMIGOSM3 of ECC5.0 ) with the methode get :
        get
          IMPORTING
            i_global_counter TYPE migo_global_counter   OPTIONAL
            i_field          TYPE migo_fieldname
            i_badi           TYPE abap_bool             OPTIONAL
          RETURNING
            value(r_status)  TYPE migo_fs_status,
    and this is perfect to know the attributes of each screen field, depending the status return.
    But, in the BADI, is it possible to use a local class during the run time of the MIGO  ? and HOW if possible ?
    thanks for your help

    Yep, this is exactly what class loaders are for. Create a URLClassLoader pointing to the specific URL you want the classes loaded from. Then use findClass on the ClassLoader to find a Class object, and newInstance on that Class object to get an instance of the class.
    Another thing you should do is completely empty out the user's classpath before running Java, so you know the only classes you're dealing with are the ones you're loading. Kinda hard for an applet, but controllable for an application.

  • Custom class loader and local class accessing local variable

    I have written my own class loader to solve a specific problem. It
    seemed to work very well, but then I started noticing strange errors in
    the log output. Here is an example. Some of the names are in Norwegian,
    but they are not important to this discussion. JavaNotis.Oppstart is the
    name of my class loader class.
    java.lang.ClassFormatError: JavaNotis/SendMeldingDialog$1 (Illegal
    variable name " val$indeks")
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
    at JavaNotis.Oppstart.findClass(Oppstart.java:193)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at JavaNotis.SendMeldingDialog.init(SendMeldingDialog.java:78)
    at JavaNotis.SendMeldingDialog.<init>(SendMeldingDialog.java:54)
    at JavaNotis.Notistavle.sendMelding(Notistavle.java:542)
    at JavaNotis.Notistavle.access$900(Notistavle.java:59)
    at JavaNotis.Notistavle$27.actionPerformed(Notistavle.java:427)
    JavaNotis/SendMeldingDialog$1 is a local class in the method
    JavaNotis.SendMeldingDialog.init, and it's accessing a final local
    variable named indeks. The compiler automatically turns this into a
    variable in the inner class called val$indeks. But look at the error
    message, there is an extra space in front of the variable name.
    This error doesn't occur when I don't use my custom class loader and
    instead load the classes through the default class loader in the JVM.
    Here is my class loading code. Is there something wrong with it?
    Again some Norwegian words, but it should still be understandable I hope.
         protected Class findClass(String name) throws ClassNotFoundException
             byte[] b = loadClassData(name);
             return defineClass(name, b, 0, b.length);
         private byte[] loadClassData(String name) throws ClassNotFoundException
             ByteArrayOutputStream ut = null;
             InputStream inn = null;
             try
                 JarEntry klasse = arkiv.getJarEntry(name.replace('.', '/')
    + ".class");
                 if (klasse == null)
                    throw new ClassNotFoundException("Finner ikke klassen "
    + NOTISKLASSE);
                 inn = arkiv.getInputStream(klasse);
                 ut = new ByteArrayOutputStream(inn.available());
                 byte[] kode = new byte[4096];
                 int antall = inn.read(kode);
                 while (antall > 0)
                     ut.write(kode, 0, antall);
                     antall = inn.read(kode);
                 return ut.toByteArray();
             catch (IOException ioe)
                 throw new RuntimeException(ioe.getMessage());
             finally
                 try
                    if (inn != null)
                       inn.close();
                    if (ut != null)
                       ut.close();
                 catch (IOException ioe)
         }I hope somebody can help. :-)
    Regards,
    Knut St�re

    I'm not quite sure how Java handles local classes defined within a method, but from this example it seems as if the local class isn't loaded until it is actually needed, that is when the method is called, which seems like a good thing to me.
    The parent class is already loaded as you can see. It is the loading of the inner class that fails.
    But maybe there is something I've forgotten in my loading code? I know in the "early days" you had to do a lot more to load a class, but I think all that is taken care of by the superclass of my classloader now. All I have to do is provide the raw data of the class. Isn't it so?

  • What is meant by Local Class and how we can create local classes in abap?

    Hi Friends
    what is meant by Local Class and how we can create local classes in abap?
    Regards,
    Sree

    Hi
    Local classes are the classes which we declare and use using the SE38 ABAP editor
    Global classes are the classes which we find in SE24 and call the methods of them into our program.
    see the sample code
    REPORT zs_class.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS:p_var TYPE i,
    p_var1 TYPE i.
    SELECTION-SCREEN END OF BLOCK b1.
    CLASS d_class DEFINITION
    CLASS d_class DEFINITION.
    PUBLIC SECTION.
    METHODS:
    add,
    sub.
    PROTECTED SECTION.
    DATA : var2 TYPE i.
    ENDCLASS. "d_class DEFINITION
    CLASS d_class IMPLEMENTATION
    CLASS d_class IMPLEMENTATION.
    METHOD add.
    var2 = p_var + p_var1.
    WRITE:/ var2.
    ENDMETHOD. "add
    METHOD sub.
    var2 = p_var - p_var1.
    WRITE:/ var2.
    ENDMETHOD. "sub
    ENDCLASS. "d_class IMPLEMENTATION
    START-OF-SELECTION
    START-OF-SELECTION.
    DATA: obj TYPE REF TO d_class.
    CREATE OBJECT: obj .
    CALL METHOD: obj->add,
    Regards
    Anji

  • Oc4j class-loading-heirarchy - enabling "search-local-classes-first" option

    Guys,
    I need some assistance with regards to oc4j class-loading hierarchy. Would appreciate some feedback on this...
    Let me give you a bit of context first.
    Basically we have 3 war modules which we initially were deployed separately on oc4j (transparently deployed by oc4j as ear). Now all of a sudden we have come to the need of instead bundling all the wars in one ear. The problem i started seeing is with respect to the output logs for the application, which was one per war modules initially (this was not clutter everything in one single log file and instead have one per deploy-able unit). The way this was implemented is that we had a log4j.properties bundled with each war with the output-file configuration, and since these 3 wars were deployed separately, the ear class-loader for each application would find one log4j.properties within each, and hence output-logs were generated as expected.
    BUT now all of a sudden as we have changed the whole deployment structure, i.e. one EAR, all the application log-outputs are going to one single log file (instead of one for each war). My immediate impression was setting the "search-local-classes-first" would resolve this issue, since then the "web-module-class-loader" (one for each war) would come into play (which i believe doesn't otherwise) and would load/search for the resources/classes first (log4j.properties in our case) from the web-module (both in WEB-INF/lib and WEB-INF/classes folder) and if not found, only then it would give the job to the parent class-loader, which would be the ear-class-loader. But it doesnt seem like its working like that, since even after enabling this option, all logs are going to one log-output file, based on whichever war-module/log4j.properties is loaded first.
    Thanks in advance and Regards,
    Farhan.
    Edited by: FarhanS on Nov 3, 2008 12:36 PM

    Guys, i need some input here....
    I turned on the class-loading trace and found out as to what is going on...but still wondering as to whats the reason for this behavior...
    So basically browsing through the trace, gave me the following important segments (as below with my comments)....
    1) Firstly, as the class-loading trace below, the log4j.jar is loaded up from the ear/lib directory (and hence by the ear-class-loader) and as it says the one in the web-inf/lib is ignored....Wonder why it picks up the one from ear/lib directory WHEN i have set the search-local-classes-first to "true", isn't the very purpose of the attribute to delegate the class-loading to the parent class-loader IFF the same is not found locally...
    Code-source /oracle_apps/j2ee/portal/applications/wes-ear/wes-wicket-1.3.X-SNAPSHOT/WEB-INF/lib/log4j-1.2.15.jar (from WEB-INF/lib/ directory in /oracle_apps/j2ee/portal/applications/wes-ear/wes-wicket-1.3.X-SNAPSHOT/WEB-INF/lib)
    has been ignored. It is a copy of /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib), which is already visible in the search path of
    loader wes-ear.web.wes-wicket-1.3.X-SNAPSHOT:0.0.0. 2) Now on the other hand as you would see from the log-excerpts below, the log4j.properties resource file (with the log-output-file-name and all) is picked up from the very web-module class-loader, but as you would notice further, the log4j classes are initialized by the ear-loader itself with which the log4j classes are visible to all the other war-modules and hence don't even require re-initializing the log4j.properties...
    ====== THE RESOURCE CORRECTLY LOCATED BY THE WEB-CLASS-LOADER ======
    Resource found: log4j.properties. Loader: wes-ear.web.wes-wicket-1.3.X-SNAPSHOT:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/wes-wicket-1.3.X-SNAPSHOT/WEB-INF/classes/
    (from WEB-INF/classes/ in /oracle_apps/j2ee/portal/applications/wes-ear/wes-wicket-1.3.X-SNAPSHOT/WEB-INF/classes)
    === ALL THE Log4j CLASSES BELOW ARE BEING INITIALIZED/LOADED BY THE EAR-CLASS-LOADER =====
    Class found: java.net.URL. Initiating loader: wes-ear.root:0.0.0. Defining loader: jre.bootstrap:1.5.0_06. Source: jre bootstrap
    Class to be defined: org.apache.log4j.PropertyConfigurator (12024 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class found: org.apache.log4j.PropertyConfigurator. Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class to be defined: org.apache.log4j.helpers.FileWatchdog (1875 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class found: org.apache.log4j.helpers.FileWatchdog. Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class to be defined: org.apache.log4j.PropertyWatchdog (753 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class found: org.apache.log4j.PropertyWatchdog. Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class found: java.io.InputStream. Initiating loader: wes-ear.root:0.0.0. Defining loader: jre.bootstrap:1.5.0_06. Source: jre bootstrap
    Class found: java.io.FileInputStream. Initiating loader: wes-ear.root:0.0.0. Defining loader: jre.bootstrap:1.5.0_06. Source: jre bootstrap
    Class found: java.util.Properties. Initiating loader: wes-ear.root:0.0.0. Defining loader: jre.bootstrap:1.5.0_06. Source: jre bootstrap
    Class found: java.util.StringTokenizer. Initiating loader: wes-ear.root:0.0.0. Defining loader: jre.bootstrap:1.5.0_06. Source: jre bootstrap
    Class to be defined: org.apache.log4j.Appender (676 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class found: org.apache.log4j.Appender. Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class to be defined: org.apache.log4j.DailyRollingFileAppender (5724 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)
    Class to be defined: org.apache.log4j.FileAppender (4764 bytes). Loader: wes-ear.root:0.0.0. Source: /oracle_apps/j2ee/portal/applications/wes-ear/lib/log4j-1.2.15.jar (from application.xml <library-directory> in /oracle_apps/j2ee/portal/applications/wes-ear/lib)Thanks in advance and Regards,
    Farhan.
    Edited by: FarhanS on Nov 4, 2008 2:43 PM
    Edited by: FarhanS on Nov 4, 2008 2:47 PM

  • Is it possible to make a local class accessible in SE24 subclasses?

    G'Day,
    The scenario is simple: I have a global class created in SE24 with a local helper class defined in the local definitions/implementations sections. The issue is anything declared here is private; however I would like my local class to be available in the subclasses of the global class as well. In other words I want a protected local class.
    ZCL_SUPER  --> contains local utility class LCL_HELPER
        |
        V
    ZCL_SUB    --> needs to make use of LCL_HELPER's methods.
    I've messed about with different definitions and FRIENDS but no joy.
    I can think of two alternatives:
    1. Write a protected wrapper method in zcl_super to expose each lcl_helper method to the subclasses. Annoying, cumbersome, defeats the object of using a local class in first place.
    2. Define LCL_HELPER in an include which is added to all subclasses. This effectively makes it public as I no longer control where LCL_HELPER is used. (Unless I do funky stuff with packages which we don't do on this project).
    Any better suggestions/ideas/workarounds?
    Cheers,
    Mike

    Hi Naimesh,
    Thanks for the input. Interesting idea about interfaces, I need to play around with this a little.
    I don't agree what I'm trying to do would violate encapsulation. I'm after the same visibility level as other class component type. i.e. methods can be private, protected or public. Classes can be local or global - a protected class visible to subclasses would fit the principles quite well.
    Consider a global class GADGET which has a protected attribute WIDGET, type ref to a local class. The widget's methods and attributes should really be separate because it is it's own entity, but at the same time it has no business in the wider SAP system. ==> Perfectly sensible use of a local class.
    Now, this widget can turn, open, close, light up. So in a GADGET method I can say WIDGET->TURN( ). Create a subclass of GADGET and boom, all such code working with WIDGETs is broken. In some ways it makes local classes a little un-future-proof.
    The bothersome thing about the workarounds is that they de-object-orient the two objects by forcing us to create protected methods TURN_WIDGET LIGHT_WIDGET OPEN_WIDGET etc. on the GADGET class. Which goes back to my original point that there's little benefit of creating a local class if we need to do this....
    Or am I missing something?
    Cheers,
    Mike

  • Define local classes in function groups

    Hi,
    I have seen in few code examples that programmers defined their classes as follows:
    1. Interfaces are defined globally i.e. under package->class library->interfaces.
    2. implementing classes are defined locally under: package->function group (as public local class in the function group).
    My question is What is the advantage/disadvantage of it?
    (beside encapsulation).
    I heard that the class loader is working better in that way, is that right?
    thanks,
    Yaron

    Hi
    excuse me I miserunderstood.
    Perhaps it's true I don't know.
    I think the different is the SE24 is a library, so it's the tool arranged to analyze all class components you can need.
    I don't think it's easier to analyze an include (function group) where the class is defined and implemented.
    You shuold measure the time in order to load the class for both case, but probably the different isn't meaningful.
    You should consider that ABAP wasn't OO language, but it was adapted for OO, and so the most ABAP developer weren't used to use OO.
    I think you should define a class as local class if it's your own class.
    Max
    Message was edited by: max bianchi

Maybe you are looking for

  • To_char function help

    Hi All, I have run this query in my oracle database SELECT J.NAME, (CASE J.STATUS WHEN 'Completed' THEN COUNT(J.STATUS) ELSE 0 END) CURRENT_MONTH_COMPLETE, (CASE J.STATUS WHEN 'Pending for Process Engine' THEN COUNT(J.STATUS) ELSE 0 END) CURRENT_MONT

  • Round badi does not work in default formulas triggered when sending a value

    I have implemented the round BADI from sdn (how to). Problem is that it works perfect when : -  I execute it in UKT - I run it as a data manager package - I put it in default formulas and run the default formulas as a packe It however doesn't work wh

  • Multiple Frames  - JInternalFrame

    Goal: I need to create a main window. This window contains multiple different views. ( I should be able to switch back and forth among these views). Each view contains 4 small frames/window. My design thought: Step 1. Main window = JFrame. Step 2.Usi

  • HTTPS error

    Hi i am trying to run standard BSP application HAP_DOCUMENT. The application is working fine in development. but in quality system while thorwing logon screen its showing message with logon screen. "the server doesn't  support HTTPS. Its therefore po

  • Adobe CS5.5 on a new Lion Mac and  printing on Canon?

    Have put Adobe CS5.5 on a new iMac with Lion and when printed indesign and photoshop comes out blurred on our Canon mp980 printer. Download updates from canon and apple and calls to canon, adobe and apple support have not helped. Is there a basic pro