<?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: Incorrect Data if executing for multiple material, but correct for single material in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609299#M2011632</link>
    <description>&lt;P&gt;Prefer editing your question to contain all this information.&lt;/P&gt;&lt;P&gt;ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2022 12:19:14 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2022-05-05T12:19:14Z</dc:date>
    <item>
      <title>Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609293#M2011626</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
  &lt;P&gt;I am facing an issue with an ALV report, where if I am executing for single material, it is showing correct values. Similarly, if I am trying to execute it for 2 materials, the second row is correct, but the first row is showing incorrect values for two particular columns.&lt;/P&gt;
  &lt;P&gt;Thanks in advance!!!&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 06:54:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609293#M2011626</guid>
      <dc:creator>PragatiBabbar</dc:creator>
      <dc:date>2022-05-05T06:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609294#M2011627</link>
      <description>&lt;P&gt;Cristal ball said, you forget to clear the structure before inserting data.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 07:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609294#M2011627</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-05-05T07:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609295#M2011628</link>
      <description>&lt;P&gt;I am attaching screenshots for better understanding of the issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Executing for single material: &lt;/STRONG&gt;CORRECT values of highlighted columns&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2049462-image.png" /&gt;&lt;/P&gt;&lt;P&gt;--------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Executing for two materials:&lt;/STRONG&gt; INCORRECT VALUE OF this column, &lt;EM&gt;but the second-row values are correct&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2049463-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 07:40:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609295#M2011628</guid>
      <dc:creator>PragatiBabbar</dc:creator>
      <dc:date>2022-05-05T07:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609296#M2011629</link>
      <description>&lt;P&gt;Show your code, or if you are sure your code is correct maybe standard code contains an error, search SAP notes.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 07:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609296#M2011629</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-05T07:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609297#M2011630</link>
      <description>&lt;P&gt;How do you load this data, SQL statements, SAP procedure calls?&lt;/P&gt;&lt;P&gt;Can you post (in the question or as a comment to it and not as an answer) the most relevant code.&lt;/P&gt;&lt;P&gt;It is probably a bad initialization or a bad processing of the read data, but without the source, it will be almost impossible to help you? &lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 09:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609297#M2011630</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-05-05T09:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609298#M2011631</link>
      <description>&lt;P&gt;Code for reference:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    READ TABLE it_vbrp1 INTO wa_vbrp1 WITH KEY matnr = wa_mara-matnr BINARY SEARCH.
    IF sy-subrc = 0.
      lv_index3 = sy-tabix.

      LOOP AT it_vbrp1 INTO wa_vbrp1 FROM lv_index3.

        IF ( wa_vbrp1-matnr = wa_mara-matnr ).

          wa_final-fkimg  = wa_vbrp1-fkimg .
          wa_final-netwr  = wa_vbrp1-netwr .
          wa_final-kzwi1  = wa_vbrp1-kzwi1 .

          "------------------------ 04.05.2022 (Supplemetary data)--------------"
          wa_final-fkimg1 =  wa_vbrp1-fkimg.       "----------------------for Quantity 
          wa_final-amount = wa_vbrp1-netwr.        "----------------------for amount   
          "-----------------------------------------------------------------------------"

          READ TABLE it_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbrp1-vbeln.
          IF sy-subrc = 0.
            wa_final-fkart  = wa_vbrk-fkart.
            wa_final-vbtyp  = wa_vbrk-vbtyp.
          ENDIF.

          IF  ( ( wa_final-fkart = 'ZDAG' OR wa_final-fkart = 'ZSCR' OR wa_final-fkart = 'ZRMS' )  AND  wa_final-vbtyp = 'M' ).
            wa_final-qty    =  wa_final-qty   + wa_final-fkimg .
            wa_final-value  =  wa_final-value + wa_final-netwr .

          ELSEIF wa_final-fkart = 'ZRE' OR wa_final-fkart = 'ZRE1' OR wa_final-fkart = 'ZSTR'.  "---Addind ZRE/ZRE1/ZSTR for D3 inclusion 
            wa_final-fkimg = wa_final-fkimg * -1.
            wa_final-netwr = wa_final-netwr * -1.
            wa_final-qty    =  wa_final-qty   + wa_final-fkimg .
            wa_final-value  =  wa_final-value + wa_final-netwr .

          ENDIF.

          IF ( ( wa_final-fkart = 'ZIPT' OR wa_final-fkart = 'ZSTO' OR wa_final-fkart = 'ZIPS' ) AND ( wa_final-vbtyp = 'M' OR wa_final-vbtyp = 'U' ) ).
            wa_final-qty1    =  wa_final-qty1   + wa_final-fkimg .
            wa_final-value1  =  wa_final-value1 + wa_final-netwr  .
          ENDIF.

          "------------------------ JWP ----------------"
          IF ( ( wa_final-fkart =  'ZJWP' OR  wa_final-fkart = 'ZJWI' ) AND wa_final-vbtyp = 'M' ).
            wa_final-qty2 = wa_final-qty2  + wa_final-fkimg.
            IF wa_final-fkart =  'ZJWP'.
              wa_final-value2  =  wa_final-value2 + wa_final-kzwi1.
              "------------  04.05.2022 (SUPPLEMENTARY)--------------*
              wa_final-amount = wa_final-kzwi1.
              "-------------------------------------------------------------*
            ELSE.
              wa_final-value2  =  wa_final-value2 + wa_final-netwr.
              "----------- 04.05.2022 (SUPPLEMENTARY)--------------*
              wa_final-amount = wa_final-netwr.
              "------------------------------------------------------------*
            ENDIF.
          ENDIF.

