SAP RM_PROT_COMMODITY Function Module for Write Commodity data to log









RM_PROT_COMMODITY is a standard rm prot commodity SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Write Commodity data to log 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 rm prot commodity FM, simply by entering the name RM_PROT_COMMODITY into the relevant SAP transaction such as SE37 or SE38.

Function Group: RMPR
Program Name: SAPLRMPR
Main Program: SAPLRMPR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RM_PROT_COMMODITY 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 'RM_PROT_COMMODITY'"Write Commodity data to log
EXPORTING
* I_LEVEL = '1' "Log Level
* I_QUOT_PRUN = "Price unit of quotation
* I_CTY_UOM = " Unit of Measure of Quotation
* I_PRICE_DATE = "Date at which price is available
* I_GRID_POINT = "Data Element of Bool Type - Whether Grid Point or Not
* I_READ_BACK = "Read Back Indicator
* I_HEADER = 'X' "
I_LINES = 0 "
I_CTY_ID = "Commodity ID
* I_CURVE_TYPE = "Commodity Curve Type
* I_PRICING_DATE = "
* I_TENOR = "Time to Maturity
* I_SHIFTED_PRICING_DATE = "
I_PRICE = "Commodity Price
I_CCY = "Currency Key for Commodity Price
.



IMPORTING Parameters details for RM_PROT_COMMODITY

I_LEVEL - Log Level

Data type: SPROT-LEVEL
Default: '1'
Optional: No
Call by Reference: Yes

I_QUOT_PRUN - Price unit of quotation

Data type: TCR_CTY_QUOT_PRUN
Optional: Yes
Call by Reference: Yes

I_CTY_UOM - Unit of Measure of Quotation

Data type: TCR_CTY_QUOT_UOM
Optional: Yes
Call by Reference: Yes

I_PRICE_DATE - Date at which price is available

Data type: D
Optional: Yes
Call by Reference: Yes

I_GRID_POINT - Data Element of Bool Type - Whether Grid Point or Not

Data type: TAN_CC_GRID_POINT
Optional: Yes
Call by Reference: Yes

I_READ_BACK - Read Back Indicator

Data type: TBA_READ_BACK_INDICATOR
Optional: Yes
Call by Reference: Yes

I_HEADER -

Data type: ABAP_BOOL
Default: 'X'
Optional: Yes
Call by Reference: Yes

I_LINES -

Data type: I
Optional: No
Call by Reference: Yes

I_CTY_ID - Commodity ID

Data type: TRCO_COMM_ID
Optional: No
Call by Reference: Yes

I_CURVE_TYPE - Commodity Curve Type

Data type: TB_CTY_CURVE_TYPE
Optional: Yes
Call by Reference: Yes

I_PRICING_DATE -

Data type: D
Optional: Yes
Call by Reference: Yes

I_TENOR - Time to Maturity

Data type: TBA_TENOR
Optional: Yes
Call by Reference: Yes

I_SHIFTED_PRICING_DATE -

Data type: D
Optional: Yes
Call by Reference: Yes

I_PRICE - Commodity Price

Data type: TCR_CTY_PRICEQUOT
Optional: No
Call by Reference: Yes

I_CCY - Currency Key for Commodity Price

Data type: TCR_CTY_QUOTCURR
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for RM_PROT_COMMODITY 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_i_level  TYPE SPROT-LEVEL, "   '1'
lv_i_quot_prun  TYPE TCR_CTY_QUOT_PRUN, "   
lv_i_cty_uom  TYPE TCR_CTY_QUOT_UOM, "   
lv_i_price_date  TYPE D, "   
lv_i_grid_point  TYPE TAN_CC_GRID_POINT, "   
lv_i_read_back  TYPE TBA_READ_BACK_INDICATOR, "   
lv_i_header  TYPE ABAP_BOOL, "   'X'
lv_i_lines  TYPE I, "   0
lv_i_cty_id  TYPE TRCO_COMM_ID, "   
lv_i_curve_type  TYPE TB_CTY_CURVE_TYPE, "   
lv_i_pricing_date  TYPE D, "   
lv_i_tenor  TYPE TBA_TENOR, "   
lv_i_shifted_pricing_date  TYPE D, "   
lv_i_price  TYPE TCR_CTY_PRICEQUOT, "   
lv_i_ccy  TYPE TCR_CTY_QUOTCURR. "   

  CALL FUNCTION 'RM_PROT_COMMODITY'  "Write Commodity data to log
    EXPORTING
         I_LEVEL = lv_i_level
         I_QUOT_PRUN = lv_i_quot_prun
         I_CTY_UOM = lv_i_cty_uom
         I_PRICE_DATE = lv_i_price_date
         I_GRID_POINT = lv_i_grid_point
         I_READ_BACK = lv_i_read_back
         I_HEADER = lv_i_header
         I_LINES = lv_i_lines
         I_CTY_ID = lv_i_cty_id
         I_CURVE_TYPE = lv_i_curve_type
         I_PRICING_DATE = lv_i_pricing_date
         I_TENOR = lv_i_tenor
         I_SHIFTED_PRICING_DATE = lv_i_shifted_pricing_date
         I_PRICE = lv_i_price
         I_CCY = lv_i_ccy
. " RM_PROT_COMMODITY




ABAP code using 7.40 inline data declarations to call FM RM_PROT_COMMODITY

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 LEVEL FROM SPROT INTO @DATA(ld_i_level).
DATA(ld_i_level) = '1'.
 
 
 
 
 
 
DATA(ld_i_header) = 'X'.
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!