Enhancement to SAP delivered transaction accomplished using Workflow standard Task
If we have a case of requested enhancement from customer NOT feasible with SAP delivered enhancements (like exits, BADI, enhancement spot), then it can be accomplished by Standard task provided a BAPI or function module available for the requested update on standard transaction. The proposed idea is to call the BAPI or function module which makes changes to standard transaction under Workflow Standard Task (provides ability to make change asynchronously and instantly) and linking it with respective business object and event.
For example, requirement from customer is to make update to additional data field as per defined criteria and send email to vendor once stock posting completed for Inspection lot. Transaction QA02 used for inspection lot change. There are several SAP delivered enhancement available in QA02 but to have enhancement after completion of save is not available along with field required for this scenario.
Business object for Inspection lot identified in transaction SWO1 business object repository – BUS2045
Event for Stock posting completion of Inspection lot – STOCKPOSTINGCOMPLT
In this business object, there is no standard SAP delivered method for changing additional data or to send email to vendor. So create custom method to call function module QPLEXT_INSPECTION_LOT_CHANGE and implement logic to send email by class CL_DOCUMENT_BCS for the vendor by pulling data using BAPI_INSPLOT_GETDETAIL.
Create a standard task in PFTC and link the above created custom method.
Now maintain assignment between Inspection lot change document and an event Stockpostingcomplt by using transaction SWEC. Alternately, you can go to Tools → Business Workflow → Development → Definition Tools → Events → Event Creation → Change Documents → Linkage.
Click on New Entries and add a new record with on change trigger event radio button linking the change document to event STOCKPOSTINGCOMPLT and ensure business object type to which the event belongs and the change documents must have the same key fields.
Enter transaction SWE2; link the created standard task with event ( get into the task and ensure binding of event and task is green under triggering event section).