Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Introduction

The printing program does not only confess with the output of purchasing documents on
the printer but with all methods of getting the documents to the vendor. This can be a
printout, but also sending a purchasing document by fax, E-mail or EDI.
The same program and form are used for the output of several documents and
processes.
Documents
The documents that can be output are:

Request for quotation

Purchase Order

Contract

Scheduling Agreement Delivery Schedule


Processes
The processes that require the output of a document:

Creating a new document

Changing an existing document

Creating a new delivery schedule for a scheduling agreement

Urging/reminding a delivery
Programs
Different programs are involved in creating and sending out messages. Our programs
are SAPMM06E, SAPFM06P and the function groups MEPO, MEDRUCK and MEDR.
From basis it is mainly RSNAST00 and RSNASTED(for EDI).
Creating messages
For testing messages it is usually a good idea to set the dispatch-time (VSZTP) to 1 or
3, so that the message is not directly sent out. Sometimes just changing the dispatchtime from 4 to 3 may solve the problem. Especially for change messages there is the

problem that creating the change-documents on the database (CDHDR, CDPOS) and
the message output both run in update task (V2). The sequence of the processing is not
guaranteed!
Messages for new and changed documents
Messages for new or changed documents are created from within the programs
SAPMM06E and the Function group MEPO (since 4.6 release).
Routines NACHRICHT_ERZEUGEN and NACHRICHT_MODIFIZIEREN are the most
important ones. NACHRICHT_ERZEUGEN calls the function ME_MESSAGES_FIND to
find out what message has to be created. NACHRICHT_MODIFIZIEREN will block or
release a message dependent form its input parameter. This is used for documents in
status 'Hold' or if a release strategy is involved.
The function ME_MESSAGES_FIND mainly calls the functions
MM_PARTNERS_FOR_MESSAGING and MESSAGING to create the new message. At
the end of ME_MESSAGES_FIND the XNAST should contain the new message.
Message determination
The message determination uses the same condition technique as it is used in Pricing.
Generally speaking a message type is the same as a condition type, but the term
'condition type' is more generic. Messages serve to send a purchase document or a
dunning/reminder of a purchase document to the vendor. Messages can be created and
send for Request for Quotations (RFQ), Purchase Orders (PO), scheduling agreements,
delivery schedules and contracts. To transmit a message you can use different media
like printer, fax, EDI, E-Mail or SAPoffice.
If a message is being sent via E-Mail then there are two possibilities:
1.

A PDF-document is attached to the mail. The mail itself does not contain any
Purchase data.

2.

The content of the message is written as ASCII-text into the mail itself.
To set up the message determination of purchasing documents you have to assign a
message scheme to a Purchasing document. But, setting up the message
determination of purchasing documents is not mandatory. If no message determination
is set, then the system always creates the message type NEU for a purchasing
document. The prerequisite is that a printer can be determined.
To determine a printer, the system checks in the following sequence.
a) Is a printer assigned to a purchasing group?
b) Is a printer maintained in the user defaults?
c) Is a printer maintained in the user parameters?

If no printer can be found at all, no message will be created. This is the case not only for
printers, but for other media (fax, mail, etc.) as well. Note that this can also happen
when the message determination is set up.
When creating or changing a purchasing document the message determination will be
always processed. The system looks up the message scheme that is assigned to the
purchasing document. Each scheme contains several message types. The message
types, themselves, are linked with condition tables, which contain the condition entries.
or each message type there is an access sequence that determines in which sequence
the condition entries for a message type are looked up. If a valid condition entry is found
then the message type of that entry will be chosen, and a message for the purchasing
document will be created. The relevant data of the message will be taken from the
condition entry, e.g. (message) partner, (output) medium, dispatching time.
Urging and reminding
Urging messages/reminders are created by the report RM06ENMA.
It is possible to select the documents that have to be examined. All positions of each
selected documents are tested if a message has to be created. The messages are
created in the routine NACHRICHTEN_ERZEUGEN by using the function
ME_MESSAGES_FIND. With note 369948 an extensive diagnostic output has been
added to this report. It was also changed that the messages are not sent out
immediately. Originally messages were created, sent out (without any feedback whether
sending was successful or not) and the counter in the scheduling line was increased.
Now the messages are created, we wait for a feedback and the counter is only
increased when the message was created successful and the message is sent out
(function WFMC_MESSAGE_SINGLE) in a last step.
Sending messages
The output is usually initiated by one of our programs. If the messages are customized
for an immediate output these are the programs SAPMM06E, RM06ENMA and the
function-group MEPO. If the output is initiated manually (or a batch-job) this is usually
the report RM06ENDR(<=4.0) or RM06ENDR_ALV(>=4.5).
The most important part is the routine USER_COMMAND from where the functions
WFMC_MESSAGE_SINGLE (real output), WFMC_MESSAGE_SINGLE_NO_UPDATE
(test, draft) or WFMC_MESSAGE_SINGLE_SCREEN (preview) are called.
These functions call routines in the standard-report RSNAST00. In this report the
routine PROGRAMM_AUFRUFEN is of special interest as in this routine the name of
the printing program and the form are retrieved from the customizing and then the
application and message-specific entry-routine in the printing program is called.
The entry-routines will then start reading the data concerning the current message and
output the document. Until 4.5B the whole logic was located in the program SAPFM06P,
from 4.6B on the entry-routines call the functions ME_READ_PO_FOR_PRINTING and
ME_PRINT_PO from the function-group MEDRUCK.

