<?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: function module -&amp;gt; do some step in workflow in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779215#M335948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;first thanks a lot for answer. &lt;/P&gt;&lt;P&gt;But i dont know if u mean the same as i.&lt;/P&gt;&lt;P&gt;what i need: i have some workflow, in one of its step can user make some decisions and fill some values.&lt;/P&gt;&lt;P&gt;And i need to do this step from some function module - i will call it from java side...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Dec 2006 15:28:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-04T15:28:14Z</dc:date>
    <item>
      <title>function module -&gt; do some step in workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779213#M335946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have some easy question i think :).&lt;/P&gt;&lt;P&gt;I have some workflow and i need to do some step in this wf from function module(st. like simulating of clicking the button), which parameters i need(what everything make identifikator for the instance of concrete wf) and how can i get an concrete object of wf?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;JJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 12:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779213#M335946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: function module -&gt; do some step in workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779214#M335947</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 need to create your own methods for executing these function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on how the FM's is defined you have the option to get the method created automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to find your delegated business object, place the cursor on methods, and push create, if possible it will generate the source code for you, otherwise you need to do it manually - see example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you created the method, create a task with this method and implement it in your workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Morten Nielsen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------" /&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;begin_method assign_role_to_user changing container.
DATA:
      to_date TYPE syst-datum,
      from_date TYPE syst-datum,
      user_name TYPE syst-uname.
swc_get_element container 'To_Date' to_date.
swc_get_element container 'From_Date' from_date.
swc_get_element container 'User_Name' user_name.

IF from_date IS INITIAL.
  from_date = sy-datum.
ENDIF.

IF to_date IS INITIAL.
  to_date = sy-datum + 180.
ENDIF.

CALL FUNCTION 'PRGN_ADD_USER_ASSIGNMENT'
  EXPORTING
    user_name                     = user_name
    activity_group                = object-key-role
   FROM_DATE                     = From_Date
   TO_DATE                       = To_Date
*   ORG_FLAG                      = ' '
*   SHOW_ERROR_MESSAGES           = 'X'
 EXCEPTIONS
   ACTGROUP_NOT_AUTHORIZED       = 1
   ACTGROUP_NOT_EXISTING         = 2
   ACTGROUP_ENQUEUED             = 3
   OTHERS                        = 4
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
exit_return 9001 object-key-role user_name ' ' ' '.
ENDIF.

end_method.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 14:57:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779214#M335947</guid>
      <dc:creator>morten_nielsen</dc:creator>
      <dc:date>2006-12-04T14:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: function module -&gt; do some step in workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779215#M335948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;first thanks a lot for answer. &lt;/P&gt;&lt;P&gt;But i dont know if u mean the same as i.&lt;/P&gt;&lt;P&gt;what i need: i have some workflow, in one of its step can user make some decisions and fill some values.&lt;/P&gt;&lt;P&gt;And i need to do this step from some function module - i will call it from java side...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 15:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-gt-do-some-step-in-workflow/m-p/1779215#M335948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T15:28:14Z</dc:date>
    </item>
  </channel>
</rss>

