<?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 740 Loop with where clause and modify in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094357#M1972215</link>
    <description>&lt;P&gt;Aah, I think IF line_exists() can only be used if there ain't any work area?!?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2019 18:22:18 GMT</pubDate>
    <dc:creator>flowers_candys</dc:creator>
    <dc:date>2019-08-07T18:22:18Z</dc:date>
    <item>
      <title>ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094348#M1972206</link>
      <description>&lt;P&gt;I am new to ABAP 740, and I am currently working on converting my existing ABAP code in ABAP 740 standards. I do have some understanding of the basic syntax of ABAP 740 and I have converted some of my existing ABAP code to 740. I am struggling to convert the below code as it has loop with where clause, two reads and based on the filter call FM and then modify the internal table. Need some guidance, please... &lt;/P&gt;
  &lt;P&gt;LOOP AT gt_vmcfa WHERE selkz = gc_charx. &lt;/P&gt;
  &lt;P&gt;READ TABLE it_vbrk WITH KEY vbeln = gt_vmcfa-vbeln BINARY SEARCH. &lt;/P&gt;
  &lt;P&gt;IF sy-subrc IS INITIAL. IF it_vbrk-rfbsk &amp;lt;&amp;gt; 'C'. &lt;/P&gt;
  &lt;P&gt;READ TABLE lt_vbfs INTO DATA(ls_vbfs) WITH KEY vbeln = gt_vmcfa-vbeln BINARY SEARCH. &lt;/P&gt;
  &lt;P&gt;IF sy-subrc IS INITIAL. &lt;/P&gt;
  &lt;P&gt;CLEAR: ld_shorttext. &lt;/P&gt;
  &lt;P&gt;ld_msgno = ls_vbfs-msgno. &lt;/P&gt;
  &lt;P&gt;CALL FUNCTION 'RPY_MESSAGE_COMPOSE' &lt;/P&gt;
  &lt;P&gt;EXPORTING message_id = ls_vbfs-msgid &lt;/P&gt;
  &lt;P&gt;message_number = ld_msgno &lt;/P&gt;
  &lt;P&gt;message_var1 = ls_vbfs-msgv1 &lt;/P&gt;
  &lt;P&gt;message_var2 = ls_vbfs-msgv2 &lt;/P&gt;
  &lt;P&gt;message_var3 = ls_vbfs-msgv3&lt;/P&gt;
  &lt;P&gt;message_var4 = ls_vbfs-msgv4 &lt;/P&gt;
  &lt;P&gt;IMPORTING message_text = ld_shorttext &lt;/P&gt;
  &lt;P&gt;EXCEPTIONS message_not_found = 1 OTHERS = 2. &lt;/P&gt;
  &lt;P&gt;gt_vmcfa-zzerror = ld_shorttext. &lt;/P&gt;
  &lt;P&gt;ENDIF. &lt;/P&gt;
  &lt;P&gt;ENDIF. &lt;/P&gt;
  &lt;P&gt;MODIFY gt_vmcfa. &lt;/P&gt;
  &lt;P&gt;ENDIF. &lt;/P&gt;
  &lt;P&gt;ENDLOOP.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 15:49:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094348#M1972206</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T15:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094349#M1972207</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;flowers.candys&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;To achieve it you need to read the documentation of &lt;STRONG&gt;FOR&lt;/STRONG&gt; or &lt;STRONG&gt;REDUCE &lt;/STRONG&gt;and&lt;STRONG&gt; internal table function&lt;/STRONG&gt; statements. We have a lot of blogs and questions telling how to do it, I put some relevant links to you read bellow. Now, about the function inside of your demo code, it not will run using inline declarations, as solution you need to create a local class and call it inside the inline loop (as I mentioned  above) or find another global one already created on your SAP system.&lt;/P&gt;&lt;P&gt;Links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/07/22/abap-news-for-release-740/"&gt;ABAP Language News for Release 7.40&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/06/22/abap-news-for-release-740-new-internal-table-functions/"&gt;Internal Table Functions&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/05/29/abap-news-for-release-740-table-expressions/"&gt;Table expressions&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/index.htm?file=ABENNEWS-740_SP05.htm"&gt;FOR and REDUCE examples&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Tips:&lt;/P&gt;&lt;P&gt;1 - If you always had a doubt about a statement or functionality, first search and read the &lt;STRONG&gt;DEMO&lt;/STRONG&gt; programs on your system, accessing it on SE38 or SE80 TCodes (Search using the string DEMO*);&lt;/P&gt;&lt;P&gt;2 - Check the version of your system, some instructions may not work correctly and you need to read the ABAP Document to check it;&lt;/P&gt;&lt;P&gt;3 - Continue to study ;).&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Raphael Pacheco.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 16:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094349#M1972207</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2019-08-07T16:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094350#M1972208</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if I were you I would start with non-ABAP-7.4 related adjustments - you seem to use tables with header lines ("LOOP AT gt_vmcfa WHERE selkz = gc_charx". or "READ TABLE it_vbrk WITH KEY vbeln = gt_vmcfa-vbeln BINARY SEARCH.") which is obsolete. &lt;/P&gt;&lt;P&gt;Modifying data in a loop is rather to be done using field symbols (better performance) than MODIFY statement.&lt;/P&gt;&lt;P&gt;You should check subrc after calling the FM.&lt;/P&gt;&lt;P&gt;Please use meaningful names of variables and also keep their namig convension proper (ld should be rather lv or l_v)&lt;/P&gt;&lt;P&gt;In terms of ABAP 7.4 you can use dynamic conversion when calling FM instead of saving data in a separate variable.&lt;/P&gt;&lt;P&gt;After changes your code could look like this (still change the names of variabls / fields symbols to more meaningful data):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  LOOP AT gt_vmcfa ASSIGNING FIELD-SYMBOL(&amp;lt;l_s_vmcfa&amp;gt;) WHERE selkz = gc_charx.

    IF NOT line_exists( it_vbrk[ vbeln = &amp;lt;l_s_vmcfa-vbeln rfbsk = 'C'  ] ).

      READ TABLE lt_vbfs ASSIGNING FIELD-SYMBOL(&amp;lt;l_s_vbfs&amp;gt;) WITH KEY vbeln = &amp;lt;l_s_vmcfa&amp;gt;-vbeln BINARY SEARCH.
      IF sy-subrc EQ 0.
        CLEAR l_s_shorttext.

        CALL FUNCTION 'RPY_MESSAGE_COMPOSE'
          EXPORTING
            message_id        = &amp;lt;l_s_vbfs&amp;gt;-msgid
            message_number    = CONV sy-msgno( &amp;lt;l_s_vbfs&amp;gt;-msgno )
            message_var1      = &amp;lt;l_s_vbfs&amp;gt;-msgv1
            message_var2      = &amp;lt;l_s_vbfs&amp;gt;-msgv2
            message_var3      = &amp;lt;l_s_vbfs&amp;gt;-msgv3
            message_var4      = &amp;lt;l_s_vbfs&amp;gt;-msgv4
          IMPORTING
            message_text      = l_s_shorttext
          EXCEPTIONS
            message_not_found = 1
            OTHERS            = 2.
        IF sy-subrc EQ 0.
          &amp;lt;l_s_vmcfa&amp;gt;-zzerror = l_s_shorttext.
        ENDIF.

      ENDIF.

    ENDIF.

  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Marek&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 17:06:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094350#M1972208</guid>
      <dc:creator>MarekTurczynski</dc:creator>
      <dc:date>2019-08-07T17:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094351#M1972209</link>
      <description>&lt;P&gt;I guess you are talking about Constructor Expressions. "construct" means the initialization of a variable from scratch. Constructor expressions cannot update existing data (except adding lines to internal tables). Period.&lt;/P&gt;&lt;P&gt;But what you can do is using &lt;STRONG&gt;sorted&lt;/STRONG&gt; or &lt;STRONG&gt;hashed&lt;/STRONG&gt; tables (available since 1998), and please stop using header lines (obsolete since at least 2005).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 17:10:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094351#M1972209</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-08-07T17:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094352#M1972210</link>
      <description>&lt;P&gt;I think he want to translate all the his code to ABAP 7.4, no?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 17:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094352#M1972210</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2019-08-07T17:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094353#M1972211</link>
      <description>&lt;P&gt;Hi Raphael - yes, thanks for the shared links. Regarding tip # 1, are there any specific DEMO programs intended for latest ABAP standards that I cAn leverage?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:00:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094353#M1972211</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094354#M1972212</link>
      <description>&lt;P&gt;Hi Marek - sure thing, the custom code that I shared was a copy of standard code that I intended to enhance, appreciate the improvements - I learnt a few new things. I was not sure how to call function module inside the new FOR syntax. I will go through the documentation shared previously.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:05:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094354#M1972212</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094355#M1972213</link>
      <description>&lt;P&gt;That's correct, Raphael.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:06:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094355#M1972213</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094356#M1972214</link>
      <description>&lt;P&gt;Hi Marek - I have a question on the revised code.. &lt;/P&gt;&lt;P&gt;READ TABLE lt_vbfs ASSIGNINGFIELD-SYMBOL(&amp;lt;l_s_vbfs&amp;gt;)WITHKEY vbeln =&amp;lt;l_s_vmcfa&amp;gt;-vbeln BINARYSEARCH.&lt;/P&gt;&lt;P&gt;can the above read statement be converted to IF line_exists(). ENDIF.? how can we move the work area into the field symbol &amp;lt;l_s_vbfs&amp;gt; in IF line_exists() syntax.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:19:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094356#M1972214</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094357#M1972215</link>
      <description>&lt;P&gt;Aah, I think IF line_exists() can only be used if there ain't any work area?!?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094357#M1972215</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094358#M1972216</link>
      <description>&lt;P&gt;E.g.: If you want to see the FOR demo programs, search for DEMO_FOR*, if you want to know about MESHES, search for DEMO_MESH*. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094358#M1972216</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2019-08-07T18:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094359#M1972217</link>
      <description>&lt;P&gt;Great tip, many thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:27:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094359#M1972217</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094360#M1972218</link>
      <description>&lt;P&gt;Exactly, line_exists is not filling any work area - it is a simple check if line exists in a table or not returning a proper subrc.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You need to have a field symbol assigned becase you want to use the variables (MSGNO / MSGID etc.) in calling an FM.&lt;/P&gt;&lt;P&gt;FOR operation on the global internal table is not useful in this case because you do not need to build a new table but only modify a field of main table.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Marek&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094360#M1972218</guid>
      <dc:creator>MarekTurczynski</dc:creator>
      <dc:date>2019-08-07T18:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094361#M1972219</link>
      <description>&lt;P&gt;Based on the links shared, I implemented FOR for some of the loops that I have had in the program and it works as expected. &lt;/P&gt;&lt;P&gt;" populate the output table&lt;BR /&gt;DATA(lt_vmcfa) =&lt;BR /&gt;VALUE ltt_vmcfa(&lt;BR /&gt;FOR ls_vbrp IN lt_vbrp&lt;BR /&gt;FOR ls_vmcfa IN c_vmcfa WHERE ( vbeln = ls_vbrp-vbeln )&lt;BR /&gt;( &lt;EM&gt;mandt = ls_vmcfa-mandt vkorg = ls_vmcfa-vkorg kunrg = ls_vmcfa-kunrg fktyp = ls_vmcfa-fktyp fkdat = ls_vmcfa-fkdat fkart = ls_vmcfa-fkart ernam = ls_vmcfa-ernam&lt;BR /&gt;erdat = ls_vmcfa-erdat kunag = ls_vmcfa-kunag vbeln = ls_vmcfa-vbeln rfbsk = ls_vmcfa-rfbsk selkz = ls_vmcfa-selkz fktyp_text = ls_vmcfa-fktyp_text fkart_text = ls_vmcfa-fkart_text&lt;BR /&gt;name1 = ls_vmcfa-name1 name2 = ls_vmcfa-name2 vfuvgr = ls_vmcfa-vfuvgr statf = ls_vmcfa-statf zzvbeln = ls_vbrp-aubel zzposnr = ls_vbrp-aupos zzmatnr = ls_vbrp-matnr&lt;/EM&gt; )