Message output
When one wants to test the output of a message by RM06ENDR_ALV, there are 3
choices:
1. Output message: The message is really processed and sent to the device for which it
was created
(fax, printer, ...)
2. Display message: A preview window is opened and the message is displayed on the
screen.
There is an important difference between the preview from ME21N and ME9F/K/L:
ME21N: Not all data is already present on the database, so the printout may be
incomplete. It
is not possible to print change-messages, as in the ME21N no changes have been
written to
the database and so no change-documents (CDHDR, CDPOS) exist.
ME9x: The document and all related data do exist on the database, so the preview
should
show exactly the same data as the printout.
3. Trial printout: The message is sent to the printer (no matter for what device the
message was
created). The status (NAST-VSTAT) is not changed.
The report RM06ENDR_ALV is usually not called directly but by one of the following
transactions:
Release <= 3.1I
ME90: Transmit purchasing documents
ME91: Reminding and Urging purchasing documents
ME92: Monitor receipt of order acknowledgement
Release >3.1I
ME9A: Transmission of RFQs
ME91A: Reminding and Urging of RFQs
ME9F: Transmit POs
ME91F: Reminding and Urging POs
ME92F: Monitor receipt of order acknowledgement
ME9L: Transmission of scheduling agreements
ME9E: Transmission of delivery schedules
ME91E: Reminding and Urging of delivery schedules
ME92L: Monitor receipt of order acknowledgement
ME84: Create delivery schedule releases
ME9K: Transmit contracts
ME92K: Monitor receipt of order acknowledgement
Printer and fax settings as well as the dispatching time can be changed before

transmitting a purchasing document. But, it is possible to exclude certain dispatching


times for a message type.
Messages of purchasing documents that are subject to release will not be displayed or
transmitted.
Special Information for Releases as of 4.6B:
When issuing NEU-messages or change-messages the quantity of the goods receipt
will be taken into
account.
Messages already processed can be processed again when using the function 'Repeat
Output' in the
message overview.
When urging a purchasing document it is not sufficient to create the urging message
MAHN manually in the message overview of the document. Such a message will not be
processed.
The urging message has to be created by the appropriate transaction as this is the only
possibility to
determine the relevant data.
The form MEDRUCK (and how to add additional data)
The one and only SAPscript form that is used for the output of purchasing documents is
the form MEDRUCK. It can be displayed and modified with the transaction SE71.
The form consists of several 'windows'.
Text elements are the link between the printing program and the form. So if something
does not look right on the form, try to identify the affected text-element.
If you want to add additional fields to the MEDRUCK you do NOT change the printing
program. First you add your additional fields to the structures e.g. PEKKO resp. PEKPO
by creating your own append. Second you create an executable program (e.g. with
SE38) and define form routines, which contain the programs to read the new data.
Finally you go to the SAPscript text and call the subroutine there.
Customizing
The Customizing can be found in transaction OLME under 'Messages'.
Transactions that make the Customizing easier to use, but do not substitute are: NACE
and OMGG.
The subsequent customizing settings can be found in the branch 'Messages -> Output
Control'.
Maintain Message Determination Scheme
M/32 RFQ
M/36 Purchase Order
M/68 Purchasing Outline Agreement

