<?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: Update/Replace table AGR_1252 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314352#M4479</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please guide for this query ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2016 05:49:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-11-18T05:49:54Z</dc:date>
    <item>
      <title>Update/Replace table AGR_1252</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314351#M4478</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;My excel file has below columns.&lt;/P&gt;&lt;P&gt;Role                                                     ,      Org level ,  Low   ,  High   ,  Replace , New&lt;/P&gt;&lt;P&gt;TEST_GOODS_MVMT_OUT_PROC  ,    $EKORG  ,  D400 ,           ,       *         ,  D800&lt;/P&gt;&lt;P&gt;TEST_GOODS_MVMT_OUT_PROC  ,      $EKORG  ,  D300   ,             ,     *          ,  D600&lt;/P&gt;&lt;P&gt;Existing value in low field will get replaced with value from New column field when there is *&lt;/P&gt;&lt;P&gt;But my code is replacing and creating new record in AGR_1252&lt;/P&gt;&lt;P&gt;FORM GET_AUTH.&lt;BR /&gt;
&lt;BR /&gt;
 CLEAR t_report.&lt;BR /&gt;
 t_report-agr_name = t_file_itab-role.&lt;BR /&gt;&lt;BR /&gt;
 LOOP AT t_itab.&lt;BR /&gt;
 LOOP AT T_FILE_ITAB.&lt;BR /&gt;
&lt;BR /&gt;
 IF t_itab-field5 eq '*'.&lt;BR /&gt;UPDATE AGR_1252 SET: low = t_itab-field6&lt;BR /&gt;
 WHERE agr_name = t_itab-field1 AND varbl = t_itab-field2 AND low = t_itab-field3.&lt;BR /&gt;
&lt;BR /&gt;
 t_report-text = text-l03.&lt;BR /&gt;
 t_report-lights = '3'. "Green if successful&lt;BR /&gt;
 APPEND t_report.&lt;BR /&gt;&lt;BR /&gt;
 ELSEIF t_itab-field5 ne '*'.&lt;BR /&gt;
&lt;BR /&gt;
 SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_T_AGR_1252 FROM AGR_1252.&lt;BR /&gt;
&lt;BR /&gt;
 IF NOT IT_T_AGR_1252 IS INITIAL.&lt;BR /&gt;
 IF NOT T_FILE_ITAB IS INITIAL.&lt;BR /&gt;&lt;BR /&gt;
 READ TABLE IT_T_AGR_1252 INTO WA_T_AGR_1252 WITH KEY AGR_NAME = T_FILE_ITAB-ROLE VARBL = T_FILE_ITAB-ORGLEVEL LOW = T_FILE_ITAB-LOW.&lt;BR /&gt;
 IF sy-subrc eq 0.&lt;BR /&gt;
 DELETE T_FILE_ITAB WHERE ROLE = T_FILE_ITAB-ROLE AND ORGLEVEL = T_FILE_ITAB-ORGLEVEL AND LOW = T_FILE_ITAB-LOW.&lt;BR /&gt;
 t_report-text = text-l05.&lt;BR /&gt;
 t_report-lights = '2'. "Yellow if same&lt;BR /&gt;
 APPEND t_report.&lt;BR /&gt;
 ENDIF.&lt;BR /&gt;
&lt;BR /&gt;
 ENDIF.&lt;BR /&gt;
 ENDIF.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;BR /&gt;
 ENDLOOP.&lt;/P&gt;&lt;P&gt;Please guide me why the elseif  condition is not working properly.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314351#M4478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-17T06:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update/Replace table AGR_1252</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314352#M4479</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please guide for this query ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 05:49:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314352#M4479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-18T05:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update/Replace table AGR_1252</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314353#M4480</link>
      <description>&lt;P&gt;What are you asking exactly?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF t_itab-field5 eq '*'.&lt;BR /&gt;...&lt;BR /&gt;ELSEIF t_itab-field5 ne '*'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is the same as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF t_itab-field5 eq '*'.&lt;BR /&gt;  ...&lt;BR /&gt;ELSE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Why shouldn't it work?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 07:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314353#M4480</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-11-18T07:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update/Replace table AGR_1252</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314354#M4481</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;My IF t_itab-field5 eq '*'.  part is for replacing AGR_1252 table for ORGLEVEL low value. &lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;Elseif &lt;/P&gt;&lt;P&gt;will update(add) new value&lt;/P&gt;&lt;P&gt;But in my above code when I upload the excel with * and low value to be replaced, it replaces the current role for orglevel low value with new value and then it also adds the new record.&lt;/P&gt;&lt;P&gt;Meaning in one go if and elseif condition us being executing.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 08:57:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-replace-table-agr-1252/m-p/314354#M4481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-18T08:57:07Z</dc:date>
    </item>
  </channel>
</rss>

