Skip to main content
Skip table of contents

Function Block/Method Definitions (X4 SAP JCo 2)

In a configuration document (by default <X4>/X4DB/0/jco_method_def.xml), you can assign a corresponding X4 process for further processing to each function block or method that is addressed by the SAP host via the JCO 2 Server.

Within the central configuration file <X4>/X4config.xml, a function block/method definition must be referenced for each JCo Server instance.

Expected XML structure

Within the function block/method definition, you can create any number of <method> elements within the root element <definitions> by following this pattern:

HTML/XML
<method>
  <name>Function block/method name</name>
    <wait_for_result>Boolean value</wait_for_result>
    <class>de.softproject.integration.sapjcoserver.requesthandlers.WorkflowStarter</class>
    <properties>
      <property Name="workflowname">Path to the X4 process</property>
      <property Name="userID">User folder within the X4DB</property>
      <property Name="raw">Boolean value</property>
    </properties>
</method>

The following applies for each function block/method definition:

  • The<name> element contains the name of the function block (method) called by SAP; The placeholder * represents all other function blocks, for which no explicit function block has been defined.

  • Within the<wait_for_result> element, you can configure whether SAP should wait for the result (false), or the function block/method call should be made asynchronously (true).

  • The <class> element specifies the used class, which is stored for the processing of the function block or method (by default de.softproject.integration.sapjcoserver.requesthandlers.WorkflowStarter for starting X4 processes); Within the child elements of <class>, you specify the corresponding properties in a <property> element.

For the X4 process starter class, the following properties are specified:

  • workflowname: Path to the Xprocess, which takes over the processing of the function block/method call

  • userID: Repository user folder containing the X4 process

  • raw: Process IDoc in raw format (true) or (false)


Compatibility notes

In older function block/method definitions, you may find additional details within the <type> and <property name = "languageID"> elements. They have no function and may therefore be omitted.

Example

In the following example, the X4 process save_idoc.wrf is called for the ORDERS05 function block (method), and data in the IDoc raw format is provided for the downstream processing.

HTML/XML
<method>
  <name>ORDERS05</name>
    <wait_for_result>false</wait_for_result>
    <class>de.softproject.integration.sapjcoserver.requesthandlers.
           WorkflowStarter</class>
    <properties>
      <property Name="workflowname">Project/Folder/ProcessIDoc.wrf</property>
      <property Name="userID">1</property>
      <property Name="raw">true</property>
    </properties>
</method>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.