SAP COMH_CREATE_CR_STATE_MESSAGE Function Module for NOTRANSL: Erzeugt eine Statusrückmeldung zu einer Herstellanweisung









COMH_CREATE_CR_STATE_MESSAGE is a standard comh create cr state message SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Erzeugt eine Statusrückmeldung zu einer Herstellanweisung 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 comh create cr state message FM, simply by entering the name COMH_CREATE_CR_STATE_MESSAGE into the relevant SAP transaction such as SE37 or SE38.

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



Function COMH_CREATE_CR_STATE_MESSAGE 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 'COMH_CREATE_CR_STATE_MESSAGE'"NOTRANSL: Erzeugt eine Statusrückmeldung zu einer Herstellanweisung
EXPORTING
CONTROL_RECIPE = "
PROCESS_ORDER = "Process Order Number
CONTROL_RECIPE_STATE = "Status of PI sheet according to CO_PISTAT
* READ_DATE = SY-DATLO "Date
* READ_TIME = SY-TIMLO "Time
MESSAGE_ID = "Message number
SOURCE = "Message source
TSTKZ = "Test indicator
WERK = "Plant

TABLES
TCOME = "Message characteristics
TCOMH = "Message header

EXCEPTIONS
MSCLA_NOT_DEFINED = 1
.



IMPORTING Parameters details for COMH_CREATE_CR_STATE_MESSAGE

CONTROL_RECIPE -

Data type: COCHP-CRID
Optional: No
Call by Reference: No ( called with pass by value option)

PROCESS_ORDER - Process Order Number

Data type: COCHP-BID
Optional: No
Call by Reference: No ( called with pass by value option)

CONTROL_RECIPE_STATE - Status of PI sheet according to CO_PISTAT

Data type: COCHP-CRSTAT
Optional: No
Call by Reference: No ( called with pass by value option)

READ_DATE - Date

Data type: SY-DATUM
Default: SY-DATLO
Optional: Yes
Call by Reference: No ( called with pass by value option)

READ_TIME - Time

Data type: SY-UZEIT
Default: SY-TIMLO
Optional: Yes
Call by Reference: No ( called with pass by value option)

MESSAGE_ID - Message number

Data type: COMHP-MSID
Optional: No
Call by Reference: No ( called with pass by value option)

SOURCE - Message source

Data type: COMHP-SOURCE
Optional: No
Call by Reference: No ( called with pass by value option)

TSTKZ - Test indicator

Data type: COMHP-TSTKZ
Optional: No
Call by Reference: No ( called with pass by value option)

WERK - Plant

Data type: COMHP-WERK
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for COMH_CREATE_CR_STATE_MESSAGE

TCOME - Message characteristics

Data type: RCOMEP
Optional: No
Call by Reference: No ( called with pass by value option)

TCOMH - Message header

Data type: RCOMHP
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

MSCLA_NOT_DEFINED - Message category not maintained

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for COMH_CREATE_CR_STATE_MESSAGE 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:
lt_tcome  TYPE STANDARD TABLE OF RCOMEP, "   
lv_control_recipe  TYPE COCHP-CRID, "   
lv_mscla_not_defined  TYPE COCHP, "   
lt_tcomh  TYPE STANDARD TABLE OF RCOMHP, "   
lv_process_order  TYPE COCHP-BID, "   
lv_control_recipe_state  TYPE COCHP-CRSTAT, "   
lv_read_date  TYPE SY-DATUM, "   SY-DATLO
lv_read_time  TYPE SY-UZEIT, "   SY-TIMLO
lv_message_id  TYPE COMHP-MSID, "   
lv_source  TYPE COMHP-SOURCE, "   
lv_tstkz  TYPE COMHP-TSTKZ, "   
lv_werk  TYPE COMHP-WERK. "   

  CALL FUNCTION 'COMH_CREATE_CR_STATE_MESSAGE'  "NOTRANSL: Erzeugt eine Statusrückmeldung zu einer Herstellanweisung
    EXPORTING
         CONTROL_RECIPE = lv_control_recipe
         PROCESS_ORDER = lv_process_order
         CONTROL_RECIPE_STATE = lv_control_recipe_state
         READ_DATE = lv_read_date
         READ_TIME = lv_read_time
         MESSAGE_ID = lv_message_id
         SOURCE = lv_source
         TSTKZ = lv_tstkz
         WERK = lv_werk
    TABLES
         TCOME = lt_tcome
         TCOMH = lt_tcomh
    EXCEPTIONS
        MSCLA_NOT_DEFINED = 1
. " COMH_CREATE_CR_STATE_MESSAGE




ABAP code using 7.40 inline data declarations to call FM COMH_CREATE_CR_STATE_MESSAGE

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 CRID FROM COCHP INTO @DATA(ld_control_recipe).
 
 
 
"SELECT single BID FROM COCHP INTO @DATA(ld_process_order).
 
"SELECT single CRSTAT FROM COCHP INTO @DATA(ld_control_recipe_state).
 
"SELECT single DATUM FROM SY INTO @DATA(ld_read_date).
DATA(ld_read_date) = SY-DATLO.
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_read_time).
DATA(ld_read_time) = SY-TIMLO.
 
"SELECT single MSID FROM COMHP INTO @DATA(ld_message_id).
 
"SELECT single SOURCE FROM COMHP INTO @DATA(ld_source).
 
"SELECT single TSTKZ FROM COMHP INTO @DATA(ld_tstkz).
 
"SELECT single WERK FROM COMHP INTO @DATA(ld_werk).
 


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!