CREATE OBJECT inside INITIALIZATION event in ABAP

Hi everyone,
I have one question, can we create object inside INITIALIZATION event. Why, I am asking this question is, because most of the time I have seen people to create object inside start-of-selection. Please give your thought on this.
The code I have just coded below is also right or wrong?
CLASS lcl_build_data DEFINITION.
   PUBLIC SECTION.
     METHODS : constructor,
                        get_all_files,
                         validate_site.
*-- Private Section declaration
   PRIVATE SECTION.
         METHODS : clear_and_refresh,
                            display_output.
ENDCLASS.                 
*** class declaration,  create instance for the class
DATA: gv_data     TYPE REF TO lcl_build_data.
INITIALIZATION.
*** Create class object. Constructor method will be called to Refresh
*** and Clear all internal tables and Work areas
   CREATE OBJECT gv_data.
*                    AT SELECTION-SCREEN             *
AT SELECTION-SCREEN ON s_vkbur.
*** Sales Office validation
   CALL METHOD gv_data->validate_site.
*                START-OF-SELECTION                    *
START-OF-SELECTION.
*** Get the list of all files from unix dir.
   CALL METHOD gv_data->get_all_files.

Since you are using the same object for your Selection screen related events, AT SELECTION-SCREEN, you would have to instantiate the object in the INITIALIZATION event. If your object usage is just for the data - In case you use the MVC design pattern, you should push back the object creation in START-OF-SELECTION.
Regards,
Naimesh Patel