*           ------------------------------  04.05.2022 (Supplemetary add) -------------------"
            IF wa_final-vbtyp = 'O' OR wa_final-vbtyp = 'N' OR wa_final-vbtyp = 'M'.
              wa_final-fkimg1  =  wa_final-fkimg1  * -1.         "--------for actual Quantity
              wa_final-amount1 =  wa_final-amount  * -1.         "--------for actual Amount
            ELSE.
              wa_final-fkimg1  =  wa_final-fkimg1.
              wa_final-amount1 =  wa_final-amount.
            ENDIF.
*          ----------------------------------------------------------------------------------------"
        ELSE.
          EXIT .
        ENDIF.
      ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 May 2022 11:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609298#M2011631</guid>
      <dc:creator>PragatiBabbar</dc:creator>
      <dc:date>2022-05-05T11:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609299#M2011632</link>
      <description>&lt;P&gt;Prefer editing your question to contain all this information.&lt;/P&gt;&lt;P&gt;ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 12:19:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609299#M2011632</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-05T12:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609300#M2011633</link>
      <description>&lt;P&gt;As Raymond said, "how do you load this data" ? I don't see any BAPI here.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 12:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609300#M2011633</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-05T12:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609301#M2011634</link>
      <description>&lt;P&gt;The logic looks rather involved with the many nested IF-statements which makes it difficult to follow without seeing the data used within the loop.&lt;/P&gt;&lt;P&gt;Have you tried stepping through your logic with debugging to actually see what is happening? This would be the first step I'd take in a case like this. &lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 12:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609301#M2011634</guid>
      <dc:creator>BaerbelWinkler</dc:creator>
      <dc:date>2022-05-05T12:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Data if executing for multiple material, but correct for single material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609302#M2011635</link>
      <description>&lt;P&gt;From debugging, I find out that the value I am getting in the first iteration of loop is correct,&lt;/P&gt;&lt;P&gt;but in the third iteration, the value became incorrect.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 04:58:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-data-if-executing-for-multiple-material-but-correct-for-single/m-p/12609302#M2011635</guid>
      <dc:creator>PragatiBabbar</dc:creator>
      <dc:date>2022-05-06T04:58:27Z</dc:date>
    </item>
  </channel>
</rss>

