<?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 Problem in HR- Abap code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200082#M1521096</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;&lt;/P&gt;&lt;P&gt;         I am writing HR Abap. I m using IF condition inside GET PERNR. As i am not givin personnel number in selection screen, it should fetch all possible persoonel number details. but in my case this loop gets termintaed if any one of the personnel number fails the if condition. But i want loop to continue to fetch other PERNR details. Please can any one help me out in this.&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;
GET pernr.
&amp;nbsp;
  IF pnpstat2-low EQ '3' OR pnpstat2-low EQ '1'.
    PERFORM get_terminatedate.
    PERFORM fetch_employee_details.
&amp;nbsp;
  ELSEIF pnpstat2-low EQ '0' OR pnpstat2-low EQ '2'.
    PERFORM get_terminatedate.

IF v_termdate LE 45.                               "This is that if condition
  PERFORM fetch_rehire USING '12'.
    IF g_rehiredate NE high-date.
      hiredate = g_rehiredate.
      wa_final-t_rehiredate = hiredate.
    ELSE.
      PERFORM fetch_rehire USING '01'.
      IF g_rehiredate NE high-date.&amp;amp;quot;endda.
        hiredate = g_rehiredate.
        wa_final-t_rehiredate = hiredate.
      ENDIF.
    ENDIF.
    PERFORM fetch_employee_details.
  ELSE.
     MESSAGE text-001 TYPE 'E'.
   ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vanitha P on Sep 2, 2010 11:28 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Sep 2010 09:24:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-02T09:24:54Z</dc:date>
    <item>
      <title>Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200082#M1521096</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;&lt;/P&gt;&lt;P&gt;         I am writing HR Abap. I m using IF condition inside GET PERNR. As i am not givin personnel number in selection screen, it should fetch all possible persoonel number details. but in my case this loop gets termintaed if any one of the personnel number fails the if condition. But i want loop to continue to fetch other PERNR details. Please can any one help me out in this.&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;
GET pernr.
&amp;nbsp;
  IF pnpstat2-low EQ '3' OR pnpstat2-low EQ '1'.
    PERFORM get_terminatedate.
    PERFORM fetch_employee_details.
&amp;nbsp;
  ELSEIF pnpstat2-low EQ '0' OR pnpstat2-low EQ '2'.
    PERFORM get_terminatedate.

IF v_termdate LE 45.                               "This is that if condition
  PERFORM fetch_rehire USING '12'.
    IF g_rehiredate NE high-date.
      hiredate = g_rehiredate.
      wa_final-t_rehiredate = hiredate.
    ELSE.
      PERFORM fetch_rehire USING '01'.
      IF g_rehiredate NE high-date.&amp;amp;quot;endda.
        hiredate = g_rehiredate.
        wa_final-t_rehiredate = hiredate.
      ENDIF.
    ENDIF.
    PERFORM fetch_employee_details.
  ELSE.
     MESSAGE text-001 TYPE 'E'.
   ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vanitha P on Sep 2, 2010 11:28 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 09:24:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200082#M1521096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T09:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200083#M1521097</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;   Remove the error message ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_termdate LE 45.                               "This is that if condition&lt;/P&gt;&lt;P&gt;  PERFORM fetch_rehire USING '12'.&lt;/P&gt;&lt;P&gt;    IF g_rehiredate NE high-date.&lt;/P&gt;&lt;P&gt;      hiredate = g_rehiredate.&lt;/P&gt;&lt;P&gt;      wa_final-t_rehiredate = hiredate.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      PERFORM fetch_rehire USING '01'.&lt;/P&gt;&lt;P&gt;      IF g_rehiredate NE high-date."endda.&lt;/P&gt;&lt;P&gt;        hiredate = g_rehiredate.&lt;/P&gt;&lt;P&gt;        wa_final-t_rehiredate = hiredate.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    PERFORM fetch_employee_details.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;     &lt;STRONG&gt;MESSAGE text-001 TYPE 'E'.&lt;/STRONG&gt;   &lt;STRONG&gt;&amp;lt;--  instead  write REJECT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&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;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 09:34:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200083#M1521097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T09:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200084#M1521098</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;PRE&gt;&lt;CODE&gt;
