<?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: Table Maintenance Event Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122908#M1618577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not so clear with your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there should not be Overlapping of dates for the Same Depo + Material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this can be solved by adding one more key fields which makes the entry unique for a Materlal &amp;amp; Depo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2011 08:52:05 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2011-09-06T08:52:05Z</dc:date>
    <item>
      <title>Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122907#M1618576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table has structue  :  Material  --- Depo --- Start Date --- End Date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During Maintenance of table , there should not be Overlapping of dates for the Same Depo + Material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this , I am using event 05.  But the problem is, it is copying the last entry read during the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first time i enter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1  -  DDPL --   1.1.2011 -- 31.12.2011 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so it will create. now I enter second entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 -- DDPL -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; 1.1.2011 -- 31.12.2011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but what I see in the table control is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1  -  DDPL --   1.1.2011 -- 31.12.2011 &lt;/P&gt;&lt;P&gt;2 -- DDPL -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; 1.1.2011 -- 31.12.2011.&lt;/P&gt;&lt;P&gt;1  -  DDPL --   1.1.2011 -- 31.12.2011  -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; Incorrect &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So its appending the last entry read . Similarly For more new entries It is showing similar behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is code written for event 05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; DATA : lt_passage TYPE TABLE OF zTable,
       wa_passage type zTable.
FIELD-SYMBOLS: &amp;lt;fs_prd&amp;gt; type any.
FIELD-SYMBOLS: &amp;lt;fs_depo&amp;gt; type any.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
lOOP at total.
if &amp;lt;action&amp;gt; = NEUER_EINTRAG. " N--&amp;gt; New entry
READ TABLE EXTRACT WITH KEY &amp;lt;vim_xtotal_key&amp;gt;.
IF SY-SUBRC EQ 0.
F_INDEX = SY-TABIX.
ELSE.
CLEAR F_INDeX.
ENDIF.
IF F_INDEX &amp;lt;&amp;gt; 0.
ASSIGN COMPONENT 'MATERIAL' of STRUCTURE  &amp;lt;vim_total_struc&amp;gt; to &amp;lt;fs_prd&amp;gt;.
ASSIGN COMPONENT 'DEPO' of STRUCTURE  &amp;lt;vim_total_struc&amp;gt; to &amp;lt;fs_depo&amp;gt;.
if &amp;lt;fs_prd&amp;gt; = zTable-PRODUCT AND
   &amp;lt;fs_depo&amp;gt; = zTable-WAREHOUSE.
  
*** code to compare Overlapping of Dates  
endif.
ENdIF.
endif.
CLEAR : total,&amp;lt;vim_xtotal_key&amp;gt;,&amp;lt;vim_total_struc&amp;gt;.
ENDLOOP.
CLEAR : total,&amp;lt;vim_xtotal_key&amp;gt;,&amp;lt;vim_total_struc&amp;gt; . &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Jitendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 08:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122907#M1618576</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-09-06T08:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122908#M1618577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not so clear with your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there should not be Overlapping of dates for the Same Depo + Material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this can be solved by adding one more key fields which makes the entry unique for a Materlal &amp;amp; Depo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 08:52:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122908#M1618577</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-09-06T08:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122909#M1618578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jitendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;DEL&gt;If you make the Material&lt;EM&gt;Depo&lt;/EM&gt;Start Date as key fields, you cannot have overlapping periods&lt;/DEL&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry for this &lt;STRONG&gt;senseless&lt;/STRONG&gt; answer &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Sep 6, 2011 2:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 09:18:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122909#M1618578</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-06T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122910#M1618579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here keys are not a issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the same Depo + Material Dats should not overlap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mateial --  Depo --- Star date -- Enddate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 ---  DDPL ---  01.01.2011 -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;   31.08.2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1--  DDPL -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  08.08.2011 --  31.12.2011 -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&amp;gt; this is invalid entry becoz from 08.08.2011 to 31.08.2011 is already covered  in &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first entry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jitendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 09:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122910#M1618579</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-09-06T09:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122911#M1618580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jitendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mateial -- Depo --- Star date -- Enddate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 --- DDPL --- 01.01.2011 -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; 31.08.2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-- DDPL -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; 08.08.2011 -- 31.12.2011 -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&amp;gt; this is invalid entry becoz from 08.08.2011 to 31.08.2011 is already covered in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case what should be SAP's response? Throw an error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N.B.: In the event 05, the system internal tables TOTAL &amp;amp; EXTRACT are not updated. You can use the fields of the table directly e.g., ZTABLE-FIELDNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA: lt_zdelimit TYPE SORTED TABLE OF zdelimit
                    WITH NON-UNIQUE KEY matnr depo.

  FIELD-SYMBOLS: &amp;lt;lwa_zdelimit&amp;gt; TYPE zdelimit.

