<?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 objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995228#M75133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try the following simple code...this should get you started&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class c1 definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public section.&lt;/P&gt;&lt;P&gt;&amp;lt;data declarations here&amp;gt;&lt;/P&gt;&lt;P&gt;protected section.&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;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class c1 implementation.&lt;/P&gt;&lt;P&gt;method m1.&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&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;DATA obj TYPE REF TO object. &lt;/P&gt;&lt;P&gt;CREATE OBJECT obj TYPE c1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now call the methods of class c1 using this object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obj-&amp;gt;m1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try it ....read documentation for more....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;PJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jul 2005 12:52:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-14T12:52:53Z</dc:date>
    <item>
      <title>abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995227#M75132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i tryin to create a report using object orianted approch, i created a class and tryin to display details of material using this class.&lt;/P&gt;&lt;P&gt;   but not able to do it, can anyone tell me how shuld approch, abap objects are new concept for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sunanda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2005 12:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995227#M75132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-14T12:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995228#M75133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try the following simple code...this should get you started&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class c1 definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public section.&lt;/P&gt;&lt;P&gt;&amp;lt;data declarations here&amp;gt;&lt;/P&gt;&lt;P&gt;protected section.&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;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class c1 implementation.&lt;/P&gt;&lt;P&gt;method m1.&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&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;DATA obj TYPE REF TO object. &lt;/P&gt;&lt;P&gt;CREATE OBJECT obj TYPE c1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now call the methods of class c1 using this object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obj-&amp;gt;m1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try it ....read documentation for more....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;PJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2005 12:52:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995228#M75133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-14T12:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: abap objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995229#M75134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is many different ways that this question can be answer.  Tradtionally,  ABAP OO is used for dialog programming rather than report programming.  This may be changing though.   Here is a quick little sample I threw together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.



*---------------------------------------------------------------------*
*       CLASS lcl_material DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_material definition.

  public section.

    data: matnr type mara-matnr.
    data: xmara type mara.
    data: xmakt type makt.
    data: xmarc type marc.
    data: imarc type table of marc.
    data: xmard type mard.
    data: imard type table of mard.

    methods: constructor importing im_matnr type mara-matnr,
             write.

  private section.
    methods: get_mara,
             get_makt,
             get_marc,
             get_mard.


endclass.

parameters: p_matnr type mara-matnr.

data: amaterial type ref to lcl_material.

create object amaterial
         exporting
              im_matnr = p_matnr.

call method amaterial-&amp;gt;write( ).


*---------------------------------------------------------------------*
*       CLASS lcl_material IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_material implementation.

  method constructor.
    matnr = im_matnr.
    call method me-&amp;gt;get_mara.
    call method me-&amp;gt;get_makt.
    call method me-&amp;gt;get_marc.
    call method me-&amp;gt;get_mard.
  endmethod.

  method write.
    write:/ xmara.
    write:/ xmakt.
    loop at imarc into xmarc.
      write:/ xmarc.
    endloop.
    loop at imard into xmard.
      write:/ xmard.
    endloop.
  endmethod.

  method get_mara.
    select single * from mara into xmara
               where matnr = matnr.
  endmethod.

  method get_makt.
    select single * from makt into xmakt
               where matnr = matnr
                 and spras = sy-langu.
  endmethod.

  method get_marc.
    select  * into corresponding fields of table imarc
           from marc
               where matnr = matnr.
  endmethod.

  method get_mard.
    select  * into corresponding fields of table imard
           from mard
               where matnr = matnr.
  endmethod.


endclass.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2005 13:04:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/995229#M75134</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-14T13:04:47Z</dc:date>
    </item>
  </channel>
</rss>