&lt;/P&gt;&lt;P&gt;).&lt;/P&gt;&lt;P&gt;However, in the above code, do I need to assign field by field? Meaning &lt;EM&gt;mandt = ls_vmcfa-mandt &lt;/EM&gt;&lt;EM&gt;vkorg = ls_vmcfa-vkorg kunrg = ls_vmcfa-kunrg &lt;/EM&gt;and so on....? &lt;/P&gt;&lt;P&gt;Am I missing anything?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094361#M1972219</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T18:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094362#M1972220</link>
      <description>&lt;P&gt;You can use the &lt;STRONG&gt;CORRESPONDING&lt;/STRONG&gt; statement, this is the same as &lt;STRONG&gt;MOVE-CORRESPONDING&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;P.S.: I'm glad to see you solving your problem.&lt;/P&gt;&lt;P&gt;#KeepLearning.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 19:06:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094362#M1972220</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2019-08-07T19:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094363#M1972221</link>
      <description>&lt;P&gt;As  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; said, use sorted or hashed table, and avoid BINARY SEARCH. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 19:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094363#M1972221</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2019-08-07T19:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094364#M1972222</link>
      <description>&lt;P&gt;yes, I tried using corresponding, but I encountered below problems -&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;     option # 1&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;
 DATA(lt_vmcfa) =&lt;BR /&gt;
 VALUE ltt_vmcfa(&lt;BR /&gt;
 FOR ls_vbrp IN lt_vbrp&lt;BR /&gt;
 FOR ls_vmcfa IN c_vmcfa WHERE ( vbeln = ls_vbrp-vbeln )&lt;BR /&gt;
 ( CORRESPONDING #( ls_vmcfa ) ) ).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Above statement does not copy data from another work area ls_vbrp but only from ls_vmcfa.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;option # 2&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;DATA(lt_vmcfa) =&lt;BR /&gt;VALUE ltt_vmcfa(&lt;BR /&gt;FOR ls_vbrp IN lt_vbrp&lt;BR /&gt;FOR ls_vmcfa IN c_vmcfa WHERE ( vbeln = ls_vbrp-vbeln )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;( CORRESPONDING #( ls_vmcfa ) ) ( zzvbeln = ls_vbrp-aubel zzposnr = ls_vbrp-aupos zzmatnr = ls_vbrp-matnr ) ).&lt;/P&gt;&lt;P&gt;Above statement  copies data two times - first from work area ls_vmcfa and then from work area ls_vbrp. So entries get doubled.&lt;/P&gt;&lt;P&gt;Hence, I did field by field assignment. Can you guide, please?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 19:54:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094364#M1972222</guid>
      <dc:creator>flowers_candys</dc:creator>
      <dc:date>2019-08-07T19:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094365#M1972223</link>
      <description>&lt;P&gt;You cant call function module inside FOR...loop, but you could try to create a function method and call it. My pseudo code (not guaranty it work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lt_vmcfa = VALUE #( FOR ls_vmcfa IN gt_vmcfa WHERE ( selkz = gc_charx )
                    LET ls_vbrk = VALUE #( it_vbrk[ vbeln = ls_vmcfa-vbeln ] OPTIONAL )
                        ls_vbfs = VALUE #( lt_vbfs[ vbeln = gt_vmcfa-vbeln ] OPTIONAL )
                     IN ( COND #( WHEN ls_vbrk IS NOT INITIAL AND
                                       ls_vbrk-rfbsk &amp;lt;&amp;gt; 'C'   AND
                                       ls_vbfs IS NOT INITIAL 
                                  THEN ( VALUE #( BASE ls_vmcfa zzerror = cl_msg=&amp;gt;get_msg( ls_vbfs-msgno ) ) ) ) ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2019 02:13:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094365#M1972223</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-08-08T02:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094366#M1972224</link>
      <description>&lt;P&gt;Why losing time to translate legacy code? What gain? Why not learning 7.40 syntax on new code instead?&lt;/P&gt;&lt;P&gt;By the way, RPY_MESSAGE_COMPOSE is obsolete too. Use MESSAGE statement instead.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 06:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094366#M1972224</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-08-08T06:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 740 Loop with where clause and modify</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094367#M1972225</link>
      <description>&lt;P&gt;Generally speaking, if one wants to learn what has changed in newest versions, there is the chapter "&lt;A href="https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abennews.htm"&gt;ABAP Release-Specific Changes&lt;/A&gt;" of the official ABAP documentation. It's very interesting to read because you can read only the changes that concern you, if you know syntax 7.02 then you just have to read the changes of 7.31, 7.40 and above, up to the version which is of some interest for you. To better understand some of those syntaxes, there are often some blog posts by Horst Keller or by other people.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 06:41:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-740-loop-with-where-clause-and-modify/m-p/12094367#M1972225</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-08-08T06:41:53Z</dc:date>
    </item>
  </channel>
</rss>