GET pernr.
 
  IF pnpstat2-low EQ '3' OR pnpstat2-low EQ '1'.
    PERFORM get_terminatedate.
    PERFORM fetch_employee_details.
 
  ELSEIF pnpstat2-low EQ '0' OR pnpstat2-low EQ '2'.
    PERFORM get_terminatedate.
    CHECK firedate GT v_termdate.     "you have to chk this statement  

IF v_termdate LE 45.                               "This is that if condition
  PERFORM fetch_rehire USING '12'.
    IF g_rehiredate NE high-date.
      hiredate = g_rehiredate.
      wa_final-t_rehiredate = hiredate.
    ELSE.
      PERFORM fetch_rehire USING '01'.
      IF g_rehiredate NE high-date."endda.
        hiredate = g_rehiredate.
        wa_final-t_rehiredate = hiredate.
      ENDIF.
    ENDIF.
    PERFORM fetch_employee_details.
  ELSE.
     MESSAGE text-001 TYPE 'E'.
   ENDIF.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ur using chk statement if the condition fail program should exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put the if condition instated of check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard&lt;/P&gt;&lt;P&gt;nawa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 09:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200084#M1521098</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2010-09-02T09:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200085#M1521099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vanitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got your problem. If you will use if else statement den it will work like that only means if any one pernr fails the condition loop will end. So better use CHECK statement there instead of giving if-else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;GET pernr.
 
  IF pnpstat2-low EQ '3' OR pnpstat2-low EQ '1'.
    PERFORM get_terminatedate.
    PERFORM fetch_employee_details.
 
  ELSEIF pnpstat2-low EQ '0' OR pnpstat2-low EQ '2'.
    PERFORM get_terminatedate.
 

 check firedate GT V_DATE .        "  Use this Check statement. 
 PERFORM fetch_rehire USING '12'.
    IF g_rehiredate NE high-date.
      hiredate = g_rehiredate.
      wa_final-t_rehiredate = hiredate.
    ELSE.
      PERFORM fetch_rehire USING '01'.
      IF g_rehiredate NE high-date."endda.
        hiredate = g_rehiredate.
        wa_final-t_rehiredate = hiredate.
      ENDIF.
    ENDIF.
    PERFORM fetch_employee_details.
  ELSE.
     MESSAGE text-001 TYPE 'E'.
   ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use one fm "RP_HIRE_FIRE" to capture fire date and then compare it with ur variable v_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Nidhi Srivastava.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 09:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200085#M1521099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T09:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200086#M1521100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is the error message which terminates the processing. The best is to either remove it or to build some error table which will hold all collected messages and at the end of processing &lt;STRONG&gt;END-OF-SELECTION&lt;/STRONG&gt; shows the EEs which were skipped because of some reason. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also avoid any messages in GET PERNR event. Imagine you are running the report for 1000 EEs and half of them has incorrect data. Would you like to see all those 500 messages? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you persist on the message write it like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
message text-001 type 'S' display like 'E'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This way you get the message and are able to process furhter.&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>Thu, 02 Sep 2010 09:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200086#M1521100</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-09-02T09:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in HR- Abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200087#M1521101</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;       Thanks for ur answers. I m using CHECK but not using if-else. &lt;/P&gt;&lt;P&gt;       By de way i m already using tat FM to get &lt;STRONG&gt;firedate&lt;/STRONG&gt; in one perform. Now its workin fine.&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;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;    Vanitha P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 09:42:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-hr-abap-code/m-p/7200087#M1521101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T09:42:41Z</dc:date>
    </item>
  </channel>
</rss>

