Sie sind auf Seite 1von 9

RM06EEI0 SAP Report - Transfer of Purchase Orders

RM06EEI0 is a standard ABAP report available within your SAP system (depending on your version and release level).
Below is the standard documentation available for this report and a few details of other objects it interacts with such as
tables, function modules, includes etc. If you would like to see the full code listing simply enter RM06EEI0 into the relevant
SAP transaction such as SE38 or SE80

SAP Documentation for program RM06EEI0


Transaction Code(s):
Below is a list of transaction codes which are relevant to this SAP report

OMQ1 - Transfer of Purchase Orders


DESCRIPTION
This direct input program creates purchase orders using function modules. In a second step, program RM06EEI1 supplements these
newly created POs with the purchase order history and the necessary accounting documents.
Please note the following restrictions:
The net price is based on one condition only (standard: PBXX): additional conditions (discounts, surcharges) are not supported
Change documents cannot be compiled for the POs
PO items with multiple account assignment cannot be transferred
"Goods-receipt based" invoice verification is not supported
The PO items may not relate to materials subject to split valuation
Down payments and subsequent debits involving PO items are not possible
Inbound deliveries are not transferred
Subcontract orders, third-party orders, stock transport orders, service orders and release orders are not transferred
The program reads a sequential file containing records of the structures MBEPOH (PO header) and MBEPOI (PO item), and
generates purchase orders from them.
The data is expected in the sequential file in the following order:
For each PO header, a record of the structure MBEPOH,
For each PO item, a record of the structure MBEPOI.
All PO items up to the next PO header are assigned to the last-read PO header. Accordingly, the first record of the sequential file
must be a PO header, whereas the last record of the file must be a PO item.
For further information on the structure of the sequential file and on the expected field formats and contents, please refer to the
Implementation Guide.
For test purposes, you can use program RM06EEEX to generate a sequential file on the basis of POs that already exist in the
system.
Program parameters:
You can maintain the following parameters on the initial screen:
File name: please specify the logical file name under which the sequential file can be accessed.
Update or test run: with these parameters you specify whether or not the program is to be run in test mode only. If you specify
the test mode, all the data transfer checks are carried out without the database being updated. If you decide on the update run, the
purchase orders will be added to the database after successful checking.
Scope of log: via this parameter, you specify whether or not you wish to have detailed output of the error messages per PO item
with error identification and short error text.

PRECONDITION
Before you begin with the actual transfer of your purchase orders using this program, certain activities must be carried out. Among
other things, the data extract for this program must be created and Customizing settings checked or altered. For further
information, please refer to the Implementation Guide.
OUTPUT
The program log contains:
Program statistics (start, end, number of records read etc.)
A listing of PO numbers added
A listing of PO numbers not added (i.e. faulty POs)
The detailed error log per PO item supplements this, provided you have activated the output of this log via the relevant program
parameter.
This latter log contains:
PO number
PO item
Message class
Error category
Error number
Error short text
CHECK
The same checks are made as in the case of the manual creation of purchase orders.
In addition, the system checks whether the order types and item categories are allowed for automatic PO transfer (see
restrictions).
If the PO history is to be compiled using program RM06EEI1, (as per the specification in field MBEPOI-WEREF), additional checks
relating to the amount and quantity fields of the invoice and goods receipts are made.
A purchase order is only created if all PO items have passed the checking process without errors.
TECHNICAL-INFO
Prior to transferring purchase orders with database updating, you should carry out a database back up. Reset programs for
automatically created purchase orders are currently not available.
Restarting at the existing sequential file is possible. The program recognizes that the PO in question is not to be added again by
reference to the external PO number assigned by you.
A database commit is initiated after each newly created purchase order.
By means of the appropriate organizational measures, please ensure that the POs created via program RM06EEI0 are not changed
manually before program RM06EEI1 has been run successfully. Inconsistencies cannot otherwise be ruled out.
The program run-time depends largely on your installation, your organization structure, and the quantity structure of your master
and transaction data.
As a rough estimate, however, it can be assumed that approx. 4000 PO items per hour can be handled.
The complete documentation on data transfer with regard to purchase orders is available in the SAP Library:
CA Cross-Application Components -> CA Data Transfer Workbench -> Data Transfer Objects by Application -> MM Materials
Management -> MM Purchase Orders: Data Transfer Workbench.

<="" div="" style="vertical-align: bottom;">

Includes used within report:


INCLUDE RM06EEDA.
INCLUDE FMMEXDIR.

Tables used within report and the associated select statement:


EKKO

SELECT SINGLE * FROM ekko WHERE ebeln = zekko-ebeln.


TSAD3T
SELECT

* FROM tsad3t

WHERE langu
AND

= zekko-spras

title_medi = help_title

T001.
SELECT bukrs waers INTO TABLE zt001 FROM t001.
T024E.
SELECT ekorg bukrs INTO TABLE zt024e FROM t024e.
TCURC.
SELECT waers INTO TABLE ztcurc FROM tcurc.
T161
SELECT bsart bsakz INTO TABLE zt161 FROM t161
WHERE bstyp = 'F'.
T001W.
SELECT werks bwkey INTO TABLE zt001w FROM t001w.
TCURM.
SELECT SINGLE * FROM tcurm.

Function Modules used within report and the associated call statement:
FILE_GET_NAME
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = lds_name
IMPORTING
file_name

= phy_filename

EXCEPTIONS
file_not_found

= 01.

ME_CREATE_PO_HEADER
CALL FUNCTION 'ME_CREATE_PO_HEADER'
EXPORTING
i_bedat

= zekko-bedat

i_bsart

= zekko-bsart

i_bukrs

= zekko-bukrs

i_ekgrp

= zekko-ekgrp

i_ekorg

= zekko-ekorg

i_lifnr

