Triggering IDocs and Sapscript Processing

SAP R/3

NAST Processing

NAST
All standard SAP application which create business documents like sales orders, purchase orders or material documents can write output messages. These output message can be customized to send an IDoc.

ALE Change Pointers

Change pointers are written from the routine CHANGEDOCUMENT_CLOSE   when saving the generated change document. This will call the following function.

CALL FUNCTION 'CHANGE_POINTERS_CREATE'
EXPORTING
change_document_header = cdhdr
TABLES
change_document_position = ins_cdpos.

Workkflow Event From Changedocument

Workflow Event form change document via SWECDOBJ-EVENTFB
Every application that writes change documents triggers a workflow event from within the function module CHANGEDOCUMENT_CLOSE, which is called form the update processing upon writing the change document. This will call the workflow processor

FUNCTION swe_event_create_changedocumnt

which in turn will call the function module, which is defined in field EVENTFB of table SWECDOBJ for each change document type. The follwoing call is performed, so make sure your function module matches the specified interface parameters. (changedocument_header is declared with structure CDHDR)

CALL FUNCTION swecdobj-objtypefb
EXPORTING
changedocument_header = changedocument_header
objecttype = swecdobj-objtype
IMPORTING
objecttype = swecdobj-objtype
TABLES
changedocument_position = changedocument_position.

We include an example Z_CHANGEDOCUMENT_WORKFLOW which is will send the customer master IDoc upon each save after modifying a customer master record. To make it work, the name of the function module must be entered in SWECDOBJ-EVENTFB for the document type KUNA.

Individual ABAP

Individual ABAP
This is not really recommended and should be reserved to situation, where the other solution do really not provide an appropriate mean. It will require you to maintain your own status recording which IDocs or Sapscripts have been already processed and which will still reuire treatment.