<?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: FM / BAPI for cheching time collusion? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250814#M1527540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benjamin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you just wanting to check if there is a collision or do you need to determine how long there is a collision?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,   Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Sep 2010 18:18:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-11T18:18:16Z</dc:date>
    <item>
      <title>FM / BAPI for cheching time collusion?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250813#M1527539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i´m looking for a function, that checks two date&amp;amp;time pairs for a collusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pair 1      -   Begin Date is 29.09.2010 time 10:00 End Date is 30.09.2010 time 22:00&lt;/P&gt;&lt;P&gt;Pair 2      -   Begin Date is 30.09.2010 time 21:30 End Date is 01.10.2010 time 23:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the two pairs collide on 30.09.2010 at 21:30 for half an our.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know a function which can handle this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Points guaranted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 16:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250813#M1527539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-11T16:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: FM / BAPI for cheching time collusion?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250814#M1527540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benjamin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you just wanting to check if there is a collision or do you need to determine how long there is a collision?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,   Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 18:18:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250814#M1527540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-11T18:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: FM / BAPI for cheching time collusion?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250815#M1527541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Benjamin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I needed to do a FM to check this issue once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION zhrf030.
*"----------------------------------------------------------------------
*"*"Interface local:
*"  IMPORTING
*"     REFERENCE(I_REGEXIS) TYPE  ZHRST035
*"     REFERENCE(I_REGCRIA) TYPE  ZHRST035
*"  EXCEPTIONS
*"      COLLISION_FOUND
*"----------------------------------------------------------------------

* Declaração das variáveis locais
  DATA: vl_subrc TYPE sysubrc VALUE 1.

* Validação do Período do Novo Registro
  IF ( ( i_regcria-begda GT i_regexis-endda )                        OR
       ( i_regcria-endda LT i_regexis-begda )                        OR
       ( ( i_regcria-begda EQ i_regexis-endda ) AND
         ( i_regcria-beguz GE i_regexis-enduz   AND
         ( i_regexis-enduz IS NOT INITIAL AND i_regexis-enduz NE space )
                                                                  ) ) OR
         ( i_regcria-endda EQ i_regexis-begda ) AND
         ( i_regcria-enduz LE i_regexis-beguz   AND
         ( i_regcria-enduz IS NOT INITIAL AND i_regcria-enduz NE space
)
                                                                   ) ) .
    CLEAR vl_subrc.
  ENDIF.

* Verifica se o registro está OK
  IF vl_subrc IS NOT INITIAL.
    RAISE collision_found.
  ENDIF.
ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kleber Santos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 18:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250815#M1527541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-11T18:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: FM / BAPI for cheching time collusion?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250816#M1527542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benjamin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no standard functionm to handle this, but you could create one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to have it more transparent in easier to understand, convert all Date/time pairs to timestamp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
    lv_timestamp1  TYPE timestamp,
    lv_timestamp2  TYPE timestamp,
    lv_timestamp3  TYPE timestamp,
    lv_timestamp4  TYPE timestamp,
  CONVERT DATE iv_date1 TIME iv_time1 INTO TIME STAMP lv_timestamp1 TIME ZONE sy-zonlo.
  CONVERT DATE iv_date2 TIME iv_time2 INTO TIME STAMP lv_timestamp2 TIME ZONE sy-zonlo.
  CONVERT DATE iv_date3 TIME iv_time3 INTO TIME STAMP lv_timestamp3 TIME ZONE sy-zonlo.
  CONVERT DATE iv_date4 TIME iv_time4 INTO TIME STAMP lv_timestamp4 TIME ZONE sy-zonlo.
if lv_timestamp1 &amp;gt; lv_timestamp2 or
   lv_timestamp3 &amp;gt; lv_timestamp4.
* raise exception invalid date/time
endif.
  CALL FUNCTION 'IGN_TIMESTAMP_DIFFERENCE'
    EXPORTING
      i_timestamp1 = lv_timestamp2
      i_timestamp2 = lv_timestamp3
    IMPORTING
      E_DIFF_SECS = rv_n_of_seconds.
if rv_n_of_seconds &amp;lt; 0.
*  * raise exception date/time range collision
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 20:44:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-bapi-for-cheching-time-collusion/m-p/7250816#M1527542</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-09-11T20:44:55Z</dc:date>
    </item>
  </channel>
</rss>

