<?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 object syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-object-syntax/m-p/1911921#M379570</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;1. from  your question &lt;/P&gt;&lt;P&gt;4) may i know if both the same?&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client&lt;/P&gt;&lt;P&gt;DATA creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above are not same &lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client - here you declared creator as a variable to get input for the method acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA creator TYPE REF TO client. - here you declared creator as an  object and it refrencing client class to access all the methods defined in client class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls see below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : creator type ref to client.&lt;/P&gt;&lt;P&gt;create object creator.&lt;/P&gt;&lt;P&gt;call method creator-&amp;gt;acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. from  your question &lt;/P&gt;&lt;P&gt;syntax error if i just define "METHODS acknowledge IMPORTING creator" for the interface parameter. so if i want to create object, i need to have both statement, correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you delcare like following .&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator  type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you need to change this code too&lt;/P&gt;&lt;P&gt;CALL METHOD server_ref-&amp;gt;acknowledge EXPORTING creator = name.&lt;/P&gt;&lt;P&gt;insted of.&lt;/P&gt;&lt;P&gt;CALL METHOD server_ref-&amp;gt;acknowledge EXPORTING creator = me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you have to remove this like below.&lt;/P&gt;&lt;P&gt;name = creator.&lt;/P&gt;&lt;P&gt;instead of &lt;/P&gt;&lt;P&gt;name = creator-&amp;gt;name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.  from your question.&lt;/P&gt;&lt;P&gt;METHODS: set_value IMPORTING im_value TYPE i&lt;/P&gt;&lt;P&gt;or METHODS acknowledge IMPORTING creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHODS: set_value IMPORTING im_value TYPE i - this code is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client.- this is also correct  here you referencing the class client that's it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. from your question.&lt;/P&gt;&lt;P&gt;this case only allow exporting? if not defined means defaulted to export?&lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value( 10 ). vs &lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value exporting im_value = p_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it deponds how you delcare those variables in the class like following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: set IMPORTING value(set_value) TYPE i,&lt;/P&gt;&lt;P&gt;             increment,&lt;/P&gt;&lt;P&gt;             get EXPORTING value(get_value) TYPE i.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;DATA number TYPE i VALUE 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cnt-&amp;gt;set EXPORTING set_value = number.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; CALL METHOD cnt-&amp;gt;set( number ).&lt;/P&gt;&lt;P&gt;here you are getting value from variable number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for importing you got to declare like following&lt;/P&gt;&lt;P&gt;  CALL METHOD cnt-&amp;gt;get importing get_value = number.&lt;/P&gt;&lt;P&gt;here you are passing value from get_value to number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check ABAPDOCU tcode and see the samples abap objects.&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;sarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Feb 2007 04:11:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-12T04:11:11Z</dc:date>
    <item>
      <title>abap object syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-object-syntax/m-p/1911920#M379569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i would like to seek advice on the following. thanks alot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) in doubt1 below, may i know why needless to create object for creator but still able to define creator-&amp;gt;name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) in doubt1, creator already been defined reference variable. why when i have doubt3 or doubt4 statement, i got error while compile. when i have doubt2 statement then compile succesfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field "CREATOR" is unknown. It is neither in one of the specified		&lt;/P&gt;&lt;P&gt;tables nor defined by a "DATA" statement.		&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)can i say that if want to create object or assignment "creator = client_ref" like in doubt3 and doubt4, we must have data keyword to define the reference variable. reference variable defined via interface parameter in methods cannot do the create object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) may i know if both the same?&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client&lt;/P&gt;&lt;P&gt;DATA creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both also define the reference variable. &lt;/P&gt;&lt;P&gt;syntax error if i just define "METHODS acknowledge IMPORTING creator" for the interface parameter. so if i want to create object, i need to have both statement, correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) interface parameter for methods against call method/create object&lt;/P&gt;&lt;P&gt;methods - need to define the type &lt;/P&gt;&lt;P&gt;METHODS: set_value IMPORTING im_value TYPE i&lt;/P&gt;&lt;P&gt;or  METHODS acknowledge IMPORTING creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;whereas&lt;/P&gt;&lt;P&gt;call methods/create object must have '='    &lt;/P&gt;&lt;P&gt;correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) this case only allow exporting? if not defined means defaulted to export?&lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value( 10 ).  vs &lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value exporting im_value = p_value.&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;REPORT self_reference.&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;      CLASS client DEFINITION&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;      ........                                                      *&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 client DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    DATA name(10) TYPE c VALUE 'master' READ-ONLY.&lt;/P&gt;&lt;P&gt;    METHODS create_server.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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;      CLASS server DEFINITION&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;      ........                                                      *&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 server DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS acknowledge IMPORTING creator TYPE REF TO client. "doubt1&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA name(10) TYPE c VALUE 'servant'.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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;      CLASS client IMPLEMENTATION&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;      ........                                                      *&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 client IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD create_server.&lt;/P&gt;&lt;P&gt;    DATA server_ref TYPE REF TO server.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT server_ref.&lt;/P&gt;&lt;P&gt;    CALL METHOD server_ref-&amp;gt;acknowledge EXPORTING creator = me.&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;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;      CLASS server IMPLEMENTATION&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;      ........                                                      *&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 server IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD acknowledge.&lt;/P&gt;&lt;P&gt;    DATA name TYPE string.&lt;/P&gt;&lt;P&gt;    name = creator-&amp;gt;name.&lt;/P&gt;&lt;P&gt;    WRITE: me-&amp;gt;name, 'created by', name.&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 client_ref TYPE REF TO client.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA creator TYPE REF TO client.  "doubt2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT client_ref.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; create object creator.                     "doubt3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; creator = client_ref.                        "doubt4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD client_ref-&amp;gt;create_server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 00:42:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-object-syntax/m-p/1911920#M379569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T00:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: abap object syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-object-syntax/m-p/1911921#M379570</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;1. from  your question &lt;/P&gt;&lt;P&gt;4) may i know if both the same?&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client&lt;/P&gt;&lt;P&gt;DATA creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above are not same &lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client - here you declared creator as a variable to get input for the method acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA creator TYPE REF TO client. - here you declared creator as an  object and it refrencing client class to access all the methods defined in client class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls see below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : creator type ref to client.&lt;/P&gt;&lt;P&gt;create object creator.&lt;/P&gt;&lt;P&gt;call method creator-&amp;gt;acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. from  your question &lt;/P&gt;&lt;P&gt;syntax error if i just define "METHODS acknowledge IMPORTING creator" for the interface parameter. so if i want to create object, i need to have both statement, correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you delcare like following .&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator  type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you need to change this code too&lt;/P&gt;&lt;P&gt;CALL METHOD server_ref-&amp;gt;acknowledge EXPORTING creator = name.&lt;/P&gt;&lt;P&gt;insted of.&lt;/P&gt;&lt;P&gt;CALL METHOD server_ref-&amp;gt;acknowledge EXPORTING creator = me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you have to remove this like below.&lt;/P&gt;&lt;P&gt;name = creator.&lt;/P&gt;&lt;P&gt;instead of &lt;/P&gt;&lt;P&gt;name = creator-&amp;gt;name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.  from your question.&lt;/P&gt;&lt;P&gt;METHODS: set_value IMPORTING im_value TYPE i&lt;/P&gt;&lt;P&gt;or METHODS acknowledge IMPORTING creator TYPE REF TO client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHODS: set_value IMPORTING im_value TYPE i - this code is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHODS acknowledge IMPORTING creator TYPE REF TO client.- this is also correct  here you referencing the class client that's it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. from your question.&lt;/P&gt;&lt;P&gt;this case only allow exporting? if not defined means defaulted to export?&lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value( 10 ). vs &lt;/P&gt;&lt;P&gt;call method o_app1-&amp;gt;set_value exporting im_value = p_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it deponds how you delcare those variables in the class like following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: set IMPORTING value(set_value) TYPE i,&lt;/P&gt;&lt;P&gt;             increment,&lt;/P&gt;&lt;P&gt;             get EXPORTING value(get_value) TYPE i.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;DATA number TYPE i VALUE 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cnt-&amp;gt;set EXPORTING set_value = number.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; CALL METHOD cnt-&amp;gt;set( number ).&lt;/P&gt;&lt;P&gt;here you are getting value from variable number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for importing you got to declare like following&lt;/P&gt;&lt;P&gt;  CALL METHOD cnt-&amp;gt;get importing get_value = number.&lt;/P&gt;&lt;P&gt;here you are passing value from get_value to number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check ABAPDOCU tcode and see the samples abap objects.&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;sarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 04:11:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-object-syntax/m-p/1911921#M379570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T04:11:11Z</dc:date>
    </item>
  </channel>
</rss>

