<?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: abap oo in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003982#M408269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the sample reports in the links below:&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/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/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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Beejal&lt;/P&gt;&lt;P&gt;**reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2007 06:35:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-09T06:35:31Z</dc:date>
    <item>
      <title>abap oo</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003980#M408267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to create report using oop?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 06:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003980#M408267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T06:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: abap oo</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003981#M408268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If u need that in ALV ,chk program   &amp;lt;b&amp;gt;BCALV_EDIT_05&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 06:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003981#M408268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T06:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: abap oo</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003982#M408269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the sample reports in the links below:&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/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/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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Beejal&lt;/P&gt;&lt;P&gt;**reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 06:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003982#M408269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T06:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: abap oo</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003983#M408270</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;check this program,i am displaying fields from 2 diff. tables MARA and MARD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for simple oops program you need to know just one thing,&lt;/P&gt;&lt;P&gt;if you are displaying data froms ingle DBtable and fetching all the fields,&lt;/P&gt;&lt;P&gt;then just specify the STRUCTURE parameter as dbtablename and pass your internal table to the FM set_table_for_first_display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you are displaying specific fields (not all the fields) either from 1 or more than one dbtables then you have to create a fieldcatalog and pass as the parameter instead of STRUCTURE parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:g_cont1 type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;g_grid1 type ref to cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;ok_code like sy-ucomm,&lt;/P&gt;&lt;P&gt;fcat type lvc_t_fcat,&lt;/P&gt;&lt;P&gt;w_fcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 type standard table of mara with header line,&lt;/P&gt;&lt;P&gt;itab2 type standard table of mard with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:begin of ty_it_final,&lt;/P&gt;&lt;P&gt;matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;mtart like mara-mtart,&lt;/P&gt;&lt;P&gt;werks like mard-werks,&lt;/P&gt;&lt;P&gt;end of ty_it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:it_final type standard table of ty_it_final with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;set screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select matnr mtart from mara&lt;/P&gt;&lt;P&gt; into corresponding fields of table itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select matnr werks from mard&lt;/P&gt;&lt;P&gt; into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt; for all entries in itab1&lt;/P&gt;&lt;P&gt; where matnr = itab1-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at itab1.&lt;/P&gt;&lt;P&gt;    it_final-matnr = itab1-matnr.&lt;/P&gt;&lt;P&gt;    it_final-mtart = itab1-mtart.&lt;/P&gt;&lt;P&gt;    read table itab2 with key matnr = itab1-matnr.&lt;/P&gt;&lt;P&gt;    it_final-werks = itab2-werks.&lt;/P&gt;&lt;P&gt;    append it_final.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fcat-col_pos = 1.&lt;/P&gt;&lt;P&gt;w_fcat-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;w_fcat-tabname = 'MARA'.&lt;/P&gt;&lt;P&gt;w_fcat-coltext = 'Material No.'.&lt;/P&gt;&lt;P&gt;append w_fcat to fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fcat-col_pos = 2.&lt;/P&gt;&lt;P&gt;w_fcat-fieldname = 'MTART'.&lt;/P&gt;&lt;P&gt;w_fcat-tabname = 'MARA'.&lt;/P&gt;&lt;P&gt;w_fcat-coltext = 'Material Type'.&lt;/P&gt;&lt;P&gt;append w_fcat to fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fcat-col_pos = 3.&lt;/P&gt;&lt;P&gt;w_fcat-fieldname = 'WERKS'.&lt;/P&gt;&lt;P&gt;w_fcat-tabname = 'MARD'.&lt;/P&gt;&lt;P&gt;w_fcat-coltext = 'Plant'.&lt;/P&gt;&lt;P&gt;append w_fcat to fcat.&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;      Module  STATUS_0100  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 status_0100 output.&lt;/P&gt;&lt;P&gt;  set pf-status 'PF1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if g_cont1 is initial.&lt;/P&gt;&lt;P&gt;create object g_cont1&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    container_name = 'CONTAINER1'.&lt;/P&gt;&lt;P&gt;create object g_grid1&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    i_parent          = g_cont1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;call method g_grid1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    it_outtab                     = it_final&lt;/P&gt;&lt;P&gt;    it_fieldcatalog               = fcat&lt;/P&gt;&lt;P&gt;        .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endmodule.                 " STATUS_0100  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  USER_COMMAND_0100  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 user_command_0100 input.&lt;/P&gt;&lt;P&gt;call method cl_gui_cfw=&amp;gt;dispatch.&lt;/P&gt;&lt;P&gt;ok_code = sy-ucomm.&lt;/P&gt;&lt;P&gt;case ok_code.&lt;/P&gt;&lt;P&gt;when 'BACK'.&lt;/P&gt;&lt;P&gt;leave program.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;clear ok_code.&lt;/P&gt;&lt;P&gt;endmodule.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the other case if your fetching all the fields from single table,&lt;/P&gt;&lt;P&gt;your FM should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL METHOD g_grid1-&amp;gt;set_table_for_first_display&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;    it_outtab                     = it_sflight.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hope it helps you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 12:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003983#M408270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T12:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: abap oo</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003984#M408271</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;Check out hte program.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZRICHA1.

INCLUDE ZRICHA_cl.

*-- Selection Values : Block1
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS s_ccode FOR v_bukrs MATCHCODE OBJECT dbukn OBLIGATORY.
PARAMETERS     p_ccode TYPE ty_bukrs OBLIGATORY.
PARAMETERS     p_ledger TYPE rldnr MATCHCODE OBJECT zled OBLIGATORY.
PARAMETERS     p_table  TYPE char30.
PARAMETERS     p_fyear TYPE gjahr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

  DATA : o_merger TYPE REF TO lcl_merger.
  CREATE OBJECT o_merger.

  CALL METHOD o_merger-&amp;gt;get_data
                            EXPORTING  e_table = p_table
                                       e_ccode  = s_ccode[]
                                       e_ledger = p_ledger
                                       e_fyear  = p_fyear
                            IMPORTING  i_subrc = v_subrc.

END-OF-SELECTION.

  IF v_subrc = 0.
    CALL METHOD o_merger-&amp;gt;write_data
  ENDIF.
*******************************************
***INCLUDE ZFGLI004_CL .
CLASS lcl_merger DEFINITION.

  PUBLIC SECTION.
    DATA : v_table     TYPE char30,       "Table Name
           v_lines     TYPE i,            "Number of Detail Record
           v_tabix     TYPE sy-tabix.    "Internal table index
    DATA : it_record     TYPE TABLE OF ty_record. 
    METHODS :

    get_data     IMPORTING e_table TYPE char30
                           e_ccode TYPE tt_bukrs
                           e_ledger TYPE rldnr
                           e_fyear  TYPE ryear
                 EXPORTING i_subrc TYPE sy-subrc ,

    process_data.

ENDCLASS.
CLASS lcl_merger IMPLEMENTATION.

  METHOD get_data.

    CLEAR : it_record[], x_record, it_ckey[], x_ckey.

    SELECT..........
      IF sy-subrc = 0.
        i_subrc = sy-subrc.
      ENDIF.
  ENDMETHOD.
  METHOD process_data.
    WRITE : / 'Number of records downloaded :'(004),v_count.
    WRITE :/,,,,,,,,,,
            ....................
  ENDMETHOD.
ENDCLASS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a report using object oriented programming concepts. Hope this example helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 12:42:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo/m-p/2003984#M408271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T12:42:04Z</dc:date>
    </item>
  </channel>
</rss>

