Condition Technique

Last edited: 1999-03-28 23:38 +0100

SAP uses a table controlled approach to determine type, time and media for output messages. The tables define the conditions which are used to determine the attribute records used for a message. SAP uses this condition technique not only for output determination, but also for pricing procedures to select applicable prices from a large price list.

Output Messages

R/3 generates paper printouts, faxes or IDocs for business documents like sales or purchase orders, invoices et. al. are generated by means of output messages.
NAST: task list for output
The output messages are stored a single record in the table NAST. Every NAST record contains a reference to the document  in the field NAST-OBJKY to be output plus a number of additional attributes which give instructions how the output should be processed. It is important to remember that the NAST does not store the output, but only a reminder. The actual content of the output document is always collected from the database the minute the document is sent, including all changes of the document made between the generation of the NAST record and the output created.

Condition Technique for Output Messages

Condition tables determine whether a message is sent and how it is processed
The entry in NAST is determined dynamically by analysing condition tables. The output determination algorithm reads the consition table, compares the actual application data against the content of the condition table. The conditions are used to determine
  • which output messages are sent,
  • under which circumstances they shall be sent,
  • which media is used to transport the message
  • when the message is sent
Function Modules used for messaging
  • RV_MESSAGES
  • ME_MESSAGE

An Example How Messages Are Determined From Conditions

We set up the following condition tables to demonstrate how the condition technique works.
The tables are searched for matching filter entries. If found the message is generated with the additional parameters for output media, output timing etc. If no matching entry is found the next table in the access sequence is searched. If no table has matching entries, no message is generated.
We will set up a message ZORD to output an order confirmation for sales orders of transaction VA01/VA02.
We will assign an access sequence Z001, which defines to search conditions Z03, Z02 and Z01.

Sample Conditions

Condition Z03: Paper print for selected user and customers

Filter customers who need a inspection of the print before sent
We want to print order acknowledgement, only for a selected range of customer-user combination.
 

Doctype

Customer

User

Media

Time

Language

1

TA

MCDONALD

MICKY

1=PRINTER

4=IMMEDIATE

EN

2

TA

ASTERIX

DONALD

1=PRINTER

3=MANUAL

EN

3

TA

MCDUCK

DONALD

1=PRINTER

1=RSNAST00

EN

Database table is BZ03
This condition generates the transparent table BZ03 which will maintain the actual condition records, against which the actual is compared.

Condition Z02: Customers With Special Communication

Filter customers who shall receive the order acknowledgement as a facsimile or IDoc
This condition is created to filter the customers who requested a special communication method eg. facsimile (NAST-NACHA = 2) or EDI (NAST-NACHA = 6)
 

Doctype

Customer

Media

Time

Language

4

TA

MCDONALD

6=EDI

4=IMMEDIATE

EN

5

TA

OBELIX

2=FAX

3=MANUAL

FR

6

TA

SPIELBERG

8=INTERNET

4=IMMEDIATE

 

Database table is BZ02
This condition generates the transparent table BZ02 which will maintain the actual condition records, against which the actual is compared.

Condition Z01: Default Definition For Remaining Orders

This condition defines default output for each document type
This condition is created as a fall-back, which will be used to output the documents for those customers, who do not match the criteria in one of the other conditions. The only filter criteria for this condition is the document type.
 

Doctype

Media

Time

Language

7

TA

1=PRINTER

4=IMMEDIATE

 

8

SO

1=PRINTER

3=MANUAL

 

Database table is BZ01
This condition generates the transparent table BZ01 which will maintain the actual condition records, against which the actual is compared.

Condition Z04: Deafult Definition For Remaining Orders

This copy of Z02 is used to generate a separate message for selected customers
This condition is a copy of Z02. This condition we shall use in an access sequence for a special message, which we will produce for a selected range of customers, who require special care. In our case we will use it to send an internal memo to customer care every time a premium customer places an order. This condition generates the transparent table BZ04.
 

Doctype

Customer

Media

Time

Language

9

TA

BILLGATES

7=EMAIL

4=IMMEDIATE

EN

Database table is BZ01
This condition generates the transparent table BZ01 which will maintain the actual condition records, against which the actual is compared.