You are on page 1of 7

Note No 424414

Symptom

You posted a goods movement for the outbound/inbound delivery with one of the
following Transactions: VL02 / Vl02N / VL32 / VL32N / VL06G.

In this case the material document was mistakenly posted


several times. Cancelling with Transaction VL09 is not successful or is
not wanted since the business process has already been completed.
However, you want to correct the stock inconsistency.
You posted a goods movement for an outbound/inbound delivery. After this, the
delivery was deleted although this error would have had to be caught by the
system. Now you want to cancel the material document later. However, this is no
longer possible with Transaction VL09.

Additional key words


GI, goods issue, cancellation, ZZWASTOR, VL09

Cause and prerequisites


The inconsistencies are caused in customer modifications, for example,
when user exits are incorrectly used in program MV50AFZ1 but also
system errors may occur which cannot be explained.

Solution
Copy report ZZWASTOR specified in the corrections to the system.
Afterwards you have the option to cancel redundant material
documents which have been posted by using this report. You must
adhere to the documentation in the report.
Report ZZWASTOR only carries out a material document cancellation.
The delivery used as a basis is not updated at all (neither document
flow nor handling unit, serial numbers or delivery requirements etc.).
The report is always useful if you want to correct a stock inconsistency
later without taking the causing delivery into account again.
The correction report represents a program modification according to
Note 170183 and is not contained in the standard system.
You must first check the effects of the report in a test system!

Source code corrections

Run the following report to cancel the erroneous material


documents after correcting table T160M by referring
following note 32236 .

REPORT ZZWASTOR
Delta 001
Context Block
Delete Block
Insert Block
REPORT ZZWASTOR .
*********************************************************************
* If you do not know the material document of the goods issue any *
* more you can use transaction SE16.
*
* - Type in table name MKPF
*
* - Type in the delivery note number in field XBLNR (always with *
* leading zeroes)
*
* - Execute
*
* - The Material document number of the goods issue for the deleted *
* delivery will be shown.
*
*
*
*
*
*
*
* LF_BUDAT => Posting date for the reversal
*
* LF_MJAHR => Posting year of the material document to reverse *
* LF_MBLNR => Goods issue document (with leading zeroes)
*
* LF_VBELN => Delivery note number (with leading zeroes)
*
* LF_TEST => When 'X' it is test mode only, otherwise GI will be *
*
cancelled
*
*********************************************************************
TABLES: MKPF, IMKPF, EMKPF, LIKP.
DATA: BEGIN OF IMSEG OCCURS 0.
INCLUDE STRUCTURE IMSEG.
DATA: END OF IMSEG.
DATA: BEGIN OF EMSEG OCCURS 0.
INCLUDE STRUCTURE EMSEG.
DATA: END OF EMSEG.
PARAMETERS: LF_BUDAT LIKE SY-DATLO DEFAULT SY-DATLO OBLIGATORY,
LF_MJAHR LIKE MKPF-MJAHR DEFAULT SY-DATLO(4) OBLIGATORY,

LF_MBLNR LIKE MKPF-MBLNR OBLIGATORY,


LF_VBELN LIKE LIKP-VBELN OBLIGATORY,
LF_TEST TYPE C DEFAULT 'X'.
DATA: MBLPO LIKE MSEG-ZEILE.
SELECT SINGLE * FROM MKPF WHERE MBLNR = LF_MBLNR
AND MJAHR = LF_MJAHR
AND XBLNR = LF_VBELN.
IF SY-SUBRC IS INITIAL.
CALL FUNCTION 'MB_CANCEL_GOODS_MOVEMENT'
EXPORTING
BUDAT
= LF_BUDAT
MBLNR
= LF_MBLNR
MBLPO
= MBLPO
MJAHR
= LF_MJAHR
TCODE
= 'VL09'
CALLED_BY = 'VL09'
IMPORTING
EMKPF
= EMKPF
TABLES
EMSEG
= EMSEG
IMSEG
= IMSEG
EXCEPTIONS
OTHERS = 1.
*... No error found, then it will be posted
IF EMKPF-SUBRC EQ 1.
IF LF_TEST IS INITIAL.
CALL FUNCTION 'MB_POST_GOODS_MOVEMENT'
EXPORTING
XBLNR_SD = LF_VBELN
IMPORTING
EMKPF = EMKPF
EXCEPTIONS
OTHERS = 0.
COMMIT WORK.
WRITE: / 'Goods movement was cancelled successfully with document:',
EMKPF-MBLNR.
ELSE.
WRITE: / 'Testmode: Goods movement could be cancelled !'.
ENDIF.
ELSE.
*... otherwise write an error-log
LOOP AT EMSEG.
WRITE: /
EMSEG-MSGID,
EMSEG-MSGNO,
EMSEG-MSGTY,
EMSEG-MSGV1,
EMSEG-MSGV2,
EMSEG-MSGV3,
EMSEG-MSGV4.

ENDLOOP.
WRITE: / EMKPF-MSGID,
EMKPF-MSGNO,
EMKPF-MSGTY,
EMKPF-MSGV1,
EMKPF-MSGV2,
EMKPF-MSGV3,
EMKPF-MSGV4.
ENDIF.
ELSE.
WRITE: / 'Material document to reverse does not exsist'.
ENDIF.

Note No - 32236
Symptom
One of the following error messages is generated when you enter a
goods movement:
M7308 'Stock value and qty are unrealistic: & / & -> see long text' & / &

