<?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: problem in update statment when using where condtion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559421#M1268682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but do not use and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same as read put sapce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example :--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE ZFINAL_DATA  SET ZDATE_FLAG = SPACE &lt;/P&gt;&lt;P&gt;          where ZGLOBAL_CODE  = w_ ZGLOBAL_CODE &lt;/P&gt;&lt;P&gt;                   ZDATE_FLAG  ne SPACE  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just keep on adding field in where condition but dont put and operator inbetween the two fields...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on May 20, 2009 12:04 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2009 18:33:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-19T18:33:54Z</dc:date>
    <item>
      <title>problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559414#M1268675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;      Iam using update statment to update field in Z-Table .My statment is not working fine as per my requirement.The statment is as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE ZFINAL_DATA  SET ZDATE_FLAG = SPACE where ZGLOBAL_CODE ( SELECT LIFNR FROM LFA1 WHERE KTOKK = 'ZLIE' ).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this statment is doing my purpose .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is , I need to update ZDATE_FLAG = SPACE in ZFINAL_DATA table when LFA1 -LIFNR = ZFINAL_DATA-ZGLOBAL_CODE and LFA1-KTOKK = 'ZLIE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any correct the update statment which will be helpfull to proceed further .&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;Sriram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:50:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559414#M1268675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T17:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559415#M1268676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Sriram,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT single LIFNR FROM LFA1  into w_lifnr WHERE KTOKK = 'ZLIE' .

data : w_ ZGLOBAL_CODE   type ZFINAL_DATA -ZGLOBAL_CODE .

  w_ ZGLOBAL_CODE = w_lfinr.

UPDATE ZFINAL_DATA  SET ZDATE_FLAG = SPACE 
where ZGLOBAL_CODE  = w_ ZGLOBAL_CODE .
if sy-subrc  = 0.
  commit work.
else.
  roll back.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:56:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559415#M1268676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T17:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559416#M1268677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhudas,&lt;/P&gt;&lt;P&gt;                     Tnks for quick responce .My LFA1 has lakhs of vendors , so i need to do same validation in the Update statment.so let me that possiblites.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559416#M1268677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559417#M1268678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sriram,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data : begin of t_lfa1 occurs 0,
             lifnr type lfa1-lifnr,
        end of t_lfa1.

SELECT  LIFNR FROM LFA1  into table t_lfa1 WHERE KTOKK = 'ZLIE' .
 
data : w_ ZGLOBAL_CODE   type ZFINAL_DATA -ZGLOBAL_CODE .

loop at t_lfal. 

   w_ ZGLOBAL_CODE = t_lfa1-lifnr.
 
   UPDATE ZFINAL_DATA  SET ZDATE_FLAG = SPACE 
          where ZGLOBAL_CODE  = w_ ZGLOBAL_CODE .
        if sy-subrc  = 0.
           commit work.
       else.
         roll back.
        endif.
 endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559417#M1268678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559418#M1268679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;                  I am searching the possiblites which i can do validtion in update statment itslef , instead of writing seperate query on LFA1 trable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:11:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559418#M1268679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559419#M1268680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you cannot do validation on update query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;validation is nothing but sucess commit work not sucess no record exists rollback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you need to read the table ZFINAL_DATA with SET ZDATE_FLAG ne sapce&lt;/P&gt;&lt;P&gt;            with select query and cross check with LFal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559419#M1268680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559420#M1268681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Hw can i use more than one WHERE condtion in UPDATE statment....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559420#M1268681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559421#M1268682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but do not use and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same as read put sapce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example :--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE ZFINAL_DATA  SET ZDATE_FLAG = SPACE &lt;/P&gt;&lt;P&gt;          where ZGLOBAL_CODE  = w_ ZGLOBAL_CODE &lt;/P&gt;&lt;P&gt;                   ZDATE_FLAG  ne SPACE  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just keep on adding field in where condition but dont put and operator inbetween the two fields...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on May 20, 2009 12:04 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559421#M1268682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T18:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: problem in update statment when using where condtion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559422#M1268683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sriram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look into the logic of the below query. Maybe this will fulfil the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:	BEGIN OF lt_lifnr,&lt;/P&gt;&lt;P&gt;	    lifnr TYPE lifnr,&lt;/P&gt;&lt;P&gt;	END OF lt_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: 	la_lifnr TYPE TABLE OF lt_lifnr,&lt;/P&gt;&lt;P&gt;       wa_zfinal_data TYPE zfinal_data,&lt;/P&gt;&lt;P&gt;       la_zfinal_data TYPE TABLE OF zfinal_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: zfinal_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lifnr&lt;/P&gt;&lt;P&gt;FROM lfa1&lt;/P&gt;&lt;P&gt;INTO TABLE la_lifnr&lt;/P&gt;&lt;P&gt;WHERE ktokk = 'ZLIE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT la_lifnr BY lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM zfinal_data &lt;/P&gt;&lt;P&gt;INTO TABLE la_zfinal_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT la_zfinal_data INTO wa_zfinal_data.&lt;/P&gt;&lt;P&gt;  READ TABLE la_lifnr WITH KEY lifnr = wa_zfinal_data-zglobal_code&lt;/P&gt;&lt;P&gt;                      BINARY SEARCH TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    wa_zfinal_data-zdate_flag = space.&lt;/P&gt;&lt;P&gt;    MODIFY la_zfinal_data&lt;/P&gt;&lt;P&gt;    FROM wa_zfinal_data&lt;/P&gt;&lt;P&gt;    INDEX sy-tabix &lt;/P&gt;&lt;P&gt;    TRANSPORTING zdate_flag.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY zfinal_data FROM TABLE la_zfinal_data.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 07:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-update-statment-when-using-where-condtion/m-p/5559422#M1268683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T07:52:13Z</dc:date>
    </item>
  </channel>
</rss>

