<?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 Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361995#M1993203</link>
    <description>&lt;P&gt;Why can't we pass data ref variable of static_type string to perform w/h USING import_par TYPE REF TO data?&lt;/P&gt;
  &lt;P&gt;REPORT ZABAP_OBJECTS_STRING_VAR_REF.&lt;/P&gt;
  &lt;P&gt;DATA: lr_string TYPE REF TO string.&lt;BR /&gt;&lt;BR /&gt;CREATE DATA lr_string.&lt;BR /&gt;lr_string-&amp;gt;* = 'String'.&lt;BR /&gt;&lt;BR /&gt;PERFORM pass_string_as_im USING lr_string.&lt;BR /&gt;&lt;BR /&gt;FORM pass_string_as_im USING&lt;BR /&gt;*** im_string TYPE REF TO data. " Syntax_Error-1&lt;BR /&gt; im_string TYPE REF TO string. "Working&lt;BR /&gt;BREAK-POINT.&lt;BR /&gt;ENDFORM .&lt;/P&gt;
  &lt;P&gt;"Syntax_Error-1-In PERFORM or CALL FUNCTION "PASS_STRING_AS_IM", the actual parameter "LR_STRING" is incompatible with the formal parameter "IM_STRING".&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 23:58:04 GMT</pubDate>
    <dc:creator>rajivsap</dc:creator>
    <dc:date>2021-03-29T23:58:04Z</dc:date>
    <item>
      <title>Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361995#M1993203</link>
      <description>&lt;P&gt;Why can't we pass data ref variable of static_type string to perform w/h USING import_par TYPE REF TO data?&lt;/P&gt;
  &lt;P&gt;REPORT ZABAP_OBJECTS_STRING_VAR_REF.&lt;/P&gt;
  &lt;P&gt;DATA: lr_string TYPE REF TO string.&lt;BR /&gt;&lt;BR /&gt;CREATE DATA lr_string.&lt;BR /&gt;lr_string-&amp;gt;* = 'String'.&lt;BR /&gt;&lt;BR /&gt;PERFORM pass_string_as_im USING lr_string.&lt;BR /&gt;&lt;BR /&gt;FORM pass_string_as_im USING&lt;BR /&gt;*** im_string TYPE REF TO data. " Syntax_Error-1&lt;BR /&gt; im_string TYPE REF TO string. "Working&lt;BR /&gt;BREAK-POINT.&lt;BR /&gt;ENDFORM .&lt;/P&gt;
  &lt;P&gt;"Syntax_Error-1-In PERFORM or CALL FUNCTION "PASS_STRING_AS_IM", the actual parameter "LR_STRING" is incompatible with the formal parameter "IM_STRING".&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 23:58:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361995#M1993203</guid>
      <dc:creator>rajivsap</dc:creator>
      <dc:date>2021-03-29T23:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361996#M1993204</link>
      <description>&lt;P&gt;Don't use FORM and PERFORM. They're obsolete. Use classes and methods instead. It works fine there.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_main DEFINITION.
  PUBLIC SECTION.
    METHODS set
      IMPORTING i_thing TYPE REF TO data.
ENDCLASS.

CLASS lcl_main IMPLEMENTATION.
  METHOD set.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  DATA main TYPE REF TO lcl_main.
  CREATE OBJECT main.
  DATA string TYPE REF TO string.
  main-&amp;gt;set( string ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It is a bit odd that FORM doesn't allow it.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361996#M1993204</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-30T06:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361997#M1993205</link>
      <description>&lt;P&gt;I guess the issue is more about USING which works like CHANGING. Even in methods, CHANGING doesn't allow a upcast/downcast in type. Here it's about a data reference, but I guess it's the same bizarre thing as with object references: &lt;A href="https://blogs.sap.com/2011/10/05/abap-trapdoors-type-lock-in/" target="test_blank"&gt;https://blogs.sap.com/2011/10/05/abap-trapdoors-type-lock-in/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 07:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361997#M1993205</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-30T07:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361998#M1993206</link>
      <description>&lt;P&gt;In this form it work for subroutines too:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lr_string TYPE REF TO data.
lr_string = REF #( 'String' ).

PERFORM pass_string_as_im USING lr_string.

FORM pass_string_as_im USING
im_string TYPE REF TO data. " no syntax error
BREAK-POINT.
ENDFORM .&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 08:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361998#M1993206</guid>
      <dc:creator>touzik_itc</dc:creator>
      <dc:date>2021-03-30T08:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361999#M1993207</link>
      <description>&lt;P&gt;If you must use subroutines, then you can convert LR_STRING to TYPE REF TO DATA, and pass that to the subroutine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lr_string  TYPE REF TO string,
      lr_string1 TYPE REF TO data.
FIELD-SYMBOLS: &amp;lt;fs_temp&amp;gt; TYPE any.
CREATE DATA lr_string.
lr_string-&amp;gt;* = 'String'.


CREATE DATA lr_string1 TYPE string.
ASSIGN lr_string1-&amp;gt;* TO &amp;lt;fs_temp&amp;gt;.
&amp;lt;fs_temp&amp;gt; = lr_string-&amp;gt;*. "basically putting LR_STRING (STRING) in LR_STRING1 (DATA)


PERFORM pass_string_as_im USING lr_string1.

FORM pass_string_as_im USING im_string TYPE REF TO data. " Syntax_Error-1
*im_string TYPE REF TO string. "Working
  FIELD-SYMBOLS: &amp;lt;fs_temp&amp;gt; TYPE any.
  ASSIGN im_string-&amp;gt;* TO &amp;lt;fs_temp&amp;gt;.
  WRITE:/ &amp;lt;fs_Temp&amp;gt;.
ENDFORM .
&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 14:19:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12361999#M1993207</guid>
      <dc:creator>former_member736527</dc:creator>
      <dc:date>2021-03-30T14:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why can't we pass data ref variable of type string to perform with USING import par TYPE REF TO data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12362000#M1993208</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;BR /&gt;I'm reminded of this. &lt;A href="https://www.youtube.com/watch?v=_y3kI-E7eCU"&gt;Everything is Broken&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 16:30:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-can-t-we-pass-data-ref-variable-of-type-string-to-perform-with-using/m-p/12362000#M1993208</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-30T16:30:21Z</dc:date>
    </item>
  </channel>
</rss>