M7309 'Stock value is negative: & -> see long text' &

M7310 'Valuated stock is negative: & -> see long text' &

M7314 Valuated stock becomes negative: & -> see long text

The error messages are only displayed as of Release 3.0. However, the
symptoms (negative stocks, stock inconsistencies) can appear from as
early on as Release 2.2.
The stock tables are not consistent.
Differences occurred between the material valuation and FI.
This note is release-independent.

Other terms
MMINKON

Reason and Prerequisites

These messages are generated if the system finds a data inconsistency


when reading material master data, that is, the stock quantity or the
stock value are inconsistent even before the goods movement.
You have inconsistencies in your tables, for example, if you compare
the stock quantity in the stock overview (taking into account all
valuated stocks) with the stock in the accounting view of the material
master.
You get differences with Report RM07MMFI.

Solution
The stock postings (material documents and accounting documents)
for the material must be checked by SAP Support. This requires several
check reports which need to be imported from sapserv3, sapserv4,
sapserv5, sapserv6, or sapserv7. For this, refer to Note 13719.
Transaction SNOTES cannot be used for importing the check reports.
1) Report RM07MMFI must be present in your system. If it is not, import
it as specified in Note 198596.
2) Use Transaction SE11 to check if you have the current version of
Tables MMINKON and MMINKON_UP. In the current version, Fields
CANCEL_YR and OWNER are present in Table MMINKON_UP. If you do
not have the tables you must import them, using the following
transports, and then activate them:
For Release 3.x:
ALRK299731 under general/R3server/abap/note.0032236
For Release 4.x:
Download the packed Transport files R101087.ZIP and K101087.ZIP
which are attached to this note. Unpack the files, and import them into
your system.
If, after importing the transports, Tables MMINKON and MMINKON_UP
are not active, check whether the following data elements are active
and, if necessary, activate them manually: BWTAR_D, CHARG_D,
FELD_30, F_SPLIT, LFDNR_MM, LFYEAR, LGORT_D, MMINKON_K,
NEW_VALUE, NEW_VAL_C, OLD_VALUE,
3) Download the packed Transport files R101080.ZIP and K101080.ZIP
which are attached to this note. Unpack the files, and import them into
your system.
The files contain the following check reports:
MBFIRST, MBQUANT, MBVALUE, MBSTOCK, MBLABST, MBMISSFI,
MBFIRST, MBANEKBE, MBCKBSEG, MBENQMAT, RM07MR51,
RM07MB51, MBTRAME, RM07REUS, RM07APP1, MBSEGBSX,
RM07AUTH, RM07UPLD, MBINKON, RM07COMP, RM07HIST, LMRMIF01,
MBUPDATE, MBHIST, MBCKMI1, MBCKBSIM and MBSHOWUP.
Make sure that the current version:
'Version 00017'

has been imported into your system. Versions with the format ##/##
(for example, 10/00) are older than Version 00011. To check the
versions in your system, start Report MBFIRST for a company code. The
version will be the first thing displayed in the list output. If this is not
the case, this means you have an earlier version.
Caution:
-------Since it can sometimes be very time-consuming to analyze and correct
inconsistencies, SAP carries this out exclusively in the PRODUCTION
SYSTEM.
During the import, there may be several error messages in the
transport log due to lines that are too long (cut off at 72 characters) or
syntax errors in the programs. You can ignore these messages. The
transport has been successful if the programs with the associated
Database tables (MMINKON, MMINKON_UP) exist in the system.
************************************************************************
If you encounter problems during the import, make sure that you have
the latest transport of R/3 trans in your system.
If this is not the case, import the current R/3 trans or kernel (see Notes
60928, 126776, and the notes referred to in these notes).
************************************************************************
In general, you should not execute the reports contained in this note
yourself because the results can often be misleading!
************************************************************************
Some check reports can also make hard updates on the database,
provided that the update parameters have been set. Updates are only
executed by the SAP Support Department and SAP cannot guarantee
data consistency in the event of incorrect use. If the data
inconsistencies are caused by SAP software, only SAP Support is
authorized to change the data. If the inconsistencies are caused by the
customer, the customer can choose to have processing done by SAP
Remote Consulting. The customer has to pay for this service. If
customers choose to process inconsistencies caused by them, applying
the data inconsistency programs listed in this note, we want to
expressly point out that this action is solely the customer's
responsibility. Follow-up problems caused by this approach cannot be
processed by SAP Support but only by SAP Remote Consulting.
If you have already archived material documents or accounting
documents in your system, or if you use the aggregation of posting
lines for your stock accounts, report this to the Hotline Services as
some of the check reports are based on these documents and can no
longer be run after the documents have been archived or the posting
lines aggregated.
For more information on the corrections which might have been
implemented, refer to Note 34440.

We recommend that you do not enter any more movements for


this material. However, if this cannot be avoided, then the
error message can be issued as a warning message. To do this,
you have to make an entry for the respective error message in
Table T160M. If you make an entry in Table T160M and then
carry out the "absolutely necessary" material movement, you
have to delete the entry in Table T160M again.
Example:
Version Ap Msg Cat Message text
00
M7 308
Stock value and qty are unrealistic: & / &
Bear in mind that the "Cat." column must be empty. The
version is 00 in the standard system, but can be defined userspecifically with Parameter ID MSV.
************************************************************************
If you still have the reports in your system from an earlier version of
the transport, and these are within the customer name range, see Note
304670.