<?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 syntax error for combination of table expression + method chaining + itab is read-only in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690519#M31049</link>
    <description>&lt;P&gt;EDIT: please ignore this comment, see next one.&lt;/P&gt;&lt;P&gt;No, it's allowed to use table expression + method chaining (abap &amp;gt;= 7.52), but with a writable internal table only. I have updated my question, by adding a demonstration in the first method, with a local variable. My question concerns the combination of the three : table expression + method chaining + read-only internal table (note: in my question, the parameter "table_of_ixml" is read-only because it's an Importing parameter).&lt;/P&gt;</description>
    <pubDate>Sun, 25 Nov 2018 08:30:27 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2018-11-25T08:30:27Z</dc:date>
    <item>
      <title>ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690517#M31047</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I have a test program below in my ABAP 7.52 system, having a syntax error in the second method, concerning the chaining of a method after a table expression on a read-only internal table.&lt;/P&gt;
  &lt;P&gt;Of course, I have the solution to avoid this syntax error, by splitting it into 2 lines, as I show in the first method. &lt;/P&gt;
  &lt;P&gt;But I don't understand why the compiler considers the table expression as being a "writing position" here, IMHO it should be considered a "reading position", but I can't find any explanation in the &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abentable_expressions.htm"&gt;ABAP doc for table expressions&lt;/A&gt;.&lt;/P&gt;
  &lt;P&gt;Can you explain why + can you point to some reference in the ABAP documentation?&lt;/P&gt;
  &lt;P&gt;Thank you!&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;CLASS lcl_app DEFINITION.
  PUBLIC SECTION.
    TYPES ty_table_of_ixml TYPE STANDARD TABLE OF REF TO if_ixml WITH EMPTY KEY.
    METHODS test_has_valid_syntax IMPORTING table_of_ixml TYPE ty_table_of_ixml.
    METHODS test_has_syntax_error IMPORTING table_of_ixml TYPE ty_table_of_ixml.
ENDCLASS.
CLASS lcl_app IMPLEMENTATION.
  METHOD test_has_valid_syntax.
    data(ixml) = table_of_ixml[ 1 ].
    ixml-&amp;gt;create_document( ).
  ENDMETHOD.
  METHOD test_has_syntax_error.
    table_of_ixml[ 1 ]-&amp;gt;create_document( ). " !!! syntax error !!! The field "TABLE_OF_IXML" cannot be modified.
  ENDMETHOD.
ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Nov 2018 21:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690517#M31047</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-24T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690518#M31048</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;If my understanding is correct then table expressions are used to return data and the data can be value, structure or object. Table expressions can be used in conditions to evaluate since they return data, so methods returning objects can be called directly from table expressions but methods which performs action cannot be called directly via table expressions..&lt;/P&gt;&lt;P&gt;You've got to use the first method.&lt;/P&gt;&lt;P&gt;Hope this helps.!!!&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;PS: Even I didn't found this in documentation.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 03:46:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690518#M31048</guid>
      <dc:creator>rameez_khan</dc:creator>
      <dc:date>2018-11-25T03:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690519#M31049</link>
      <description>&lt;P&gt;EDIT: please ignore this comment, see next one.&lt;/P&gt;&lt;P&gt;No, it's allowed to use table expression + method chaining (abap &amp;gt;= 7.52), but with a writable internal table only. I have updated my question, by adding a demonstration in the first method, with a local variable. My question concerns the combination of the three : table expression + method chaining + read-only internal table (note: in my question, the parameter "table_of_ixml" is read-only because it's an Importing parameter).&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 08:30:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690519#M31049</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-25T08:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690520#M31050</link>
      <description>&lt;P&gt;Same code + example with an internal table being &lt;STRONG&gt;writable&lt;/STRONG&gt;, and I also replaced the method called with the method &lt;STRONG&gt;activate&lt;/STRONG&gt; which does not return anything to make sure the types of parameters have no impact on the syntax check:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_app DEFINITION.
  PUBLIC SECTION.
    TYPES ty_table_of_ixml TYPE STANDARD TABLE OF REF TO if_ixml WITH EMPTY KEY.
    METHODS test_has_valid_syntax IMPORTING read_only_table_of_ixml TYPE ty_table_of_ixml.
    METHODS test_has_syntax_error IMPORTING read_only_table_of_ixml TYPE ty_table_of_ixml.
ENDCLASS.
CLASS lcl_app IMPLEMENTATION.
  METHOD test_has_valid_syntax.
    " Valid syntax for a read-only internal table, only if it's written in two parts 
    data(ixml) = read_only_table_of_ixml[ 1 ].
    ixml-&amp;gt;activate( ).
    " Valid syntax if a writable internal table is used 
    data writable_table_of_ixml type ty_table_of_ixml.
    writable_table_of_ixml[ 1 ]-&amp;gt;activate( ).
  ENDMETHOD.
  METHOD test_has_syntax_error.
    " !! syntax error !! The field "TABLE_OF_IXML" cannot be modified.
    read_only_table_of_ixml[ 1 ]-&amp;gt;activate( ). 
  ENDMETHOD.