M/42 Purchasing Scheduling Agreement


VNE7 Inbound Delivery
You can define more than one scheme. But only one scheme can be assigned to one
purchasing document type.
Assign Message Determination Scheme
You can set a dispatching time here as default.
To make sure that the message determination works properly, the flags 'M' for message
determination
and 'P' for partner determination should be set. The flag 'Rel. mess.' is only relevant for
scheduling agreement releases. If this flag is set, the system creates a new message
for each release.
Only one message scheme can be assigned to each purchasing document
Define message types
If a message shall be sent via EDI, in transaction WE20 the message type has to be
maintained for the message partner.
In the details of a message type several settings are available:
General Data:
One message scheme is assigned to the message type. In case a communication
strategy shall be used, this has to be assigned here as well. Make sure that the flags for
'Access to conditions' and 'Multiple issuing' are set. The flag for 'Multiple issuing' allows
sending messages multiple times to the same partner --> this is relevant for urgings and
reminders.
If the flag for 'partner-independent output' is not set, the system allows only certain
partner roles for the message determination.
To create change messages properly, the program FM06AEND and the form
CHANGE_FLAG must be maintained.
In case you want to send a message via Email and provide purchasing-documentspecific information in the title of the Email you need to maintain the area 'Replacement
of text symbols' with the program SAPMM06E and form TEXT_SYMBOL_REPLACE.
Default Values:
you maintain the dispatching time and the transmission medium.
'Processing routines'
In the branch 'Processing routines' the processing programs, form routines and forms
can be assigned to the different media.
Fine-tune Control

Defines which message type shall be used for which print operation (new print, change
print, urging letter, expediter). For the message type NEU the print operations 1 (new
print) and 2 (change print) should be always maintained. In case scheduling
agreements are used, the flag 'Update print-dependent data' should be selected. This
flag controls whether print-dependent data should be updated when printing messages
in case of scheduling agreement releases. Please note that when transmitting several
message types, e.g. LPH1 and LPJ2, the flag should be set only for the last one.
Define Access-Sequence
The access sequence is assigned to the message type. Assigned can be only one
access sequence. The access sequence serves as key combination for the creation of
condition-/message entries. The access sequence orders the condition tables in a
certain sequence. Tables with the lowest sequence number will be looked up first. The
tables should be sorted from specific to unspecific. In this case the most specific
condition table will be looked up first.
The flag 'Exclusive' prevents the system to look up subsequent tables in case one table
was already matched. This prevents that more than one message will be created.
Define condition tables
The condition tables contain those fields for which a purchasing document will be
checked when determining the message.
In the standard the tables delivered contain the following fields:
Table name Fields
027 Purch. Org./Vendor for EDI
025 Doc.Type/Purch.Org/Vendor
026 Document Type
Communication strategy: (>= 4.6B)
Menu Path: SPRO -> Basis Components -> Basis Services -> Message Control
For each message type a communication strategy can be maintained. The
communication strategy determines the sequence in which the system looks up the
communication type (Email, Fax, Printer...) of a partner. SAPConnect must support the
communication types. The first communication type that has a valid entry will be used.
The advantage of a communication strategy is that you, for example, can send a
message primarily by Email. All partners without an Email-address shall receive their
messages by fax. All partners without Email and fax shall receive the message by mail
(Printer).
Condition-/Message Entries
After having set up the customizing it is mandatory to fill the condition tables. As long as
the condition tables are not filled there will be no message determination!

Menu path: Logistics -> Materials Management -> Purchasing -> Master Data ->
Messages
In the condition entry at the latest, a transmission medium has to be maintained.
Otherwise a message will not be created. The settings in the condition entry always
overwrite all other settings that might have been maintained in other parts of the
customizing.
Via the determination analysis, which can be found within the message overview of a
purchasing document, it is possible to identify why a message was created or not.
When using FAX or Email as transmission medium, make sure that a valid fax number
or Email-address in the vendor's master data is maintained.
In case a message should be transmitted immediately, the flag 'Print immediately' in the
communication data should be set. Otherwise the message is send to the spool and the
transmission has to be continued from there, e.g. via a job.
When 'holding' a faulty purchase order in ME21N, no message will be created. The
message determination will wait until the purchase order is no longer faulty.

You might also like