SAP MC_INSERT_MCTBAT Function Module for Make entry in the 'internal' TBATG - store actions
MC_INSERT_MCTBAT is a standard mc insert mctbat SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Make entry in the 'internal' TBATG - store actions 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 mc insert mctbat FM, simply by entering the name MC_INSERT_MCTBAT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SMC1
Program Name: SAPLSMC1
Main Program: SAPLSMC1
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MC_INSERT_MCTBAT 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 'MC_INSERT_MCTBAT'"Make entry in the 'internal' TBATG - store actions.
EXPORTING
* FUNC = ' ' "Function to be executed
* MCID = ' ' "Name of the matchcode ID
* MCONAME = ' ' "Name of the matchcode object
* OBJTYP = ' ' "Object to be handled
* ONAME1 = ' ' "Object name
* ONAME2 = ' ' "Additional object name (e.g. index name)
TABLES
MCTBAT_TAB = "'Internal' TBATG - store actions
IMPORTING Parameters details for MC_INSERT_MCTBAT
FUNC - Function to be executed
Data type: MCTBAT-FUNCDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
MCID - Name of the matchcode ID
Data type: MCTBAT-MCIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MCONAME - Name of the matchcode object
Data type: MCTBAT-MCONAMEDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJTYP - Object to be handled
Data type: MCTBAT-OBJECTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
ONAME1 - Object name
Data type: MCTBAT-OBJNAME1Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
ONAME2 - Additional object name (e.g. index name)
Data type: MCTBAT-OBJNAME2Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MC_INSERT_MCTBAT
MCTBAT_TAB - 'Internal' TBATG - store actions
Data type: MCTBATOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MC_INSERT_MCTBAT 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_func | TYPE MCTBAT-FUNC, " ' ' | |||
| lt_mctbat_tab | TYPE STANDARD TABLE OF MCTBAT, " | |||
| lv_mcid | TYPE MCTBAT-MCID, " SPACE | |||
| lv_mconame | TYPE MCTBAT-MCONAME, " ' ' | |||
| lv_objtyp | TYPE MCTBAT-OBJECT, " ' ' | |||
| lv_oname1 | TYPE MCTBAT-OBJNAME1, " ' ' | |||
| lv_oname2 | TYPE MCTBAT-OBJNAME2. " ' ' |
|   CALL FUNCTION 'MC_INSERT_MCTBAT' "Make entry in the 'internal' TBATG - store actions |
| EXPORTING | ||
| FUNC | = lv_func | |
| MCID | = lv_mcid | |
| MCONAME | = lv_mconame | |
| OBJTYP | = lv_objtyp | |
| ONAME1 | = lv_oname1 | |
| ONAME2 | = lv_oname2 | |
| TABLES | ||
| MCTBAT_TAB | = lt_mctbat_tab | |
| . " MC_INSERT_MCTBAT | ||
ABAP code using 7.40 inline data declarations to call FM MC_INSERT_MCTBAT
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 FUNC FROM MCTBAT INTO @DATA(ld_func). | ||||
| DATA(ld_func) | = ' '. | |||
| "SELECT single MCID FROM MCTBAT INTO @DATA(ld_mcid). | ||||
| DATA(ld_mcid) | = ' '. | |||
| "SELECT single MCONAME FROM MCTBAT INTO @DATA(ld_mconame). | ||||
| DATA(ld_mconame) | = ' '. | |||
| "SELECT single OBJECT FROM MCTBAT INTO @DATA(ld_objtyp). | ||||
| DATA(ld_objtyp) | = ' '. | |||
| "SELECT single OBJNAME1 FROM MCTBAT INTO @DATA(ld_oname1). | ||||
| DATA(ld_oname1) | = ' '. | |||
| "SELECT single OBJNAME2 FROM MCTBAT INTO @DATA(ld_oname2). | ||||
| DATA(ld_oname2) | = ' '. | |||
Search for further information about these or an SAP related objects