<?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: Workflow Agent Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow-agent-function-module/m-p/3061366#M725146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my guess, the function module interface is incorrect. The function module should contain only the following interface:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      ACTOR_TAB STRUCTURE  SWHACTOR&lt;/P&gt;&lt;P&gt;*"      AC_CONTAINER STRUCTURE  SWCONT&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      NOAGENT_FOUND&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You seem to be passing an order number. you need pass container elements using the table AC_Container and cannot send it directly. For further information, look at the following tutorial:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/Workflow/Rules/Create.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/Workflow/Rules/Create.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2007 02:00:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-21T02:00:12Z</dc:date>
    <item>
      <title>Workflow Agent Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow-agent-function-module/m-p/3061365#M725145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to develop a workflow for the approval of CATS time entries. Users will enter their time data and specify a receiving maintenance work order (CATSD-RAUFNR). The approver of the CATS time entry should be the user ID identified in the Partner tab of the maintenance work order identified in the CATS record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to determine the agent in a workflow task based on a default rule for agent assignment. My idea was to capture the work order number (stored in table AUFK) from the CATS entry, then reference plant maintenance partners table (IHPA) to get the user id to use as the agent in the workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed a function module that works when testing it in the function builder, but when I try to test it in the "Maintain Rule" transaction (PFAC_CHG), it does not work. Can anyone let me know how to make this code work in the Maintain Rule simulation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for the function module:&lt;/P&gt;&lt;P&gt;FUNCTION Z_GET_WO_PARTNER.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(ORDER_NUMBER) TYPE  AUFNR OPTIONAL&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      ACTOR_TAB STRUCTURE  SWHACTOR&lt;/P&gt;&lt;P&gt;*"      AC_CONTAINER STRUCTURE  SWCONT&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      NOBODY_FOUND&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*INCLUDE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF PLANT_MAINT,&lt;/P&gt;&lt;P&gt;          OBJECT     TYPE  IHPA-OBJNR,&lt;/P&gt;&lt;P&gt;          PARTFUNC   TYPE  IHPA-PARVW,&lt;/P&gt;&lt;P&gt;          PARTNER    TYPE  IHPA-PARNR,&lt;/P&gt;&lt;P&gt;        END OF PLANT_MAINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF ORDER_MASTER,&lt;/P&gt;&lt;P&gt;          ORDER      TYPE  AUFK-AUFNR,&lt;/P&gt;&lt;P&gt;          OBJECTN    TYPE  AUFK-OBJNR,&lt;/P&gt;&lt;P&gt;        END OF ORDER_MASTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: WA_MAINT  TYPE  PLANT_MAINT.&lt;/P&gt;&lt;P&gt;DATA: WA_ORDER  TYPE  ORDER_MASTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ITABIHPA TYPE STANDARD TABLE OF PLANT_MAINT.&lt;/P&gt;&lt;P&gt;DATA: ITABAUFK TYPE STANDARD TABLE OF ORDER_MASTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: PARTNERVAR  TYPE  STRING.&lt;/P&gt;&lt;P&gt;DATA: OBJN TYPE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get object number from order master&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SWC_GET_ELEMENT AC_CONTAINER 'OrderNumber' ORDER_NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: ACTOR_TAB.&lt;/P&gt;&lt;P&gt;REFRESH: ACTOR_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE AUFNR OBJNR FROM AUFK INTO WA_ORDER&lt;/P&gt;&lt;P&gt;     WHERE AUFNR = ORDER_NUMBER.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    RAISE nobody_found.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJN = WA_ORDER-OBJECTN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*get Partner field (system user id) from Plant Maintenance: Partners table&lt;/P&gt;&lt;P&gt;SELECT SINGLE OBJNR PARVW PARNR FROM IHPA INTO WA_MAINT&lt;/P&gt;&lt;P&gt;          WHERE OBJNR = OBJN AND PARVW = '§G'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    RAISE nobody_found.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;        ACTOR_TAB-OTYPE  =  'US'.&lt;/P&gt;&lt;P&gt;        ACTOR_TAB-OBJID  =  WA_MAINT-PARTNER.&lt;/P&gt;&lt;P&gt;        APPEND ACTOR_TAB.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(sorry about the poor ABAP code...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 19:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/workflow-agent-function-module/m-p/3061365#M725145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T19:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Agent Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/workflow-agent-function-module/m-p/3061366#M725146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my guess, the function module interface is incorrect. The function module should contain only the following interface:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      ACTOR_TAB STRUCTURE  SWHACTOR&lt;/P&gt;&lt;P&gt;*"      AC_CONTAINER STRUCTURE  SWCONT&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      NOAGENT_FOUND&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You seem to be passing an order number. you need pass container elements using the table AC_Container and cannot send it directly. For further information, look at the following tutorial:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/Workflow/Rules/Create.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/Workflow/Rules/Create.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2007 02:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/workflow-agent-function-module/m-p/3061366#M725146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-21T02:00:12Z</dc:date>
    </item>
  </channel>
</rss>

