<?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: whats  wrong with this code? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219417#M767759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;H Dan, if you would like to use the EXPORTING parameter, then you must write you method call like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
object_reference-&amp;gt;get_data( importing e_data = var ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are on an earlier release, then you must use the CALL METHOD as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL METHOD object_reference-&amp;gt;get_data( importing e_data = var ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regars,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2008 19:26:48 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2008-01-16T19:26:48Z</dc:date>
    <item>
      <title>whats  wrong with this code?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219414#M767756</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;I am getting the error as " the method get_data has no returning parameter.&lt;/P&gt;&lt;P&gt;Can someone please help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS main 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 add_data IMPORTING i_data TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS get_data EXPORTING e_data TYPE char20.&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 attribute TYPE char01.&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;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 main 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;P&gt;&lt;/P&gt;&lt;P&gt;CLASS main IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD add_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ADD i_data TO attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD get_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE 'Attribute value' attribute&lt;/P&gt;&lt;P&gt;                               INTO e_data SEPARATED BY space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&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;DATA: object_reference TYPE REF TO main.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT object_reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;  var TYPE char20.&lt;/P&gt;&lt;P&gt;  CALL METHOD object_reference-&amp;gt;add_data( i_data = 3 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var = object_reference-&amp;gt;get_data( ).  --&amp;gt; errored here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE var.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 19:01:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219414#M767756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T19:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: whats  wrong with this code?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219415#M767757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan, if you want to use a RETURNING parameter when you call you method, you need to define the parameter as a RETURNING parameter in your class definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    METHODS get_data RETURNING VALUE(e_data) TYPE char20.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had defined it as an EXPORTING parameter, which means that when you call the method you would have need to use this syntax instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   object_reference-&amp;gt;get_data( IMPORTING e_data = var ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Wed, 16 Jan 2008 19:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219415#M767757</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-16T19:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: whats  wrong with this code?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219416#M767758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;I still want to use exporting param as :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHODS get_data exporting e_data TYPE char20.&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;HR originaltext="----------------------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and called the method as u suggested it is throwing an error saying " statement object_reference-&amp;gt;get_data( is not defined ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please suggest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Dany&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 19:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219416#M767758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T19:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: whats  wrong with this code?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219417#M767759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;H Dan, if you would like to use the EXPORTING parameter, then you must write you method call like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
object_reference-&amp;gt;get_data( importing e_data = var ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are on an earlier release, then you must use the CALL METHOD as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL METHOD object_reference-&amp;gt;get_data( importing e_data = var ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regars,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 19:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/whats-wrong-with-this-code/m-p/3219417#M767759</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-16T19:26:48Z</dc:date>
    </item>
  </channel>
</rss>

