<?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: help in the abap code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002892#M76945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,  build another itab using the COLLECT keyword.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2005 16:07:04 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-08-17T16:07:04Z</dc:date>
    <item>
      <title>help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002885#M76938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  In this piece of code  I have to add the credits and debits for each adjustment type like 'DZ',&lt;/P&gt;&lt;P&gt;'ZA','ZW' separately and store it (like in  zappliedcredits1, zappliedcredits2, zappliedcredits3) as I am looping the data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The question I am facing is, as I loop through patcloseditemsitab there is a possiblity that it loops through the same adjustment type more than once for a given set of data and at this situation it updates the values in 'zzdebitxx' and 'zzcreditxx' resulting in the wrong value in the overallbalance. To avoid that I used 'clear zzdebitxx' and 'clear zzcreditxx' after the loop but then the value in 'zappliedcredits1' got updated with the wrong value.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I have explained my issue and everytime I check each of these adjustment types it has to get updated properly in the given scenario how can i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be really helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code goes like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insert  lines of patopenitemsitab into table&lt;/P&gt;&lt;P&gt;     patcloseditemsitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at patcloseditemsitab  into wa_payadjustment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    case wa_payadjustment-blart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      when 'DZ'.&lt;/P&gt;&lt;P&gt;        if wa_payadjustment-wrbtr = ' '.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        elseif wa_payadjustment-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;          add wa_payadjustment-wrbtr to zzcredit1.&lt;/P&gt;&lt;P&gt;        elseif wa_payadjustment-shkzg = 'S'.&lt;/P&gt;&lt;P&gt;           add wa_payadjustment-wrbtr to zzdebit1.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        ctext2 = 'CUSTOMER PAYMENT'.&lt;/P&gt;&lt;P&gt;        zappliedcredits1 = zzdebit1 - zzcredit1.&lt;/P&gt;&lt;P&gt;      when 'ZA'.&lt;/P&gt;&lt;P&gt;        if wa_payadjustment-wrbtr = ' '.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        elseif wa_payadjustment-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;          add wa_payadjustment-wrbtr to zpayment.&lt;/P&gt;&lt;P&gt;          add wa_payadjustment-wrbtr to zzcredit1.&lt;/P&gt;&lt;P&gt;        elseif wa_payadjustment-shkzg = 'S'.&lt;/P&gt;&lt;P&gt;          add wa_payadjustment-wrbtr to zpayment.&lt;/P&gt;&lt;P&gt;          add wa_payadjustment-wrbtr to zzdebit1.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        ctext2 = 'CHECK BY PHONE'.&lt;/P&gt;&lt;P&gt;        zappliedcredits1 = zzdebit1 - zzcredit1.&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;  when 'ZW'.&lt;/P&gt;&lt;P&gt;        if wa_payadjustment-wrbtr = ' '.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        elseif wa_payadjustment-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;           add wa_payadjustment-wrbtr to zzcredit2.&lt;/P&gt;&lt;P&gt;         elseif wa_payadjustment-shkzg = 'S'.&lt;/P&gt;&lt;P&gt;           add wa_payadjustment-wrbtr to zzdebit2.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        ctext2 = 'PAYMENT'.&lt;/P&gt;&lt;P&gt;         zappliedcredits3 = zzdebit3 - zzcredit3.&lt;/P&gt;&lt;P&gt;         when  others.&lt;/P&gt;&lt;P&gt;        continue.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ztotalappliedcredits = zappliedcredits1 + zappliedcredits2 &lt;EM&gt;........&lt;/EM&gt; zappliedcredits3.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 15:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002885#M76938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T15:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002886#M76939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was thinking that you where updating a internal table at first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you make it that the internal table patcloseditemsitab only has one record per type.  When building that table, use COLLECT instead of APPEND.  This will collect the numeric values into one record per the table key, which is all the fields to the left of the numeric fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 15:43:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002886#M76939</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-17T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002887#M76940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I use it here ? Because I am dealing with variables like zzcredit, zzdebit zapplied credits for each adjustment type separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 15:46:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002887#M76940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T15:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002888#M76941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You say that you are clearing zzdebitxx and zzcreditxx after the loop, but I don't see it in your code. In any event, you should clear them within the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 15:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002888#M76941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T15:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002889#M76942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'there is a possiblity that it loops through the same adjustment type more than once for a given set of data'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not clear why this happen. Does it means there is duplicate entries in your internal table?&lt;/P&gt;&lt;P&gt;Can you explain this point more details?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 15:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002889#M76942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T15:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002890#M76943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot do that because 'patcloseditemsitab' has data related to non-adjustment types too which i have to display in the form, it is a part of the whole big process that is going to display the data in the form in the final section. so I cannot disturb that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way using variables I can get the data  at each instance and store them like in zappliedcreditsxx for each adjustment type and taking into consideration as to how many times it gets executed for record -- add them to a final variable that gives the exact summation of all the adjustment types for that particular order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:01:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002890#M76943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T16:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002891#M76944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that.. it changes the value of zappliedcreditsxx when it runs the second time for the same adjustment type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002891#M76944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T16:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002892#M76945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,  build another itab using the COLLECT keyword.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002892#M76945</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-17T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002893#M76946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are updating zappliedcredits1 for both blart 'DZ' and 'ZA'. Is that what you want to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002893#M76946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T16:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002894#M76947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich, your suggesstion helped me.&lt;/P&gt;&lt;P&gt;Full points to you.&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/1002894#M76947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-17T16:43:37Z</dc:date>
    </item>
  </channel>
</rss>

