При создании события через SWE_EVENT_CREATE (к примеру) создайте инстанцию заказа на закупку и добавьте в контейнер события.
Инстанцию можно создать использованием макросов из инклюда <CNTN01>.
Code:
INCLUDE <cntn01>.
DATA: requisition TYPE swc_object,
purchase_order TYPE swc_object,
objkey LIKE sweinstcou-objkey.
PARAMETERS: p_ebeln LIKE ekko-ebeln,
p_banfn LIKE eban-banfn.
START-OF-SELECTION.
MOVE p_banfn TO objkey.
" Create master instance
swc_create_object requisition 'BUS2105' p_banfn.
" Create purchase order instance
swc_create_object purchase_order 'BUS2012' p_ebeln.
" Create event container
swc_container container.
swc_create_container container.
" Add objects to container
swc_set_element container 'Requsition' requisition.
swc_set_element container 'PurchaseOrder' purchase_order.
" Set objects persistent
swc_container_to_persistent container.
" Create event
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'BUS2105'
objkey = objkey
event = 'purchase_order_created'
TABLES
event_container = container
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.