Reg. OOPs....abstract class....have ur ponts.

Hi all,
I m made an abstract class in SE24. i took 2 methods, 1 with implemetation & other with just definition
Now i m taking another class...making class1 as super class.
but now how i give code to my method2....
Pleas assist me..
<b>Have ur ponts.</b>
Regards,
pradeep phogat

Hello,
USE Keyword <b>REDEFINITION</b>
Eg.
      CLASS passenger_plane  DFINITION INHE
CLASS passenger_plane DEFINITION INHERITING FROM lcl_airplane.
  PUBLIC SECTION.
    METHODS :  constructor IMPORTING in_name TYPE ch1 in_planetype TYPE
saplane-planetype in_n_o_seats TYPE sflight-seatsmax.
    <b>METHODS : display_attributes REDEFINITION.</b>
  PRIVATE SECTION.
    DATA : n_o_seats TYPE sflight-seatsmax.
ENDCLASS.
      CLASS passenger_plane IMPLEMENTATION
CLASS passenger_plane IMPLEMENTATION.
  METHOD constructor.
    CALL METHOD super->constructor EXPORTING in_name = in_name
in_planetype = in_planetype.
    n_o_seats = in_n_o_seats.
  ENDMETHOD.
  METHOD display_attributes.
    CALL METHOD super->display_attributes.
    WRITE : / 'No of Seats inside the Passenger Plane = ' , n_o_seats.
    uline.
  ENDMETHOD.
endclass.
Regards,
LIJO

