Show TOC
Define R/3
Function Module
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 may not transmit any
COMMIT WORK. This is executed via process management.
- The function module may 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 copy template
COCD_MESSAGE_DEST_TEMPLATE
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 goods receipts |
| COCI_CONFIRM_MATERIAL_CONS |
|
|
Posting 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 user status |
|
|
|
for operation and phase |
| COCI_CONFIRM_CONTROL_RECIPE |
|
|
Updating control recipe status |
| COCI_CONFIRM_CNTRL_REC_TO_PO |
|
|
Updating order status |
|
|
|
according to control recipe status |
Activities
1. Copy the
function module COCD_MESSAGE_DEST_TEMPLATE.
Use a function group in the customer name range 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 name range 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 yourown (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 filling out 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 for error handling).