* Fetch the recs from the table
  SELECT * FROM zdelimit
    INTO TABLE lt_zdelimit
    WHERE matnr = zdelimit-matnr "Material Number
    AND   depo  = zdelimit-depo. "Depo
  IF sy-subrc = 0.
    LOOP AT lt_zdelimit ASSIGNING &amp;lt;lwa_zdelimit&amp;gt;.
*     Check if the i/p is overlapping with another period
      IF &amp;lt;lwa_zdelimit&amp;gt;-start_dt LE zdelimit-end_dt AND
         &amp;lt;lwa_zdelimit&amp;gt;-end_dt   GE zdelimit-start_dt.
        MESSAGE 'Overlapping periods. Correct your entry' TYPE 'E'.
      ENDIF.
    ENDLOOP.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Sep 6, 2011 3:25 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Sep 6, 2011 3:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 09:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122911#M1618580</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-06T09:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122912#M1618581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused ..Suppose if the user enters 2 records without hitting an enter key and just hits the save button to save it...Will this code part execute correctly ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose that event 05 triggers with a enter key action...Is this correct ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about event 01..I think we should consider this event also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 10:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122912#M1618581</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-09-06T10:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122913#M1618582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks For your Help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes. it should throw an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked , in event 05, system internal tables TOTAL &amp;amp; EXTRACT are  &lt;STRONG&gt;updated&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use fields of table name directly, It will give me contents of the row currently being entered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have to do is , I have to compare this entry with other entries entered(not saved) + Database entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code given by you ,compares current entry with  Database entries ( it should also consider other entries entered but not &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAVED).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jitendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 10:32:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122913#M1618582</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-09-06T10:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122914#M1618583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jitendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I have checked , in event 05, system internal tables TOTAL &amp;amp; EXTRACT are updated .&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked now &amp;amp; i don't find the new entries being updated in TOTAL. The table EXTRACT contains only the initial records. This does confirm to the SAP documentation on [Event 05|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f1aa9d111d1a5690000e82deaaa/content.htm].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;What I have to do is , I have to compare this entry with other entries entered(not saved) + Database entries.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In this case you got to use the Event 01 &amp;amp; not 05! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 10:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122914#M1618583</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-06T10:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122915#M1618584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current entry will not update in TOTAL &amp;amp; EXTRACT, but entries entered previous than this entry, are updated in those tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the current entry, I  can directly use Table name and compare it with previous entries in table TOTAL &amp;amp; EXTRACT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It a requiremnt that this checking should take place once use press enter  So i have to use 05 only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Jitendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 11:39:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122915#M1618584</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-09-06T11:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122916#M1618585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jitendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_helper DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS check_db_data
    RETURNING value(ex_err) TYPE flag.
ENDCLASS.                    "lcl_helper DEFINITION
*----------------------------------------------------------------------*
*       CLASS lcl_helper IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_helper IMPLEMENTATION.

  METHOD check_db_data.

    DATA: lt_zdelimit TYPE SORTED TABLE OF zdelimit
                      WITH NON-UNIQUE KEY matnr depo.

    FIELD-SYMBOLS: &amp;lt;lwa_zdelimit&amp;gt; TYPE zdelimit.

* Fetch the recs from the table
    SELECT * FROM zdelimit
      INTO TABLE lt_zdelimit
      WHERE matnr = zdelimit-matnr "Material Number
      AND   depo  = zdelimit-depo. "Depo
    IF sy-subrc = 0.
      LOOP AT lt_zdelimit ASSIGNING &amp;lt;lwa_zdelimit&amp;gt;.
*       Check if the i/p is overlapping with another period
        IF &amp;lt;lwa_zdelimit&amp;gt;-start_dt LE zdelimit-end_dt AND
           &amp;lt;lwa_zdelimit&amp;gt;-end_dt   GE zdelimit-start_dt.
          ex_err = 'X'.
        ENDIF.
      ENDLOOP.
    ENDIF.

  ENDMETHOD.                    "check_db_data

