Structure pour classe évolutive (LV OOP)

Bonjour,
Quelle est la structure la plus adaptée pour gérer des classes qui sont susceptibles d'évoluer ? L'évolution consistera le plus souvent en un ajout de "variables membres". Je souhaiterais faire évoluer les classes tout en pouvant relire les objects sauvegardés dans la version précédente. Pour des raisons pratiques (grand nombre d'objets sauvegardés, sur des serveurs pas toujours accessibles),  j'aimerais ne pas avoir à "convertir" mes anciens fichiers dans le nouveau format.
Comment construire ma classe initiale pour pouvoir dans le futur passer en version 2 tout en pouvant accéder à mon carnet d'adresse vieux de la version 1 ?
Exemple :
Classe version 1 : Demoiselle admet comme variable nom et numéro de téléphone
Puis dans la version 2, j'ajoute à ces 2 variables un booléen "est-elle mariée ?"
Espérant que la question est compréhensible.
Merci !
Résolu !
Accéder à la solution.

 Bonjour petitOhu,
Merci d'avoir posté sur le forum National Instruments.
Je ne suis pas certain de bien comprendre ta question car il me semble que tu peux ajouter un élément dans la définition de ta classe (dans le *.ctl) sans pour autant "casser" les accesseurs ou propriétés/méthodes déjà existants.
Finalement, il est aussi possible d'utiliser un serveur de contrôle de code source afin d'avoir un suivi de l'historique de ton développement. De plus, cela te permets de revenir à une version précédente facilement, de gérer le fait de développer à plusieurs... Voici un tutorial sur ce point.
N’hésites pas à préciser ta question si je n’ai pas bien compris ce que tu cherche à faire.
Benjamin R.
R&D Software Development Manager
http://www.fluigent.com/

Similar Messages

  • Help me structure my classes oop way

    I have a combo box for color which takes it's items from a specific table from database. I don't want it to take items directly from db.
    I make a Color class which holds id and name, has public methods like getName, setName and save().
    I have also made 2 packages to divide GUI and other classes:
    GUI
    ---- window.java
    core
    --- Color.java
    So now I'm confused. Ofcourse there are lots of different ways but I'd like to know the oop way.
    Where do I write the code that gets all colors from database?
    I'll make a class that basically is a combobox?
    I'll make a new class called Colors that extends Color?

    That's a bit better. Depends on what they do.
    If Color is a class that sub-classes java.awt.Color
    (not sure why you would do that, and the description
    of it does not sound like it is or would be), then it
    might go in a package like com.colorapp.color.
    A class called Colors that is a "collection" of Color
    classes - if that's what it it, might go in a package
    perhaps like com.colorapp.utils.
    A class like MyColorCombo - if it's a widget, and why
    do you need to subclass one of those? - might go
    either in some main class package, or in something
    like com.colorapp.gui ...
    ~Billheh. Color was my bad. Dog would have been better.
    You made things clearer.
    I thought if ComboBoxDogs extended Dogs, and Dogs extended Dog then they had to make up something like this visually
    Dog
    --- Dogs
    --------ComboBoxDogs
    Like package dog, dog.dogs and dog.dogs.comboboxdogs .

  • Xcode, how do you take an app from an idea to a data model, data structure, or class structure?

    Hey everyone!
    I'm a beginner xcoder and computer engineering sophomore and have literally spent every hour of the past few weeks reading as much as I possibly can about becoming a developer.
    I've found plenty of documentation, and guides on how to do very specific things in xcode and objective-C but am still looking for more information on one topic; how do you decide which data models/structures/controllers etc to use?
    I mean, you personally. I've been looking for a resource on this and have not been able to find one. I just finished Apple's iOS Developers Guide and they mention "choosing a data model" but do not describe them in much detail.
    The following is what is provided in the guide:
    ● Choose a basic approach for your data model:
    ● Existing data model code—If you already have data model code written in a C-based language, you
    can integrate that code directly into your iOS apps. Because iOS apps are written in Objective-C, they
    work just fine with code written in other C-based languages. Of course, there is also benefit to writing
    an Objective-C wrapper for any non Objective-C code.
    ● Custom objects data model—A custom object typically combines some simple data (strings, numbers,
    dates, URLs, and so on) with the business logic needed to manage that data and ensure its consistency.
    Custom objects can store a combination of scalar values and pointers to other objects. For example,
    the Foundation framework defines classes for many simple data types and for storing collections of
    other objects. These classes make it much easier to define your own custom objects.
    ● Structured data model—If your data is highly structured—that is, it lends itself to storage in a
    database—use Core Data (or SQLite) to store the data. Core Data provides a simple object-oriented
    model for managing your structured data. It also provides built-in support for some advanced features
    like undo and iCloud. (SQLite files cannot be used in conjunction with iCloud.)
    ● Decide whether you need support for documents:
    The job of a document is to manage your app’s in-memory data model objects and coordinate the storage
    of that data in a corresponding file (or set of files) on disk. Documents normally connote files that the user
    created but apps can use documents to manage non user facing files too. One big advantage of using
    documents is that the UIDocument class makes interacting with iCloud and the local file system much
    simpler. For apps that use Core Data to store their content, the UIManagedDocument class provides similar
    support.
    I suppose my question boils down to, how do you decide which structures to use? If you can provide an example of an app idea and how its implemented that would be very helpful and much appreciated!
    For example, to implement the idea of an app which allows users to progress through levels of knowledge of a certain subject and rewarding them with badges and such (this is not an actual app just a whim) how would one model that?
    Thanks in advance for all your help!!!

    SgtChevelle wrote:
    how do you decide which structures to use?
    Trial and error.
    I wish I had a better answer for you, but that pretty much encapsulates it. There is some, but not much, good wisdom out there, but it takes a significant amount of experience to be able to recognize it. The software development community if currently afflicted with a case of copy-and-paste-itis. And the prognosis is poor.
    The solution is to be brutal to yourself and others. Focus on what you need and ignore everything else. Remember that other people have their own needs and methods and they might not be applicable to you. Apple, for example, can hire thousands of programmers, set them to coding for six months, pick the best results, and have the end-users spend their own time and monety to test it. If you don't have Apple's resources and power, think twice about adopting Apple's approach. And I am talking from a macro to a micro perspective. Apple's sample and boilerplate code is just junk. Don't assume you can't do better. You can.
    Unfortunately, all this takes time and practice. You can read popular books, but never assume that anyone knows more than you do. Maybe they do and maybe they don't. It takes time to figure that out. Just do your best, ignore the naysayers, and doubt other people even more than you doubt yourself.

  • How to use Common Structure in class!!

    Hi,
    I have 3 different structures being used in the 3 different methods containing one select query and populate the  internal table and exported now i want to use single method and pass the internal table depending on the structure which is receives
    Plz help me how i can achieve.
    Thanks...

    In the class this is how i have declared
    DATA_PACKAGE_STRUCTURE     Instance Attribute     Public     Type     /BIC/CS8E_HNOD     
    Method parameters       SELECT_METHOD                          
    Methods      Exception                                      
    Parameter               Type  Pas       Opt     Typing M     Associated Type
    DATA_PACKAGE            Import                Type          ANY                
    IT_AGRS                          Export               Type          ZTY_AGR_USERS      
    IT_AUTHMAP                   Export               Type          ZTY_ZAGR_AUTH      
    ABORT                             Export               Type         SY-SUBRC           
    i have declared DATA_PACKAGE with type ANY as per ur post let me know how will i create dynamic internal table and
    in attribute declare different structure such as /BIC/CS8E_HNDEL.
    Thanks...

  • Choix de structure pour une IHM

    Bonjour,
    Je m'essaye actuellement au Xcontrol et tente une IHM un peu poussé que mes habituelles.
    Comme vous pouvez le voir dans mon programme j'utilise les splitters pour passer d'une "fenêtre" `l'autre lorsque l'on appuie sur les graphiques.
    Ma question est la suivante : faut il que je gère aussi ces mouvements comme des Xcontrols ? dans ce cas cela signifierait gérer tout la face avant en tant que Xcontrol non ? ou dois je tout laisser comme avant ?
    Je cherche juste à partir dans la meilleure direction pour la suite de mes développements.
    Merci d'avance !
    (normalement toutes les pièces se trouve dans le dossier)
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    IHM.zip ‏435 KB

    Salut,
    il n’y a pas l’ensemble du code, mais si je comprends bien tu veux faire un effet « slider » « swipe screen », pour décaler ta page avec un effet de mouvement et tu veux le gérer avec des splitters.
    Je réponds non à la question : je gère aussi ces mouvements comme des Xcontrols 
    Pour info, pour le principe, je pense qu’il y a plus simple, tu as une fenêtre, qui a une origine, tu changes programmatiquement l’origine. Je te conseille de regarder le projet de
    http://chrislarson.me/content/chris-larson/labview-vi-ipad-style-page-swiping
    même si l'ensemble du code n'est pas à prendre en exemple.
    J'ai codé une IHM qui gére plusieurs pages avec une gestion tactile, comme le soft de Chris.
    La gestion n'est pas un objet graphique, de type XControl, mais un process (ou actor ou acteur ou programme informatique) qui gére, en parallèle du reste du code, les actions (états, message) que lui produit ue autre structure.
    Donc structure producteur-consommateur, avec un structure "event" dans le code IHM du Main, qui produit sur détection d'actions de l'utilisateur sur l'IHM, par exemple par FIFO, à une deuximée boucle while en // (le deuximème process) des actions. Sur les actions, la deuxième boucle va gérer le "déplacer l'origine" de la fenêtre".
    Tu peux le coder facilement sur un base de QMH (ou QDMH), cf les templates de projet de LabVIEW.
    J'ai commencer, il y a quelques temps, à encapsuler le code de gestion "swipe" dans un code autonome, type Actor de l'actor framework, mais je n'ai pas terminé, par manque de temps, mais il faudrait... si je le termine je te le donne...
    A+
    Luc Desruelle | Voir mon profil | LabVIEW Code & blog
    Co-auteur livre LabVIEW : Programmation et applications
    CLA : Certified LabVIEW Architect / Certifié Architecte LabVIEW
    CLD : Certified LabVIEW Developer / Certifié Développeur LabVIEW

  • Quelle structure pour mon programme

    Rebonjour à tous,
    J'écris ce nouveau message pour obtenir de l'aide pour la modification de mon programme qui ne tourne pas comme j'aimerais.
    J'utilise LV2010 et un moteur dont l'axe est relié à un compteur angulaire.
    Fonctionnement du programme:
    L'utilisateur rentre le n° de série de l'instrument à tester ainsi que le nombre de cycle de mesure à réaliser
    Il clique ensuite sur le bouton START pour lancer le test
    Le programme suit une certaine suite de séquence (initialisation des ports COM, déplacement du moteur, enregistrement des données) - j'utilise donc une machine à état
    Je me suis concentré sur le développement de cette machine à état dont la 1ère séquence est lancé via un événement sur le bouton START.
    Le problème est qu'avec la structure actuelle, je ne peux rien faire (arrêter le déplacement du moteur par ex.) tant que la suite de séquence citée ci-dessus n'est pas terminée (et elle dure environ 2 minutes...).
    J'ai pu voir sur un message du forum (mais trop tard) qu'il ne fallait pas mettre de boucle while à l'intérieur d'événement.
    Mais alors comment intégrer ma structure machine à état ? Que dois-je modifier?
    Ci-joint, mon programme.
    Quelqu'un aurait-il des solutions?
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    Main.vi ‏335 KB

    J'ai modifié mon programme initial en architecture producteur / consommateur avec des événement et des queues...
    Il fonctionne correctement au niveau du déplacement du moteur cependant je n'arrive toujours pas à stopper la séquence quand j'appuie sur le bouton stop.
    Concernant les acquisitions, je n'en fais qu'une fois la position cible atteinte - je dois l' atteindre avec précision, c'est pourquoi j'utilise 2 types de mouvement:
    Je démarre en lui donnant une grande valeur et une grande vitesse pour une avance rapide. Ce déplacement se fait en une seule fois et la sortie du vi n'est libérée que quand la position est atteinte. J'ai comme l'impression que je ne pourrais pas avoir la main pendant ce déplacement. D'ailleurs l'icône du programme devient un carré blanc comme s'il ne répondait pas si j'essaye d'appuyer sur stop.
    En revanche, pour atteindre la position cible précisément, la suite des déplacement se font en avançant par petits pas successifs et je devrais normalement avoir la main entre les déplacements... Mais je n'y arrive pas...
    PS:
    Le moteur utilisé est un maxon motor EC-max30 équipé d'une Epos24/2
    Je vous joins mon nouveau vi. Y a-t-il une erreur?
    Qu'en pensez-vous?
    Pièces jointes :
    Main_Test.vi ‏338 KB

  • Structured Properties class

    Hi!
    I'm wondering if there is a class similar to the Properties class that outputs it content in a structured way. That is, if you use the Properties class to read properties from a properties file and then you modify its content and write it out to a file, there will not be the same structure in the output file as in the input file.
    What I'm looking for is a class that can be used to parse properties files and where it is possible to change properties, but the output has the property names in the same place (in the file) as the input, but the property values might have changed.
    Would really appreciate some help!
    Best regards
    Lars

    there is no standard class for it. i think the best (and also an easy solution) is to do the input/output via a XML wrapper (written by yourself), with the available XML tools this is simple.
    if you are going to use JDK1.4 have a look at the Preferences API: i think it is great!

  • Sound class help?(oop)

    hey,
    i have got all my public vars for sound class but im having trouble on how i would execute them because i normal would use event listener but its OOP lol so how do you get that functionality :/
    ---code in star.as file:
    package
        import flash.display.MovieClip;
        public class star extends MovieClip
            public var my_sound:MySong = new MySong();
            public var my_channel:SoundChannel = new SoundChannel();
            public function star()
    thanks everyone

    dont worry i learnt oop and made my own class here it is if anyone has the same problem!
    Code:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.media.Sound;
        public class SoundClass extends MovieClip
            var sound = new Sound  ;
            var mySound:MySong = new MySong  ;
            public function SoundClass()
                mySound.play();
    Hope this helped somebody else

  • Create a Exception Class

    hi all ,,
    can any one tell me how to create a exception class in ABAP OOPS concept ??
    if possible can give link also for document

    HI Jayakumar,
    Please go thru this document
    Exceptions are represented by objects that are instances of exception classes. Defining an exception is, therefore, the same as creating an exception class.
    All exception classes must inherit from the common superclass CX_ROOT and one of its subordinate classes:
    CX_STATIC_CHECK
    CX_DYNAMIC_CHECK
    CX_NO_CHECK
    . The assignment of exception classes to one of these three paths of the inheritance hierarchy determines the way in which the associated exceptions are propagated. There is a record of predefined exception classes CX_SY_... whose exceptions are raised in error situations in the runtime environment. These classes all inherit from CX_DYNAMIC_CHECK or CX_NO_CHECK but not from CX_STATIC_CHECK (see hierarchy in the ABAP keyword documentation).
    All exception classes must begin with the prefix CX_. They are usually defined globally with the Class Builder of the ABAP Workbench. Local exception classes can, however, also be defined.
    Individual (abstract) exception classes that are used as the superclass of further exception classes can be defined. The exceptions of the subordinate classes can be handled together using a superclass.
    Exception classes have the following features:
    Constructor
    The constructor must have a predefined structure and a specific interface. With global classes, the Class Builder generates the correct constructor and sets it to an unchangeable status. The constructor has two IMPORTING parameters:
    TEXTID of the SOTR_CONC type
    This parameter can be used to determine which of your exception texts the exception will use.
    PREVIOUS of the CX_ROOT type
    This parameter can be used to assign the PREVIOUS attribute a previous exception.
    Methods
    In exception classes, you can define your own methods. The following two predefined methods are inherited from the root class CX_ROOT:
    GET_TEXT
    Sends back the exception texts of a class (controlled by the TEXTID attribute) as a string.
    GET_SOURCE_POSITION
    Returns the program name, the name of a possible include program, and the line number of the statement that raised the exception.
    Attributes
    The attributes of exception classes are used to transport additional information on an error situation to the handler. The main piece of information is, however, always the fact that an exception of a particular class has occurred. The following attributes are inherited from CX_ROOT:
    TEXTID
    Used to specify the exception of a class more precisely by using several exception texts. Is evaluated in the GET_TEXT method.
    PREVIOUS
    If an exception is mapped to another exception, a reference to the original exception can be defined in this attribute via the EXPORTING addition of the RAISE EXCEPTION statement and by means of the constructor IMPORTING PARAMETER with the same name. This can result in a chain of exception objects. In the event of a runtime error, the exception texts of all the exceptions in the chain are output. Mapping an exception to another exception is only beneficial if the context in which the original exception occurred is important for characterizing the error situation.
    KERNEL_ERRID
    The name of the associated runtime error is stored in this attribute if the exception was raised by the runtime environment, for example, COMPUTE_INT_ZERODIVIDE with a division by zero. If the exception is not handled, precisely this runtime error occurs.
    Parameters cannot be transferred to the constructor for this attribute. If the exception is raised with RAISE EXCEPTION, the attribute is set to initial.
    Global Exception Classes
    Global exception classes are defined and managed in the Class Builder. If the correct naming convention (prefix CX_) and the class type Exception Class is chosen when a new class is created, the Class Builder automatically becomes the Exception Builder.
    The Exception Builder offers precisely the functionality required to define exception classes and generates independently-defined components that must not be changed. When classes are created, the category of the exception must be specified, in other words, whether it is to inherit from CX_STATIC_CHECK, CX_DYNAMIC_CHECK, or CX_NOCHECK.
    Tab Pages of the Exception Builder
    The Exception Builder has the tab pages Properties, Attributes, Methods, and Texts.
    The properties do not normally need to be changed.
    Except for the four inherited attributes mentioned above, further public attributes can be generated by the Exception Builder. The contents of these attributes specify the exception more clearly and manage the exception texts.
    All of the methods are inherited from CX_ROOT. New methods cannot be added. The instance constructor is generated automatically. It ensures that, when an exception is raised, the attributes have the right values. It also transfers the text of the superclass for an exception class whose exception text is not specified explicitly.
    The instance constructor is generated on the basis of the attributes, which are set up on the basis of the exception texts. Changing the attributes in superclasses can, therefore, invalidate the constructors of subordinate classes. The constructors of subordinate classes can be regenerated under Utilities ® CleanUp ® Constructor.
    Texts are a special feature of exception classes and the Exception Builder. For further information, refer to Exception Texts.
    Local Exception Classes
    Local exception classes can be defined for specific exceptions that only occur within one single ABAP program. The condition for a local exception class is that it inherits from one of the three classes CX_STATIC_CHECK, CX_DYNAMIC_CHECK, or CX_NO_CHECK, or from their subordinate classes. An individual constructor and individual attributes can be created. Individual methods should not be created, however, and the methods of superclasses should not be redefined.
    Examples of Local Exception Classes
    report DEMO_LOCAL_EXCEPTION_1.
    class CX_LOCAL_EXCEPTION definition
                            inheriting from CX_STATIC_CHECK.
    endclass.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION.
        catch CX_LOCAL_EXCEPTION.
          message 'Local Exception!' type 'I'.
      endtry.
    This example shows a minimal local exception class, which is simply the local representation of one of the three direct subordinate classes of CX_ROOT. It can be used in the program.
    report DEMO_LOCAL_EXCEPTION_2.
    class CX_LOCAL_EXCEPTION definition
                            inheriting from CX_STATIC_CHECK.
      public section.
        data LOCAL_TEXT type STRING.
        methods CONSTRUCTOR importing TEXT type STRING.
    endclass.
    class CX_LOCAL_EXCEPTION implementation.
      method CONSTRUCTOR.
        SUPER->CONSTRUCTOR( ).
        LOCAL_TEXT = TEXT.
      endmethod.
    endclass.
    data OREF type ref to CX_LOCAL_EXCEPTION.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION
                          exporting TEXT = `Local Exception`.
        catch CX_LOCAL_EXCEPTION into OREF.
          message OREF->LOCAL_TEXT type 'I'.
      endtry.
    In this example, the exception class from the previous example is extended to include an individual attribute and constructor. The IMPORTING parameter of the constructor must be supplied when the exception is raised (it is required here). The attribute can be evaluated in the handler of the exception.
    report DEMO_LOCAL_EXCEPTION_3.
    class CX_LOCAL_EXCEPTION definition
          inheriting from CX_SY_ARITHMETIC_ERROR.
      public section.
        methods CONSTRUCTOR importing SITUATION type STRING.
    endclass.
    class CX_LOCAL_EXCEPTION implementation.
      method CONSTRUCTOR.
        SUPER->CONSTRUCTOR( OPERATION = SITUATION ).
      endmethod.
    endclass.
    data OREF type ref to CX_LOCAL_EXCEPTION.
    data TEXT type STRING.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION
                exporting SITUATION = `START-OF-SELECTION`.
        catch CX_LOCAL_EXCEPTION into OREF.
          TEXT = OREF->GET_TEXT( ).
          message TEXT type 'I'.
      endtry.
    In this example, an exception class is derived from one of the predefined exception classes for error situations in the runtime environment. An individual constructor is defined with an individual IMPORTING parameter that supplies the superclass constructor with this parameter. When the exception is handled, the exception text, as defined in the superclass, is read with GET_TEXT.

  • Creation of Material using BDC Session method & global class

    Hi
    Creation of Material using BDC Session method & global class by using oops.
    can anyone plz help me out

    Hi,
    it looks like it's not possible to call this BAPI wihtout material number. Here is a quote from BAPI documentation.
    When creating material master data, you must transfer the material
    number, the material type, and the industry sector to the method. You
    must also enter a material description and its language.
    Cheers

  • Control problem in trees using class

    Hi all i am creating tree structure using class method in that when i am creating only one node it is working properly but when i try to crate multiple nodes it is giving me dump my program is as follow.
    I search these on sdn and try the things but it still giving me same error.
    *& Report  ZIRPT_HR_TEST_SPLITTER_01
    report  zirpt_hr_test_splitter_01.
    tables : pa0001,t582s.
    select-options : p_pernr for pa0001-pernr no intervals.
    *       CLASS screen_init DEFINITION
    class screen_init definition create private.
      public section.
        class-methods init_screen.
        methods constructor.
      private section.
        data: splitter_h type ref to cl_gui_splitter_container,
        splitter_v type ref to cl_gui_splitter_container,
        picture type ref to cl_gui_picture,
        tree type ref to cl_gui_simple_tree,
         it_pa0001 type table of pa0001,
         it_pa0000 type table of pa0000.
        methods: fill_tree,
        fill_picture.
    endclass.                    "screen_init DEFINITION
    *       CLASS screen_handler DEFINITION
    class screen_handler definition.
      public section.
        methods: constructor importing container
        type ref to cl_gui_container,
        handle_node_double_click
        for event node_double_click
        of cl_gui_simple_tree
        importing node_key.
      private section.
        data: html_viewer type ref to cl_gui_html_viewer,
               it_pa0001 type table of pa0001,
               it_pa0000 type table of pa0000,
        list_viewer type ref to cl_gui_alv_grid.
        methods:
        fill_list importing pernr type pa0001-pernr
                           infty type t582s-infty.
    endclass.                    "screen_handler DEFINITION
    *       CLASS screen_init IMPLEMENTATION
    class screen_init implementation.
      method init_screen.
        data screen type ref to screen_init.
        create object screen.
      endmethod.                    "init_screen
      method constructor.
        data: events type cntl_simple_events,
        event like line of events,
        event_handler type ref to screen_handler,
        container_left type ref to cl_gui_container,
        container_right type ref to cl_gui_container,
        container_top type ref to cl_gui_container,
        container_bottom type ref to cl_gui_container.
        create object splitter_h
        exporting
        parent = cl_gui_container=>screen0
        rows = 1
        columns = 2.
        call method splitter_h->set_border
          exporting
            border = cl_gui_cfw=>false.
        call method splitter_h->set_column_mode
          exporting
            mode = splitter_h->mode_absolute.
        call method splitter_h->set_column_width
          exporting
            id    = 1
            width = 110.
        container_left = splitter_h->get_container( row = 1 column = 1 ).
        container_right = splitter_h->get_container( row = 1 column = 2 ).
        create object splitter_v
        exporting
        parent = container_left
        rows = 2
        columns = 1.
        call method splitter_v->set_border
          exporting
            border = cl_gui_cfw=>false.
        call method splitter_v->set_row_mode
          exporting
            mode = splitter_v->mode_absolute.
        call method splitter_v->set_row_height
          exporting
            id     = 1
            height = 160.
        container_top = splitter_v->get_container( row = 1 column = 1 ).
        container_bottom = splitter_v->get_container( row = 2 column = 1 ).
        create object picture
        exporting parent = container_top.
        create object tree
        exporting parent = container_bottom
        node_selection_mode =
        cl_gui_simple_tree=>node_sel_mode_single.
        create object event_handler
        exporting container = container_right.
        event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
        event-appl_event = ' '.
        append event to events.
        call method tree->set_registered_events
          exporting
            events = events.
        set handler event_handler->handle_node_double_click for tree.
        call method: me->fill_tree,
                     me->fill_picture.
         call method cl_gui_cfw=>flush.
      endmethod.                    "constructor
      method fill_picture.
        types pict_line(256) type c.
        data pict_tab type table of pict_line.
        data url(255) type c.
        data : file type rlgrap-filename value 'C:\Documents and Settings\sapgroup.NITCOWRL\My Documents\nitco.gif'.
        translate file to upper case.
    *CALL FUNCTION 'WS_UPLOAD'
    *EXPORTING
    *filename = file
    *filetype = 'BIN'
    *TABLES
    *data_tab = pict_tab.
        data query_table_wa type w3query.
        data query_table type table of w3query." OF like w3query occurs 1 with header line.
        data html_table type table of w3html."  like w3html occurs 1.
        data return_code type  w3param-ret_code.
        data content_type type  w3param-cont_type.
        data content_length type  w3param-cont_len.
        data pic_data type table of w3mime."  like w3mime occurs 0.
        data pic_size type i.
        refresh query_table.
        query_table_wa-name = '_OBJECT_ID'.
        query_table_wa-value = 'ENJOYSAP_LOGO'.
        append query_table_wa to query_table.
        call function 'WWW_GET_MIME_OBJECT'
          tables
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          changing
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          exceptions
            object_not_found    = 1
            parameter_not_found = 2
            others              = 3.
        if sy-subrc = 0.
          pic_size = content_length.
        endif.
        call function 'DP_CREATE_URL'
          exporting
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          tables
            data     = pic_data
          changing
            url      = url
          exceptions
            others   = 1.
    *IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'FLIGHTS'.
    *CALL FUNCTION 'DP_CREATE_URL'
    *EXPORTING
    *type = 'IMAGE'
    *subtype = 'GIF'
    *TABLES
    *data = pict_tab
    *CHANGING
    *url = url.
        call method picture->load_picture_from_url
          exporting
            url = url.
        call method picture->set_display_mode
          exporting
            display_mode = picture->display_mode_fit_center.
    *     CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "fill_picture
      method fill_tree.
        data: node_table type table of abdemonode,
        node type abdemonode.
    *data : it_pa0001 TYPE TABLE OF p0001,
        data :wa_pa0001 type pa0001,
              wa_pa0000 type pa0000,
              it_t582s type table of t582s,
              wa_t582s type t582s.
        types : begin of ttab,
                 itext type t582s-itext,
                 infty type t582s-infty,
                 pernr type p0001-pernr,
                 end of ttab.
        data : itab type table of ttab,
               wa_tab type ttab.
          field-symbols : <fs> like p_pernr.
          data : text1 type c.
        node-hidden = ' '.
        node-disabled = ' '.
        node-isfolder = 'X'.
        node-expander = ' '.
        select * from t582s
                 into corresponding fields of table it_t582s
                 where sprsl = sy-langu
                   and infty in ('0001','0000')."'0002','0006',
    *                         '0008','0015','0019').
        loop at it_t582s into wa_t582s .
          move-corresponding wa_t582s to wa_tab.
          node-node_key = wa_t582s-infty.
          clear node-relatkey.
          clear node-relatship.
          node-text = wa_t582s-itext.
          node-n_image = ' '.
          node-exp_image = ' '.
          append node to node_table.
          loop at p_pernr assigning <fs>.
            wa_tab-pernr = <fs>-low.
            append wa_tab to itab.
            clear p_pernr-low.
            node-node_key = <fs>-low.
            node-relatkey = wa_tab-infty.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = <fs>-low.
            node-n_image = '@AV@'.
            append node to node_table.
          endloop.
    *        SELECT SINGLE * FROM pa0001 INTO wa_pa0001 WHERE pernr in p_pernr.
    *     WHEN '0000'.
    *        SELECT SINGLE * FROM pa0000 INTO wa_pa0000 WHERE pernr = p_pernr.
    *    wa_tab-pernr = wa_pa0000-pernr.
    *    endcase.
          clear : wa_tab,wa_pa0001,wa_pa0000.
        endloop.
    *node-hidden = ' '.
    *node-disabled = ' '.
    *node-isfolder = 'X'.
    *node-expander = ' '.
    *LOOP AT itab INTO wa_tab.
    *AT NEW infty.
    *node-node_key = wa_tab-infty.
    *CLEAR node-relatkey.
    *CLEAR node-relatship.
    *node-text = wa_tab-itext.
    *node-n_image = ' '.
    *node-exp_image = ' '.
    *APPEND node TO node_table.
    *ENDAT.
    *AT NEW pernr.
    * node-node_key = wa_tab-pernr.
    *node-relatkey = wa_tab-infty.
    *node-relatship = cl_gui_simple_tree=>relat_last_child.
    *node-text = wa_tab-pernr.
    *node-n_image = '@AV@'.
    *node-exp_image = '@AV@'.
    *ENDAT.
    *APPEND node TO node_table.
    *ENDLOOP.
        call method tree->add_nodes
          exporting
            table_structure_name = 'ABDEMONODE'
            node_table           = node_table.
    *    CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "fill_tree
    endclass.                    "screen_init IMPLEMENTATION
    *       CLASS screen_handler IMPLEMENTATION
    class screen_handler implementation.
      method constructor.
        create object: html_viewer exporting parent = container,
        list_viewer exporting i_parent = container.
      endmethod.                    "constructor
      method handle_node_double_click.
        data: infty type t582s-infty,
              pernr type pa0001-pernr.
        infty = node_key(4).
        pernr = node_key+4(8).
    *IF pernr IS INITIAL.
    *CALL METHOD: fill_html EXPORTING infty = infty,
    *html_viewer->set_visible EXPORTING visible = 'X',
    *list_viewer->set_visible EXPORTING visible = ' '.
    *ELSE.
        call method: fill_list exporting infty = infty
                                         pernr = pernr,
        list_viewer->set_visible exporting visible = 'X',
        html_viewer->set_visible exporting visible = ' '.
    *ENDIF.
    *    CALL METHOD cl_gui_cfw=>flush.
      endmethod.                    "handle_node_double_click
    *METHOD fill_html.
    *DATA url TYPE scarr-url.
    *SELECT SINGLE url
    *FROM scarr
    *INTO url
    *WHERE infty = infty.
    *CALL METHOD html_viewer->show_url EXPORTING url = url.
    *ENDMETHOD.
      method fill_list.
        data: flight_tab type table of demofli,
        begin of flight_title,
        carrname type scarr-carrname,
        cityfrom type spfli-cityfrom,
        cityto type spfli-cityto,
        end of flight_title,
        list_layout type lvc_s_layo.
    *DATA : it_pa0001 TYPE TABLE OF p0001.
        if infty = '0001'.
          select * from pa0001 into table it_pa0001 where pernr = pernr.
        elseif infty = '0000'.
          select * from pa0001 into table it_pa0001 where pernr = pernr.
        endif.
    *SELECT SINGLE c~carrname p~cityfrom p~cityto
    *INTO CORRESPONDING FIELDS OF flight_title
    *FROM ( scarr AS c
    *INNER JOIN spfli AS p ON c~carrid = p~carrid )
    *WHERE p~carrid = carrid AND
    *p~connid = connid.
    *SELECT fldate seatsmax seatsocc
    *INTO CORRESPONDING FIELDS OF TABLE flight_tab
    *FROM sflight
    *WHERE carrid = carrid AND connid = connid
    *  ORDER BY fldate.
    *CONCATENATE flight_title-carrname
    *connid
    *flight_title-cityfrom
    *flight_title-cityto
        list_layout-grid_title = 'TEST'.
        list_layout-smalltitle = 'X'.
        list_layout-cwidth_opt = 'X'.
        list_layout-no_toolbar = 'X'.
    *if infty = '0001'.
        call method list_viewer->set_table_for_first_display
          exporting
            i_structure_name = 'PA0001'
            is_layout        = list_layout
          changing
            it_outtab        = it_pa0001.
    * CALL METHOD cl_gui_cfw=>flush.
    *ELSEIF infty = '0001'.
    *CALL METHOD list_viewer->set_table_for_first_display
    *EXPORTING i_structure_name = 'PA0000'
    *is_layout = list_layout
    *CHANGING it_outtab = it_pa0000.
    *endif.
      endmethod.                    "fill_list
    endclass.                    "screen_handler IMPLEMENTATION
    start-of-selection.
      data : it_pa0001 type table of p0001.
      call screen 100.
    *  MODULE status_0100 OUTPUT
    module status_0100 output.
      set pf-status 'SCREEN_100'.
      set titlebar 'TIT_100'.
      call method screen_init=>init_screen.
    *   CALL METHOD cl_gui_cfw=>flush.
    endmodule.                    "status_0100 OUTPUT
    *  MODULE cancel INPUT
    module cancel input.
      set screen 0.
      leave program.
    endmodule.                    "cancel INPUT
    Plz Suggest ,
    Regards ,
    Paresh G.

    METHOD fill_tree.
        DATA: node_table TYPE TABLE OF abdemonode,
        node TYPE abdemonode.
    *data : it_pa0001 TYPE TABLE OF p0001,
        DATA :wa_pa0001 TYPE pa0001,
              wa_pa0000 TYPE pa0000,
              it_t582s TYPE TABLE OF t582s,
              wa_t582s TYPE t582s.
        TYPES : BEGIN OF ttab,
                 itext TYPE t582s-itext,
                 infty TYPE t582s-infty,
                 pernr TYPE p0001-pernr,
                 END OF ttab.
        DATA : itab TYPE TABLE OF ttab,
               wa_tab TYPE ttab.
          FIELD-SYMBOLS : <fs> LIKE p_pernr.
          DATA : text1 TYPE c.
        node-hidden = ' '.
        node-disabled = ' '.
        node-isfolder = 'X'.
        node-expander = ' '.
        SELECT * FROM t582s
                 INTO CORRESPONDING FIELDS OF TABLE it_t582s
                 WHERE sprsl = sy-langu
                   AND infty IN ('0001','0000')."'0002','0006',
                            '0008','0015','0019').
        LOOP AT it_t582s INTO wa_t582s .
          MOVE-CORRESPONDING wa_t582s TO wa_tab.
          node-node_key = wa_t582s-infty.
          CLEAR node-relatkey.
          CLEAR node-relatship.
          node-text = wa_t582s-itext.
          node-n_image = ' '.
          node-exp_image = ' '.
          APPEND node TO node_table.
          LOOP AT p_pernr ASSIGNING <fs>.
            wa_tab-pernr = <fs>-low.
            APPEND wa_tab TO itab.
            CLEAR p_pernr-low.
            node-node_key = <fs>-low.
            node-relatkey = wa_tab-infty.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = <fs>-low.
            node-n_image = '@AV@'.
            APPEND node TO node_table.
          ENDLOOP.
    CLEAR : wa_tab,wa_pa0001,wa_pa0000.
        ENDLOOP.
    CALL METHOD tree->add_nodes
          EXPORTING
            table_structure_name = 'ABDEMONODE'
            node_table           = node_table.
       CALL METHOD cl_gui_cfw=>flush.
      ENDMETHOD.                    "fill_tree

  • Function Module to get all feild names in a structure

    Hello Friends,
    Is there a function module,where i give the structure name and get all the feild names within that structure.
    regards
    kaushik

    Hi,
    You can use the for run time type descriptor classes to do this :
    Here is a simple example :
    REPORT  z_assign_comp.
    TYPE-POOLS : slis.
    include <icon>.
    "&   Dynamic Programming ! Using Structure Descriptior Class.          *
    DATA: BEGIN OF line OCCURS 0,
            col1 TYPE i,
            col2(10) TYPE c,
            col3 TYPE i,
          END OF line.
    FIELD-SYMBOLS : <fs> TYPE ANY.
    FIELD-SYMBOLS : <itab_line> TYPE ANY.
    DATA : BEGIN OF t_comp OCCURS 0,
            comp(5) TYPE c,
           END OF t_comp.
    DATA : l_struc TYPE REF TO cl_abap_structdescr.
    DATA : l_typedesc TYPE REF TO cl_abap_typedescr.
    DATA : lt_comp TYPE abap_compdescr_tab,
           w_comp LIKE LINE OF lt_comp.
    line-col1 = 11.line-col2 = 'SAP'.line-col3 = 33.
    APPEND line.
    line-col1 = 44.line-col2 = 'P.I.'.line-col3 = 66.
    APPEND line.
    ASSIGN line TO <itab_line>.
    "Call the static method of the structure descriptor describe_by_data
    CALL METHOD cl_abap_structdescr=>describe_by_data
      EXPORTING
        p_data      = <itab_line>
      RECEIVING
        p_descr_ref = l_typedesc.
    "The method returns a reference of  a type descriptor class therefore we
    "need to Cast the type descriptor to a more specific class i.e
    "Structure Descriptor.
    l_struc ?= l_typedesc.
    "Use the Attribute COMPONENTS of the structure Descriptor class to get
    "the field names of the structure
    lt_comp = l_struc->components.
    LOOP AT line.
      WRITE :/ 'Row : ', sy-tabix.
      LOOP AT lt_comp INTO w_comp.
    "   Using the ASSIGN component ,assigns a data object to a field symbol.
        ASSIGN COMPONENT w_comp-name OF STRUCTURE line TO <fs>.
        WRITE :/ w_comp-name, ' ', <fs>.
      ENDLOOP.
    ENDLOOP.
    Hope this helps.
    regards,
    Advait

  • Some basic questions: Help defining Real World Classes

    I am trying to write a small applet using proper OO concempts and Java technique and I'm confused on the proper way to do this. I think I know several ways that work and have all the peices I need such as JMail and JDBC drivers, but would appreciate help on understanding how to properly structure my classes and objects.
    The application will simply do the following: I have a database table that receives a new entry when a truck is late for its delivery. When this new record is created, I need to send an email to the driver manager who will then decide (via a jsp page) whether the customer should receive an email about the late delivery. For each truck, there will only be one driver manager and one client to be notified.
    What I'm confused about is what classes and objects to create (and why). My first thought is to create a LateTruck class, a DriverManager class and a Customer class and have the LateTruck class call up the DriverManager to send an email then have the JSP page reinstantiate the LateTruck and instantiate the Customer class to send the email to the client.
    If I do it this way, is there a proper way to send the email? Do I send the email as a method in LateTruck which gets the email address from DriverManager such as
    LateTruck.Order1234.SendEmail(DriverManager.JoeBlow.Email)
    or do I use LateTruck to write the email message which I then pass to DriverManager such as
    DriverManager.JoeBlow.SendEmail(message)
    Should I even break up the applet into three classes and objects? Since each LateTruck only needs one DriverManager and one Client, is the proper way to do this to create only one class called LateTruck which has DriverManager, DriverManagerEmail, ClientName and ClientEmail all as properties of LateTruck?
    Thanks for any help in understanding the basics here.

    Is that the story of Static Write and the Seven Classes and the evil stepmother Wilma Gates who kept asking "Mirror Site, Mirror Site on the web, who's got the buggiest InterDev?

  • Dynamic Call to Java Class or Method

    Hi All,
    I have a requirement to call a Class or a Method Within the same class dynamically based on the user choice. I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?
    Thank you.
    Edited by: Eric S. on Jul 6, 2011 9:52 AM

    I have a requirement to call a Class or a MethodYou can call a method, but not the Class where as you can instantiate the Class.
    I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?The similar way. Here it takes the following structure.
    ClassA object = new ClassA();
    if(choice==1) {
          object.callMethod1();
    } else if(choice==2) {
          object.callMethod2();
    } else if(choice==3) {
          object.callMethod3();
    } Also you can switch case instead of if else. It takes the following structure.
    ClassA object = new ClassA();
    switch(choice) {
    case 1:  object.callMethod1(); break;
    case 2:  object.callMethod2(); break;
    case 3:  object.callMethod3(); break;
    }I recommend you to go with the second one which using switch.

  • Doc Uploaded by ABAP Class CL_SA_DOC_FACTORY= UPLOAD_DOC not visible

    I am uploading a document in Solution manager through the below code.
    CALL METHOD CL_SA_DOC_FACTORY=>UPLOAD_DOC
      EXPORTING
        I_DOC_TITLE              = 'TEST'
        I_DOC_TECH_NAME          = 'TEST'
        I_DOC_TYPE               = 'AD'
        I_DOC_STATUS             = 'RELEASED'
        I_DOC_BLUEPRINT_RELEVANT = 'X'
       I_FOLDER_ID              = 'DF1223E3C88613F1BDD70011258C9477'
       I_FOLDER_TITLE           =
        I_FOLDER_TECH_NAME       = 'TCLSUPPORT'
        I_FOLDER_RESPONSIBLE     = SY-UNAME
      RECEIVING
        E_IOBJECT                =  eobj
    EXCEPTIONS
       CANCELLED                = 1
       FOLDER_ERROR             = 2
       ERROR                    = 3
       others                   = 4
    CALL METHOD eobj->SAVE
    EXPORTING
      RECEIVING
        E_LOIO             = eresult
    EXCEPTIONS
       CANCELLED          = 1
       ERROR              = 2
       others             = 3
    eresult structure gives:
    CLASS      SOLARGEN
    OBJID       DF1BC08D3D729FF1BDD70011258C9477
    But when I go to SOLAR01 and then to my project document in not visible there.
    Tables SA01PHIO  and SA01LOIO are getting updated with OBJID but document not visible through SOLAR01

    Hi Abhinav,
    Did you perhaps every find the document that you uploaded?
    I am experiencing the same problem and would be interested in your solution.
    Thanks,
    Miguel

Maybe you are looking for

  • I need to sync my old iPhone to a new iTunes but need to keep the data?

    Hi, I have got a new computer, and so obviosuly have had to download a new verison of iTunes to go with it, however, I now cant sync my iPhone (which was linked previously to an iTunes account on my old computer) without it wanting to erase allll my

  • DVD Burning Process Stops

    Whenever I try to burn a DVD in iDVD, the burning of the DVD takes a good eight hours and then in one of the ending steps it just stops, ejects the disc and comes up with an error. When this was a problem in iDVD 5, I assumed that it would get fixed

  • Unable to access ESS

    HI Team The initial exception that caused the request to fail, was:    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to resolve JCO destination name 'SAP_R3_SelfServiceGenerics_MetaData' in the SLD. No such JCO destination is de

  • Gray box visible before SWF loads

    My site is live at  brucebever.com when you go to my site, you'll see a welcome screen.  When you click on the business card or the enter button a gray box, the same size as my flash file (720x720px) is visible in the moment before the flash file fin

  • Macbook Pro Retina upgrade questions.

    Hey guys, A warm hello. This is my very first post on the community, and i feel privildged to be here. Been an iPhone user since gen 1, now want to extend my love to MacBook Pro Retina. I am planning on getting the rMBP 15.5" 2.6Ghz, 16GB RAM, 256 Fl