To implement your own code, create a new user exit, known as a Business Add-In (BAdI), that enables a new functionality at the chosen entry point.
To create a new BAdI, proceed as follows:
In your SAP system, start transaction SE19. The BAdI Builder: Initial Screen for Implementations screen is displayed.
In the Create Implementation area, select the New BAdI radio button.
In the Enhancement Spot field, enter the following
To change the task title for all items when executing a query operation on the Task Collection (Query BAdI), enter /IWPGW/ES_TGW_TASK_QUERY.
To change the task title or task description for a specific item when executing a Read operation on the Task Collection or Task Description Collection (Read BAdI), enter /IWPGW/ES_TGW_TASK_DATA.
To change the user details that are returned by the service, enter /IWPGW/ES_TGW_USER_DETAIL.
Choose Create Impl. The Create Enhancement Implementation screen is displayed.
In the Enhanced Implementation field, enter the name of the new BAdI that will contain the code you want to add.
In the Short Text field, add a short description of the BAdI's function.
Press the checkmark. The Create Object Directory Entry screen is displayed.
Save the BAdI in the appropriate package. The Enhancement Implementation: Create BAdI Impl. screen is displayed.
In the BAdI Implementation column, enter a name for the BAdI implementation, for example, BADI_IMPLEMENTATION,
In the Implementation Class column, enter a name for the BAdI implementation class, for example, ZBADI_IMPL_CLASS.
In the BAdI Definition column, select the BAdI definition name from the dropdown list (for SAP Gateway there is only one definition name in Workflow.
Press the checkmark. The Enhancement Implementation Display screen is displayed.
Under BAdI Implementations, expand the BAdI you have just created.
If no filter values are entered, your code is applied to ALL workflows.
Double-click Filter Val.
Choose Create Combination. The Choose Filter screen is displayed.
Select the PROVIDER_ID and the TASK_DEF_ID rows and press the checkmark.
The filter name TASK_DEF_ID does not exist for the BAdI /IWPGW/BADI_TGW_TASK_QUERY or /IWPGW/ES_TGW/USER_DETAIL.
In the Filter Values section, replace the question marks in the Value 1 column with the task provider ID and the task definition ID.
In each row, choose the question marks in the Comparator field. The Display Filter Value screen is displayed.
In the Comparator 1 dropdown list, select the equals sign (=)-
Press the checkmark.
On the Enhancement Implementation: Change screen, double-click the implementing class node in the BAdI implementations section.
Double-click the relevant method.
Press the checkmark. The ABAP Editor is displayed.
When prompted, choose Yes.
Add your additional code.
For the Query BAdI: The import parameters are the task provider ID and the table containing all task header details. The output parameter is a table containing the task IDs and the corresponding task IDs after modification.
For the Read BAdI: The import parameters are the task provider's ID and the task header details.
In the MODIFY_TASK_TITLE method, the output (Changing) parameter is the task title after modification.
In the MODIFY_TASK_DESCRIPTION method, the output (Changing) parameter is the task description after modification.
For the User Info BAdI: There are two methods in the BAdI interface, one for retrieving textual user details and the other for retrieving the user's image. Both of these methods receive an instance ID, navigation path, URL parameters, and a referent to the current provider façade implementation. The output parameter for the first method is the user details structure and for the second method, a media resource structure. The BAdI finds the user based on the import parameters and retrieves the user's details and image as applicable.
Choose Save and then Activate. The Inactive Objects screen is displayed.
Select all objects and press the checkmark.