The objective of Message Control is the exchange of information between various partners and the launching of subsequent processing which is partner-independent.
Message Control uses the condition technique for message determination. The condition technique is also used in other areas, such as pricing.
A (message) application is a separate function within an SAP application, which uses the condition technique in the message determination area.
The message application is the highest element in the hierarchy of condition components. Each R/3 application which wants to use Message Control is assigned an application with the relevant application code.
A message application cannot be equated with an SAP application.
The field catalog groups together all fields which can be selected as key fields for condition tables in Message Control. It is represented by the structure KOMB in Message Control.
SAP supplies adequate field catalogs for all applications.
The application filter is the application view of the field catalog for condition keys.
It determines which fields of the field catalog can be selected per application (e.g. V1). To check this, you can display the contents of the table T681F (Allowed Fields Per Usage and Application).
Display the contents of table T681F with the Data Browser. (Tools ® ABAP Workbench, Overview ® Data Browser.)
Always enter B (Output) in the field KVEWE (Usage of condition table).
Enter the application in the field KAPPL (application). For the purposes of the tutorial, enter V1 (sales) here.
Leave the other selection fields empty and select Program ® Execute.
The fields of the structure KOMB, which are used in Message Control and in the application V1, are now displayed.
An output type (e.g. BA00 for order confirmation, MAIL for internal message, or KRML for an exceeded credit limit):
· An abbreviation for the message contents
· Used for the administration of parameters for message determination
The output type is assigned an access sequence, which in turn contains an assignment to condition tables. An output type must be assigned exactly one access sequence.
The assignment between the output type and access sequence is not defined until step 7 of this tutorial.
The output type is assigned a processing program per transmission medium. This program is called when a corresponding Message Control record is processed.
The transmission media determine the type of processing. The following options exist:
5. Mail (external)
7. Mail (internal)
8. Special function
9. Event (partner-independent)
The special function allows you to use your own programs.
In this tutorial, only transmission medium 9 (Workflow events) is used.
To be able to send a message using a particular transmission medium, it is necessary to define a processing program for the respective transmission medium, which is called by report RSNAST00 for message dispatch.
An appropriate processing program must be maintained for each transmission medium. The processing program may have the functionality for sending SAPoffice mails, for example, or triggering events.
This processing program is assigned to application, output type, and transmission medium. If the processing program is not maintained, messages cannot be sent and the processing log is updated.
In the standard system, the table of processing programs (TNAPR) specifies which programs can be used for sending messages.
Transmission medium 9 (Workflow events) has been set up in order to create events from Message Control.
The application-independent standard processing program for event creation is called RSWEMC01 with the FORM routine CREATE_EVENT.
A condition table consists of one or more condition keys and a data part:
· the condition keys can be selected according to the data constellation which is to trigger a message default.
· the data part consists of an index to the table of message attributes (table NACH).
The condition table is identified in the dialog screen via a three-digit number. Internally, a database table is created with the name B<three-digit number>. The key fields of each condition table are selected fields from the (filtered) field catalog.
When the key fields have been specified, the condition table must be generated and therefore created in the database.
An access sequence determines the order in which the condition tables are processed. Exit criteria can be defined at each level for terminating the search for message proposals.
Exactly one access sequence is assigned to each output type. However, several output types can be assigned to one access sequence. An advantage of this procedure is that various output types can apply for the same data constellation.
Condition tables and access sequences are predefined as examples. They are supplied with a customer name range so that they can be defined to meet the requirements of a specific customer situation.
The values which trigger a message default are defined, that is the records of the condition tables are filled with values. These values are determined on an application-specific basis using transactions.
The condition records of a condition table describe the values or field contents, which result in a message default, and the attributes of this message default.
When an application calls message determination, the defined condition components are used to find the condition records which correspond to the current application data. If the search is successful, a message default is generated.
The following diagram illustrates the process:
Important aspects which need to be considered when entering condition records are transmission medium, time of dispatch, and the language as well as entries for partner determination.
Messages which are to be sent at a particular time are selected by the program RSNAST00. This program is usually executed at predefined intervals. You can define these intervals in SAP background processing (Tools ® Administration, Jobs ® Job definition). The selection program can also be started online if necessary.
In both cases (background, online), the selection program processes all Message Control records which meet the selection options and whose processing time or interval has been reached or has passed.
If a business application transfers a procedure for message determination to Message Control, all output types in the procedure are searched.
In the diagram, these are the output types order confirmationand internal mail in the schema order.
A message type in the schema can be assigned a condition. This condition is formulated as ABAP code. The value of the system return code at the end of the condition determines whether condition tables are accessed for this message. If the result is negative, processing continues in the schema.
If messages with no difference in partner function, partner number, or language are to be sent for an object, you must use different output types in Message Control to implement this.
If, for example, a sold-to party is supposed to receive an order confirmation both in printed form and via EDI, this means that a message for an object (a customer order) needs to be sent to a specific partner and in a specific language, but using different methods.
Message Control, and thus the condition technique, require different output types to represent this situation. These are linked in the schema. It is not possible to specify an exit criterion.