Copyright 2020 - BV TallVision IT

This function module is executed to check wheter a given event/workflow linkage should be triggered. This can be set up in customizing on the triggering event. 

 

FUNCTION Z_CHECK_FB_XXX.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(OBJTYPE) LIKE  SWETYPECOU-OBJTYPE
*"     VALUE(OBJKEY) LIKE  SWEINSTCOU-OBJKEY
*"     VALUE(EVENT) LIKE  SWETYPECOU-EVENT
*"     VALUE(RECTYPE) LIKE  SWETYPECOU-RECTYPE
*"  TABLES
*"      EVENT_CONTAINER STRUCTURE  SWCONT
*"  EXCEPTIONS
*"      ERROR_EVENT_CONTAINER_EMPTY
*"      ERROR_CONDITION_NOT_FOUND
*"      ERROR_CONVERTING_CURRENCY
*"      ERROR_EVALUATING_CONDITION
*"      CONDITION_EVALUATES_TO_FALSE
*"----------------------------------------------------------------------

*----------------------------------------------------------------------
* Function module__: Z_CHECK_FB_XXX
* Description______: XXX XXX processing: check whether event
*                    SAVED should be thrown for a specific workflow
*
* Author___________: W.Maasdam
* Date created_____: November 2005
*----------------------------------------------------------------------
* This function module is a check module which can control whether the
* SAVED event for event linkage to the "" (BUS2205)
* should be triggered for workflow "Complete by Purchaser"
* (WS90000018/ZAppSCPurch).
*
* FM copied from SWB_CHECK_FB_START_COND_EVAL
*----------------------------------------------------------------------
*                                                       Version history
* Date      By           Description
* 17NOV2005 W.Maasdam    Initial version
* -         -            -
*
*----------------------------------------------------------------------

  include <cntn01>.

* Object type (Invoice) and it's key (invoice number) are passed to this
* function module, which is the business object behind the event we are
* checking here.

  DATA: l_result_object like OBJ_RECORD,
        l_flag like TLANSUPTA-COMPLETE.

* Starting conditions check: the event should be thrown for a shopping cart
  SWC_GET_ELEMENT EVENT_CONTAINER  '_EVT_OBJECT' l_result_object.
  if sy-subrc ne 0.
* Message: Container element _EVT_OBJECT not found (internal error)
    message e121(zsrm) raising CONDITION_EVALUATES_TO_FALSE.
  endif.
  SWC_GET_PROPERTY l_result_object 'ExistFreeTextLineItem' l_flag.
  if sy-subrc ne 0 or l_flag eq space.
* Message: Container element ExistFreeTextLineItem not set
    message e120(zsrm) raising CONDITION_EVALUATES_TO_FALSE.
  endif.

ENDFUNCTION.