<?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/2988352#M705759</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;Class-Constructor or A Static Constructor is the first method to be called, when we do any kind of operation on the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would trigger only once in a program execution... while create the class object or when we access the class variables with out creating the object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So The first method to be trigegred is the Constructor class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ysk_sdn_temp.

DATA : zcurrstr TYPE ihttpnvp,
       zcurrttype TYPE tihttpnvp.
*----------------------------------------------------------------------*
*       CLASS c1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS c1 DEFINITION .
  PUBLIC SECTION.
    CLASS-DATA : num TYPE i VALUE 5.
    CLASS-METHODS:class_constructor.
    METHODS: normal_method.
ENDCLASS.                    "c1 DEFINITION

*----------------------------------------------------------------------*
*       CLASS c1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS c1 IMPLEMENTATION.
  METHOD class_constructor.
    WRITE:/5 'I am class constructor'.
    zcurrstr-name   = 'INDIA'.
    zcurrstr-value  =  'RS'.
    APPEND zcurrstr TO zcurrttype.
  ENDMETHOD.                    "CLASS_CONSTRUCTOR

  METHOD normal_method.
    WRITE:/ zcurrstr-name,
            zcurrstr-value.
  ENDMETHOD.                    "NORMAL_METHOD
ENDCLASS.                    "c1 IMPLEMENTATION


DATA: obj1 TYPE REF TO c1.

START-OF-SELECTION.
  WRITE:/5 c1=&amp;gt;num.
  CREATE OBJECT obj1.
  obj1-&amp;gt;normal_method( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreekanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Do not forget to reward if it helps you ;)&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Oct 2007 17:16:21 GMT</pubDate>
    <dc:creator>sreekanthgo</dc:creator>
    <dc:date>2007-10-29T17:16:21Z</dc:date>
    <item>
      <title>ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988350#M705757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the doubt about class constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write the code in Class constructor like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : ZCURRSTR TYPE IHTTPNVP,
       ZCURRTTYPE TYPE TIHTTPNVP.

ZCURRSTR-NAME   = 'INDIA'.
ZCURRSTR-VALUE  =  'RS'.
APPEND ZCURRSTR TO ZCURRTTYPE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to call this Table ZCURRTTYPE in One of the method of Same class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one help me on this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Points Assured for all suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 17:04:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988350#M705757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988351#M705758</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;Go thru this Threads.U ll get an idea,&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3997105"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4288705"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3911668"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Padmam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 17:09:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988351#M705758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T17:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988352#M705759</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;Class-Constructor or A Static Constructor is the first method to be called, when we do any kind of operation on the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would trigger only once in a program execution... while create the class object or when we access the class variables with out creating the object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So The first method to be trigegred is the Constructor class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ysk_sdn_temp.

DATA : zcurrstr TYPE ihttpnvp,
       zcurrttype TYPE tihttpnvp.
*----------------------------------------------------------------------*
*       CLASS c1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS c1 DEFINITION .
  PUBLIC SECTION.
    CLASS-DATA : num TYPE i VALUE 5.
    CLASS-METHODS:class_constructor.
    METHODS: normal_method.
ENDCLASS.                    "c1 DEFINITION

*----------------------------------------------------------------------*
*       CLASS c1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS c1 IMPLEMENTATION.
  METHOD class_constructor.
    WRITE:/5 'I am class constructor'.
    zcurrstr-name   = 'INDIA'.
    zcurrstr-value  =  'RS'.
    APPEND zcurrstr TO zcurrttype.
  ENDMETHOD.                    "CLASS_CONSTRUCTOR

  METHOD normal_method.
    WRITE:/ zcurrstr-name,
            zcurrstr-value.
  ENDMETHOD.                    "NORMAL_METHOD
ENDCLASS.                    "c1 IMPLEMENTATION


DATA: obj1 TYPE REF TO c1.

START-OF-SELECTION.
  WRITE:/5 c1=&amp;gt;num.
  CREATE OBJECT obj1.
  obj1-&amp;gt;normal_method( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreekanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Do not forget to reward if it helps you ;)&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 17:16:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects/m-p/2988352#M705759</guid>
      <dc:creator>sreekanthgo</dc:creator>
      <dc:date>2007-10-29T17:16:21Z</dc:date>
    </item>
  </channel>
</rss>

