<?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: CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703721#M2018544</link>
    <description>&lt;P&gt;you can use modify statement, which will internally check the entries before inserting into custom table zcustomer.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Modify zcustomer from ls_customer.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Feb 2023 10:27:26 GMT</pubDate>
    <dc:creator>shantraj6</dc:creator>
    <dc:date>2023-02-20T10:27:26Z</dc:date>
    <item>
      <title>CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703718#M2018541</link>
      <description>&lt;P&gt;I want to check if a record already exist in a table ( zcustomer ) by using it's primary key ( zzcustomer_no) before inserting a new record from the structure table ls_customer to actual table zcustomer. how do i do that?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 09:48:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703718#M2018541</guid>
      <dc:creator>muzizimele</dc:creator>
      <dc:date>2023-02-20T09:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703719#M2018542</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You can use the code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE @abap_true
       FROM scarr
       WHERE carrid = @carrier
       INTO @DATA(exists).

IF exists = abap_true.
  cl_demo_output=&amp;gt;display( |Carrier { carrier } exists in SCARR| ).
ELSE.
  cl_demo_output=&amp;gt;display( |Carrier { carrier } does not exist in SCARR| ).
ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can also check the following blog from &lt;SPAN class="mention-scrubbed"&gt;keller.m&lt;/SPAN&gt;  - &lt;A href="https://blogs.sap.com/2019/10/06/the-x-in-the-select-statement/"&gt;the ‘X’ in the select statement&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 09:54:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703719#M2018542</guid>
      <dc:creator>akmal1216</dc:creator>
      <dc:date>2023-02-20T09:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703720#M2018543</link>
      <description>&lt;P&gt;Just read any already existing record with a simple SELECT statement.  (or use a dirty ACCEPTING DUPLICATE KEYS or a dirty MODIFY)&lt;/P&gt;&lt;P&gt;But first check duplicate records in the internal table.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 09:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703720#M2018543</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-02-20T09:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703721#M2018544</link>
      <description>&lt;P&gt;you can use modify statement, which will internally check the entries before inserting into custom table zcustomer.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Modify zcustomer from ls_customer.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Feb 2023 10:27:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703721#M2018544</guid>
      <dc:creator>shantraj6</dc:creator>
      <dc:date>2023-02-20T10:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: CHECKING FOR EXISTING FIELD IN TABLE BEFORE INSERTING NEW DATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703722#M2018545</link>
      <description>&lt;P&gt;The main question is...?&lt;/P&gt;&lt;P&gt;If you need to check if a record exists, the SELECT SINGLE option (as  &lt;SPAN class="mention-scrubbed"&gt;akmal1216&lt;/SPAN&gt; suggested) is the way to go. It's irrelevant WHY you want to check it.&lt;/P&gt;&lt;P&gt;If you need to check it because it's giving you an error while INSERTing, then you must think your process' requirements. What the customer asked for? If you don't care about the existing data, go for a MODIFY (as  &lt;SPAN class="mention-scrubbed"&gt;shantraj&lt;/SPAN&gt; said), but it's a very dirty thing to do (as   &lt;SPAN class="mention-scrubbed"&gt;raymond.giuseppi&lt;/SPAN&gt; points).&lt;/P&gt;&lt;P&gt;But the main problem here is your question.&lt;/P&gt;&lt;P&gt;And I will not point at the use of CAPS in the subject...&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 11:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-existing-field-in-table-before-inserting-new-data/m-p/12703722#M2018545</guid>
      <dc:creator>VXLozano</dc:creator>
      <dc:date>2023-02-21T11:21:54Z</dc:date>
    </item>
  </channel>
</rss>