Similar Messages

  • Create an event using abap class (transaction swetypv)

    Hi,
    I’m trying to create an event by using an abap class.
    The purpose is to update po reqs using BAPI_REQUISITION_CHANGE upon saving a sales order. The exit is called on saving a sales order MV45AFZZ.
    In MV45AFZZ the method cl_swf_evt_event is called and the object type, event, objkey and obj cat is exported.
    Object Type = ZBUS203200
    Event = Z_TRAD_ORDER_CHANGE_OO
    I created my class ZCL_UPDATE_PUR_REQ (by copying CL_SWF_RUN_WIM_HANDLER
    And using interface name BI_EVENT_HANDLER_STATIC )
    In /nswetypv I assigned Class ZCL_UPDATE_PUR_REQ
    to Object Type ZBUS203200
    And Event Z_TRAD_ORDER_CHANGE_OO.
    All that works fine except for passing in the objectkey.
    In Class ZCL_UPDATE_PUR_REQ
    Method BI_EVENT_HANDLER_STATIC~ON_EVENT
    When I go to create a parameter for object key, I get the message
    ‘Parameters/exceptions of inherited methods or events cannot be changed’.
    Has anyone any suggestions for how I can get the object key into the method call BI_EVENT_HANDLER_STATIC~ON_EVENT?
    Thanks
    Ann

    Hi Johann,
    You don't need a class to do the job if you are on a 6.10 or higher system. Use command CALL TRANSFORMATION to create an XML from an internal table.
    Regards,
    John.

  • Create an event using abap class

    Hi,
    I’m trying to create an event by using an abap class.
    The purpose is to update po reqs using BAPI_REQUISITION_CHANGE upon saving a sales order.  The exit is called on saving a sales order MV45AFZZ.
    In  MV45AFZZ the method cl_swf_evt_event is called and the object type, event, objkey and obj cat is exported.
    Object Type    = ZBUS203200              
    Event          = Z_TRAD_ORDER_CHANGE_OO  
    I created my class ZCL_UPDATE_PUR_REQ (by copying CL_SWF_RUN_WIM_HANDLER    
    And using interface name BI_EVENT_HANDLER_STATIC   )
    In /nswetypv I assigned Class  ZCL_UPDATE_PUR_REQ
    to     Object Type     ZBUS203200                 
    And   Event              Z_TRAD_ORDER_CHANGE_OO.
    All that works fine except for passing in the objectkey.
    In Class ZCL_UPDATE_PUR_REQ 
    Method  BI_EVENT_HANDLER_STATIC~ON_EVENT
    When I go to create a parameter for object key, I get the message
    ‘Parameters/exceptions of inherited methods or events cannot be changed’.
    Has anyone any suggestions for how I can get the object key into the method call BI_EVENT_HANDLER_STATIC~ON_EVENT?
    Thanks
    Ann

    Hi Johann,
    You don't need a class to do the job if you are on a 6.10 or higher system. Use command CALL TRANSFORMATION to create an XML from an internal table.
    Regards,
    John.

  • Events in Abap Objects

    What are events. how to create and handle this events.

    HI,
    By triggering an event, an object or a class announces a change of state, or that a certain state has been achieved.Events link objects or classes more loosely than direct method calls do. Method calls establish precisely when and in which statement sequence the method is called. However, with events, the reaction of the object to the event is determined by the triggering of the event itself.
    Events are most often used in GUI implementations.Other external object models, such as COM, ActiveX Controls etc, also provide events.
    At the moment of implementation, a class defines its instance events (using the statement EVENTS) and static events (using the statement CLASS-EVENTS)
    Classes or their instances that receive a message when an event is triggered at runtime and want to react to this event define event handler methods.
    Statement : (CLASS-)METHODS  | FOR ALL INSTANCES.
    Every object that has defined events has an internal table: the handler table. All objects that have registered for events are entered in this table together with their event handler methods.Objects that have registered themselves for an event that is still “live” also remain “live”. The methods of these objects are called when the event is triggered, even if they can no longer be reached using main memory references.
    If several objects have registered themselves for an event, then the sequence in which the event handler methods are called is not defined, that is, there is no guaranteed algorithm for the sequence in which the event handler methods are called.
    If a new event handler is registered in an event handler method for an event that has just been triggered, then this event handler is added to the end of the sequence and is then also executed when its turn comes.
    If an existing event handler is deregistered in an event handler method, then this handler is deleted from the event handler method sequence.
    Events are also subject to the visibility concept and can therefore be either public, protected or private. Visibility establishes authorization for event handling :
         all users
         only users within that class or its subclasses
         only users in that class.
    Event handler methods also have visibility characteristics. Event handler methods, however, can only have the same visibility or more restricted visibility than the events they refer to.
    The visibility of event handler methods establishes authorization for SET-HANDLER statements: SET HANDLER statements can be made
         anywhere
         in that class and its subclasses
         only in that class
    Regards,
    Balaji Reddy G
    **Rewards if answers are useful

  • ABAP OO:  Duplication of selected data in created objects?

    I am new to ABAP OO and I have a conceptual question/concern that I cannot resolve.  Can someone explain what I am missing?
    I would think that selecting and storing (in internal tables) a large amount of data from many related database tables and, at the same time, creating and storing objects from this same data would unnecessarily consume a huge amount of memory.  To avoid this problem, it seems that the selected data and created objects should not be stored in internal tables simultaneously.
    Does this concern make sense?  If so, how is this problem best handled?
    Does it make sense to delete the corresponding data once the objects are created (to free memory)?
    Or does it make sense to keep the data and only temporarily create objects as needed?
    Thanks.

    Hello Matt
    The approach you describe is to select data first and the feed the object instances with them. <b>Why not let the object instances do the data selection themselves?</b>
    I will give you an example what I mean.
    (1) Lets assume I want to write an application that allows to deal with cost center hierarchies. On the selection screen you can choose one or many cost center hierarchies.
    (2) Using the selection criteria I would select all cost center hierarchies but without any details (just the key values).
    (3) Next I would loop over the cost center hierarchies and create a cost center hierarchy instance (a class you have to define yourself) for each key value. The CONSTRUCTOR of this class will have an IMPORTING parameter like <i>id_kostl_hier</i>.
    (4) In the CONSTRUCTOR method I first check if the cost center hierarchy exists (if not raise an exception-class based exception) and then do the selection of the hierarchy details (e.g. the cost centers).
    (5) The instances are collected in an itab of the "frame" application.
    Using this approach you will have little duplication of data within your application. Furthermore, if you really have to deal with huge amounts of data then you could read them only on demand (like in tree controls where the sub-nodes usually are read when the parent node is expanded).
    Hope I could give you some fresh insights into this exciting topic.
    Regards
      Uwe

  • Why and how to use events in abap objects

    Dear all,
      Please explain me why and how to use events in abap objects with real time example
    regards
    pankaj giri

    Hi Pankaj,
    I will try to explain why to use events... How to use is a different topic.. which others have already answered...
    This is same from your prev. post...
    Events :
    Technically speaking :
    " Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
    Lets say you have an ALV - An editable one ...
    Lats say - Once you press some button  you want some kind of validation to be done.
    How to do this ?
    Raise an Event - Which is handled by a method and write the validation code.
    Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
    Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
    Where is the function code here ? No function code... But there is an event here - The data changed event.
    So you can raise a data changed event that can be handled and will do the validation.
    It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
    The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
    Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
    Advantage with events : Event handlers can be in a separate class also.
    e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
    In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
    So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
    Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
    And these different classes for different Operation systems will have different code to raise a pop-up.
    Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac  they will catch this event and process accordingly.
    May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
    Cheers.
    Varun.

  • How to Handle Business Object event in ABAP class

    Hello Everybody,
    I wanted to know if it was possible to reference BOR objects in ABAP class and handle BOR events in ABAP Objects.
    Thanks in advance.

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • What is the equivalent for 'On Change of' Event in ABAP OBJECTS?

    What is the equivalent for 'On Change of' Event in ABAP OBJECTS?  and how to use it in LOOP control?

    hi,
    There is no such Equivalent in OO ABAP.
    You have to Raise your own Event within tha class checking the value of the field whose value is changing.
    Regards
    Sumit Agarwal

  • ABAP OO, Creating object dynamically

    Hi everybody,
         I’m currently working on some Abap OO examples. Everything is working ok except for the following: Creating objects dynamically.
    This is what I’d like to do:
    Lets say we obtain a bunch of sales orders using a simple select statement and place them in an internal table. For each entry in our internal table, I’d like to generate a new sales order object. This salesorder object is a simple class with a constructor with an Id and some other attributes.
    When this is done, I’d like to append every object to a new object, say basket, so that this basket contains something like an internal table within each record a reference to the salesorder. Is this easy to do? I’m using the example that is described in the sap guide (create object pointer type (class_name) but it looks to me that you still have to declare the reference variables before you can create the object.
    Hmm, I think Java is better suited for a job like this.
    Hope you can help,
    Cheers and Best wishes
    Laurens Steffers
    The Netherlands.

    Hi,
    Its not all that difficult in ABAP as well. The following code is based on Chapter 5, Listing 5.20 from book ABAP Objects.
    What you need is an internal table of type <your sales object> e.g.
    DATA: BEGIN OF obj_sales_order
            sales_order_no LIKE <sales_order_no_type>,
            <...>,
            objref TYPE REF TO <SALES_ORDER_CLASS>
          END OF obj_sales_order,
          reftab LIKE SORTED TABLES OF obj_sales_order
                      WITH UNIQUE KEY sales_order_no
                                      <other key attributes>.
    Now all you need to do is to do a SELECT...ENDSELECT loop, and:
    SELECT ...
    obj_sales_order-sales_order_no = <selection result>
    obj_sales_order-<other key attr> = <selection result>
    READ TABLE reftab INTO obj_sales_order
                      FROM obj_sales_order.
    IF sy-subrc <> 0.
      CREATE OBJECT obj_sales_order-objref
             EXPORTING ...
             EXCEPTIONS ...
      IF sy-subrc <> 0.
        MESSAGE ...
        CONTINUE.
      ELSE.
        INSERT obj_sales_order INTO TABLE reftab.
      ENDIF.
    ENDIF.
    CALL METHOD obj_sales_order-objref-><method>.
    ENDSELECT.
    Hope this help.
    Regards

  • The method creates a new object and initializes it...

    Hello there,
    I just started learn the Java, and can't understand the method declaration in "Parameter Types" example at "[Passing Information to a Method or a Constructor|http://download.oracle.com/javase/tutorial/java/javaOO/arguments.html] " tutorial section.
    public Polygon polygonFrom(Point[] corners) {
    // method body goes here
    Can you explain me please the example above, what does "Polygon polygonFrom" means?
    And can it be " the method creates a new Polygon object and initializes it", isn't it Constructor's and the new operator job?
    Thanks a lot!

    869857 wrote:
    public Polygon polygonFrom(Point[] corners) {
    // method body goes here
    }Can you explain me please the example above, what does "Polygon polygonFrom" means?
    Polygon is the return type of the method polygonForm
    And can it be " the method creates a new Polygon object and initializes it", isn't it Constructor's and the new operator job?We can't say that it is a constructor and new operator job. Because, As the return type is Polygon, the method should return an object of Polygon or null. For that purpose only the method needs to create a new Polygon object and initialize with some values.

  • Hi How do we create Methods inside the Business objects of Z

    Hi Abapers,
                        How do we create Methods inside the Business objects (z objects) and how *** an import parameter or export parameter  to be defined for the new Methods.
    Regards
    Bhaskar Rao.M

    Hi Bhaskar,
    that ´s not difficult.
    Open your Bus.Obj. in SWO1 with CHANGE/EDIT
    Click on the "Methods" header line and then use the button for "Create".
    If you want to add the method on basis of a function module, choose next in the next pop up. Then the system will offer you the ex/import parameter from the function module. So this is a really simple way.
    If you don´t have a FM, it is a little bit more difficult.
    Choose No on the quetion about a FM, fill in the next pop up  methode name (no blanks allowed).
    Dialogue is for user related method (call screen...) synchronous for methods which have to give back a result directly in to the workflow.
    After completing the screen the method will be displayed as new method at the end of method list. Now add parameters (first click on the method name, then choose parameter button, same functionality to add program to the method).
    Programm:
    Code snip:
    BEGIN_METHOD ZWFCHECKMIRO CHANGING CONTAINER.
    DATA:
          ZBELNR TYPE RBKP-BELNR,
          ZGJAHR TYPE RBKP-GJAHR,
          RESULT TYPE HRP1001-ISTAT,
          BELNR TYPE BKPF-BELNR,
          GJAHR TYPE BKPF-GJAHR,
          BUKRS TYPE BKPF-BUKRS.
    to import parameter
      SWC_GET_ELEMENT CONTAINER 'Zbelnr' ZBELNR.
      SWC_GET_ELEMENT CONTAINER 'Zgjahr' ZGJAHR.
    *(or SWC_GET_TABLE)
    here add the functionality of your method!
    to export parameter
    SWC_SET_ELEMENT CONTAINER 'Result' RESULT.
      SWC_SET_ELEMENT CONTAINER 'Belnr' BELNR.
    *(or SWC_SET_TABLE)
    !!! Important: naming convention!!! Use same writing of parameter names in
    PARAM area (button PARAMETER) and here in code.
    To use your method, change it to implemented after adding your code.
    -> Edit -> Change release status -> object type component -> into implemented
    (Sorry , have a german screen here, possibly terms are a little bit different.
    Hope this helps a little bit.!
    regards
    Dirk

  • Event for ABAP Objects

    Dear All,
    Would you mind tell me the concept of the event in the ABAP objects.
    Regards,
    Luke

    hI
    Triggering and Handling Events
    In ABAP Objects, triggering and handling an event means that certain methods act as triggers and trigger events, to which other methods - the handlers - react. This means that the handler methods are executed when the event occurs.
    This section contains explains how to work with events in ABAP Objects.  For precise details of the relevant ABAP statements, refer to the corresponding keyword documentation in the ABAP Editor.
    Triggering Events
    To trigger an event, a class must
    ·        Declare the event in its declaration part
    ·        Trigger the event in one of its methods
    Declaring Events
    You declare events in the declaration part of a class or in an interface. To declare instance events, use the following statement:
    EVENTS ) TYPE type ..
    To declare static events, use the following statement:
    CLASS-EVENTS ... ...
    It links a list of handler methods with corresponding trigger methods.  There are four different types of event.
    It can be
    ·        An instance event declared in a class
    ·        An instance event declared in an interface
    ·        A static event declared in a class
    ·        A static event declared in an interface
    The syntax and effect of the SET HANDLER depends on which of the four cases listed above applies. 
    For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler.  You can either specify a single instance as the trigger, using a reference variable ...
    The registration applies automatically to the whole class, or to all of the classes that implement the interface containing the static event.  In the case of interfaces, the registration also applies to classes that are not loaded until after the handler has been registered.
    Timing of Event Handling
    After the RAISE EVENT statement, all registered handler methods are executed before the next statement is processed (synchronous event handling).  If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
    Handler methods are executed in the order in which they were registered.  Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
    http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

  • ABAP OBJECTS: Dynamic Create object

    Hi folks!
    I have a problem... I need to create a dynamic type object with:
    <b>DATA: my_instance TYPE REF TO class1.
    CREATE OBJECT my_instance TYPE (class2).</b>
    <i>* where class1 is a superclass of class2.</i>
    When I do:
    <b>my_instance ?= m_parent.</b>
    <i>* where m_parent is an instance of class1</i>
    My problem is when I want to access to an attribute of the class2, the compiler says that it cannot find the attribute <i>(this is OK, because the attribute is only in the class2).</i>
    My question:
    Is there anyway to access to an atribute of second class when is not in the first class? (i don't want to create the attribute as an attribute of the first class).
    Thanx!!!!

    Hi David,
    When you do the debugging, you are dealing with run-time - i.e., the program is now running and you are just interrupting it at each statement to examine the program state. You will reach the point where the object is already created. That is why you can see all those attributes. But when you comiple, the program is not yet <i>running</i>, so the attributes will be unknown because of the dynamic type specification.
    I think you will have to redesign the program logic. As i had already said in my earlier post, it is not proper to have the attributes specified statically while the class itself is specified dynamically.
    Your situation is somewhat similar to -
    DATA ITAB TYPE TABLE OF SPFLI.
    PERFORM TEST TABLES ITAB.
    FORM TEST TABLES ITAB.
      LOOP AT ITAB.
        WRITE: / ITAB-CARRID.
      ENDLOOP.
    ENDFORM.
    Hope the point is clear.
    Regards,
    Anand Mandalika.

  • How to create objects in ABAP Webdynpro?

    Hi,
    I want to create the object for the class: <b>CL_GUI_FRONTEND_SERVICES.</b>
    then i want to call file_save_dialog method.
    how shoud i write the code, plz?

    I have written this code:
    v_guiobj TYPE REF TO cl_gui_frontend_services.
    <u> ?????????????</u>
    v_guiobj->file_save_dialog( ...).
    How to create object in the place of ?????????????.
    Bcoz, when i run this i am getting:
    <b>Access via Null object reference not possible.</b>

  • How can I importing when create object?

    Hi Gurus,
    I’m beginner with OO Abap. Please give me a hand with this.
    I’m using the programming interface REPORT  Z_TEST_ST_TEXT_EDITOR for text editor found on /people/igor.barbaric/blog/2005/06/06/the-standard-text-editor-oo-abap-cfw-class which is good and useful for me (highly recommended) but I need to import the text created (t_text)  in method constructor in order to send it via e.mail.
    Could anybody tell me how to get/import the text created?
    Thank you in advance.
    Below is the coding. (program which uses the developed class and method consisting the created text)
    DATA: o_txe     TYPE REF TO <b>zcl_standard_text_editor</b>,
          v_caption TYPE char100,
          s_thead   TYPE thead.
    call screen
    CALL SCREEN 0100.
    MODULE s0100_start
    MODULE s0100_start OUTPUT.
        SET PF-STATUS 'BASIC'.
        s_thead-tdname   = 'VENDOR0000000011'.
        s_thead-tdid     = 'ST'.
        s_thead-tdobject = 'TEXT'.
        s_thead-tdspras  = sy-langu.
        CONCATENATE 'Standard text:' s_thead-tdname
                    INTO v_caption SEPARATED BY space.
        IF o_txe IS INITIAL.
    <b>       CREATE OBJECT o_txe</b>         
    EXPORTING i_thead   = s_thead
                       i_caption = v_caption. 
    <b>IMPORTING????</b>
         ENDIF.
    ENDMODULE.
    <b>method CONSTRUCTOR</b>.
    DATA: o_dialogbox TYPE REF TO cl_gui_dialogbox_container,
          t_text      TYPE STANDARD TABLE OF tdline,
          s_event     TYPE cntl_simple_event,
          t_events    TYPE cntl_simple_events,
          t_lines     TYPE STANDARD TABLE OF tline,
          v_text      TYPE tdline,
          v_text_temp TYPE tdline,
          v_line_temp TYPE tdline,
          v_line_len  TYPE i,
          v_index     TYPE i.
    FIELD-SYMBOLS: <line> TYPE tline.
    me->thead   = i_thead.
    me->caption = i_caption.
    *------ containers
    IF i_container IS INITIAL.
        CREATE OBJECT o_dialogbox
                EXPORTING top     = 50
                          left    = 200
                          height  = 150
                          width   = 500
                          caption = i_caption.
        me->main_container = o_dialogbox.
        SET HANDLER me->on_container_close FOR o_dialogbox.
    ELSE.
        me->main_container = i_container.
    ENDIF.
    IF me->splitter IS INITIAL.
        CREATE OBJECT me->splitter
                EXPORTING
                     parent        = me->main_container
                     orientation   = me->splitter->orientation_vertical
                     sash_position = 10. "percentage of containers
       ------ toolbar
        CREATE OBJECT me->toolbar
              EXPORTING parent = me->splitter->top_left_container.
        CALL METHOD me->toolbar->add_button
             EXPORTING  fcode       = me->c_save
                        is_disabled = ' '
                        icon        = '@2L@' "icon_system_save
                        butn_type   = cntb_btype_button.
        CALL METHOD me->toolbar->add_button
             EXPORTING  fcode       = me->c_close
                        is_disabled = ' '
                        icon        = '@3X@' "icon_close
                        butn_type   = cntb_btype_button.
    *------ register events
        REFRESH t_events.
        s_event-eventid = cl_gui_toolbar=>m_id_function_selected.
        s_event-appl_event = ' '.
        APPEND s_event TO t_events.
        CALL METHOD me->toolbar->set_registered_events
              EXPORTING events = t_events.
        SET HANDLER: me->on_toolbar_func_sel FOR me->toolbar.
    *------ create textedit control
        CREATE OBJECT me->textedit
           EXPORTING parent = me->splitter->bottom_right_container.
    ENDIF.
    get text
    CALL FUNCTION 'READ_TEXT'
            EXPORTING ID       = me->thead-tdid
                      LANGUAGE = me->thead-tdspras
                      NAME     = me->thead-tdname
                      OBJECT   = me->thead-tdobject
            TABLES    LINES    = t_lines
            EXCEPTIONS ID                      = 1
                       LANGUAGE                = 2
                       NAME                    = 3
                       NOT_FOUND               = 4
                       OBJECT                  = 5
                       REFERENCE_CHECK         = 6
                       WRONG_ACCESS_TO_ARCHIVE = 7
                       OTHERS                  = 8.
    *------- convert text to text editor format
    LOOP AT t_lines ASSIGNING <line>.
        IF <line>-tdformat = space OR <line>-tdformat = '=' OR sy-tabix = 1.
            v_line_temp = <line>-tdline.
            CONCATENATE v_text v_line_temp INTO v_text_temp.
        ELSE.
            CONCATENATE: cl_abap_char_utilities=>cr_lf <line>-tdline
                         INTO v_line_temp.
            CONCATENATE  v_text v_line_temp   INTO v_text_temp.
        ENDIF.
        IF sy-subrc = 0.
            v_text = v_text_temp.
        ELSE.
            APPEND v_text TO t_text.
            v_text = v_line_temp.
        ENDIF.
    ENDLOOP.
    IF sy-subrc = 0.
        APPEND v_text TO <b>t_text</b>.
    ENDIF.
    *------- display text
    CALL METHOD me->textedit->set_text_as_stream
             EXPORTING text = t_text.
    me->t_initial_text = t_text.
    endmethod.

    good book on ABAP objects(OOPS)
    http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Rewards if useful......................
    Minal

Maybe you are looking for

  • Where can I buy an 7' tablet running firefox os?

    I would love to get started on Firefox OS but I really want a 7-inch tablet with GPS. Are there any manufacturers now selling them in the US market? I've looked at VIA, Alcatel, ZTE but can't find a source that sells tablets, only phones. Lacking tha

  • Why not jdeveloper creates the persistance unit and the session client and

    why you do not create the persistance unit (outside) and the session client and ...the interface and other required opjects automatically when I create the application or the project? why you are using symbols like AFD, JSF, JSP, JPA,.JEE...and tens

  • INFO - General DBM Cookbooks / Consulting Notes / Guides / etc.

    This message contains all general cookbooks, consulting notes, guidelines, etc. about Dealer Business Management apart from the ones about vehicle master and model master. For these areas of DBM, a seperate message was posted. The documents to which

  • Html input tags

    why doesn't the jsf <input_text> tag generate a correctly terminated html <input> tag? It leaves off the closing /, ie, <input type="text" name="vendor_name" maxlength="25" size="50"> instead of <input type="text" name="vendor_name" maxlength="25" si

  • Restricting the values based on exit

    Hi, I have a report in which it is displaying the user details with logged date information.  But my requriement if the user is not there then that person should not be display.  I am very new to BW how to restrict in the query. Thanks Naveen