SAP TPM_TRCO_MDATA_CTY_MODIFY Function Module for Create/update Commodity master data
TPM_TRCO_MDATA_CTY_MODIFY is a standard tpm trco mdata cty modify SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create/update Commodity master data 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 tpm trco mdata cty modify FM, simply by entering the name TPM_TRCO_MDATA_CTY_MODIFY into the relevant SAP transaction such as SE37 or SE38.
Function Group: TPM_TRCO_MDATA
Program Name: SAPLTPM_TRCO_MDATA
Main Program: SAPLTPM_TRCO_MDATA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TPM_TRCO_MDATA_CTY_MODIFY 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 'TPM_TRCO_MDATA_CTY_MODIFY'"Create/update Commodity master data.
EXPORTING
IS_CTY_MASTER = "Commodity master data
IT_CTY_EXCHNG = "Commodity exchange relevant data
IT_CTY_QUOTE = "Commodity quotation source
IT_CTY_FWD_PROV = "Provider settings for Forward Periods
* IT_CTY_DCSMIC = "Table for dcs alv grid for real commodity
* I_MODIFY = ' ' "Is it to update or create a record
IMPORTING
E_SUBRC = "Status of executed funtion module
EXCEPTIONS
COMMODITY_ID_NOT_ENTERED = 1 EXCHANGE_NAME_NOT_ENTERED = 2 COMMODITY_ALREADY_EXISTS = 3 AUTHORITY_ERROR = 4
IMPORTING Parameters details for TPM_TRCO_MDATA_CTY_MODIFY
IS_CTY_MASTER - Commodity master data
Data type: TRCOS_CTY_MASTEROptional: No
Call by Reference: Yes
IT_CTY_EXCHNG - Commodity exchange relevant data
Data type: TRCOY_CTY_EXCHNGOptional: No
Call by Reference: Yes
IT_CTY_QUOTE - Commodity quotation source
Data type: TRCOY_CTY_QUOTATIONOptional: No
Call by Reference: Yes
IT_CTY_FWD_PROV - Provider settings for Forward Periods
Data type: TRCOY_CTY_PROVOptional: No
Call by Reference: Yes
IT_CTY_DCSMIC - Table for dcs alv grid for real commodity
Data type: TRCOY_CTY_DCS_REAL_ALVOptional: Yes
Call by Reference: Yes
I_MODIFY - Is it to update or create a record
Data type: BOOLE_DDefault: ' '
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for TPM_TRCO_MDATA_CTY_MODIFY
E_SUBRC - Status of executed funtion module
Data type: SY-SUBRCOptional: No
Call by Reference: Yes
EXCEPTIONS details
COMMODITY_ID_NOT_ENTERED - Commodity ID not provided
Data type:Optional: No
Call by Reference: Yes
EXCHANGE_NAME_NOT_ENTERED - Exchange name is not provided
Data type:Optional: No
Call by Reference: Yes
COMMODITY_ALREADY_EXISTS - Commodity ID entered already exists
Data type:Optional: No
Call by Reference: Yes
AUTHORITY_ERROR - No authority for the required action
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TPM_TRCO_MDATA_CTY_MODIFY 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_e_subrc | TYPE SY-SUBRC, " | |||
| lv_is_cty_master | TYPE TRCOS_CTY_MASTER, " | |||
| lv_commodity_id_not_entered | TYPE TRCOS_CTY_MASTER, " | |||
| lv_it_cty_exchng | TYPE TRCOY_CTY_EXCHNG, " | |||
| lv_exchange_name_not_entered | TYPE TRCOY_CTY_EXCHNG, " | |||
| lv_it_cty_quote | TYPE TRCOY_CTY_QUOTATION, " | |||
| lv_commodity_already_exists | TYPE TRCOY_CTY_QUOTATION, " | |||
| lv_authority_error | TYPE TRCOY_CTY_QUOTATION, " | |||
| lv_it_cty_fwd_prov | TYPE TRCOY_CTY_PROV, " | |||
| lv_it_cty_dcsmic | TYPE TRCOY_CTY_DCS_REAL_ALV, " | |||
| lv_i_modify | TYPE BOOLE_D. " ' ' |
|   CALL FUNCTION 'TPM_TRCO_MDATA_CTY_MODIFY' "Create/update Commodity master data |
| EXPORTING | ||
| IS_CTY_MASTER | = lv_is_cty_master | |
| IT_CTY_EXCHNG | = lv_it_cty_exchng | |
| IT_CTY_QUOTE | = lv_it_cty_quote | |
| IT_CTY_FWD_PROV | = lv_it_cty_fwd_prov | |
| IT_CTY_DCSMIC | = lv_it_cty_dcsmic | |
| I_MODIFY | = lv_i_modify | |
| IMPORTING | ||
| E_SUBRC | = lv_e_subrc | |
| EXCEPTIONS | ||
| COMMODITY_ID_NOT_ENTERED = 1 | ||
| EXCHANGE_NAME_NOT_ENTERED = 2 | ||
| COMMODITY_ALREADY_EXISTS = 3 | ||
| AUTHORITY_ERROR = 4 | ||
| . " TPM_TRCO_MDATA_CTY_MODIFY | ||
ABAP code using 7.40 inline data declarations to call FM TPM_TRCO_MDATA_CTY_MODIFY
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 SUBRC FROM SY INTO @DATA(ld_e_subrc). | ||||
| DATA(ld_i_modify) | = ' '. | |||
Search for further information about these or an SAP related objects