= zekko-lifnr

i_ebeln

= zekko-ebeln

i_tekko

= ztekko

i_tekkorel

= 'X'

i_no_condition_copy = 'X'
i_vorga

= cva_bu

i_address

= addr1_val

EXCEPTIONS
error_message

= 1.

ME_CREATE_PO_ITEM
CALL FUNCTION 'ME_CREATE_PO_ITEM'
EXPORTING
i_adrnr
i_ematn

= zekpo-adrnr
= zekpo-ematn

i_knttp

= zekpo-knttp

i_kunnr

= zekpo-kunnr

i_lgort

= zekpo-lgort

i_matkl

= zekpo-matkl

i_meins

= zekpo-meins

i_pstyp

= zpstyp

i_txz01

= zekpo-txz01

i_werks

= zekpo-werks

i_kanba

= zekpo-kanba

i_aktnr

= zekpo-aktnr

i_abeln

= zekpo-abeln

i_abelp

= zekpo-abelp

i_netpr

= zekpo-netpr

i_peinh

= zekpo-peinh

i_bprme

= zekpo-bprme

i_bpumz

= zekpo-bpumz

i_bpumn

= zekpo-bpumn

i_packno

= zekpo-packno

i_tekpo

= ztekpo

i_tekporel

= 'X'

i_ebelp
i_bpueb

= zekpo-ebelp
= '2'

i_no_rounding = 'X'
i_attyp

= zekpo-attyp

i_upvor

= zekpo-upvor

i_uebpo

= zekpo-uebpo

i_uptyp

= zekpo-uptyp

IMPORTING
e_ebelp

= zekpo-ebelp

TABLES
xeket

= zeket

xekkn

= zekkn

EXCEPTIONS
error_message = 1.

"363722

ME_POST_PO
CALL FUNCTION 'ME_POST_PO'
IMPORTING
e_ebeln

= zekko-ebeln

EXCEPTIONS
error_message = 1.
DEQUEUE_EMEKKOE
*
*
*

call function 'DEQUEUE_EMEKKOE'


exporting

"INSERT 84048
"INSERT 84048

ebeln = zekko-ebeln.

"INSERT 84048

DEQUEUE_ALL
CALL FUNCTION 'DEQUEUE_ALL'.
ME_REFRESH_PO
CALL FUNCTION 'ME_REFRESH_PO'.
ME_ITEM_CATEGORY_INPUT
CALL FUNCTION 'ME_ITEM_CATEGORY_INPUT'
EXPORTING
epstp

= mbepoi-epstp

IMPORTING
pstyp

= zpstyp

EXCEPTIONS
not_found = 01.
MBEW_SINGLE_READ
CALL FUNCTION 'MBEW_SINGLE_READ'
EXPORTING
*

kzrfb

maxtz
matnr

=''
=0
= mbepoi-ematn

"170479

bwkey

= zt001w-bwkey

bwtar

= space

sperrmodus

=''

std_sperrmodus

=''

IMPORTING
wmbew

= mbew

EXCEPTIONS
lock_on_mbew

=1

lock_system_error = 2
wrong_call

=3

not_found

=4

OTHERS

= 5.

READ_NETWORK_AUFPL_APLZL
CALL FUNCTION 'READ_NETWORK_AUFPL_APLZL'
EXPORTING
nplnr

= mbepoi-nplnr

vornr

= mbepoi-vornr

IMPORTING
aplzl

= zekkn-aplzl

aufpl

= zekkn-aufpl

EXCEPTIONS
not_found = 01.
CALCULATE_EXCHANGE_RATE
CALL FUNCTION 'CALCULATE_EXCHANGE_RATE'
EXPORTING
date

= sy-datum

foreign_amount

= zwebtf

foreign_currency = zekko-waers

local_amount

= zwebth

local_currency

= zt001-waers

type_of_rate

= 'M'

IMPORTING
exchange_rate

= zkurs.

CALCULATE_EXCHANGE_RATE
CALL FUNCTION 'CALCULATE_EXCHANGE_RATE'
EXPORTING
date

= sy-datum

foreign_amount

= zrebtf

foreign_currency = zekko-waers
local_amount

= zrebth

local_currency

= zt001-waers

type_of_rate

= 'M'

IMPORTING
exchange_rate

= zkurs.

MESSAGE_TEXT_BUILD
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid

= prot-msgid

msgnr

= prot-msgno

msgv1

= prot-msgv1

msgv2

= prot-msgv2

msgv3

= prot-msgv3

msgv4

= prot-msgv4

IMPORTING
message_text_output = omess.

Text pool values


Selection Text: TESTLAUF = Without database update
Selection Text: PROTOCOL = Log without error messages
Selection Text: NUM = For test only (Reineck)
Selection Text: LDS_NAME = File name
Selection Text: ECHTLAUF = With database update
Selection Text: DETAILPR = Log with error messages
Title: Transfer of Purchase Orders
Text Symbol: 019 = Logical file
Text Symbol: 018 = Scope of log
Text Symbol: 017 = Update or test run
Text Symbol: 016 = Test run without database update!
Text Symbol: 015 = Message text
Text Symbol: 014 = No.
Text Symbol: 013 = T
Text Symbol: 012 = ID
Text Symbol: 011 = Item
Text Symbol: 010 = Purchase order
Text Symbol: 009 = Detailed error log
Text Symbol: 008 = Program end :
Text Symbol: 007 = Program start :
Text Symbol: 006 = Following purchase orders not added:
Text Symbol: 005 = Following purchase orders added:
Text Symbol: 004 = Program statistics
Text Symbol: 003 = Number of purchase orders added :
Text Symbol: 002 = Number of purchase orders read :
Text Symbol: 001 = Number of data records read :

Das könnte Ihnen auch gefallen