SAP TM_COLLECTIVE_MAINTENANCE Function Module for Fast Processing of Fixed-Term Deposits
TM_COLLECTIVE_MAINTENANCE is a standard tm collective maintenance SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Fast Processing of Fixed-Term Deposits processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for tm collective maintenance FM, simply by entering the name TM_COLLECTIVE_MAINTENANCE into the relevant SAP transaction such as SE37 or SE38.
Function Group: TM02
Program Name: SAPLTM02
Main Program: SAPLTM02
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TM_COLLECTIVE_MAINTENANCE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'TM_COLLECTIVE_MAINTENANCE'"Fast Processing of Fixed-Term Deposits.
EXPORTING
* SORT = '00' "Gewünschte Sortierung (--> FB TM_SORTFIELDS...)
* DESCENDING = ' ' "Sort in Descending Order
* MODE = 'N' "Display mode for call transaction using
* UPDATE = 'A' "Update mode for call transaction using
TABLES
DEALS = "Transactions
EXCEPTIONS
MODE_INVALID = 1 UPDATE_INVALID = 2 SORT_INVALID = 3
IMPORTING Parameters details for TM_COLLECTIVE_MAINTENANCE
SORT - Gewünschte Sortierung (--> FB TM_SORTFIELDS...)
Data type: VTBSODOKU-SSORTDefault: '00'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DESCENDING - Sort in Descending Order
Data type: VTBSODOKU-SSORTDESCDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MODE - Display mode for call transaction using
Data type: VTBBDC-MODEDefault: 'N'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPDATE - Update mode for call transaction using
Data type: VTBBDC-UPDATEDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TM_COLLECTIVE_MAINTENANCE
DEALS - Transactions
Data type: VTMTGSBOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
MODE_INVALID - Display mode not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UPDATE_INVALID - Update mode not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SORT_INVALID - Gewünschte Sortierung ist unzulässig
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TM_COLLECTIVE_MAINTENANCE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_sort | TYPE VTBSODOKU-SSORT, " '00' | |||
| lt_deals | TYPE STANDARD TABLE OF VTMTGSB, " | |||
| lv_mode_invalid | TYPE VTMTGSB, " | |||
| lv_descending | TYPE VTBSODOKU-SSORTDESC, " SPACE | |||
| lv_update_invalid | TYPE VTBSODOKU, " | |||
| lv_mode | TYPE VTBBDC-MODE, " 'N' | |||
| lv_sort_invalid | TYPE VTBBDC, " | |||
| lv_update | TYPE VTBBDC-UPDATE. " 'A' |
|   CALL FUNCTION 'TM_COLLECTIVE_MAINTENANCE' "Fast Processing of Fixed-Term Deposits |
| EXPORTING | ||
| SORT | = lv_sort | |
| DESCENDING | = lv_descending | |
| MODE | = lv_mode | |
| UPDATE | = lv_update | |
| TABLES | ||
| DEALS | = lt_deals | |
| EXCEPTIONS | ||
| MODE_INVALID = 1 | ||
| UPDATE_INVALID = 2 | ||
| SORT_INVALID = 3 | ||
| . " TM_COLLECTIVE_MAINTENANCE | ||
ABAP code using 7.40 inline data declarations to call FM TM_COLLECTIVE_MAINTENANCE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single SSORT FROM VTBSODOKU INTO @DATA(ld_sort). | ||||
| DATA(ld_sort) | = '00'. | |||
| "SELECT single SSORTDESC FROM VTBSODOKU INTO @DATA(ld_descending). | ||||
| DATA(ld_descending) | = ' '. | |||
| "SELECT single MODE FROM VTBBDC INTO @DATA(ld_mode). | ||||
| DATA(ld_mode) | = 'N'. | |||
| "SELECT single UPDATE FROM VTBBDC INTO @DATA(ld_update). | ||||
| DATA(ld_update) | = 'A'. | |||
Search for further information about these or an SAP related objects