<?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 ABAP HR code . in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857645#M1475202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With &lt;STRONG&gt;provide&lt;/STRONG&gt; statement you get a &lt;EM&gt;join&lt;/EM&gt; made on querying tables, which means there are new periods created as a result of all the records from these tables. Please refer the below for example&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
P0000 
'----first_record----'--------second record------------'.
P0001
'--first rec---'------sec.rec.----------'------third rec---'.


Result in provide
'--first-------'--sec-'----third---------'------fourth------'
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So in your example you got different results in &lt;EM&gt;provide&lt;/EM&gt; as this is simply a join of all these tables. That's why you see something different from what is in the system (or tables themselves). If you wan to have exact records as they appear in the system use &lt;EM&gt;loop&lt;/EM&gt; instead, but &lt;EM&gt;provide&lt;/EM&gt; gives the opportunity to identify these small chunks of data where records overlaps in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 May 2010 07:03:40 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2010-05-10T07:03:40Z</dc:date>
    <item>
      <title>Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857644#M1475201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hae written below code in abap hr ,when executed it gives wrong data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : PERNR.&lt;/P&gt;&lt;P&gt;infotypes : 0000,0001,0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get PERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROVIDE *   FROM p0000&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FROM P0001&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FROM P0002&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BETWEEN PN-BEGDA AND PN-ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;write : / p0000-begda , p0001-begda, p0002-begda .&lt;/P&gt;&lt;P&gt;endprovide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know what the issue is . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the above output dates from write statement are incorrect.&lt;/P&gt;&lt;P&gt;In the selection criteria, i have given only the emloyee number .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 06:18:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857644#M1475201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-10T06:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857645#M1475202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With &lt;STRONG&gt;provide&lt;/STRONG&gt; statement you get a &lt;EM&gt;join&lt;/EM&gt; made on querying tables, which means there are new periods created as a result of all the records from these tables. Please refer the below for example&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
P0000 
'----first_record----'--------second record------------'.
P0001
'--first rec---'------sec.rec.----------'------third rec---'.


