There are numerous standard mass activity transactions in SAP FS-CD, e.g. Payment run, Clearing run, Debit run etc and there is a provision to create your own mass activity as well. Through this blog, I would like to share detail information on how to create your own mass activity and its usage in customer projects.
The entire process involves a combination of IMG activity and creation of function modules.
Events and Function Modules
Create two custom (Z) function modules using standard function modules ‘FKK_SAMPLE_INTERVAL_1740’ and ‘FKK_SAMPLE_INTERVAL_1741’ as reference. The content must be modified based on your requirements. To give an idea, the above two standard function modules belong to event 1740 and 1741, which are a type of exit programs for the standard Mass activity of Payment Run.
Run transaction code SM30. Enter table name TFKFBM (Event table).
Create two new entries in the above table. These entries are known as events; hence in other words create two new events as shown below. Add the two function modules created in previous step in this table for the corresponding event. It will look like the below picture.
Basics and Addons Structures
The standard Mass activity framework uses two important structures, they are ‘Basics’ and ‘Addons’. The ‘Basics’ structure remains mostly constant but the ‘Addons’ structure can vary from one type of mass activity to another. The ‘Basics’ structure contains information about general selections, parallel processing objects, date and time of mass activity creation, log data, authorization data and many more. This information is crucial for the standard mass activity framework to run properly. On the other hand, the ‘Addons’ structure is used to transfer data between the screens and database, hence this structure varies for different type of mass activity.
In this example, I have used the standard ‘Basics’ structure i.e. ‘FKK_MAD_BASICS’.
For the ‘Addons’ structure, you have to create a custom structure that will define the custom screen elements.
Below is an example of such a structure.
Create a custom transaction code. Run transaction SE93.
Please ensure that the program and screen number remains same as shown in the picture below.
Create a custom sub-screen in the same Function group that was used to create the event function modules.
This sub-screen will define the screen fields relevant to your requirements. The fields in the ‘Addons’ structure can be used to link the screen fields.
Group frame is a place-holder for the screen layouts to be used in the mass activity. In this document, we will be using a combination of standard group frames and newly created custom group frames.
Select the entry as shown below and then click on Group box on the left.
Create a new group frame. Add the screen program name (function group) and screen number (created earlier) as shown below. This will result into a new custom tab in the final mass activity transaction.
Go back to the IMG activity main menu for mass activities. Select and execute “Define layout for mass activities”.
Create a new custom layout. Select the entry and click on Tab page titles.
Create entries as shown in the picture
Including Tab 3 and Tab 4 is logically mandatory because those two tabs will facilitate declaring parallel processing object and error handling during the mass activity.
Select on each entry and click on ‘Position of group’ to enter the group frames. Only for Tab 2, you need to include the newly created group frame in the previous step. Below picture will show the various group frames to be included.
Prepare Mass Activities
Go back to the IMG activity main menu for mass activities. Select and execute “Prepare mass activities”.
Create a new custom mass activity as shown below.
Select the entry and click on General control and fill the required fields as mentioned below.
Enter the events created earlier.
Enter the transaction code created earlier
Enter the ‘Addons’ structure created earlier
Type FICA as the object name
Enter the tab layout created earlier
All the activities related to the screens and customizing are now complete, run your mass activity transaction and it should look like the picture below
The core program behind your new mass activity will be those two new function modules that you have created in the beginning. You must modify the function module ending with ‘Z001’ to suit your requirement. It is recommendable to use the already existing sub-routines for handling the error messages in the application logs.
You should also add your own code for the custom tab on the screen. The screen programs transfer the data from the screen to those function modules during the mass activity processing.
The other tabs on the screen don’t need much change as they belong to the standard group frames.
Custom mass activities can help you control various database updates to be done at once. Instead of writing longer lines of code inside the exit programs or making multiple database updates during a business process, you can use the mass activity to make a single update for multiple types of data. This provides more control and maintains data accuracy in the critical standard tables.