SAP ABAP IMG Activity COCB310-11 (Define SAP Function Module)
Hierarchy
EA-APPL (Software Component) SAP Enterprise Extension PLM, SCM, Financials
   PP-PI-PMA-MSG (Application Component) Process Message
     CMX_PM (Package) Manufacturing Execution: Process Messages
IMG Activity
ID COCB310-11 Define SAP Function Module  
Transaction Code S_ALR_87007580   IMG Activity: COCB310-11 
Created on 19981222    
Customizing Attributes COCB310-11   Define SAP Function Module 
Customizing Activity COCB310-11   Define SAP Function Module 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name COCB310-11    

In this step, you define the function modules you want to use as destinations for process messages in order to process the messages for your own specific requirements.

To enable process messages to be received and processed correctly by your function module, you must observe the following points:

  • Use the COCD function group as a template. It contains the sample function module COCD_MESSAGE_DEST_TEMPLATE and all necessary Includes.
  • The function module must not transmit any COMMIT WORK. This is executed via process management.
  • The function module must not execute a dialog. No dialog boxes, for example, may be called and no messages may be issued in the status line.
    Errors, warnings and information messages must be transferred instead via the internal SCOMP table (see sample function module).
  • The function module may not execute a CALL TRANSACTION.
  • It may not trigger terminations and exceptions.
  • The function module should be programmed so that it can be called several times over during a transaction. Only when all messages in the transaction have been processed does process management execute a COMMIT WORK.
  • Updates may only be carried out asynchronously as update1 (CALL FUNCTION ... IN UPDATE TASK).

Example

You can use the following function modules as samples:

  • The standard function modules listed below
  • The copying template COCD_MESSAGE_DEST_TEMPLATE

Requirements

Standard settings

The standard system contains the following function modules in the function group COCI. These function modules are used as message destinations:

Function module            task

COCI_CONFIRM_MATERIAL_PROD            Posting of goods receipts

COCI_CONFIRM_MATERIAL_CONS            Posting of goods receipts

COCI_CONFIRM_INSPECTION_CHAR            Results confirmation for inspection

            characteristics (summary)

COCI_CONFIRM_OPERATION            Confirmation of time events for

            phases

COCI_CONFIRM_ACTIVITY            Confirmation of time events for

            variable services

COCI_CONFIRM_OPERATION_USER_ST            Updating of user status

            for operation and phase

COCI_CONFIRM_CONTROL_RECIPE            Updating of control recipe status

COCI_CONFIRM_CNTRL_REC_TO_PO            Updating of order status

            according to control recipe status

Recommendation

Activities

  1. Copy the function module COCD_MESSAGE_DEST_TEMPLATE.
    Use a function group in the customer namespace as a target group. If you have not yet defined a special group for your message destinations, create a new one.

    Warning:

    Customer data outside the customer namespace are overwritten at the next release changeover. For this reason, please use names which begin as follows:

    • Function groups with Y or Z
    • Function modules with Y_ or Z_
  2. Copy the contents of the TOP includes LCOCDTOP of the function group COCD to the TOP include of your function group (function group global data).
  3. Replace the sample target fields in the copied function module with your own (see Coding, section *Target Fields).
  4. Adjust the constants as required for target field names (see Coding, section *Constants for Target Field Names).
  5. Specify how the program should react to errors when populating the table TARGET_FIELD_NAMES.
    To do this, set the fields CHK_OBLI and CHK_INIT (see Coding, section *Fill Table TARGET_FIELD_NAMES).
  6. Insert your own processing into the program flow (see Coding, section *Further Processing).
  7. Enter any errors, warnings or information in the message log (see Coding, section *Example of Error Handling).

Further notes

Business Attributes
ASAP Roadmap ID 255   Create Interfaces 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Assigned Application Components
Documentation Object Class Documentation Object Name Current line number Application Component Application Component Name
SIMG COCB310-11 0 HLA0006278 Process Message 
Maintenance Objects
Maintenance object type C   Customizing Object 
Assigned objects
Customizing Object Object Type Transaction Code Sub-object Do not Summarize Skip Subset Dialog Box Description for multiple selections
DWBDUMMY D - Dummy object SE37 17 ABAP Function Modules 
History
Last changed by/on SAP  20070731 
SAP Release Created in