ENDCLASS.                    "lcl_helper IMPLEMENTATION

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ZDELIMIT_EVT_05
*&amp;amp;---------------------------------------------------------------------*
*       Event 05
*----------------------------------------------------------------------*
FORM zdelimit_evt_05.

  STATICS: lv_run_flag TYPE flag.

  DATA: lt_zdelimit TYPE SORTED TABLE OF zdelimit
                    WITH NON-UNIQUE KEY matnr depo.

  FIELD-SYMBOLS: &amp;lt;matnr&amp;gt;     TYPE matnr,
                 &amp;lt;depo&amp;gt;      TYPE lgort_d,
                 &amp;lt;start_dt&amp;gt;  TYPE d,
                 &amp;lt;end_dt&amp;gt;    TYPE d.

  BREAK-POINT.

  IF lv_run_flag IS INITIAL.

    lv_run_flag = 'X'. "Idea is to check for multiple "new" recs

*   Step 1. Check existing DB recs
    IF lcl_helper=&amp;gt;check_db_data( ) = 'X'.
      MESSAGE 'Overlapping periods found in the table' TYPE 'E'.
    ENDIF.

*   Step 2. Check other "new" records
*   TOTAL &amp;amp; EXTRACT tables are not updated in the first run, will check
*   in subsequent runs
  ELSE.

*   Step 1. Check existing DB recs
    IF lcl_helper=&amp;gt;check_db_data( ) = 'X'.
      MESSAGE 'Overlapping periods found in the table' TYPE 'E'.
    ENDIF.

*   Step 2. Check other "new" records
    LOOP AT total.

      IF &amp;lt;action&amp;gt; = neuer_eintrag. " N--&amp;gt; New entry.
        ASSIGN COMPONENT:
          'MATNR' OF STRUCTURE &amp;lt;vim_total_struc&amp;gt; TO &amp;lt;matnr&amp;gt;,
          'DEPO'  OF STRUCTURE &amp;lt;vim_total_struc&amp;gt; TO &amp;lt;depo&amp;gt;.

        CHECK &amp;lt;matnr&amp;gt; = zdelimit-matnr AND &amp;lt;depo&amp;gt; = zdelimit-depo.

        ASSIGN COMPONENT:
          'START_DT' OF STRUCTURE &amp;lt;vim_total_struc&amp;gt; TO &amp;lt;start_dt&amp;gt;,
          'END_DT'   OF STRUCTURE &amp;lt;vim_total_struc&amp;gt; TO &amp;lt;end_dt&amp;gt;.

*       Check if the i/p is overlapping with another period
        IF &amp;lt;start_dt&amp;gt; LE zdelimit-end_dt AND
           &amp;lt;end_dt&amp;gt;   GE zdelimit-start_dt.
          MESSAGE 'Overlapping periods found in user input' TYPE 'E'.
        ENDIF.
      ENDIF.

    ENDLOOP.

  ENDIF.

ENDFORM.                    "ZDELIMIT_EVT_05&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 12:44:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122916#M1618585</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-06T12:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122917#M1618586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i have done some changes. I have removed &amp;lt;action&amp;gt; = neuer_eintrag condition and also we dont need to fetch data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;database as data exists in database will automatically filled in TOTAL table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still confused between EXTRACT and TOTAL table as they have same data. what is difference between them ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jitendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 06:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122917#M1618586</guid>
      <dc:creator>jitendra_it</dc:creator>
      <dc:date>2011-09-07T06:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Table Maintenance Event Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122918#M1618587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jitendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOTAL -&amp;gt; Contains all the data in the table - new, existing(unchanged), changed, deleted(you can check this in Event 01)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXTRACT -&amp;gt; This is a subset of TOTAL &amp;amp; contains the data which is displayed. I've never checked this, but may be in 2-step maintenance you'll appreciate the difference between TOTAL &amp;amp; EXTRACT!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read the SAP documentation on these tables for further details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;also we dont need to fetch data from database as data exists in database will automatically filled in TOTAL table.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then TOTAL contains all the records(as mentioned above), so in order to check the existence of the record i've to LOOP on TOTAL everytime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP'ing on TOTAL for every "new" record may give performance hiccups. So i thought it'll better to select data directly from the DB based on the material + depot combination! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 07:16:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-event-problem/m-p/8122918#M1618587</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-07T07:16:18Z</dc:date>
    </item>
  </channel>
</rss>

