Skip to Content

Hi All,

 

This blog is about how to create and register the Event handler Function modules for our own requirements.

 

How it is used?

 

This Event Handler FM’s are useful in many scenarios like

1. When we want to update some field values on save of the Transactions ( Here FM will be called after ORDER_SAVE BADI check is successful so you can confirm that transaction will be saved)

2. When partner value is changing on after change you wnat to perform any update in Transaction

3.You can register this FM for any objects ( ORDERADM_H, ORDERADM_I, CUSTOMER_H, CUSTOMER_I, … etc)

 

Step1:

How to create the FM

 

Fm should created with name endes with _EC for ex ZTEST_EVENT_SAVE_EC

FM2.PNG

 

Step2:

Created FM must registered for Specific Objects ( CRM_ORDERADM_H, CRM_ORDERADM_I, ..etc)

FM3.jpg

 

Under this register your custom FM for your specific object

FM4.jpg

 

Step3:

 

After registeration Maintain Event handler for which transaction, object and event in SPRO under CRM->Transaction->Basic Settings->Edit Event Handler Table

FM5.jpg

 

After this You can all the registered FM for events

FM6.jpg

 

Click on new entries and maintain the event for your custom FM

FM7.jpg

 

In the above screenshot FM is registered for Object PARTNER , for Event After Change and execution time is Immediately

 

This FM will be called immediately after Partner changed for Service Request Transactions

 

This FM will be called for Header/Item partner changes with importing fields passed are object name, event attributes with old and new values

FM9.jpg

 

In the above screenshot FM is registered for Service Request Transaction types, for object ORDERADM_H and for event SAVE and execution time before saving

 

This FM will be called when Service Request Transaction are saved and before saving the document you want to do any update according to user inputs you can do the code in this custom FM.

 

This FM will be called only once

 

Possib;e call Callback are

 

FM8.jpg

 

After these steps are done FM will be called on registered Events.

 

Regards,

Deepika.

To report this post you need to login first.

4 Comments

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

  1. Stephen Johannes

    Good example, but you didn’t explain how to determine what event you want to use or analyzing what events already exist.  There is a lot more options available as I have personally discovered 😉 .  It was also good showing people the registration in the correct place.

    For those interested program CRM_EVENT_TRACE can be used to help find the correct event needed for your logic.

    Take care,

    Stephen

    (0) 
      1. Rajashekar S

        Thanks for the excellent post.

        Can you please tell us while creating callback FM, do we have to maintain Importing and Exporting parameters ?

        If yes, Please guide us what to maintain ? Any standard structure will be there for Importing and Exporting parameters for Call back FM ?

        Regards

        Rajashekar

        (0) 

Leave a Reply