Skip to Content

Hello Folks,

Today I thought to share with you a detailed screen by screen implementations of custom FM in SAP Events in SAP ISU. No step will be jumped and screenshot will be provided for every minute points. It will be taken care that if you try to implement this in your system and find something missing in the literature, you can always refer to the screenshots.

From this blog you will get to know:

  1. How to find Events for any standard SAP application.
  2. How to implement custom Function Module for the event.

Wish you a very Happy Read !!!!


Step by step process:



First process: How to find Events for a standard SAP transaction:

  1. Go to Tcode: SE37
  2. Enter function module name: FKK_FUNC_MODULE_DETERMINE

FQ1.png

3. Click on Display

FQ2.png

4. Go to line number 32 and place a BreakPoint.


5. We will find the events that are hit during Installment Plan creation. (Tcode FPR1)

FQ3.png

6. Go to SAP eassy access screen and Enter Tcode FPR1 and press enter.

Note: If you want to find the events that are hit in any intermediate process in any standard transaction (I mean to say not exactly after entry of the Tcode) then follow the same process as stated below but keep pressing F8 until your desired screen is hit.FQ4.png

7. The system will open a debugger session and the function module FKK_FUNC_MODULE_DETERMINE.

              8. Double click on the variable I_FBEVE (as per the above screen shot 1107 is the event number). The value of this variable is the events hit at that time.

               9. Press F8 and if there is any other event that is being hit then the debugger will stop at this particular event and the value of the variable I_FBEVE will change to the event name.

In simple words the event name is the value of the variable I_FBEVE.FQ5.png

10. So by this process you get the entire list of Events that are hit while execution of any standard process in SAP.




Second Process: Implementing Custom Code:

After determining the event name, the next step is to implementing your custom code in the event so that customer’s enhanced requirements can be complemented and the custom code can be executed while execution of the standard TCODE.



Steps are as follows:

  1. Go to Tcode FQEVENTS.
  2. Click on the binocular sign as shown below and enter the event name.

Note: If at any point the event name search shows not entries found then first click on ‘All Entries’ button and then again do the search.FQ6.png

3. Double click on the Event name

FQ7.png

4. The event opens on the right sub-screen: It has two tabs: Documentation and Function modules. From the documentation you will get to know about how and when the event is hit and what are expected if custom enhancements are implemented.FQ8.png

5. In the Function Module tab: You will get the sample function module for each and every event in SAP. The second portion is the Standard Function module. This function module is the SAP provided FM for the event and the logic of this function module can be changed or appended. The sample function module will generally be blank and the standard FM will have some code in it.Now I will explain in detail how to create own custom function module for the SAP event and configure the same to the event.



Detailed Steps:

  1. Enter Tcode SE80

FQ9.png

2. From the drop down select function module3. Enter the standard FM from the event (if standard FM is not present then paste here the Sample FM)4. The function group will be displayed automatically as shown below:

FQ10.png

5. Right Click on the object name of the function group and select copy as below

FQ11.png

6. In the next screen which appears, enter your custom function group name, just enter ‘ZFG_’ in front of the standard FG name. Provide a FG text. Click on ‘Copy’.

FQ12.png

7. Assign Package and TR and save the function group.

/wp-content/uploads/2016/05/fq13_952265.png

8. Click on the tick sign.

9. Then deselect the function modules and do not copy any of the function modules.

/wp-content/uploads/2016/05/fq14_952266.png

10. As seen in the above screen the object name of your custom FG is seen with the objects that are copied from the standard function module.

11. Now you want to create your custom FM

12. Go to Tcode SE37

13. Paste the standard FM name and click on the Copy button as shown in the screen shot below:

/wp-content/uploads/2016/05/fq21_952267.png

14. Enter a ‘ZFM_’ in front of the FM name, and enter the Custom FG you created as shown below. However you can give any name starting with z or y./wp-content/uploads/2016/05/fq22_952268.png

15. Click on Copy

/wp-content/uploads/2016/05/fq23_952269.png

16. Click on Tick

17. You can see the success message as shown below

/wp-content/uploads/2016/05/fq24_952270.png

18. Again in SE37 screen enter your custom FM name and click Change./wp-content/uploads/2016/05/fq25_952271.png

19. Click on tick 

      /wp-content/uploads/2016/05/fq26_952272.png

20. You can Change or Append the code in our custom FM/wp-content/uploads/2016/05/fq27_952273.png/wp-content/uploads/2016/05/fq28_952274.png

21. In the above screen you can provide your code.

22. Save and Activate the FM.



Third Process: Assigning the vustom FM to SAP Event


Detailed Steps

1. Go to the FQEVENTS screen as shown above go to the Function Modules sub-screen, and press the change pencil button as shown below.

/wp-content/uploads/2016/05/fq29_952047.png

2. The following screen appears as shown below:

3. Click on new entries.

/wp-content/uploads/2016/05/fq30_952048.png

4. Enter the sequence number as 0 and the custom function module name which you have created, in the above steps.

/wp-content/uploads/2016/05/fq31_952244.png

5. Save and assign it to a Customizing TR.

/wp-content/uploads/2016/05/fq32_952245.png

6. After assigning the custom FM to the event you will find the activated sign, (torch) have shifted in front of the Installation specific function module.

7. Go to the tcode SE80 enter the custom function group which you created.

8. Right click on the object (FG) and activate the FG.

/wp-content/uploads/2016/05/fq33_952246.png

By this you have completed assigning the custom function module to the Event.

Now it’s time to test whether your custom function module is executed or not while executing the standard Tcode.

Testing:

Detailed Steps:

  1. Enter Tcode SE37 and open your custom function module.
  2. Pout a break point on the starting of the executable line of your custom function module

/wp-content/uploads/2016/05/fq34_952247.png

3. Enter Tcode FPR1 and press ENTER.

4. Second screen appears, ‘Create Installment Plan: Initial Screen’

/wp-content/uploads/2016/05/fq35_952248.png

5, Enter the required fields namely: Contract Account, Currency, Reconciliation key, and other fields will be auto-populated as per configuration as the above screen.

6. The next screen is as shown below.

/wp-content/uploads/2016/05/fq36_952249.png

VOILA!!!!!! 

The code is right into your custom FM.

So this was all I had to share with you……

See you soon in some other topic…

Until then have some good food, plenty of water, plant trees and save the mother nature !!!!

Bye !!!

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply