To explain with an example we will take Custom Contract as Transaction Type.
When you go to Custom Contract Transaction you have one standard action, view the below screen shot.
In this blog we will see how to create one more action for this which will call a method.
The Transaction type of this transaction is CMCC.
Follow below steps to create a custom action in transaction,
1. Go to IMG -> Customer relationship management -> Basic Functions -> actions -> Actions in transaction -> Assign Action Profile to the Business Transaction Type
Search for CMCC and double click on that, you will get screen as shown below
You will get the Action Profile Name from this screen. In our case it is CMS_SALES_CONTRACT.
2 Go to IMG -> Customer relationship management -> Basic Functions -> actions -> Actions in transaction -> Create Actions with Wizard
You will go to wizard,
3. Press Continue.
4. Give the Action Profile name and Click Continue.
5. Give your Action Definition Name (Any name which suites your requirement) and Description and click continue.
6. Give the Above details and click continue.
7. Give the Above details and click continue.
8. Give the Above details and click continue.
9. Click Create button as shown in screen.
10. Select the CREATE_ALERT and click the create button.
11. Press Enter.
12. Specify Filter.
13. Double click the EXECUTE method.
14. Write the code in the method which should get executed when ever this action is created. We will write a information message in our case. Then activate the method and BADI and come back.
15. Press F4 for the method and select the filter created.
16. Press Continue.
17. Press Continue.
18. Press Continue.
19. Press Continue.
20. Press Complete.
21. Now when we go to the Custom Contract Transaction you can see Action Demo which we have created.
If you click on the action, code written in the method gets executed.
Note: You can implement the method according to your business requirement. The information popup in the method is written for the understanding of action only.