ENDCLASS.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Nov 2018 08:40:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690520#M31050</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-25T08:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690521#M31051</link>
      <description>&lt;P&gt;Sorry, I understand what you say now.&lt;/P&gt;&lt;P&gt;This code has a valid syntax!! :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(doc) = read_only_table_of_ixml[ 1 ]-&amp;gt;create_document( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As I shown in my question, the next one isn't valid (syntax error "The field "TABLE_OF_IXML" cannot be modified"):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read_only_table_of_ixml[ 1 ]-&amp;gt;create_document( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, the question remains : why?&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 08:59:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690521#M31051</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-25T08:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690522#M31052</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;seems like a bug to me. The compiler should not evaluate the table expression method call to be a modifying operation to the read only table. It works if you change the method signature to pass by value by the way. (Maybe the newer method call syntax is implemented in a way that it expects an assignment on the right side of the statement and then it could be a modifying operation on the table?)&lt;/P&gt;&lt;P&gt;Would be interesting if the older CALL METHOD syntax could do it, but it of course does not support table expressions at all.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 10:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690522#M31052</guid>
      <dc:creator>fabianlupa</dc:creator>
      <dc:date>2018-11-25T10:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690523#M31053</link>
      <description>&lt;P&gt;Maybe not a bug, but something not implemented yet, because the ABAP documentation often has "It is not yet possible to ..." (but couldn't find such a text corresponding to my question). &lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 11:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690523#M31053</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-25T11:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690524#M31054</link>
      <description>&lt;P&gt;On a similar note: I am often missing this feature, where the solution also is to split things up into two statements:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lo_object-&amp;gt;get_table_of_things( )[ 1 ]-&amp;gt;do_stuff( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Nov 2018 12:13:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690524#M31054</guid>
      <dc:creator>fabianlupa</dc:creator>
      <dc:date>2018-11-25T12:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690525#M31055</link>
      <description>&lt;P&gt;so your read_only_table_of_ixml is importing parameter, it isnt supposed to be changed, is it? i think that syntax message not relevant to method chaning or table expression but the natural of import parameter. if its exporting or changing parameter i belive that your code will work.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 02:51:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690525#M31055</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-11-26T02:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690526#M31056</link>
      <description>&lt;P&gt;As suggested by  &lt;SPAN class="mention-scrubbed"&gt;rameez.khan&lt;/SPAN&gt; :&lt;/P&gt;&lt;P&gt;This code has a valid syntax!! :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(doc)= read_only_table_of_ixml[1]-&amp;gt;create_document().&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As I shown in my question, the next one isn't valid (syntax error "The field "TABLE_OF_IXML" cannot be modified"):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read_only_table_of_ixml[1]-&amp;gt;create_document().&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, the question remains : why?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 08:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690526#M31056</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-26T08:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690527#M31057</link>
      <description>But &lt;SPAN class="mention-scrubbed"&gt;rameez.khan&lt;/SPAN&gt; has shown that this code works, by adding an assignment :&lt;BR /&gt;&lt;P&gt;DATA(doc)= read_only_table_of_ixml[1]-&amp;gt;create_document().&lt;/P&gt;So the reason is not because of the importing parameter.</description>
      <pubDate>Mon, 26 Nov 2018 08:49:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690527#M31057</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-26T08:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690528#M31058</link>
      <description>&lt;P&gt;my guess: It is an evaluation error for the [  ]-&amp;gt;method( ) expression, which is understood as [ ]-field_name&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CAST if_ixml( table_of_ixml[ 1 ] )-&amp;gt;create_document( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 13:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690528#M31058</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2018-11-26T13:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690529#M31059</link>
      <description>&lt;P&gt;Thank you very much Jacques, nice finding !&lt;/P&gt;&lt;P&gt;Then maybe &lt;SPAN class="mention-scrubbed"&gt;horst.keller&lt;/SPAN&gt; could confirm.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 14:22:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690529#M31059</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-11-26T14:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690530#M31060</link>
      <description>&lt;P&gt;no i dont think its mean that. &lt;/P&gt;&lt;P&gt;DATA(doc)= read_only_table_of_ixml[1]-&amp;gt;create_document().&lt;/P&gt;&lt;P&gt;mean assign the import parameter to a help variable so its not mean that you change the import parameter. after that statement, your import table still not change and created document will assign to doc, right?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 00:24:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690530#M31060</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-11-27T00:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690531#M31061</link>
      <description>&lt;P&gt;I get &lt;EM&gt;&lt;STRONG&gt;Unexpected operator "-&amp;gt;"&lt;/STRONG&gt;&lt;/EM&gt; on this: APPEND gt_ref[ key = 'my_key' ]-ref-&amp;gt;* TO gt_data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ts_data,
         key  TYPE char10,
         attribute TYPE i,
       END OF ts_data.
TYPES tt_data TYPE STANDARD TABLE OF ts_data.
  
TYPES: BEGIN OF ts_ref,
         key TYPE char10,
         ref TYPE REF TO ts_data,
       END OF ts_ref.
TYPES tt_ref TYPE STANDARD TABLE OF ts_ref.
 
DATA gt_data TYPE tt_data.
DATA gt_ref TYPE tt_ref.
  
APPEND gt_ref[ key = 'my_key' ]-ref-&amp;gt;* TO gt_data.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 06:36:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690531#M31061</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2018-12-06T06:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690532#M31062</link>
      <description>&lt;P&gt;It works with ABAP 7.52 (before the APPEND, I had to add the 2 following lines:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gt_data = value #( ( key = 'a' ) ( key = 'b' ) ).
gt_ref = value #( ( key = 'my_key' ref = ref #( gt_data[ 1 ] ) ) ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 14:18:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690532#M31062</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-12-06T14:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP syntax error for combination of table expression + method chaining + itab is read-only</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690533#M31063</link>
      <description>&lt;P&gt;The syntax error occured on Netweaver 7.4, SP10 and SP18.  It verify if was fixed on Netweaver 7.50 SP09&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 19:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-syntax-error-for-combination-of-table-expression-method-chaining-itab/m-p/690533#M31063</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2018-12-06T19:04:03Z</dc:date>
    </item>
  </channel>
</rss>