Similar Messages

  • Abstract classes and Constructors

    I am wiondering how can an Abstract class have a constructor?
    Won't the constructor of the derived class
    automatically invoke the constructor of Shape
    by calling super()implicitly
    That means that an object of type Shape has been created
    Or have I overlooked a certain point?
    abstract class Shape {
         public String color;
         public Shape() {
         public void setColor(String c) {
              color = c;
         public String getColor() {
              return color;
         abstract public double area();
    public class Point extends Shape {
         static int x, y;
            // ?? Wont this constructor invoke the super class's constructor?
         public Point() {
              x = 0;
              y = 0;
         public double area() {
              return 0;
         public static void print() {
              System.out.println("point: " + x + "," + y);
         public static void main(String args[]) {
              Point p = new Point();
              p.print();
    }

    bhuru_luthria wrote:
    I am wiondering how can an Abstract class have a constructor?
    Won't the constructor of the derived class
    automatically invoke the constructor of Shape
    by calling super()implicitly If you don't explicitly invoke a superclass c'tor, super() will be called, but you can also explicitly invoke any non-private parent constructor from the child's constructor.
    That means that an object of type Shape has been createdC'tors don't create objects. They initialize newly created objects to valid state.

  • Abt Abstract Class

    Hi,
    Why Abstract classes have constructors
    We cant create instance of Abstract Class so when these constructors are called.
    Thanks in advance
    Amar

    We cant create instance of Abstract Class so
    Class so when these constructors are called.IIRC, you can create an instance of the non-abstract subclass which extends the abstract class. When you invoke the constructor of the subclass, it calls the constructor of the superclass too. The constructor of the abstract class might be needed to initialize something, for example!
    BTW, don't write "abt".. it's irritating! And post such questions on Java Programming forum.
    xH4x0r

  • Abstract class costructor

    I came to know that even abstract classes have constructors,
    which get called when concrete subclass is instantiated.
    In order to create an instance of a class we need a constructor so if we have constructor of abstract classes why can't we create object of abstract classes?

    hi,
    Constructors do not create the instance of any class.They are used to initialize the instance variables of the class.In other words ctor are a part while the class is being instantiated.....In case of an abstract class ,the subclass which extend this parent class will be extending the methods and variables in the parent class..so when the child class is instantiated the call to ctor of parent class is either made implicitly (as super()) or by explicitly defining the ctor of that class.
    So in order to inherit the variables of the parent class they are initialized by the constructor of the parent class.....

  • Reg. oops...implementation of abstract method in se24...have ur ponts..

    Hi all,
    In SE24 i made an abstract class & made a method abstract successfully.
    Now i made another class that inherited my abstract class, it is showing my abstract method there.
    Now when i want to give implementation to that method, but when i double click on that system is showing "method is abstract & has not yet redefined".
    Pleas let me know..how i implement it..
    Thanx in advance..
    <b>Have ur point.s</b>

    Hi
    Inheritance Inheritance defines the implementation relationship between classes, in which one class (the subclass) shares the structure and the behavior defined in one or more other classes (superclasses). Note: ABAP Objects only allows single inheritance.
    Inheritance is a relationship, in which one class (the subclass) inherits all the main characteristics of another class (the superclass). The subclass can also add new components (attributes, methods, and so on) and replace inherited methods with its own implementations.
    <b>Single Inheritance</b>
    ABAP Objects only has single inheritance.
    A class may only have one direct superclass, but it can have more than one direct subclass. The empty class OBJECT is the root node of every inheritance tree in ABAP Objects.
    <b>Relationship between Superclasses and Subclasses</b>
    Common components only exists in  the superclass
            new components in the supercalss are automatically available in subclass
            amount of new coding is reduced ( programing by difference)
    Subclass are extremely dependent on superclases
           white box reuse – subclass must possess detailed knowledge of the implementation of the superclass
    <b>Inheritance: Syntax</b>
           Normally the only other entry required for subclasses is what has changed in relation to the direct superclass. Only additions are permitted in ABAP Objects, that  is, in a subclass you can "never take something away from a superclass". All components from the superclass are automatically present in the subclass.
    <b>Class name defination.
        public section.
             methods. First name importing some type some type
                                            returning value(value) type some type.
       private section
              data : make type string..
    Endclass.
    Class name1 definition inheriting name
    public section
           method. : get  returning value ( value) type get.
    Priavte section.
       data : max type some type
    endclass</b>
    <b> Redefining methods</b>
    The REDEFINITION statement for the inherited method must be in the same SECTION as the definition of the original method.
    If you redefine a method, you do not need to enter its interface again in the subclass, but only the name of the method.
    In the case of redefined methods, changing the interface (overloading) is not permitted; exception: Overloading is possible with the constructor.
    Within the redefined method, you can access components of the direct superclass using the SUPER reference.
    The pseudo-reference super can only be used in redefined methods.
    reward if usefull

  • Reg. OOPs.------Have ur ponts..

    Hi all,
    What is the meaning of parameters in event. Can u plea let me know...here we have to include system defined events or we have to make our own events...
    if own events...then how.
    Pleas give me a simple example..
    <b>Have ur ponts.</b>
    Regards,
    pradeep phogat

    Hi
    se this program it will helpful for u
    *& Report  SALV_TEST_HIERSEQ_FORM_EVENTS
    report salv_test_hierseq_form_events no standard page heading.
    *... This report describes how the form renderer of the ALV can be used
       for layouting screen information.
       This demo report focusses on how the form renderer can be used in
       the new API's. The demonstration uses the new ALV API
         - cl_salv_hierseq_table (hierseq. lists)
       The ALV form description is a neutral description of the layouting
       of elements on the screen. With this description it is possible to
       render the information to different output mediums. At the moment
       ABAP Writes and HTML Documents are supported
       The ALV form also gaurantees the accessibility of such forms
       If the table ALV_T_T2 is empty, please create data for the demo
       by running report BCALV_GENERATE_ALV_T_T2
    §1   select data into global output table
    §2   create ALV hierseq Table
    §2.1 create the binding information between master and slave
    §2.2 create instance of cl_salv_hierseq_table for displaying a
         hierseq list of your output tables
    §3   TOP_OF_LIST
         set the TOP_OF_LIST content by calling the method set_top_of_list
         of cl_salv_table with the created content
    §4   END_OF_LIST
         set the END_OF_LIST content by calling the method set_end_of_list
         of cl_salv_table with the created content
    §5   Event Handler TOP_OF_PAGE / END_OF_PAGE
         define a handler for the events of cl_salv_table
    §5.1 define a local class for handling events of cl_salv_table
         define methods for the events which are to be handled
    §5.2 implement the defined methods for handling the events of
         cl_salv_table
    §6   Events TOP_OF_PAGE / END_OF_PAGE
         register to events of cl_salv_table
    §6.1 register to the event TOP_OF_PAGE for setting the content of
         the top of a page
    §6.2 register to the event END_OF_PAGE for setting the content of
         the end of a page
    §7   Display
         display the configurated ALV Table by calling the method
         display of cl_salv_table.
    types: begin of g_type_s_master.
    include type alv_chck.
    types:   expand   type char01,
           end of g_type_s_master,
           begin of g_type_s_slave.
    include type alv_t_t2.
    types: end   of g_type_s_slave.
    types: begin of g_type_s_test,
             amount      type i,
             repid       type syrepid,
             top_of_list type i,
             end_of_list type i,
           end of g_type_s_test.
    constants: begin of gc_s_alv_event,
                 print_eq_online type i value 1,
                 print_ne_online type i value 2,
                 print_no_online type i value 3,
                 online_no_print type i value 4,
               end of gc_s_alv_event,
               con_master type lvc_fname value 'ALV_CHCK',
               con_slave  type lvc_fname value 'ALV_T_T2'.
    *... §5 Definition is later
    class lcl_handle_events_hierseq definition deferred.
    data: gs_test type g_type_s_test.
    data: gt_master type standard table of g_type_s_master,
          gt_slave  type standard table of alv_t_t2.
    data: gr_hierseq type ref to cl_salv_hierseq_table.
    *... §5 object for handling the events of cl_salv_table
    data: gr_events_hierseq type ref to lcl_handle_events_hierseq.
          CLASS lcl_handle_events DEFINITION
    class lcl_handle_events_hierseq definition.
      public section.
        methods:
          on_top_of_page for event top_of_page of cl_salv_events_hierseq
            importing r_top_of_page page table_index,
          on_end_of_page for event end_of_page of cl_salv_events_hierseq
            importing r_end_of_page page.
    endclass.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    class lcl_handle_events_hierseq implementation.
      method on_top_of_page.
        data: lr_content type ref to cl_salv_form_element.
    *... create the content
        perform create_alv_form_content_top
          using    page
                   table_index
          changing lr_content.
    *... set the content
        r_top_of_page->set_content( lr_content ).
      endmethod.                    "on_top_of_page
      method on_end_of_page.
        data: lr_content type ref to cl_salv_form_element.
    *... create the content
        perform create_alv_form_content_eop
          using    page
          changing lr_content.
    *... set the content
        r_end_of_page->set_content( lr_content ).
      endmethod.                    "on_end_of_page
    endclass.                    "lcl_handle_events IMPLEMENTATION
    SELECTION-SCREEN                                                     *
    selection-screen begin of block gen with frame.
    selection-screen begin of line.
    parameters:
    p_db    radiobutton group db.
    selection-screen comment (29) for field p_db.
    selection-screen comment (29) for field p_amount.
    parameters:
    p_amount type i default 30.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:
    p_ext    radiobutton group db.
    selection-screen comment (29) for field p_ext.
    selection-screen comment (29) for field p_d_file.
    parameters:
    p_d_file   type char128.
    selection-screen end of line.
    selection-screen end of block gen.
    selection-screen begin of block evtt with frame title text-f01.
    parameters:
    p_t_peqo radiobutton group top,
    p_t_pneo radiobutton group top,
    p_t_pnoo radiobutton group top,
    p_t_onop radiobutton group top.
    selection-screen end of block evtt.
    selection-screen begin of block evte with frame title text-f02.
    parameters:
    p_e_peqo radiobutton group end,
    p_e_pneo radiobutton group end,
    p_e_pnoo radiobutton group end,
    p_e_onop radiobutton group end.
    selection-screen end of block evte.
    START-OF-SELECTION                                                   *
    start-of-selection.
      gs_test-amount = p_amount.
      gs_test-repid = sy-repid.
      case abap_true.
        when p_t_peqo.
          gs_test-top_of_list = gc_s_alv_event-print_eq_online.
        when p_t_pneo.
          gs_test-top_of_list = gc_s_alv_event-print_ne_online.
        when p_t_pnoo.
          gs_test-top_of_list = gc_s_alv_event-print_no_online.
        when p_t_onop.
          gs_test-top_of_list = gc_s_alv_event-online_no_print.
      endcase.
      case abap_true.
        when p_e_peqo.
          gs_test-end_of_list = gc_s_alv_event-print_eq_online.
        when p_e_pneo.
          gs_test-end_of_list = gc_s_alv_event-print_ne_online.
        when p_e_pnoo.
          gs_test-end_of_list = gc_s_alv_event-print_no_online.
        when p_e_onop.
          gs_test-end_of_list = gc_s_alv_event-online_no_print.
      endcase.
    *... §1 select data into global output table
      perform select_data.
    END-OF-SELECTION                                                     *
    end-of-selection.
      perform display_hierseq.
    *&      Form  select_data
    §1 select data into your global output table
    form select_data.
      field-symbols: gui_upload
            exporting
              filename            = l_filename
              has_field_separator = 'X'
              read_by_line        = 'X'
            changing
              data_tab            = gt_slave.
      endcase.
    endform.                    " select_data
    *&      Form  display_hierseq
          text
    form display_hierseq.
      data:
        lt_binding type salv_t_hierseq_binding,
        ls_binding type salv_s_hierseq_binding.
      data:
        lr_functions type ref to cl_salv_functions_list.
      data:
        lr_columns type ref to cl_salv_columns_hierseq,
        lr_column  type ref to cl_salv_column_hierseq.
      data:
        lr_level type ref to cl_salv_hierseq_level.
      data:
        lr_content type ref to cl_salv_form_element.
    *... create the binding information between master and slave
      ls_binding-master = 'MANDT'.
      ls_binding-slave  = 'MANDT'.
      append ls_binding to lt_binding.
      ls_binding-master = 'CARRID'.
      ls_binding-slave  = 'CARRID'.
      append ls_binding to lt_binding.
      ls_binding-master = 'CONNID'.
      ls_binding-slave  = 'CONNID'.
      append ls_binding to lt_binding.
    *... §2 create an ALV hierseq table
      try.
          cl_salv_hierseq_table=>factory(
            exporting
              t_binding_level1_level2 = lt_binding
            importing
              r_hierseq               = gr_hierseq
            changing
              t_table_level1           = gt_master
              t_table_level2           = gt_slave ).
        catch cx_salv_data_error cx_salv_not_found.
      endtry.
    *... Functions
    *... activate ALV generic Functions
      lr_functions = gr_hierseq->get_functions( ).
      lr_functions->set_all( abap_true ).
    *... §3 set the top of list content
      if gs_test-top_of_list ne gc_s_alv_event-print_no_online.
        perform create_alv_form_content_tol using space changing lr_content.
        gr_hierseq->set_top_of_list( lr_content ).
      endif.
      case gs_test-top_of_list.
        when gc_s_alv_event-print_eq_online.
    *... top_of_list_print is automatically set to top_of_list
        when gc_s_alv_event-print_ne_online or gc_s_alv_event-print_no_online.
          perform create_alv_form_content_tol using abap_true changing lr_content.
          gr_hierseq->set_top_of_list_print( lr_content ).
        when gc_s_alv_event-online_no_print.
    *... top_of_list_print is automatically set to top_of_list
       therefor this must be cleared
          clear lr_content.
          gr_hierseq->set_top_of_list_print( lr_content ).
      endcase.
    *... §4 set the end of list content
      if gs_test-end_of_list ne gc_s_alv_event-print_no_online.
        perform create_alv_form_content_eol using space changing lr_content.
        gr_hierseq->set_end_of_list( lr_content ).
      endif.
      case gs_test-end_of_list.
        when gc_s_alv_event-print_eq_online.
    *... end_of_list_print is automatically set to end_of_list
        when gc_s_alv_event-print_ne_online or gc_s_alv_event-print_no_online.
          perform create_alv_form_content_eol using abap_true changing lr_content.
          gr_hierseq->set_end_of_list_print( lr_content ).
        when gc_s_alv_event-online_no_print.
    *... end_of_list_print is automatically set to end_of_list
       therefor this must be cleared
          clear lr_content.
          gr_hierseq->set_end_of_list_print( lr_content ).
      endcase.
    *... *** MASTER Settings ***
      try.
          lr_columns = gr_hierseq->get_columns( 1 ).
        catch cx_salv_not_found.
      endtry.
    *... set the columns technical
      try.
          lr_column ?= lr_columns->get_column( 'MANDT' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
    *... set expand column
      try.
          lr_columns->set_expand_column( 'EXPAND' ).
        catch cx_salv_data_error.                           "#EC NO_HANDLER
      endtry.
    *... set items expanded
      try.
          lr_level = gr_hierseq->get_level( 1 ).
        catch cx_salv_not_found.
      endtry.
      lr_level->set_items_expanded( ).
    *... subtotal over columns CARRID and CONNID of Master
      data: lr_sorts type ref to cl_salv_sorts.
      try.
          lr_sorts = gr_hierseq->get_sorts( 1 ).
        catch cx_salv_not_found.
      endtry.
      lr_sorts->set_group_active( ).
      try.
          lr_sorts->add_sort(
            columnname = 'CARRID'
            subtotal   = abap_true ).
        catch cx_salv_not_found cx_salv_existing cx_salv_data_error."#EC NO_HANDLER
      endtry.
      try.
          lr_sorts->add_sort(
            columnname = 'CONNID'
            subtotal   = abap_true
            group      = if_salv_c_sort=>group_with_newpage ).
        catch cx_salv_not_found cx_salv_existing cx_salv_data_error."#EC NO_HANDLER
      endtry.
    *... *** SLAVE Settings ***
      try.
          lr_columns = gr_hierseq->get_columns( 2 ).
        catch cx_salv_not_found.
      endtry.
    *... set the columns technical
      perform set_columns_technical using lr_columns.
    *... total over Column PRICE of Slave
      data: lr_aggregations type ref to cl_salv_aggregations.
      try.
          lr_aggregations = gr_hierseq->get_aggregations( 2 ).
        catch cx_salv_not_found.
      endtry.
      try.
          lr_aggregations->add_aggregation( 'PRICE' ).
        catch cx_salv_not_found cx_salv_data_error cx_salv_existing."#EC NO_HANDLER
      endtry.
    *... *** GENERAL Settings ***
    *... register to the events for top-of-page and end-of-page
      data: lr_events type ref to cl_salv_events_hierseq.
      lr_events = gr_hierseq->get_event( ).
      create object gr_events_hierseq.
      set handler gr_events_hierseq->on_top_of_page for lr_events.
      set handler gr_events_hierseq->on_end_of_page for lr_events.
    *... display the table
      gr_hierseq->display( ).
    endform.                    "display_hierseq
    *&      Form  create_alv_form_content_tol
          text
    form create_alv_form_content_tol
                       using i_print type sap_bool
                       changing cr_content type ref to cl_salv_form_element.
      data: lr_header type ref to cl_salv_form_header_info,
            l_text    type string.
    *... create header information
      case i_print.
        when space.
          concatenate 'TOP_OF_LIST' text-h01 into l_text separated by space.
        when abap_true.
          concatenate 'TOP_OF_LIST_PRINT' text-h01 into l_text separated by space.
      endcase.
      create object lr_header
        exporting
          text    = l_text
          tooltip = l_text.
      cr_content = lr_header.
    endform.                    " create_alv_form_content_tol
    *&      Form  create_alv_form_content_eol
          text
    form create_alv_form_content_eol
                       using i_print type sap_bool
                       changing cr_content type ref to cl_salv_form_element.
      data: lr_header type ref to cl_salv_form_header_info,
            l_text    type string.
    *... create header information
      case i_print.
        when space.
          concatenate 'END_OF_LIST' text-h01 into l_text separated by space.
        when abap_true.
          concatenate 'END_OF_LIST_PRINT' text-h01 into l_text separated by space.
      endcase.
      create object lr_header
        exporting
          text    = l_text
          tooltip = l_text.
      cr_content = lr_header.
    endform.                    " create_alv_form_content_eol
    *&      Form  create_alv_form_content_top
          text
    form create_alv_form_content_top
           using    i_page  type sypagno
                    i_index type syindex
           changing cr_content     type ref to cl_salv_form_element.
      field-symbols: get( ).
    *... check if a group change with new page exists and get the position of the
       last group change with new page
      loop at lt_sort into ls_sort.
        if ls_sort-r_sort->get_group( ) eq if_salv_c_sort=>group_with_newpage.
          l_end = sy-tabix.
        endif.
      endloop.
    *... read the current line in the output table which is to be displayed next
      l_index = i_index.
      if l_index is initial.
        add 1 to l_index.
      endif.
      read table  index l_index.
    *... create a grid
      create object lr_grid.
      if l_end is not initial.
    *... group change with new page exists
    *... in the cell create a left grid
        lr_grid_1 = lr_grid->create_grid(
          row    = 1
          column = 1 ).
    *... in the cell create a right grid
        lr_grid_2 = lr_grid->create_grid(
          row    = 1
          column = 2 ).
    *... go through the sort criteria
        loop at lt_sort into ls_sort.
          if sy-tabix gt l_end.
            exit.
          endif.
          l_rest = sy-tabix mod 2.
          if l_rest is not initial.
            add 1 to l_row.
          endif.
    *... get the column information for this sort criteria
          try.
              lr_column = lr_columns->get_column( ls_sort-columnname ).
            catch cx_salv_not_found.                        "#EC NO_HANDLER
          endtry.
    *... get the calue of this column
          assign component ls_sort-columnname of structure .
          endif.
          case ls_sort-columnname.
            when 'CARRID'.
    *... in the cell of the left grid create a label
              l_text = lr_column->get_medium_text( ).
              lr_label = lr_grid_1->create_label(
                row     = l_row
                column  = 1
                text    = l_text
                tooltip = l_text ).                             "#EC NOTEXT
    *... in the cell of the left grid create a text
              lr_text = lr_grid_1->create_text(
                row     = l_row
                column  = 2
                text    =  ).
    *... in the cell of the left grid create a text
              lr_grid_1->create_text(
                row     = l_row
                column  = 3
                text    = ls_tab-carrname
                tooltip = ls_tab-carrname ).
            when others.
              if l_rest is not initial.
    *... display data in the left grid
    *... in the cell of the left grid create a label
                l_text = lr_column->get_medium_text( ).
                lr_label = lr_grid_1->create_label(
                  row     = l_row
                  column  = 1
                  text    = l_text
                  tooltip = l_text ).                           "#EC NOTEXT
    *... in the cell of the left grid create a text
                lr_text = lr_grid_1->create_text(
                  row     = l_row
                  column  = 2
                  text    =  ).
              else.
    *... display data in the right grid
    *... in the cell of the right grid create a label
                l_text = lr_column->get_medium_text( ).
                lr_label = lr_grid_2->create_label(
                  row     = l_row
                  column  = 1
                  text    = l_text
                  tooltip = l_text ).                           "#EC NOTEXT
    *... in the cell of the right grid create a text
                lr_text = lr_grid_2->create_text(
                  row     = l_row
                  column  = 2
                  text    = set_label_for( lr_text ).
        endloop.
      else.
    *... in the cell create header information
        concatenate 'TOP_OF_PAGE' text-h01 into l_text separated by space.
        lr_grid->create_header_information(
          row    = 1
          column = 1
          text    = l_text
          tooltip = l_text ).
    *... add a row to the grid -> row 2
        lr_grid->add_row( ).
    *... in the cell create a grid
        lr_grid_1 = lr_grid->create_grid(
                      row    = 3
                      column = 1 ).
    *... in the cell of the second grid create a label
        lr_label = lr_grid_1->create_label(
          row     = 1
          column  = 1
          text    = text-t10
          tooltip = text-t10 ).
    *... in the cell of the second grid create a text
        lr_text = lr_grid_1->create_text(
          row     = 1
          column  = 2
          text    = gs_test-amount
          tooltip = gs_test-amount ).
        lr_label->set_label_for( lr_text ).
    *... in the cell of the second grid create a label
        lr_label = lr_grid_1->create_label(
          row    = 2
          column = 1
          text    = text-t11
          tooltip = text-t11 ).
    *... in the cell of the second grid create a text
        l_text = text-t15.
        lr_text = lr_grid_1->create_text(
          row    = 2
          column = 2
          text    = l_text
          tooltip = l_text ).
        lr_label->set_label_for( lr_text ).
        if i_page is not initial.
    *... in the cell of the second grid create a label
          lr_label = lr_grid_1->create_label(
            row    = 1
            column = 3
            text    = text-i01
            tooltip = text-i01 ).
    *... in the cell of the second grid create a text
          lr_text = lr_grid_1->create_text(
            row    = 1
            column = 4
            text    = i_page
            tooltip = i_page ).
        endif.
      endif.
    *... content is the top grid
      cr_content = lr_grid.
    endform.                    " create_alv_form_content_top
    *&      Form  create_alv_form_content_eop
          text
    form create_alv_form_content_eop
           using    i_page type sypagno
           changing cr_content    type ref to cl_salv_form_element."#EC *
      data: lr_header type ref to cl_salv_form_header_info,
            l_text    type string.
    *... create header information
      concatenate 'END_OF_PAGE' text-h01 into l_text separated by space.
      create object lr_header
        exporting
          text    = l_text
          tooltip = l_text.
      cr_content = lr_header.
    endform.                    " create_alv_form_content_eop
    *&      Form  set_columns_technical
          text
    form set_columns_technical using ir_columns type ref to cl_salv_columns_hierseq.
      data: lr_column type ref to cl_salv_column.
      try.
          lr_column = ir_columns->get_column( 'MANDT' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'FLOAT_FI' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'STRING_F' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'XSTRING' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'INT_FIEL' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'HEX_FIEL' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'DROPDOWN' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
      try.
          lr_column = ir_columns->get_column( 'TAB_INDEX' ).
          lr_column->set_technical( if_salv_c_bool_sap=>true ).
        catch cx_salv_not_found.                            "#EC NO_HANDLER
      endtry.
    endform.                    " set_columns_technical(

  • About  "abstract class cannot have be instantiated"

    in java coding it means
    ========
    abstract  class X
      public X();
    }========
    no {} is allowed to public X
    or i can not write a invoke as
    ========
    X x=new X();========
    or both of them are forbidden by abstract class?
    why body{} is related to instantiated?
    why a abstract class can not has a static method?

    in java coding it means
    ========
    abstract class X
    public X();
    ========
    no {} is allowed to public X???
    You must include the braces for the constructor. The code you have posted won't compile.
    or i can not write a invoke as
    ========
    X x=new X();
    ========Correct. You need to provide the implementation first, which can be as simple as "X x = new X() { };".
    why body{} is related to instantiated?It's not.
    why a abstract class can not has a static method?It can. Try writing some of your own tests to validate your (incorrect) assumptions.
    Example:abstract class X
      public X() { };
      static void foo() {};
    }

  • Reg. decimal airthmetic......have ur ponts.

    Hi all,
    I have a decimal field with 2 places....say A = 1234.12
    My requirement to put the decimal value in another variable B. eg.   now B should be equal to B = 12.
    Help me out..
    & <b>Have ur pont.s</b>

    check this
    data : v1 type p decimals 2 value '123.45',
           v2 type i,
           v3 type p decimals 2.
    v3 = v1.
    v3 = v3 * 100.
    v2 = v3  mod 100.
    write : / v2.
    regards
    shiba dutta

  • Abstract class Vs interface

    Hi,
    I have to buid a report in ECM with complete details of the engineering as well as production. This include workflow as well as various fucntionality depends upon the criterion and user's event.
    I am implementating in OOPS and I Want to know that when I should use the Abstract class and when interface  ?
    Because as per me both serve the same purpose. Kindly send me the exact difference so that i can efficiently use the same.
    Thanks
    Prince

    When inheriting A Interface We have to inherit all the methods of the Interface there's no other option whereas with abstract classes we can inherit the members that we are in need of.
    Just the interface has to have body of the method and the method is to be used by the classes inheriting it. Whereas in the case of Abstract Class it can have declarations (Other than the abstract method) and it can be further extended in the classes inheriting the Abstract Class.
    Interface contains all abstract methods,all methods compulsory implemented by particular class, interface does not contain Constructor
    abstract classes are designed with implemantion gaps for sub-class to fill in.
    interfaces are sintacticlly similar to classes but they lack insance variables & methods.
    abstract classes can also have both abstract methods & non-abstract methods. where as in interface methods are abstract only, & variables are implicitly static&final
    regards
    Preetesh

  • Abstract class - subclass

    a quik question: if I have a abstract class define a method, and a subclass implementing it, and a third class with an instance casted as the abstract class, would the following method in the subclass then return the instance casted as subclass? :
    public Subclass getInstance() {
    return this;
    Stig.

    oops.... cant return SubClass....

  • Final in abstract class, again

    Hello,
    Consider an abstract class with a final variable:abstract class RingRing {
      private final int m;
    } upon compiling, you will find a compiler error.
    Couldn't this error be delayed and placed on the implementors of this class?
    Why was it designed this way?
    The solution to this problem is to set the variable via a constructor,
    but it's a bit of a 'hack' to pass everything in the constructor. specially
    if we would like to pass it, say, an array of some yet unknown size, or ...

    Hello,
    Consider an abstract class with a final
    variable:abstract class RingRing {
    private final int m;
    } upon compiling, you will find a compiler
    error.
    Couldn't this error be delayed and placed on the
    implementors of this class?Well, considering it's private, implementors don't
    have access to it.oops, i did not mean for it to be private, i meant protected or public.
    Does it compile if it's protected? At first blush,
    what seems logical to me is that if it's protected or
    public, then the compiler would complain about any
    implementor that doesn't initialize it in all its
    constructors or in an instance initializer. I've no
    clue whether it actually works that way though, and
    since I'm assigning homework anyway... :-)and yes, the problem still exists with protected :)

  • Abstract Classes & Interface Classes

    Dear members of the Sun Community
    My studies are progressing and just 1 period ago we started doing Object-Orinted Programming in Java and I must say I'm quite fond of it. It's become quite clear that OOP is an important aspect of Programming and just can't be missed. We've learned about Inheritance, Polymorfism, Mutators, Inspectors, Uses-Relationships and everything else however now I've come to the point where I got a problem:
    Up until now we have been using normal classes to work with in which you could create objects and in your main program create objects from that class however. We've just learned about Abstract and Interface classes. As far as I'm concerned I'm quite confused with both of them.
    If I am not mistaken (please correct me if I'm wrong) Abstract classes are classes from which you cannot create an object but is only used to make a subclass inherit everything from this superclass.
    I am not quite sure what Interface classes are as they just plain confuse me. Would anyone be so kind to maybe explain what all of this is ?
    Thanks a whole bunch
    Herazio

    Funny enough that already solved the question !
    Thank you so much for the quick reply ^^
    Herazio

  • Interfaces and abstract classes

    can anyone pls tell me where exactly an abstract class is used and where exactly an interface is to be used.
    i think the main difference between an abstract class and an interface is that an interface will have all the abstract methods whereas an abstract class can have one or more abstract methods--- if i am not wrong.
    anything to add? -- pls let me know on this....
    and also how they might be useful for us....

    Inheritance is the most popular feature of the OOP. By organising classes into class hierachy it gives an extra dimension to the encapsulation of abstract data types becauase it enables classes to inherit attributes/methods from other classes.
    There are two complementary roles of inheritance in OOP application.
    1. Specialisation: Extending the functionality of an existing class.
    2. Generalisation: Sharing commonality between two or more classes.
    So adding functionality by extending what exists at each level to create more specialized classes. This would create a hierarchy and would be helpful even later on in maintenance.
    Now when to have an abstarct class and when an interface. An interface just defines the basic functionality to be implemented by all the subclasses, though the way they are implemented may be different. e.g an interfaca animal can have all those functionalities common to all animals in basics but different in implementation. e.g all animals walk however some walk on two legs and some on four. All animals can see but they might have a different colour spectrum visible. So all such methods general but common can be in an interface.
    Abstract classes come into play at a more defined level e.g in an abstract class human though walk would be the same so implemented there and then but talking can be left abstract since there may be different languages involved.
    For more details refer to a good OOP book.

  • What is the diff b/w Abstract class and an interface ?

    Hey
    I am always confused as with this issue : diff b/w Abstract class and an interface ?
    Which is more powerful in what situation.
    Regards
    Vinay

    Hi, Don't worry I am teach you
    Abstract class and Interface
    An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
    Edited by SASIKUMARA
    SIT INNOVATIONS- Chennai
    Message was edited by:
    sasikumara
    Message was edited by:
    sasikumara

  • Abstract class with set and get methods

    hi
    how to write set and get methods(plain methods) in an abstartc class
    ex: setUsername(String)
    String getUsername()
    and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
    am new to programming....
    asap
    thnx in advance

    yes... as i told u.... i am new to coding......
    and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
    in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
    for that now i am writing business process classes..... the above mentioned two classes are from business process.....
    could u help me now
    thnx in advance

Maybe you are looking for

  • Convert .txt file to .pdf using java code

    Hi, My requirement is to read the .txt file and convert it into .pdf file after changing certain text. Searched the net got a document on iText ..is it the only way for conversion or any other method....please help. Thanks in advance. Pooja

  • NEWSPAPER CLASSIFIED LAYOUT QUESTION

    We currently export our orders  from the accounting software to an OS X numbers spreadsheet and pull that data into our small newspaper layout for classifieds as text, then we have to manually re-format the data for underlines, bold, spacing, etc.. T

  • How to stop Adobe Connect Pro from resizing my content window?

    Version info: Adobe Connect Pro version 8 When I upload training content in the form of output of a SWF to my company's Connect server, and then play back the training content, the size of the window that Connect opens is whatever size I have created

  • Firebug not working

    I have downloaded fire bug on my Emachine E525 runing on linux mint 14. I have downloaded it on an up to date version of Mozzilla Firefox . The problem is on the console when i type in java script and hit run on the comand line it only returns the co

  • MacBook Pro Cases

    So I was just given a the Macbook Pro 13" as a gift from my husband. I'm just wondering what is the best case to get for it? Im pretty clumsy and have a 5 year old child who is already trying to get her little hands all over it. Im looking for a real