Check Function Module for FIPP(CREATED)

Mike Mathieson msmathieson at hotmail.com
Mon Jan 29 09:04:23 EST 2001


I want to create a check function module for FIPP(CREATED) so the workflow
only starts if the invoice was created with reference to a purchase order.
But the CREATED event does not have any parameters, so I'm not sure how to
code it.  Do I need to add parameters to the CREATED event of a delegate of
FIPP or is there a way to get the key fields of a business object?  I have
never created a check function module before so I am just guessing - here is
what I have scratched together.
 
FUNCTION z_fipp_check_event_po.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(OBJTYPE) LIKE  SWETYPECOU-OBJTYPE
*"     VALUE(OBJKEY) LIKE  SWEINSTCOU-OBJKEY
*"     VALUE(EVENT) LIKE  SWEINSTCOU-EVENT
*"     VALUE(RECTYPE) LIKE  SWETYPECOU-RECTYPE
*"  TABLES
*"      EVENT_CONTAINER STRUCTURE  SWCONT
*"  EXCEPTIONS
*"      NON_PO_INVOICE
*"      CONTAINER_ERROR
*"----------------------------------------------------------------------
 
  INCLUDE <cntain>.
 
*  DATA: zfipp LIKE SWOTOBJID OCCURS 0 WITH HEADER LINE.
*  SWC_GET_TABLE EVENT_CONTAINER '??????' zfipp.
*  DESCRIBE TABLE zfipp LINES SY-TFILL.
*  IF SY-TFILL EQ 0.
*    RAISE container_error.
*  ENDIF.
 
  swc_get_element event_container 'SourceCompanyCode' hold_bukrs.
  swc_get_element event_container 'DocumentNo'        hold_belnr.
  swc_get_element event_container 'FiscalYear'        hold_gjahr.
 
  SELECT ebeln UP TO 1 ROWS
    FROM vbsegs
    INTO vbsegs-ebeln
   WHERE ausbk = hold_bukrs
     AND belnr = hold_belnr
     AND gjahr = hold_gjahr
     AND ebeln NE space.
  ENDSELECT.
 
  IF vbsegs-ebeln IS INITIAL.
    RAISE non_po_invoice.
  ENDIF.
 
ENDFUNCTION.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
 


More information about the SAP-WUG mailing list