<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: undesratsnding abap objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274490#M494405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  BCALV_TREE_SIMPLE_DEMO                                      *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report  bcalv_tree_simple_demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class cl_gui_column_tree definition load.&lt;/P&gt;&lt;P&gt;class cl_gui_cfw definition load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tree1  type ref to cl_gui_alv_tree_simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;include bcalv_simple_event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gt_sflight      type sflight occurs 0,      "Output-Table&lt;/P&gt;&lt;P&gt;      gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog&lt;/P&gt;&lt;P&gt;      gt_sort         type lvc_t_sort, "Sortiertabelle&lt;/P&gt;&lt;P&gt;      ok_code         like sy-ucomm.   "OK-Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_structure_name = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;       changing&lt;/P&gt;&lt;P&gt;            ct_fieldcat      = gt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;change fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: ls_fieldcatalog type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;  loop at gt_fieldcatalog into ls_fieldcatalog.&lt;/P&gt;&lt;P&gt;    case ls_fieldcatalog-fieldname.&lt;/P&gt;&lt;P&gt;      when 'CARRID' or 'CONNID' or 'FLDATE'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-no_out = 'X'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-key    = ''.&lt;/P&gt;&lt;P&gt;      when 'PRICE' or 'SEATSOCC' or 'SEATSMAX' or 'PAYMENTSUM'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-do_sum = 'X'.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;    modify gt_fieldcatalog from ls_fieldcatalog.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_OUTTAB&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from sflight into table gt_sflight.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             up to 1 rows.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_OUTTAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_SORT_TABLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_sort_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data ls_sort_wa type lvc_s_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create sort-table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_sort_wa-spos = 1.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-subtot = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_sort_wa-spos = 2.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'CONNID'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-subtot = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_sort_wa-spos = 3.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'FLDATE'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_SORT_TABLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  PBO  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module pbo output.&lt;/P&gt;&lt;P&gt;  if tree1 is initial.&lt;/P&gt;&lt;P&gt;    perform init_tree.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  set pf-status 'MAIN100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                             " PBO  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  PAI  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module pai input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  case ok_code.&lt;/P&gt;&lt;P&gt;    when 'EXIT' or 'BACK' or 'CANC'.&lt;/P&gt;&lt;P&gt;      perform exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when others.&lt;/P&gt;&lt;P&gt;      call method cl_gui_cfw=&amp;gt;dispatch.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;  clear ok_code.&lt;/P&gt;&lt;P&gt;endmodule.                             " PAI  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  exit_program&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      free object and leave program&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method tree1-&amp;gt;free.&lt;/P&gt;&lt;P&gt;  leave program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " exit_program&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  register_events&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form register_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;define the events which will be passed to the backend&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: lt_events type cntl_simple_events,&lt;/P&gt;&lt;P&gt;        l_event type cntl_simple_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;define the events which will be passed to the backend&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_node_context_menu_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_item_context_menu_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_header_context_men_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_expand_no_children.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_header_click.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_item_keypress.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method tree1-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      events = lt_events&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      cntl_error                = 1&lt;/P&gt;&lt;P&gt;      cntl_system_error         = 2&lt;/P&gt;&lt;P&gt;      illegal_event_combination = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set Handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: l_event_receiver type ref to lcl_tree_event_receiver.&lt;/P&gt;&lt;P&gt;  create object l_event_receiver.&lt;/P&gt;&lt;P&gt;  set handler l_event_receiver-&amp;gt;on_add_hierarchy_node&lt;/P&gt;&lt;P&gt;                                                        for tree1.&lt;/P&gt;&lt;P&gt;endform.                               " register_events&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_header&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      build table for html_header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_comment using&lt;/P&gt;&lt;P&gt;      pt_list_commentary type slis_t_listheader&lt;/P&gt;&lt;P&gt;      p_logo             type sdydo_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: ls_line type slis_listheader.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LIST HEADING LINE: TYPE H&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'H'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY:  NOT USED FOR THIS TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_line-info = 'ALV-tree-simple-Demo: flight-overview'.   "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STATUS LINE: TYPE S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'valid to'.                                "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  ls_line-info = 'January 29 1999'.                         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'time'.&lt;/P&gt;&lt;P&gt;  ls_line-info = '2.00 pm'.                                 "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACTION LINE: TYPE A&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'A'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY:  NOT USED FOR THIS TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_line-info = 'up-to-date data'.                         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  p_logo = 'ENJOYSAP_LOGO'.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM init_tree.&lt;/P&gt;&lt;P&gt;  perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform build_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform build_sort_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create container for alv-tree&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: l_tree_container_name(30) type c,&lt;/P&gt;&lt;P&gt;        l_custom_container type ref to cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;  l_tree_container_name = 'TREE1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  create object l_custom_container&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;            container_name = l_tree_container_name&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;            cntl_error                  = 1&lt;/P&gt;&lt;P&gt;            cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;            create_error                = 3&lt;/P&gt;&lt;P&gt;            lifetime_error              = 4&lt;/P&gt;&lt;P&gt;            lifetime_dynpro_dynpro_link = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create tree control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create object tree1&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;        i_parent              = l_custom_container&lt;/P&gt;&lt;P&gt;        i_node_selection_mode =&lt;/P&gt;&lt;P&gt;                              cl_gui_column_tree=&amp;gt;node_sel_mode_multiple&lt;/P&gt;&lt;P&gt;        i_item_selection      = 'X'&lt;/P&gt;&lt;P&gt;        i_no_html_header      = ''&lt;/P&gt;&lt;P&gt;        i_no_toolbar          = ''&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;        cntl_error                   = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error            = 2&lt;/P&gt;&lt;P&gt;        create_error                 = 3&lt;/P&gt;&lt;P&gt;        lifetime_error               = 4&lt;/P&gt;&lt;P&gt;        illegal_node_selection_mode  = 5&lt;/P&gt;&lt;P&gt;        failed                       = 6&lt;/P&gt;&lt;P&gt;        illegal_column_name          = 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create info-table for html-header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: lt_list_commentary type slis_t_listheader,&lt;/P&gt;&lt;P&gt;        l_logo             type sdydo_value.&lt;/P&gt;&lt;P&gt;  perform build_comment using&lt;/P&gt;&lt;P&gt;                 lt_list_commentary&lt;/P&gt;&lt;P&gt;                 l_logo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;repid for saving variants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: ls_variant type disvariant.&lt;/P&gt;&lt;P&gt;  ls_variant-report = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;register events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform register_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create hierarchy&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;          exporting&lt;/P&gt;&lt;P&gt;               it_list_commentary   = lt_list_commentary&lt;/P&gt;&lt;P&gt;               i_logo               = l_logo&lt;/P&gt;&lt;P&gt;               i_background_id      = 'ALV_BACKGROUND'&lt;/P&gt;&lt;P&gt;               i_save               = 'A'&lt;/P&gt;&lt;P&gt;               is_variant            = ls_variant&lt;/P&gt;&lt;P&gt;          changing&lt;/P&gt;&lt;P&gt;               it_sort              = gt_sort&lt;/P&gt;&lt;P&gt;               it_outtab            = gt_sflight&lt;/P&gt;&lt;P&gt;               it_fieldcatalog      = gt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;expand first level&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;expand_Tree&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;             i_level = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;optimize column-width&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;column_optimize&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;               i_start_column = tree1-&amp;gt;c_hierarchy_column_name&lt;/P&gt;&lt;P&gt;               i_end_column   = tree1-&amp;gt;c_hierarchy_column_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " init_tree&lt;/P&gt;&lt;P&gt;=============================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE BCALV_SIMPLE_EVENT_RECEIVER                                *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_tree_event_receiver definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: on_add_hierarchy_node&lt;/P&gt;&lt;P&gt;              for event on_add_hierarchy_node of cl_gui_alv_tree_simple&lt;/P&gt;&lt;P&gt;                    importing grouplevel&lt;/P&gt;&lt;P&gt;                              index_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_tree_event_receiver implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method on_add_hierarchy_node.&lt;/P&gt;&lt;P&gt;    data ls_outtab_line type sflight.&lt;/P&gt;&lt;P&gt;    ls_outtab_line-planetype = 'Note'. "#EC NOTEXT&lt;/P&gt;&lt;P&gt;    call method tree1-&amp;gt;set_hierarchy_data&lt;/P&gt;&lt;P&gt;            exporting&lt;/P&gt;&lt;P&gt;                is_outtab_line = ls_outtab_line.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2007 09:41:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-14T09:41:08Z</dc:date>
    <item>
      <title>undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274482#M494397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one provide basic material for underatanding object oriented in abap...with many sample programs(preferably)....u can also provide me links....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ginni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 05:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274482#M494397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T05:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274483#M494398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ginni &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure oriented approach&lt;/P&gt;&lt;P&gt;1. Emphasis on tasks &lt;/P&gt;&lt;P&gt;2. Large programs are divided into smaller programs known as functions&lt;/P&gt;&lt;P&gt;3. Most of the functions share global data&lt;/P&gt;&lt;P&gt;4. Data move openly around the system from function to function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Object oriented approach&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Emphasis on things that does those tasks&lt;/P&gt;&lt;P&gt;Programs are divided into objects&lt;/P&gt;&lt;P&gt;3.    Data structures are designed such that they characterized the objects &lt;/P&gt;&lt;P&gt;4.    Functions that operate on the data of an object are tied together in the data structure&lt;/P&gt;&lt;P&gt;5.    Data can be hidden and cannot be accessed by external functions &lt;/P&gt;&lt;P&gt;6.    New data and functions can be easily added whenever necessary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Object Oriented Approach  (key features)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Better Programming Structure&lt;/P&gt;&lt;P&gt;2. Real world entity can be modeled very well&lt;/P&gt;&lt;P&gt;3.Stress on data security and access&lt;/P&gt;&lt;P&gt;4. Data encapsulation and abstraction&lt;/P&gt;&lt;P&gt;5. Reduction in code redundancy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;1.1	Accessibility of different sections of a class&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Theme	From this program, one will learn:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.	How to define, implement and instantiate a class.&lt;/P&gt;&lt;P&gt;2.	What are the different sections of visibility in a class.&lt;/P&gt;&lt;P&gt;3.	How to define instance attributes and get them accessed by external users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following program will also show that :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61558;	Data declared in public section can be accessed by the class itself, by its subclasses as well as by other users outside the class.&lt;/P&gt;&lt;P&gt;&amp;amp;#61558;	Data declared in the protected section can be accessed by the class itself,  and also by its subclasses but not by external users outside the class.&lt;/P&gt;&lt;P&gt;&amp;amp;#61558;	Data declared in the private section can be accessed by the class only, but not by its subclasses and by external users outside the class.&lt;/P&gt;&lt;P&gt;Brief Description	This program contains a class : parentclass with following attributes in different sections:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Commondata     in public section&lt;/P&gt;&lt;P&gt;  Protectdata       in   private section&lt;/P&gt;&lt;P&gt;  Privatedata       in   private section&lt;/P&gt;&lt;P&gt;The method showval in class : parentclass displays values of all the attributes.&lt;/P&gt;&lt;P&gt;This demonstrates that class can access all its attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class childclass is a subclass of  class parentclass, which has a method : subval. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It displays the value for the data : commondata and protectdata .&lt;/P&gt;&lt;P&gt;Then, it changes the values for both and displays them again.&lt;/P&gt;&lt;P&gt;This demonstrates that subclass can access/change public/ protected attributes of superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the START-OF-SELECTION event, object : parent is instantiated from class : parentclass and object : child is instantiated from class : childclass.&lt;/P&gt;&lt;P&gt;Then , the method showval of parent(object of parentclass) and method subval of child(object of childclass) is called , which displays the values of  different attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, the public attribute of object parent is changed and the changed value is displayed. &lt;/P&gt;&lt;P&gt;This demonstrates that external users can change/display public attributes of a class.&lt;/P&gt;&lt;P&gt;Dump of the program:-&lt;/P&gt;&lt;P&gt;REPORT  YSUBDEL LINE-SIZE 120.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS parentclass DEFINITION .&lt;/P&gt;&lt;P&gt; PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  DATA : commondata(30) type c value 'Accessible to all'.&lt;/P&gt;&lt;P&gt;  METHODS : SHOWVAL.&lt;/P&gt;&lt;P&gt; PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;  DATA : protectdata(40) type c value 'Protected data'.&lt;/P&gt;&lt;P&gt; private section.&lt;/P&gt;&lt;P&gt; data : privatedata(30) type c value 'Private data'.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS parentclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; METHOD : SHOWVAL.&lt;/P&gt;&lt;P&gt;  write:/5 'All data from parentclass shown:-'.&lt;/P&gt;&lt;P&gt;  write:/ sy-uline.&lt;/P&gt;&lt;P&gt;  WRITE:/5 COMMONDATA,&lt;/P&gt;&lt;P&gt;        /5 PROTECTDATA,&lt;/P&gt;&lt;P&gt;        /5 PRIVATEDATA.&lt;/P&gt;&lt;P&gt; endmethod.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS childclass DEFINITION INHERITING FROM parentclass.&lt;/P&gt;&lt;P&gt; PUBLIC SECTION .&lt;/P&gt;&lt;P&gt; METHODS : subval.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS childclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; method : subval.&lt;/P&gt;&lt;P&gt;  skip 1.&lt;/P&gt;&lt;P&gt;  write:/5 'Data of parent shown from child-'.&lt;/P&gt;&lt;P&gt;  write:/5 sy-uline.&lt;/P&gt;&lt;P&gt;  WRITE:/5 COMMONDATA,&lt;/P&gt;&lt;P&gt;        /5 PROTECTDATA.&lt;/P&gt;&lt;P&gt;  Commondata = 'Public data changed in subclass'.&lt;/P&gt;&lt;P&gt;  Protectdata = 'Protected data changed in subclass'.&lt;/P&gt;&lt;P&gt;  write:/5 sy-uline.&lt;/P&gt;&lt;P&gt;  WRITE:/5 COMMONDATA,&lt;/P&gt;&lt;P&gt;        /5 PROTECTDATA.&lt;/P&gt;&lt;P&gt; endmethod.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help u a lot &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Dont forget to reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 05:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274483#M494398</guid>
      <dc:creator>sonu_p2</dc:creator>
      <dc:date>2007-05-14T05:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274484#M494399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ginni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope these below links will be useful.&lt;/P&gt;&lt;P&gt;==========================&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A href="http://www.sapgenie.com/abap/OO/syntax.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/syntax.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;http://www.sapgenie.com/abap/OO/defn.htm&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these links&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For function module to class&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for classes&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for methods&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for inheritance&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for interfaces&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AbyJacob(Bangalore)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 06:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274484#M494399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T06:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274485#M494400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ginni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this topic interesting&lt;/P&gt;&lt;P&gt;=================&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further Reading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are many books about object orientation, object-oriented programming languages, object-oriented analysis and design, project management for OO projects, patterns and frameworks, and so on. This is a small selection of good books covering the most important topics:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Ambler, The Object Primer, SIGS Books &amp;amp; Multimedia (1996), ISBN: 1884842178&lt;/P&gt;&lt;P&gt;A very good introduction to object orientation for programmers. It provides comprehensive explanations of all essential OO concepts, and contains a procedure model for learning OO quickly and thoroughly. It is easy to read and practical, but still theoretically-founded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grady Booch, Object Solutions: Managing the Object-Oriented Project, Addison-Wesley Pub Co (1995), ISBN: 0805305947&lt;/P&gt;&lt;P&gt;A good book about all of the non-technical aspects of OO that are equally important for effective object-oriented programming. Easy to read and full of practical tips.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin Fowler, UML Distilled: Applying the Standard Object Modeling Language, Addison-Wesley Pub Co (1997), ISBN: 0201325632&lt;/P&gt;&lt;P&gt;An excellent book about UML (Unified Modeling Language - the new standardized OO language and notation for modeling). Assumes knowledge and experience of object orientation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns. Elements of Reusable Object-Oriented Software, Addison-Wesley Pub Co (1998), ISBN: 0201634988&lt;/P&gt;&lt;P&gt;Provides a pattern, showing how recurring design problems can be solved using objects. This is the first big pattern book, containing many examples of good OO design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James Rumbaugh, OMT Insights: Perspectives on Modeling from the Journal of Object-Oriented Programming, Prentice Hall (1996), ISBN: 0138469652&lt;/P&gt;&lt;P&gt;A collection of articles addressing the many questions and problems of OO analysis and design, implementation, dependency management, and so on. Highly recommended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is Object Orientation? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An object is a section of source code that contains data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object References&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a program, you identify and address objects using unique object references. Object references allow you to access the attributes and methods of an object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In object-oriented programming, objects usually have the following properties:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Encapsulation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Polymorphism&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Identical (identically-named) methods behave differently in different classes. Object-oriented programming contains constructions called interfaces. They enable you to address methods with the same name in different objects. Although the form of address is always the same, the implementation of the method is specific to a particular class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Uses of Object Orientation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are some of the advantages of object-oriented programming: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques. &lt;/P&gt;&lt;P&gt;In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required. &lt;/P&gt;&lt;P&gt;Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components. &lt;/P&gt;&lt;P&gt;In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase. &lt;/P&gt;&lt;P&gt;Achieving these goals requires: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object-oriented programming languages&lt;/P&gt;&lt;P&gt;Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency of object-oriented programming depends directly on how object-oriented language techniques are implemented in the system kernel. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object-oriented tools &lt;/P&gt;&lt;P&gt;Object-oriented tools allow you to create object-oriented programs in object-oriented languages. They allow you to model and store development objects and the relationships between them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object-oriented modeling&lt;/P&gt;&lt;P&gt;The object-orientation modeling of a software system is the most important, most time-consuming, and most difficult requirement for attaining the above goals. Object-oriented design involves more than just object-oriented programming, and provides logical advantages that are independent of the actual implementation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 06:58:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274485#M494400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T06:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274486#M494401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/48/4aad83b75211d194f50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/48/4aad83b75211d194f50000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 07:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274486#M494401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T07:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274487#M494402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Methods in ABAP Objects - Example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following example shows how to declare, implement, and use methods in ABAP Objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example uses three classes called C_TEAM, C_BIKER, and C_BICYCLE. A user (a program) can create objects of the class C_TEAM. On a selection screen, the class C_TEAM asks for the number of members of each team. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each object in the class C_TEAM can create as many instances of the class C_BIKER as there are members in the team. Each instance of the class C_BIKER creates an instances of the class C_BICYCLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each instance of the class C_TEAM can communicate with the program user through an interactive list. The program user can choose individual team members for actions. The instances of the class C_BIKER allow the program user to choose the action on a further selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constraints&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ABAP statements used for list processing are not yet fully available in ABAP Objects. However, to produce a simple test output, you can use the following statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE [AT] /&amp;lt;offset&amp;gt;(&amp;lt;length&amp;gt;) &amp;lt;f&amp;gt; &lt;/P&gt;&lt;P&gt;ULINE &lt;/P&gt;&lt;P&gt;SKIP &lt;/P&gt;&lt;P&gt;NEW-LINE&lt;/P&gt;&lt;P&gt;Note: The behavior of formatting and interactive list functions in their current state are not guaranteed. Incompatible changes could occur in a future release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declarations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example is implemented using local classes, since selection screens belong to an ABAP program, and cannot be defined or called in global classes. Below are the definitions of the two selection screens and three classes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global Selection Screens&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF: SCREEN 100 TITLE TIT1, LINE.&lt;/P&gt;&lt;P&gt;  PARAMETERS MEMBERS TYPE I DEFAULT 10.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF: LINE, SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF SCREEN 200 TITLE TIT2.&lt;/P&gt;&lt;P&gt;  PARAMETERS: DRIVE    RADIOBUTTON GROUP ACTN,&lt;/P&gt;&lt;P&gt;              STOP     RADIOBUTTON GROUP ACTN,&lt;/P&gt;&lt;P&gt;              GEARUP   RADIOBUTTON GROUP ACTN,&lt;/P&gt;&lt;P&gt;              GEARDOWN RADIOBUTTON GROUP ACTN.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF SCREEN 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Class Definitions&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS: C_BIKER DEFINITION DEFERRED,&lt;/P&gt;&lt;P&gt;       C_BICYCLE DEFINITION DEFERRED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_TEAM DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TYPES: BIKER_REF TYPE REF TO C_BIKER,&lt;/P&gt;&lt;P&gt;         BIKER_REF_TAB TYPE STANDARD TABLE OF BIKER_REF &lt;/P&gt;&lt;P&gt;                                           WITH DEFAULT KEY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         BEGIN OF STATUS_LINE_TYPE,&lt;/P&gt;&lt;P&gt;           FLAG(1)  TYPE C,&lt;/P&gt;&lt;P&gt;           TEXT1(5) TYPE C,&lt;/P&gt;&lt;P&gt;           ID       TYPE I,&lt;/P&gt;&lt;P&gt;           TEXT2(7) TYPE C,&lt;/P&gt;&lt;P&gt;           TEXT3(6) TYPE C,&lt;/P&gt;&lt;P&gt;           GEAR     TYPE I,&lt;/P&gt;&lt;P&gt;           TEXT4(7) TYPE C,&lt;/P&gt;&lt;P&gt;           SPEED    TYPE I,&lt;/P&gt;&lt;P&gt;         END OF STATUS_LINE_TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLASS-METHODS: CLASS_CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHODS: CONSTRUCTOR,&lt;/P&gt;&lt;P&gt;           CREATE_TEAM,&lt;/P&gt;&lt;P&gt;           SELECTION,&lt;/P&gt;&lt;P&gt;           EXECUTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLASS-DATA: TEAM_MEMBERS TYPE I,&lt;/P&gt;&lt;P&gt;              COUNTER TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ID TYPE I,&lt;/P&gt;&lt;P&gt;        STATUS_LINE TYPE STATUS_LINE_TYPE,&lt;/P&gt;&lt;P&gt;        STATUS_LIST TYPE SORTED TABLE OF STATUS_LINE_TYPE &lt;/P&gt;&lt;P&gt;                                      WITH UNIQUE KEY ID,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        BIKER_TAB TYPE BIKER_REF_TAB,&lt;/P&gt;&lt;P&gt;        BIKER_SELECTION LIKE BIKER_TAB,&lt;/P&gt;&lt;P&gt;        BIKER LIKE LINE OF BIKER_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHODS: WRITE_LIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_BIKER DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHODS: CONSTRUCTOR IMPORTING TEAM_ID TYPE I MEMBERS TYPE I,&lt;/P&gt;&lt;P&gt;           SELECT_ACTION,&lt;/P&gt;&lt;P&gt;           STATUS_LINE EXPORTING LINE &lt;/P&gt;&lt;P&gt;                       TYPE C_TEAM=&amp;gt;STATUS_LINE_TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLASS-DATA COUNTER TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ID TYPE I,&lt;/P&gt;&lt;P&gt;        BIKE TYPE REF TO C_BICYCLE,&lt;/P&gt;&lt;P&gt;        GEAR_STATUS  TYPE I VALUE 1,&lt;/P&gt;&lt;P&gt;        SPEED_STATUS TYPE I VALUE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHODS BIKER_ACTION IMPORTING ACTION TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_BICYCLE DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHODS: DRIVE EXPORTING VELOCITY TYPE I,&lt;/P&gt;&lt;P&gt;           STOP  EXPORTING VELOCITY TYPE I,&lt;/P&gt;&lt;P&gt;           CHANGE_GEAR IMPORTING CHANGE TYPE I&lt;/P&gt;&lt;P&gt;                       RETURNING VALUE(GEAR) TYPE I&lt;/P&gt;&lt;P&gt;                       EXCEPTIONS GEAR_MIN GEAR_MAX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: SPEED TYPE I,&lt;/P&gt;&lt;P&gt;        GEAR  TYPE I VALUE 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONSTANTS: MAX_GEAR TYPE I VALUE 18,&lt;/P&gt;&lt;P&gt;             MIN_GEAR TYPE I VALUE 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that none of the three classes has any public attributes. The states of the classes can only be changed by their methods. The class C_TEAM contains a static constructor CLASS_CONSTRUCTOR. C_TEAM and C_BIKER both contain instance constructors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implementations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The implementation parts of the classes contain the implementations of all of the methods declared in the corresponding declaration parts. The interfaces of the methods have already been defined in the declarations. In the implementations, the interface parameters behave like local data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods of Class C_TEAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following methods are implemented in the section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_TEAM IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS_CONSTRUCTOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD CLASS_CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;    TIT1 = 'Team members ?'.&lt;/P&gt;&lt;P&gt;    CALL SELECTION-SCREEN 100 STARTING AT 5 3.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;      LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      TEAM_MEMBERS = MEMBERS.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The static constructor is executed before the class C_TEAM is used for the first time in a program. It calls the selection screen 100 and sets the static attribute TEAM_MEMBERS to the value entered by the program user. This attribute has the same value for all instances of the class C_TEAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTRUCTOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;    COUNTER = COUNTER + 1.&lt;/P&gt;&lt;P&gt;    ID = COUNTER.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The instance constructor is executed directly after each instance of the class C_TEAM is created. It is used to count the number of instance of C_TEAM in the static attribute COUNTER, and assigns the corresponding number to the instance attribute ID of each instance of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE_TEAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD CREATE_TEAM.&lt;/P&gt;&lt;P&gt;    DO TEAM_MEMBERS TIMES.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT BIKER EXPORTING TEAM_ID = ID&lt;/P&gt;&lt;P&gt;                                    MEMBERS = TEAM_MEMBERS.&lt;/P&gt;&lt;P&gt;      APPEND BIKER TO BIKER_TAB.&lt;/P&gt;&lt;P&gt;      CALL METHOD BIKER-&amp;gt;STATUS_LINE IMPORTING LINE = STATUS_LINE.&lt;/P&gt;&lt;P&gt;      APPEND STATUS_LINE TO STATUS_LIST.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method CREATE_TEAM can be called by any user of the class containing a reference variable with a reference to an instance of the class. It is used to create instances of the class C_BIKER, using the private reference variable BIKER in the class C_TEAM. You must pass both input parameters for the instance constructor of class C_BIKER in the CREATE OBJECT statement. The references to the newly-created instances are inserted into the private internal table BIKER_TAB. After the method has been executed, each line of the internal table contains a reference to an instance of the class C_BIKER. These references are only visible within the class C_TEAM. External users cannot address the objects of class C_BIKER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE_TEAM also calls the method STATUS_LINE for each newly-created object, and uses the work area STATUS_LINE to append its output parameter LINE to the private internal table STATUS_LIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD SELECTION.&lt;/P&gt;&lt;P&gt;    CLEAR BIKER_SELECTION.&lt;/P&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;      READ LINE SY-INDEX.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC &amp;lt;&amp;gt; 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;      IF SY-LISEL+0(1) = 'X'.&lt;/P&gt;&lt;P&gt;        READ TABLE BIKER_TAB INTO BIKER INDEX SY-INDEX.&lt;/P&gt;&lt;P&gt;        APPEND BIKER TO BIKER_SELECTION.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;    CALL METHOD WRITE_LIST.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method SELECTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. It selects all of the lines in the current list in which the checkbox in the first column is selected. For these lines, the system copies the corresponding reference variables from the table BIKER_TAB into an additional private internal table BIKER_SELECTION. SELECTION then calls the private method WRITE_LIST, which displays the list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD EXECUTION.&lt;/P&gt;&lt;P&gt;    CHECK NOT BIKER_SELECTION IS INITIAL.&lt;/P&gt;&lt;P&gt;    LOOP AT BIKER_SELECTION INTO BIKER.&lt;/P&gt;&lt;P&gt;      CALL METHOD BIKER-&amp;gt;SELECT_ACTION.&lt;/P&gt;&lt;P&gt;      CALL METHOD BIKER-&amp;gt;STATUS_LINE IMPORTING LINE = STATUS_LINE.&lt;/P&gt;&lt;P&gt;      MODIFY TABLE STATUS_LIST FROM STATUS_LINE.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    CALL METHOD WRITE_LIST.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method EXECUTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method calls the two methods SELECT_ACTION and STATUS_LINE for each instance of the class C_BIKER for which there is a reference in the table BIKER_SELECTION. The line of the table STATUS_LIST with the same key as the component ID in the work area STATUS_LINE is overwritten and displayed by the private method WRITE_LIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE_LIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD WRITE_LIST.&lt;/P&gt;&lt;P&gt;    SET TITLEBAR 'TIT'.&lt;/P&gt;&lt;P&gt;    SY-LSIND = 0.&lt;/P&gt;&lt;P&gt;    SKIP TO LINE 1.&lt;/P&gt;&lt;P&gt;    POSITION 1.&lt;/P&gt;&lt;P&gt;    LOOP AT STATUS_LIST INTO STATUS_LINE.&lt;/P&gt;&lt;P&gt;      WRITE: / STATUS_LINE-FLAG AS CHECKBOX,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-TEXT1,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-ID,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-TEXT2,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-TEXT3,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-GEAR,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-TEXT4,&lt;/P&gt;&lt;P&gt;               STATUS_LINE-SPEED.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The private instance method WRITE_LIST can only be called from the methods of the class C_TEAM. It is used to display the private internal table STATUS_LIST on the basic list (SY-LSIND = 0) of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods of Class C_BIKER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following methods are implemented in the section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_BIKER IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTRUCTOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;    COUNTER = COUNTER + 1.&lt;/P&gt;&lt;P&gt;    ID = COUNTER - MEMBERS * ( TEAM_ID - 1).&lt;/P&gt;&lt;P&gt;    CREATE OBJECT BIKE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The instance constructor is executed directly after each instance of the class C_BIKER is created. It is used to count the number of instance of C_BIKER in the static attribute COUNTER, and assigns the corresponding number to the instance attribute ID of each instance of the class. The constructor has two input parameters - TEAM_ID and MEMBERS - which you must pass in the CREATE OBJECT statement when you create an instance of C_BIKER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The instance constructor also creates an instance of the class C_BICYCLE for each new instance of the class C_BIKER. The reference in the private reference variable BIKE of each instance of C_BIKER points to a corresponding instance of the class C_BICYCLE. No external user can address these instances of the class C_BICYCLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT_ACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD SELECT_ACTION.&lt;/P&gt;&lt;P&gt;    DATA ACTIVITY TYPE I.&lt;/P&gt;&lt;P&gt;    TIT2 = 'Select action for BIKE'.&lt;/P&gt;&lt;P&gt;    TIT2+24(3) = ID.&lt;/P&gt;&lt;P&gt;    CALL SELECTION-SCREEN 200 STARTING AT 5 15.&lt;/P&gt;&lt;P&gt;    CHECK NOT SY-SUBRC GT 0.&lt;/P&gt;&lt;P&gt;    IF GEARUP = 'X' OR GEARDOWN = 'X'.&lt;/P&gt;&lt;P&gt;      IF GEARUP = 'X'.&lt;/P&gt;&lt;P&gt;        ACTIVITY = 1.&lt;/P&gt;&lt;P&gt;      ELSEIF GEARDOWN = 'X'.&lt;/P&gt;&lt;P&gt;        ACTIVITY = -1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ELSEIF DRIVE = 'X'.&lt;/P&gt;&lt;P&gt;      ACTIVITY = 2.&lt;/P&gt;&lt;P&gt;    ELSEIF STOP = 'X'.&lt;/P&gt;&lt;P&gt;      ACTIVITY = 3.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CALL METHOD BIKER_ACTION( ACTIVITY).&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method SELECT_ACTION can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method calls the selection screen 200 and analyzes the user input. After this, it calls the private method BIKER_ACTION of the same class. The method call uses the shortened form to pass the actual parameter ACTIVITY to the formal parameter ACTION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BIKER_ACTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD BIKER_ACTION.&lt;/P&gt;&lt;P&gt;    CASE ACTION.&lt;/P&gt;&lt;P&gt;      WHEN -1 OR 1.&lt;/P&gt;&lt;P&gt;        CALL METHOD BIKE-&amp;gt;CHANGE_GEAR&lt;/P&gt;&lt;P&gt;                          EXPORTING CHANGE = ACTION&lt;/P&gt;&lt;P&gt;                          RECEIVING GEAR = GEAR_STATUS&lt;/P&gt;&lt;P&gt;                          EXCEPTIONS GEAR_MAX = 1&lt;/P&gt;&lt;P&gt;                                     GEAR_MIN = 2.&lt;/P&gt;&lt;P&gt;        CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;          WHEN 1.&lt;/P&gt;&lt;P&gt;            MESSAGE I315(AT) WITH 'BIKE' ID&lt;/P&gt;&lt;P&gt;                                  ' is already at maximal gear!'.&lt;/P&gt;&lt;P&gt;          WHEN 2.&lt;/P&gt;&lt;P&gt;            MESSAGE I315(AT) WITH 'BIKE' ID&lt;/P&gt;&lt;P&gt;                                  ' is already at minimal gear!'.&lt;/P&gt;&lt;P&gt;        ENDCASE.&lt;/P&gt;&lt;P&gt;      WHEN 2.&lt;/P&gt;&lt;P&gt;        CALL METHOD BIKE-&amp;gt;DRIVE IMPORTING VELOCITY = SPEED_STATUS.&lt;/P&gt;&lt;P&gt;      WHEN 3.&lt;/P&gt;&lt;P&gt;        CALL METHOD BIKE-&amp;gt;STOP IMPORTING VELOCITY = SPEED_STATUS.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The private instance method BIKER_ACTION can only be called from the methods of the class C_BIKER. The method calls other methods in the instance of the class C_BICYCLE to which the reference in the reference variable BIKE is pointing, depending on the value in the input parameter ACTION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATUS_LINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD STATUS_LINE.&lt;/P&gt;&lt;P&gt;    LINE-FLAG = SPACE.&lt;/P&gt;&lt;P&gt;    LINE-TEXT1 = 'Biker'.&lt;/P&gt;&lt;P&gt;    LINE-ID = ID.&lt;/P&gt;&lt;P&gt;    LINE-TEXT2 = 'Status:'.&lt;/P&gt;&lt;P&gt;    LINE-TEXT3 = 'Gear = '.&lt;/P&gt;&lt;P&gt;    LINE-GEAR  = GEAR_STATUS.&lt;/P&gt;&lt;P&gt;    LINE-TEXT4 = 'Speed = '.&lt;/P&gt;&lt;P&gt;    LINE-SPEED = SPEED_STATUS.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method STATUS_LINE can be called by any user of the class containing a reference variable with a reference to an instance of the class. It fills the structured output parameter LINE with the current attribute values of the corresponding instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods of Class C_BICYCLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following methods are implemented in the section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C_BICYCLE IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DRIVE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD DRIVE.&lt;/P&gt;&lt;P&gt;    SPEED = SPEED  + GEAR * 10.&lt;/P&gt;&lt;P&gt;    VELOCITY = SPEED.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method DRIVE can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute SPEED and passes it to the caller using the output parameter VELOCITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD STOP.&lt;/P&gt;&lt;P&gt;    SPEED = 0.&lt;/P&gt;&lt;P&gt;    VELOCITY = SPEED.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method STOP can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute SPEED and passes it to the caller using the output parameter VELOCITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHANGE_GEAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD CHANGE_GEAR.&lt;/P&gt;&lt;P&gt;    GEAR = ME-&amp;gt;GEAR.&lt;/P&gt;&lt;P&gt;    GEAR = GEAR + CHANGE.&lt;/P&gt;&lt;P&gt;    IF GEAR GT MAX_GEAR.&lt;/P&gt;&lt;P&gt;      GEAR = MAX_GEAR.&lt;/P&gt;&lt;P&gt;      RAISE GEAR_MAX.&lt;/P&gt;&lt;P&gt;    ELSEIF GEAR LT MIN_GEAR.&lt;/P&gt;&lt;P&gt;      GEAR = MIN_GEAR.&lt;/P&gt;&lt;P&gt;      RAISE GEAR_MIN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    ME-&amp;gt;GEAR = GEAR.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The public instance method CHANGE_GEAR can be called by any user of the class containing a reference variable with a reference to an instance of the class. The method changes the value of the private attribute GEAR. Since the formal parameter with the same name obscures the attribute in the method, the attribute has to be addressed using the self-reference ME-&amp;gt;GEAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the Classes in a Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following program shows how the above classes can be used in a program. The declarations of the selection screens and local classes, and the implementations of the methods must also be a part of the program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT OO_METHODS_DEMO NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declarations and Implementations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global Program Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES TEAM TYPE REF TO C_TEAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TEAM_BLUE  TYPE TEAM,&lt;/P&gt;&lt;P&gt;      TEAM_GREEN TYPE TEAM,&lt;/P&gt;&lt;P&gt;      TEAM_RED   TYPE TEAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA  COLOR(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Program events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT: TEAM_BLUE,&lt;/P&gt;&lt;P&gt;                 TEAM_GREEN,&lt;/P&gt;&lt;P&gt;                 TEAM_RED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL METHOD: TEAM_BLUE-&amp;gt;CREATE_TEAM, &lt;/P&gt;&lt;P&gt;               TEAM_GREEN-&amp;gt;CREATE_TEAM,&lt;/P&gt;&lt;P&gt;               TEAM_RED-&amp;gt;CREATE_TEAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'TEAMLIST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE '                   Select a team!             ' COLOR = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;  CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;    WHEN 'TEAM_BLUE'.&lt;/P&gt;&lt;P&gt;      COLOR = 'BLUE '.&lt;/P&gt;&lt;P&gt;      FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;       CALL METHOD TEAM_BLUE-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;    WHEN 'TEAM_GREEN'.&lt;/P&gt;&lt;P&gt;      COLOR = 'GREEN'.&lt;/P&gt;&lt;P&gt;      FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;       CALL METHOD TEAM_GREEN-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;    WHEN 'TEAM_RED'.&lt;/P&gt;&lt;P&gt;      COLOR = 'RED '.&lt;/P&gt;&lt;P&gt;      FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;       CALL METHOD TEAM_RED-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;    WHEN 'EXECUTION'.&lt;/P&gt;&lt;P&gt;      CASE COLOR.&lt;/P&gt;&lt;P&gt;        WHEN 'BLUE '.&lt;/P&gt;&lt;P&gt;          FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;           CALL METHOD TEAM_BLUE-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;          CALL METHOD TEAM_BLUE-&amp;gt;EXECUTION. &lt;/P&gt;&lt;P&gt;        WHEN 'GREEN'.&lt;/P&gt;&lt;P&gt;          FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;           CALL METHOD TEAM_GREEN-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;          CALL METHOD TEAM_GREEN-&amp;gt;EXECUTION. &lt;/P&gt;&lt;P&gt;        WHEN 'RED '.&lt;/P&gt;&lt;P&gt;          FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.&lt;/P&gt;&lt;P&gt;           CALL METHOD TEAM_RED-&amp;gt;SELECTION. &lt;/P&gt;&lt;P&gt;          CALL METHOD TEAM_RED-&amp;gt;EXECUTION. &lt;/P&gt;&lt;P&gt;      ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program contains three class reference variables that refer to the class C_TEAM. It creates three objects from the class, to which the references in the reference variables then point. In each object, it calls the method CREATE_TEAM. The method CLASS_CONSTRUCTOR of class C_TEAM is executed before the first of the objects is created. The status TEAMLIST for the basic list allows the user to choose one of four functions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user chooses a function, the event AT USER-COMMAND is triggered and public methods are called in one of the three instances of C_TEAM, depending on the user&amp;#146;s choice. The user can change the state of an object by selecting the corresponding line in the status list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 07:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274487#M494402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T07:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274488#M494403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;/people/thomasalexander.ritter/blog/2007/04/19/how-to-encapsulate-an-internal-table-with-abap-objects&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 07:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274488#M494403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T07:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274489#M494404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ginni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the below program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BCALV_TREE_SIMPLE_DEMO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABY&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 09:38:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274489#M494404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T09:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274490#M494405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  BCALV_TREE_SIMPLE_DEMO                                      *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report  bcalv_tree_simple_demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class cl_gui_column_tree definition load.&lt;/P&gt;&lt;P&gt;class cl_gui_cfw definition load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tree1  type ref to cl_gui_alv_tree_simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;include bcalv_simple_event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gt_sflight      type sflight occurs 0,      "Output-Table&lt;/P&gt;&lt;P&gt;      gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog&lt;/P&gt;&lt;P&gt;      gt_sort         type lvc_t_sort, "Sortiertabelle&lt;/P&gt;&lt;P&gt;      ok_code         like sy-ucomm.   "OK-Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_structure_name = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;       changing&lt;/P&gt;&lt;P&gt;            ct_fieldcat      = gt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;change fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: ls_fieldcatalog type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;  loop at gt_fieldcatalog into ls_fieldcatalog.&lt;/P&gt;&lt;P&gt;    case ls_fieldcatalog-fieldname.&lt;/P&gt;&lt;P&gt;      when 'CARRID' or 'CONNID' or 'FLDATE'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-no_out = 'X'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-key    = ''.&lt;/P&gt;&lt;P&gt;      when 'PRICE' or 'SEATSOCC' or 'SEATSMAX' or 'PAYMENTSUM'.&lt;/P&gt;&lt;P&gt;        ls_fieldcatalog-do_sum = 'X'.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;    modify gt_fieldcatalog from ls_fieldcatalog.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_OUTTAB&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from sflight into table gt_sflight.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             up to 1 rows.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_OUTTAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_SORT_TABLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_sort_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data ls_sort_wa type lvc_s_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create sort-table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_sort_wa-spos = 1.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-subtot = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_sort_wa-spos = 2.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'CONNID'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-subtot = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_sort_wa-spos = 3.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-fieldname = 'FLDATE'.&lt;/P&gt;&lt;P&gt;  ls_sort_wa-up = 'X'.&lt;/P&gt;&lt;P&gt;  append ls_sort_wa to gt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " BUILD_SORT_TABLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  PBO  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module pbo output.&lt;/P&gt;&lt;P&gt;  if tree1 is initial.&lt;/P&gt;&lt;P&gt;    perform init_tree.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  set pf-status 'MAIN100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                             " PBO  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  PAI  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module pai input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  case ok_code.&lt;/P&gt;&lt;P&gt;    when 'EXIT' or 'BACK' or 'CANC'.&lt;/P&gt;&lt;P&gt;      perform exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when others.&lt;/P&gt;&lt;P&gt;      call method cl_gui_cfw=&amp;gt;dispatch.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;  clear ok_code.&lt;/P&gt;&lt;P&gt;endmodule.                             " PAI  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  exit_program&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      free object and leave program&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method tree1-&amp;gt;free.&lt;/P&gt;&lt;P&gt;  leave program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " exit_program&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  register_events&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form register_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;define the events which will be passed to the backend&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: lt_events type cntl_simple_events,&lt;/P&gt;&lt;P&gt;        l_event type cntl_simple_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;define the events which will be passed to the backend&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_node_context_menu_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_item_context_menu_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_header_context_men_req.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_expand_no_children.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_header_click.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_item_keypress.&lt;/P&gt;&lt;P&gt;  append l_event to lt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method tree1-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      events = lt_events&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      cntl_error                = 1&lt;/P&gt;&lt;P&gt;      cntl_system_error         = 2&lt;/P&gt;&lt;P&gt;      illegal_event_combination = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set Handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: l_event_receiver type ref to lcl_tree_event_receiver.&lt;/P&gt;&lt;P&gt;  create object l_event_receiver.&lt;/P&gt;&lt;P&gt;  set handler l_event_receiver-&amp;gt;on_add_hierarchy_node&lt;/P&gt;&lt;P&gt;                                                        for tree1.&lt;/P&gt;&lt;P&gt;endform.                               " register_events&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_header&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      build table for html_header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_comment using&lt;/P&gt;&lt;P&gt;      pt_list_commentary type slis_t_listheader&lt;/P&gt;&lt;P&gt;      p_logo             type sdydo_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: ls_line type slis_listheader.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LIST HEADING LINE: TYPE H&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'H'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY:  NOT USED FOR THIS TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_line-info = 'ALV-tree-simple-Demo: flight-overview'.   "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STATUS LINE: TYPE S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'valid to'.                                "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  ls_line-info = 'January 29 1999'.                         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'time'.&lt;/P&gt;&lt;P&gt;  ls_line-info = '2.00 pm'.                                 "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACTION LINE: TYPE A&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'A'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY:  NOT USED FOR THIS TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ls_line-info = 'up-to-date data'.                         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;  append ls_line to pt_list_commentary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  p_logo = 'ENJOYSAP_LOGO'.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM init_tree.&lt;/P&gt;&lt;P&gt;  perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform build_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform build_sort_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create container for alv-tree&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: l_tree_container_name(30) type c,&lt;/P&gt;&lt;P&gt;        l_custom_container type ref to cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;  l_tree_container_name = 'TREE1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  create object l_custom_container&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;            container_name = l_tree_container_name&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;            cntl_error                  = 1&lt;/P&gt;&lt;P&gt;            cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;            create_error                = 3&lt;/P&gt;&lt;P&gt;            lifetime_error              = 4&lt;/P&gt;&lt;P&gt;            lifetime_dynpro_dynpro_link = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create tree control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create object tree1&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;        i_parent              = l_custom_container&lt;/P&gt;&lt;P&gt;        i_node_selection_mode =&lt;/P&gt;&lt;P&gt;                              cl_gui_column_tree=&amp;gt;node_sel_mode_multiple&lt;/P&gt;&lt;P&gt;        i_item_selection      = 'X'&lt;/P&gt;&lt;P&gt;        i_no_html_header      = ''&lt;/P&gt;&lt;P&gt;        i_no_toolbar          = ''&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;        cntl_error                   = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error            = 2&lt;/P&gt;&lt;P&gt;        create_error                 = 3&lt;/P&gt;&lt;P&gt;        lifetime_error               = 4&lt;/P&gt;&lt;P&gt;        illegal_node_selection_mode  = 5&lt;/P&gt;&lt;P&gt;        failed                       = 6&lt;/P&gt;&lt;P&gt;        illegal_column_name          = 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create info-table for html-header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: lt_list_commentary type slis_t_listheader,&lt;/P&gt;&lt;P&gt;        l_logo             type sdydo_value.&lt;/P&gt;&lt;P&gt;  perform build_comment using&lt;/P&gt;&lt;P&gt;                 lt_list_commentary&lt;/P&gt;&lt;P&gt;                 l_logo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;repid for saving variants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: ls_variant type disvariant.&lt;/P&gt;&lt;P&gt;  ls_variant-report = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;register events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform register_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create hierarchy&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;          exporting&lt;/P&gt;&lt;P&gt;               it_list_commentary   = lt_list_commentary&lt;/P&gt;&lt;P&gt;               i_logo               = l_logo&lt;/P&gt;&lt;P&gt;               i_background_id      = 'ALV_BACKGROUND'&lt;/P&gt;&lt;P&gt;               i_save               = 'A'&lt;/P&gt;&lt;P&gt;               is_variant            = ls_variant&lt;/P&gt;&lt;P&gt;          changing&lt;/P&gt;&lt;P&gt;               it_sort              = gt_sort&lt;/P&gt;&lt;P&gt;               it_outtab            = gt_sflight&lt;/P&gt;&lt;P&gt;               it_fieldcatalog      = gt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;expand first level&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;expand_Tree&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;             i_level = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;optimize column-width&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method tree1-&amp;gt;column_optimize&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;               i_start_column = tree1-&amp;gt;c_hierarchy_column_name&lt;/P&gt;&lt;P&gt;               i_end_column   = tree1-&amp;gt;c_hierarchy_column_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " init_tree&lt;/P&gt;&lt;P&gt;=============================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE BCALV_SIMPLE_EVENT_RECEIVER                                *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_tree_event_receiver definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: on_add_hierarchy_node&lt;/P&gt;&lt;P&gt;              for event on_add_hierarchy_node of cl_gui_alv_tree_simple&lt;/P&gt;&lt;P&gt;                    importing grouplevel&lt;/P&gt;&lt;P&gt;                              index_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_tree_event_receiver implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method on_add_hierarchy_node.&lt;/P&gt;&lt;P&gt;    data ls_outtab_line type sflight.&lt;/P&gt;&lt;P&gt;    ls_outtab_line-planetype = 'Note'. "#EC NOTEXT&lt;/P&gt;&lt;P&gt;    call method tree1-&amp;gt;set_hierarchy_data&lt;/P&gt;&lt;P&gt;            exporting&lt;/P&gt;&lt;P&gt;                is_outtab_line = ls_outtab_line.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 09:41:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274490#M494405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T09:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: undesratsnding abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274491#M494406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check out this Excellent BLOG from Ravikumar Allampallam&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ABAP OO in Action&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 10:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/undesratsnding-abap-objects/m-p/2274491#M494406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T10:20:56Z</dc:date>
    </item>
  </channel>
</rss>

