<?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: Please, pretty please, correct this code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800122#M1123983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u have looped MPRPS but moving PRPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move MPRPS then it  will work &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;&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 13:24:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-03T13:24:36Z</dc:date>
    <item>
      <title>Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800120#M1123981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT FINAL.
    IF FINAL-PSTYV EQ 'ZTAO'.
      DATA : MPSPHI LIKE PRPS-PSPHI.
      DATA : MPRPS LIKE PRPS OCCURS 0 WITH HEADER LINE.
      DATA : MOBJRN LIKE RPSCO-OBJNR.
            
      SELECT SINGLE * FROM PRPS WHERE PSPNR = FINAL-PS_PSP_PNR.

      MPSPHI = PRPS-PSPHI.

      SELECT * FROM PRPS INTO TABLE MPRPS WHERE PSPHI = MPSPHI.

      SORT MPRPS BY OBJNR.

      LOOP AT MPRPS.

        MOBJNR = PRPS-OBJNR.

      ENDLOOP. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;when I debug the code MOBJNR is not changing it is taking from row value even it is running in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly correct this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Dec 3, 2008 3:53 PM - Subject made less demanding&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800120#M1123981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T13:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800121#M1123982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : MPSPHI LIKE PRPS-PSPHI.
DATA : MPRPS LIKE PRPS OCCURS 0 WITH HEADER LINE.
DATA : MOBJRN LIKE RPSCO-OBJNR.

LOOP AT FINAL.
IF FINAL-PSTYV EQ 'ZTAO'.
SELECT SINGLE * FROM PRPS WHERE PSPNR = FINAL-PS_PSP_PNR.
MPSPHI = PRPS-PSPHI.

SELECT * FROM PRPS INTO TABLE MPRPS WHERE PSPHI = MPSPHI.
SORT MPRPS BY OBJNR.

LOOP AT MPRPS.
MOBJNR = PRPS-OBJNR.
ENDLOOP. 

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the loop for MPRPS, the object number wil be overwritten and everytime only the last record from the table MPRPS will be available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change that part. It should work. If you want to store the object number in another table, you need to declare a table of type MOBJNR and you need to append records to that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Please avoid selects inside loop as it would affect the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800121#M1123982</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800122#M1123983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u have looped MPRPS but moving PRPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move MPRPS then it  will work &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;&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800122#M1123983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800123#M1123984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT FINAL.&lt;/P&gt;&lt;P&gt;IF FINAL-PSTYV EQ 'ZTAO'.&lt;/P&gt;&lt;P&gt;DATA : MPSPHI LIKE PRPS-PSPHI.&lt;/P&gt;&lt;P&gt;DATA : MPRPS LIKE PRPS OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : MOBJRN LIKE RPSCO-OBJNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM PRPS WHERE PSPNR = FINAL-PS_PSP_PNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MPSPHI = PRPS-PSPHI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM PRPS INTO TABLE MPRPS WHERE PSPHI = MPSPHI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT MPRPS BY OBJNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT MPRPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOBJNR = MPRPS-OBJNR.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:29:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800123#M1123984</guid>
      <dc:creator>paolo_romano2</dc:creator>
      <dc:date>2008-12-03T13:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800124#M1123985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paolo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks I got it. Some times it happens...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:37:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800124#M1123985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T13:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Please, pretty please, correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800125#M1123986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you're right...I make such an error thousands of times...and every time I go crazy to recognize it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 13:38:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-pretty-please-correct-this-code/m-p/4800125#M1123986</guid>
      <dc:creator>paolo_romano2</dc:creator>
      <dc:date>2008-12-03T13:38:36Z</dc:date>
    </item>
  </channel>
</rss>

