---
title: "转 Using \"Check Function Module\" in Workflow "
author: "evangxli"
date: "2013-06-03T09:40:23Z"
tags: []
categories: ["行业应用"]
slug: "using-check-function-module-in-workflow"
draft: false
lastmod: "2013-06-03T09:40:23Z"
id: 1880431
url: "https://sapabap.iteye.com/blog/1880431"
---

## Using Check Function Module in SAP Workflow

By Geethanjali K, Kaavian Systems from [**link**](http://www.saptechnical.com)

 

Following is a custom function module created for our demo purpose, which will check the conditions before triggering the workflow. 

```
FUNCTION ZGEE_SALES_ORG.
*"----------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(OBJTYPE) TYPE  SWETYPECOU-OBJTYPE
*"     VALUE(OBJKEY) TYPE  SWEINSTCOU-OBJKEY
*"     VALUE(EVENT) TYPE  SWETYPECOU-EVENT
*"     VALUE(RECTYPE) TYPE  SWETYPECOU-RECTYPE
*"  EXPORTING
*"     REFERENCE(RESULT) TYPE  C
*"  TABLES
*"      EVENT_CONTAINER STRUCTURE  SWCONT
*"  EXCEPTIONS
*"      NOT_TRIGGERED
*"----------------------------------------------------------------
```

```
TABLES: VBAK.
  DATA VKORG LIKE VBAK-VKORG.
```

```
  SELECT SINGLE VKORG INTO VKORG
     FROM VBAK WHERE VBELN = OBJKEY.
```

```
  IF VKORG = '3000'.
    RAISE NOT_TRIGGERED.
  ENDIF.
ENDFUNCTION.
```

> Now go to transaction SWE2 and insert your object type, event, and the receiver type. 
> 
> ![](http://www.saptechnical.com/Tutorials/Workflow/checkfunctionmodule/demo.h41.gif)

  Double click on your entry, following screen appears: 

> ![](http://www.saptechnical.com/Tutorials/Workflow/checkfunctionmodule/demo.h42.jpg)

Provide the name of the customized function module name created earlier in the check function module field. 

> ![](http://www.saptechnical.com/Tutorials/Workflow/checkfunctionmodule/demo.h43.jpg)

Now workflow is triggered only when the sales order is created with the sales organization 3000.