Result in provide
'--first-------'--sec-'----third---------'------fourth------'
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So in your example you got different results in &lt;EM&gt;provide&lt;/EM&gt; as this is simply a join of all these tables. That's why you see something different from what is in the system (or tables themselves). If you wan to have exact records as they appear in the system use &lt;EM&gt;loop&lt;/EM&gt; instead, but &lt;EM&gt;provide&lt;/EM&gt; gives the opportunity to identify these small chunks of data where records overlaps in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 07:03:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857645#M1475202</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-05-10T07:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857646#M1475203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post your requirement... if Requirement is there people can guide you better.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes thats not a best practice infact ....Try with 2 inner joins you can understand the diffenrence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try by passing PN-BEGDA = PN-ENDDA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 08:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857646#M1475203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-10T08:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857647#M1475204</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 currently giving employee number and &lt;STRONG&gt;dates in PN-BEGDA AND PN-ENDDA.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Even then i am getting wrong output.&lt;/P&gt;&lt;P&gt;I have written write statement ,  p0001-begda &amp;amp; p0002-begda both displays same date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PERNR.&lt;/P&gt;&lt;P&gt;INFOTYPES: 0001, "Organizational Assignment&lt;/P&gt;&lt;P&gt;0002, "Personal Data&lt;/P&gt;&lt;P&gt;0006. "Addresses&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;PROVIDE * FROM P0001&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FROM P0002&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;BETWEEN PN-BEGDA AND PN-ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / p0001-begda , p0002-begda.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDPROVIDE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 06:44:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857647#M1475204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-12T06:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857648#M1475205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will receive that result. Within &lt;EM&gt;PROVIDE ... ENDPROVIDE&lt;/EM&gt; begda and endda of all the table entries will be restrcited to given dates &lt;EM&gt;PN-BEGDA&lt;/EM&gt; and &lt;EM&gt;PN-ENDDA&lt;/EM&gt; .&lt;/P&gt;&lt;P&gt;So if you have period&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PN-BEGDA = 01.04.2010
PN-ENDDA = 31.04.2010
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you have entries in tables like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
P0001: 06.03.2008 - 31.12.9999
P0002: 07.04.2009 - 06.04.2010,  07.04.2010 - 31.12.9999
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the both table &lt;EM&gt;begda&lt;/EM&gt; and &lt;EM&gt;eddna&lt;/EM&gt; will be restrcited to period given in &lt;EM&gt;pn-begda&lt;/EM&gt; and &lt;EM&gt;pn-endda&lt;/EM&gt; like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
P0001: 01.04.2010  - 31.04.2010
P0002: 01.04.2010 -  06.04.2010, 07.04.2010 - 31.04.2010
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which means that the records in p0001 and p0002 are &lt;STRONG&gt;bound&lt;/STRONG&gt; to dates given in &lt;STRONG&gt;between&lt;/STRONG&gt; . This is beacause the system assumes you are interested only in that period, so it provides you only the actuall state of employee within that period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 06:57:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857648#M1475205</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-05-12T06:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857649#M1475206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;table: pa0000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDA      BEGDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;31.12.2004                 15.11.2004&lt;/P&gt;&lt;P&gt;14.11.2005                 01.01.2005&lt;/P&gt;&lt;P&gt;27.08.2007                15.11.2005&lt;/P&gt;&lt;P&gt;31.03.2009                28.08.2007&lt;/P&gt;&lt;P&gt;14.09.2009                 01.04.2009&lt;/P&gt;&lt;P&gt;31.12.9999                   15.09.2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table : pa0001&lt;/P&gt;&lt;P&gt;31.12.2004                   15.11.2004&lt;/P&gt;&lt;P&gt;14.11.2005                     01.01.2005&lt;/P&gt;&lt;P&gt;27.08.2007                   15.11.2005&lt;/P&gt;&lt;P&gt;31.03.2009                   28.08.2007&lt;/P&gt;&lt;P&gt;14.09.2009                  01.04.2009&lt;/P&gt;&lt;P&gt;31.12.9999                   15.09.2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table : pa0002 &lt;/P&gt;&lt;P&gt;pernr                  endda                              begda &lt;/P&gt;&lt;P&gt;00001111           31.12.9999                  20.01.1989&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT DISTINCT a&lt;SUB&gt;pernr a&lt;/SUB&gt;sname a&lt;SUB&gt;ename a&lt;/SUB&gt;begda a~endda&lt;/P&gt;&lt;P&gt;                    b&lt;SUB&gt;stat2 b&lt;/SUB&gt;massn b~massg&lt;/P&gt;&lt;P&gt;                    c&lt;SUB&gt;gbdat c&lt;/SUB&gt;begda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     into TABLE itab_emp&lt;/P&gt;&lt;P&gt;    FROM ( ( pa0001 AS a&lt;/P&gt;&lt;P&gt;               INNER JOIN pa0000 AS b ON a&lt;SUB&gt;pernr = b&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;               INNER JOIN pa0002 AS c ON a&lt;SUB&gt;pernr = c&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;    WHERE a~pernr = 1111&lt;/P&gt;&lt;P&gt;    AND b~massn &amp;lt;&amp;gt; '03'&lt;/P&gt;&lt;P&gt;    AND a~begda &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;    AND a~endda &amp;gt;= sy-datum&lt;/P&gt;&lt;P&gt;    AND b~begda &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;    AND b~endda &amp;gt;= sy-datum&lt;/P&gt;&lt;P&gt;    AND c~endda = '99991231'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output : &lt;/P&gt;&lt;P&gt;pernr           pa0001-begda           pa0001-endda           pa0002-begda&lt;/P&gt;&lt;P&gt;00001111   15.09.2009             31.12.9999                   20.01.1989&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the above select statement i am getting the proper output . &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can i achieve the same using provide endprovide .&lt;/STRONG&gt;&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;Rachel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rachel on May 12, 2010 12:13 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 10:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857649#M1475206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-12T10:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ABAP HR code .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857650#M1475207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want it like that then &lt;EM&gt;provide&lt;/EM&gt; statment does not make sense here. You can simply use &lt;EM&gt;loop&lt;/EM&gt; to achieve that, but with &lt;EM&gt;provide&lt;/EM&gt; you won't get that result. It's for different purpose.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES: pernr.
INFOTYPES: 0001,
0002.

GET pernr.
  LOOP AT p0001 WHERE begda &amp;lt;= pn-endda
                  AND endda &amp;gt;= pn-begda.
    LOOP AT p0002 WHERE begda &amp;lt;= p0001-endda
                    AND endda &amp;gt;= p0001-begda.
      WRITE: / p0001-begda , p0001-endda,
             / p0002-begda, p0002-endda.
    ENDLOOP.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 10:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-abap-hr-code/m-p/6857650#M1475207</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-05-12T10:44:43Z</dc:date>
    </item>
  </channel>
</rss>

