<?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 me with this code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469485#M1252672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this way &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT abc WHERE vbeln IN so AND posnr IN li.
 
    abc-gbsta = status.
    abc-lfgsa = status.
    abc-absta = status.
 
    vbup-gbsta = abc-gbsta.
    vbup-lfgsa = abc-lfgsa.
    vbup-absta = abc-absta.
 
    modify  abc transporting gbsta lfgsa absta . " changing the internal table data.
    MODIFY vbup FROM TABLE abc. " changing the DB table
 
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2009 18:46:20 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2009-04-21T18:46:20Z</dc:date>
    <item>
      <title>Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469481#M1252668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear gurus.&lt;/P&gt;&lt;P&gt;This is my code please guide me where im wrong..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: vbap , vbup.

DATA: abc LIKE vbup OCCURS 1 WITH HEADER LINE.
DATA: status LIKE vbup-gbsta.

status = 'C'.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS so FOR vbup-vbeln OBLIGATORY.
SELECT-OPTIONS li FOR vbup-posnr OBLIGATORY.
SELECTION-SCREEN END OF SCREEN 100.



SELECTION-SCREEN: BEGIN OF TABBED BLOCK b2 FOR 4 LINES,
                  TAB (50) title USER-COMMAND '' DEFAULT SCREEN 100,
                  END OF BLOCK b2.

INITIALIZATION.
  title = 'Selection OF Sales Order And Line Items'.

START-OF-SELECTION.

  SELECT *
    FROM vbup
    INTO TABLE abc
    WHERE gbsta EQ 'A'
    AND lfgsa EQ 'A'
    AND absta EQ 'A'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT abc WHERE vbeln IN so AND posnr IN li.


    abc-gbsta = status.
    abc-lfgsa = status.
    abc-absta = status.

    vbup-gbsta = abc-gbsta.
    vbup-lfgsa = abc-lfgsa.
    vbup-absta = abc-absta.

    APPEND  abc.
    MODIFY vbup FROM TABLE abc.

  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469481#M1252668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T18:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469482#M1252669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will run into infinite loop ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT abc WHERE vbeln IN so AND posnr IN li.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    abc-gbsta = status.&lt;/P&gt;&lt;P&gt;    abc-lfgsa = status.&lt;/P&gt;&lt;P&gt;    abc-absta = status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    vbup-gbsta = abc-gbsta.&lt;/P&gt;&lt;P&gt;    vbup-lfgsa = abc-lfgsa.&lt;/P&gt;&lt;P&gt;    vbup-absta = abc-absta.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;APPEND  abc.&lt;/STRONG&gt;     &lt;STRONG&gt;&amp;lt;-- remove this statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MODIFY vbup FROM TABLE abc.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:30:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469482#M1252669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T18:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469483#M1252670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i remove the append code&lt;/P&gt;&lt;P&gt;then the standard table vbup is not modified&lt;/P&gt;&lt;P&gt;it contains the same previous values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:34:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469483#M1252670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469484#M1252671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT abc WHERE vbeln IN so AND posnr IN li.
 
 
    abc-gbsta = status.
    abc-lfgsa = status.
    abc-absta = status.
 
    vbup-gbsta = abc-gbsta.
    vbup-lfgsa = abc-lfgsa.
    vbup-absta = abc-absta.
 
    APPEND  abc.                            "Coment this
   modify abc index Sy-tabix.           "write this
    MODIFY vbup FROM TABLE abc.  "you are updating VBUP inside the loop so you can update by line by line
Modify VBUP from abc.  "write this
if sy-subrc = o.
commit work.
else.
roll back.
endif.

 
  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469484#M1252671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T18:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469485#M1252672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this way &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT abc WHERE vbeln IN so AND posnr IN li.
 
    abc-gbsta = status.
    abc-lfgsa = status.
    abc-absta = status.
 
    vbup-gbsta = abc-gbsta.
    vbup-lfgsa = abc-lfgsa.
    vbup-absta = abc-absta.
 
    modify  abc transporting gbsta lfgsa absta . " changing the internal table data.
    MODIFY vbup FROM TABLE abc. " changing the DB table
 
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469485#M1252672</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-21T18:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help me with this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469486#M1252673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are trying to modify a standard SAP table. Have you done the analysis to ensure that there will not be problems with data consistency?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:59:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-me-with-this-code/m-p/5469486#M1252673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-21T18:59:16Z</dc:date>
    </item>
  </channel>
</rss>

