<?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: Calling FM in a loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695962#M1451820</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;You can see in transaction SU53 authorization problem for specific user and give him required authorization. &lt;/P&gt;&lt;P&gt;Just run it after your function run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Yossi Rozenberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Mar 2010 20:49:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-15T20:49:53Z</dc:date>
    <item>
      <title>Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695956#M1451814</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 have created a custom FM- Z_HRGPBS_ME_P46_DAYS_ACTIVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i test it for 1 employee it gives me correct result...then if i green arrow back and test for second employtee it gives me incorrect result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly if i use this FM in a loop where it has to process for multiple employees, it give me incorrect result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me correct this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 17:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695956#M1451814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T17:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695957#M1451815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clear your global variables in the FM before doing anything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 17:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695957#M1451815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T17:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695958#M1451816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code in this FM. Export parameter is p_days and input parameter is P_PERNR. I have cleared the p_days toward the begning of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please recommend why it work for 1 employee at atime but not in a loop (or if i test second employee after first one without totally exiting the FM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_HRGPBS_ME_P46_DAYS_ACTIVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: p0000_tab TYPE TABLE OF p0000 INITIAL SIZE 1.&lt;/P&gt;&lt;P&gt;    DATA: msgv_date TYPE symsgv.&lt;/P&gt;&lt;P&gt;    STATICS: s0000 TYPE p0000.&lt;/P&gt;&lt;P&gt;    DATA it0000 type p0000.&lt;/P&gt;&lt;P&gt;    DATA l_begda TYPE DATUM.&lt;/P&gt;&lt;P&gt;    DATA l_endda TYPE DATUM.&lt;/P&gt;&lt;P&gt;    DATA a type num1.&lt;/P&gt;&lt;P&gt;    DATA b type num1.&lt;/P&gt;&lt;P&gt;    Data c type p decimals 2.&lt;/P&gt;&lt;P&gt;    DATA l_days type i.&lt;/P&gt;&lt;P&gt;  DATA message_handler TYPE REF TO if_hrpa_message_handler.&lt;/P&gt;&lt;P&gt;  PERFORM create_dummy_handler CHANGING message_handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear P_DAYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'HR_ECM_READ_INFOTYPE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        pernr           = P_PERNR&lt;/P&gt;&lt;P&gt;        infty           = '0000'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       subty           = '*'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        begda           = '20090401'&lt;/P&gt;&lt;P&gt;        endda           = '20100331'&lt;/P&gt;&lt;P&gt;        no_auth_check   = ' '&lt;/P&gt;&lt;P&gt;        message_handler = message_handler&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        infotype_tab    = p0000_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    p_days = 0.&lt;/P&gt;&lt;P&gt;    a = 0 + 1.&lt;/P&gt;&lt;P&gt;    b = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Do.&lt;/P&gt;&lt;P&gt;          READ TABLE p0000_tab INDEX a INTO it0000.&lt;/P&gt;&lt;P&gt;         If it0000-STAT2 = '1'.&lt;/P&gt;&lt;P&gt;           write it0000-begda to l_begda.&lt;/P&gt;&lt;P&gt;           write it0000-endda to l_endda.&lt;/P&gt;&lt;P&gt;          If l_endda = '99991231'.&lt;/P&gt;&lt;P&gt;           l_endda = '20100331'.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;           p_days = l_endda - l_begda.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;        a = a + 1.&lt;/P&gt;&lt;P&gt;       if a = b.&lt;/P&gt;&lt;P&gt;          Exit.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;     ENDDO.&lt;/P&gt;&lt;P&gt;   p_days = p_days - 30.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 17:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695958#M1451816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T17:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695959#M1451817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try calling FM &lt;STRONG&gt;HR_ECM_INITIALIZE_BUFFER&lt;/STRONG&gt; in the loop before the call to HR_ECM_READ_INFOTYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 17:45:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695959#M1451817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T17:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695960#M1451818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did as you said. Now if i test the function module, i get correct data for all employees one after the other without exiting from the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I call this FM inside another FM where it is executed inside a loop for multiple employees, then it again don't give correct result.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea? I appreaciate your input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 18:49:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695960#M1451818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T18:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695961#M1451819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I have identified the problem to be an authorization error.&lt;/P&gt;&lt;P&gt;If I login as a super user then this gives desired result otherwise not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the FM HR_ECM_READ_INFOTYPE within this FM, but I have the parameter&lt;/P&gt;&lt;P&gt;no_auth_check   = ' '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so not sure what else i need to do to make it work for normal users with no super authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 20:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695961#M1451819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T20:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695962#M1451820</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;You can see in transaction SU53 authorization problem for specific user and give him required authorization. &lt;/P&gt;&lt;P&gt;Just run it after your function run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Yossi Rozenberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 20:49:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695962#M1451820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T20:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calling FM in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695963#M1451821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's usually a management decision about who gets which authorizations - not a programming decision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 22:08:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-fm-in-a-loop/m-p/6695963#M1451821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T22:08:57Z</dc:date>
    </item>
  </channel>
</rss>

