SAP BAPI_TRCO_COMMODITY_CREATE Function Module for Create commodity master data
BAPI_TRCO_COMMODITY_CREATE is a standard bapi trco commodity create 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 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 bapi trco commodity create FM, simply by entering the name BAPI_TRCO_COMMODITY_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: TPM_TRCO_COMMODITY
Program Name: SAPLTPM_TRCO_COMMODITY
Main Program: SAPLTPM_TRCO_COMMODITY
Appliation area:
Release date: 28-Aug-2007
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_TRCO_COMMODITY_CREATE 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 'BAPI_TRCO_COMMODITY_CREATE'"Create commodity master data.
EXPORTING
COMMODITY_DATA = "BAPI structure for creating commodity master data
* TESTRUN = ' ' "Switch to Simulation Session for Write BAPIs
IMPORTING
COMMODITY_ID = "Commodity ID
TABLES
EXCHANGE_DATA = "BAPI structure for creating commodity exchange data
QUOTATION_DATA = "BAPI structure for creating commodity quotation data
RETURN = "Return Parameter
* PROVIDER_DATA = "BAPI structure for creating market data provider settings
IMPORTING Parameters details for BAPI_TRCO_COMMODITY_CREATE
COMMODITY_DATA - BAPI structure for creating commodity master data
Data type: BAPI_TRCOS_CTY_CREATEOptional: No
Call by Reference: No ( called with pass by value option)
TESTRUN - Switch to Simulation Session for Write BAPIs
Data type: BAPI2042-TESTRUNDefault: SPACE
Optional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_TRCO_COMMODITY_CREATE
COMMODITY_ID - Commodity ID
Data type: BAPI_TRCOS_CTY_CREATE-COMMODITY_IDOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_TRCO_COMMODITY_CREATE
EXCHANGE_DATA - BAPI structure for creating commodity exchange data
Data type: BAPI_TRCOS_CTY_EXCHNG_CREATEOptional: No
Call by Reference: Yes
QUOTATION_DATA - BAPI structure for creating commodity quotation data
Data type: BAPI_TRCOS_CTY_QUOT_CREATEOptional: No
Call by Reference: Yes
RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: Yes
PROVIDER_DATA - BAPI structure for creating market data provider settings
Data type: BAPI_TRCOS_CTY_PROV_CREATEOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_TRCO_COMMODITY_CREATE 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_commodity_id | TYPE BAPI_TRCOS_CTY_CREATE-COMMODITY_ID, " | |||
| lt_exchange_data | TYPE STANDARD TABLE OF BAPI_TRCOS_CTY_EXCHNG_CREATE, " | |||
| lv_commodity_data | TYPE BAPI_TRCOS_CTY_CREATE, " | |||
| lv_testrun | TYPE BAPI2042-TESTRUN, " SPACE | |||
| lt_quotation_data | TYPE STANDARD TABLE OF BAPI_TRCOS_CTY_QUOT_CREATE, " | |||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lt_provider_data | TYPE STANDARD TABLE OF BAPI_TRCOS_CTY_PROV_CREATE. " |
|   CALL FUNCTION 'BAPI_TRCO_COMMODITY_CREATE' "Create commodity master data |
| EXPORTING | ||
| COMMODITY_DATA | = lv_commodity_data | |
| TESTRUN | = lv_testrun | |
| IMPORTING | ||
| COMMODITY_ID | = lv_commodity_id | |
| TABLES | ||
| EXCHANGE_DATA | = lt_exchange_data | |
| QUOTATION_DATA | = lt_quotation_data | |
| RETURN | = lt_return | |
| PROVIDER_DATA | = lt_provider_data | |
| . " BAPI_TRCO_COMMODITY_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_TRCO_COMMODITY_CREATE
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 COMMODITY_ID FROM BAPI_TRCOS_CTY_CREATE INTO @DATA(ld_commodity_id). | ||||
| "SELECT single TESTRUN FROM BAPI2042 INTO @DATA(ld_testrun). | ||||
| DATA(ld_testrun) | = ' '. | |||
Search for further information about these or an SAP related objects