<?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 program bug... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-bug/m-p/6594402#M1436310</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;I have below code..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  data: lv_update_field(50).

  if not it_bsid_vertn[] is initial.

    sort it_bsid by vertn.
    loop at it_bsid_vertn assigning &amp;lt;fs_bsid_vertn&amp;gt;.
** parallel cursor approach

      clear w_index.
      read table it_bsid assigning &amp;lt;fs_bsid&amp;gt; with key vertn = &amp;lt;fs_bsid_vertn&amp;gt;-vertn binary search.

      if sy-subrc = 0.
        w_index = sy-tabix.
        loop at it_bsid assigning &amp;lt;fs_bsid&amp;gt; from w_index.
          if &amp;lt;fs_bsid&amp;gt;-vertn ne &amp;lt;fs_bsid_vertn&amp;gt;-vertn.
            exit.
          endif.

          read table it_ztrans_type_mast assigning &amp;lt;fs_ztrans_type_mast&amp;gt; with key anbwa = &amp;lt;fs_bsid&amp;gt;-anbwa
                                                                                shkzg = &amp;lt;fs_bsid&amp;gt;-shkzg binary search.
          if sy-subrc = 0.
            concatenate 'WA_UPDATE-' &amp;lt;fs_ztrans_type_mast&amp;gt;-field_name into lv_update_field.
            assign (lv_update_field) to &amp;lt;fs_update_amt&amp;gt;.
            &amp;lt;fs_update_amt&amp;gt; = &amp;lt;fs_update_amt&amp;gt; + ( &amp;lt;fs_bsid&amp;gt;-dmbtr * &amp;lt;fs_ztrans_type_mast&amp;gt;-field_value ).
          endif.

          unassign &amp;lt;fs_ztrans_type_mast&amp;gt;.
          clear lv_update_field.

** requirement for ODC calculation
          move-corresponding &amp;lt;fs_bsid&amp;gt; to it_bsid_odc_l.
          append it_bsid_odc_l.

        endloop. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is happening is that if I have two records in it_bsid for same anbwa e.g. ZBC.. so when it comes to statement "assign (lv_update_field) to &amp;lt;fs_update_amt&amp;gt;." it overwrites the first value of ZBC.  If there are 2 records of ZBC i want to sum up this value and final value i have to update dynamically in &amp;lt;fs_update_amt&amp;gt; as written through statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;fs_update_amt&amp;gt; = &amp;lt;fs_update_amt&amp;gt; + ( &amp;lt;fs_bsid&amp;gt;-dmbtr * &amp;lt;fs_ztrans_type_mast&amp;gt;-field_value ).   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any array like concept?? can you tell me how to overcome this ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2010 03:47:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-11T03:47:23Z</dc:date>
    <item>
      <title>program bug...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-bug/m-p/6594402#M1436310</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;I have below code..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  data: lv_update_field(50).

  if not it_bsid_vertn[] is initial.

    sort it_bsid by vertn.
    loop at it_bsid_vertn assigning &amp;lt;fs_bsid_vertn&amp;gt;.
** parallel cursor approach

      clear w_index.
      read table it_bsid assigning &amp;lt;fs_bsid&amp;gt; with key vertn = &amp;lt;fs_bsid_vertn&amp;gt;-vertn binary search.

      if sy-subrc = 0.
        w_index = sy-tabix.
        loop at it_bsid assigning &amp;lt;fs_bsid&amp;gt; from w_index.
          if &amp;lt;fs_bsid&amp;gt;-vertn ne &amp;lt;fs_bsid_vertn&amp;gt;-vertn.
            exit.
          endif.

          read table it_ztrans_type_mast assigning &amp;lt;fs_ztrans_type_mast&amp;gt; with key anbwa = &amp;lt;fs_bsid&amp;gt;-anbwa
                                                                                shkzg = &amp;lt;fs_bsid&amp;gt;-shkzg binary search.
          if sy-subrc = 0.
            concatenate 'WA_UPDATE-' &amp;lt;fs_ztrans_type_mast&amp;gt;-field_name into lv_update_field.
            assign (lv_update_field) to &amp;lt;fs_update_amt&amp;gt;.
            &amp;lt;fs_update_amt&amp;gt; = &amp;lt;fs_update_amt&amp;gt; + ( &amp;lt;fs_bsid&amp;gt;-dmbtr * &amp;lt;fs_ztrans_type_mast&amp;gt;-field_value ).
          endif.

          unassign &amp;lt;fs_ztrans_type_mast&amp;gt;.
          clear lv_update_field.

** requirement for ODC calculation
          move-corresponding &amp;lt;fs_bsid&amp;gt; to it_bsid_odc_l.
          append it_bsid_odc_l.

        endloop. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is happening is that if I have two records in it_bsid for same anbwa e.g. ZBC.. so when it comes to statement "assign (lv_update_field) to &amp;lt;fs_update_amt&amp;gt;." it overwrites the first value of ZBC.  If there are 2 records of ZBC i want to sum up this value and final value i have to update dynamically in &amp;lt;fs_update_amt&amp;gt; as written through statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;fs_update_amt&amp;gt; = &amp;lt;fs_update_amt&amp;gt; + ( &amp;lt;fs_bsid&amp;gt;-dmbtr * &amp;lt;fs_ztrans_type_mast&amp;gt;-field_value ).   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any array like concept?? can you tell me how to overcome this ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 03:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-bug/m-p/6594402#M1436310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T03:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: program bug...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-bug/m-p/6594403#M1436311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need make unique records of your it_bsid based on the key field before going into loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if sy-subrc = 0.
        w_index = sy-tabix.
        "&amp;lt;====== Here
        loop at it_bsid assigning &amp;lt;fs_bsid&amp;gt; from w_index.
          if &amp;lt;fs_bsid&amp;gt;-vertn ne &amp;lt;fs_bsid_vertn&amp;gt;-vertn.
            exit.
          endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 04:12:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-bug/m-p/6594403#M1436311</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2010-02-11T04:12:00Z</dc:date>
    </item>
  </channel>
</rss>

