A delivery is posted several times for goods issue.
For reasons yet unknown, the deliveries can be posted several times for goods issue. The following constellations are known so far:
- There is a GI document for a delivery item with several document items, and the delivery item is displayed several times. Example from the document flow.
Item 10
GI document 49123456 item 1
GI document 49123456 item 11
GI document 49123456 item 21
GI document 49123456 item 31
- There are several GI documents for a delivery item with this delivery item.
Example from the document flow
Item 10
GI document 49000001 item 1
GI document 49000002 item 1
GI document 49000003 item 1
GI document 49000004 item 1
The exact cause is not yet known.
SolutionThe following can be installed if one of these situations occurs:
Include field in Include FV50WTOP
*-----------------------------------------------------------------------
* Interne Felder
*-----------------------------------------------------------------------
DATA: WB_WA_ERR LIKE SY-SUBRC, "WA nicht erfolgreich
WB_MSGID LIKE SY-MSGID,
WB_MSGNO LIKE SY-MSGNO,
WB_MSGTY LIKE SY-MSGTY,
WB_MSGV1 LIKE SY-MSGV1,
WB_MSGV2 LIKE SY-MSGV2,
WB_MSGV3 LIKE SY-MSGV3,
WB_MSGV4 LIKE SY-MSGV4,
WB_XSTOR TYPE C VALUE ' ', "Storno-Kennzeichen
LF_ANZ_ERR LIKE SY-TFILL VALUE 0, "Anzahl fehlerhaft. LF-Pos.
ANZ_MPOS LIKE SY-TFILL VALUE 0, "Anzahl M-Belegpositionen
WB_POSNR LIKE VBAP-POSNR VALUE '000000',
WB_ANZ_LPOS LIKE SY-TFILL VALUE 0. "Anzahl LF-Positionen <=new
in the include FV50WF0W
FORM WARENAUSGANG_BUCHEN.
*... Hilfsfelder relevante Positionen
* DATA: WB_WA_REL TYPE C VALUE ' ', "WA-relevant
DATA: WB_WA_ERF TYPE C VALUE ' ', "WA muß noch erfolgen
WB_LS_ERR TYPE C VALUE ' ', "LS-Position fehlerhaft
* WB_ANZ_LPOS LIKE SY-TFILL VALUE 0, "Anzahl LF-Positionen <=del
WB_SUBRC LIKE SY-SUBRC VALUE 0. "eigener subrc
WB_SUBRC LIKE SY-SUBRC VALUE 0, "eigener subrc <= Rel 2.2
WB_TABIX LIKE SY-TABIX VALUE 0. "eigener TABIX <= Rel 2.2
.......
* Fehler bei der WA-Buchung aufgetreten ?
IF NOT WB_WA_ERR IS INITIAL.
PERFORM VLBEFU_ERROR_HANDLING.
ENDIF.
ENDIF.
ELSE.
*... Fehlerhafte Lieferung
PERFORM WAT_FEHLERPROTOKOLL.
ENDIF.
*----------------------------------------------------------------------*
* Prüfen der Tabelle VLBEFU gegen XLIPS <= new*
* Sicherheitsprüfungen <= new
*---------------------------------------------------------------------*
PERFORM VLBEFU_XLIPS_CHECK. <= new
*---------------------------------------------------------------------*
* Bearbeiten der Lieferpositionen *
* Update im RV-Teil *
*---------------------------------------------------------------------*
LOOP AT XLIPS.
CHECK: XLIPS-LIPS_UP <> SPACE.
.....
in the include FV50WF0V
new form routine!
*eject
*&---------------------------------------------------------------------*
*& Form VLBEFU_XLIPS_CHECK
*&---------------------------------------------------------------------*
* Vergleich der Tabellen XLIPS und VLBEFU *
*----------------------------------------------------------------------*
FORM VLBEFU_XLIPS_CHECK.
DATA: VXC_MBLNR LIKE LBEFU-MBLNR. "M-Belegnr.
*----------------------------------------------------------------------*
* Vergleich der Anzahl der VLBEFU-Zeilen mit denen der XLIPS
* Hiermit soll verhindert werden, daß eine Lieferung mehrfach in
* einem MM-Beleg erscheint, warum auch immer..
* Phänomen: doppelte WA-Buchung, ein Beleg, die gesamte
* XLIPS-Zeilensequenz mehrfach in einem Beleg
*----------------------------------------------------------------------*
*... Anzahl Positionen in der Lieferung
DESCRIBE TABLE XLIPS LINES WB_ANZ_LPOS.
*... Anzahl VLBEFU - Positionen
DESCRIBE TABLE VLBEFU LINES WA_ANZ_MPOS.
IF WA_ANZ_MPOS > WB_ANZ_LPOS.
MESSAGE A697 WITH WA_ANZ_MPOS WB_ANZ_LPOS.
ENDIF.
*----------------------------------------------------------------------*
* Prüfen der Tabelle VLBEFU auf doppelte M-Belegnr.
* Phänomen: doppelte WA-Buchung, mehrere Belege mit allen
* XLIPS-Zeilen
*----------------------------------------------------------------------*
CLEAR VXC_MBLNR.
LOOP AT VLBEFU.
IF NOT VXC_MBLNR IS INITIAL.
IF VXC_MBLNR <> VLBEFU-MBLNR.
MESSAGE A696 WITH VXC_MBLNR VLBEFU-MBLNR.
ENDIF.
ELSE.
VXC_MBLNR = VLBEFU-MBLNR.
ENDIF.
ENDLOOP.
*----------------------------------------------------------------------*
* Prüfen der Tabelle XVBFA auf doppelte Flußsätze
*----------------------------------------------------------------------*
LOOP AT XLIPS.
LOOP AT XVBFA WHERE MANDT = LIKP-MANDT AND
VBELV = XLIPS-VBELN AND
POSNV = XLIPS-POSNR AND
VBTYP_V = LIKP-VBTYP AND
VBTYP_N = R.
*... hier sollte man nie hinkommen!!!
MESSAGE A695 WITH XVBFA-VBELN XVBFA-POSNN.
ENDLOOP.
ENDLOOP.
ENDFORM. " VLBEFU_XLIPS_CHECK
Add/Change the following messages (SM31):
Message-ID VL
695
Processing error: XVBFA already contains flow record MM document no. & &
696
Processing error: VLBEFU contains at least two MM documents & and &
697
Processing error: Number VLBEFU & > Number XLIPS &
698
Processing error: XLIPS and VLBEFU do not match
699
Processing error updating delivery: XLIPS and VLBEFU do not match
If one of the above mentioned error messages is displayed during GI posting, please contact us immediately.
Please carry out the following changes:
Copy the function module 'MB_CREATE_MATERIAL_DOCUMENT' to Function
module 'MB_CREATE_MATERIAL_DOCUMENT_UT' ( in the function group
MBWL ).
Release 2.1: The system creates the new Include LMBWLU13.
Release 2.2: The system creates the new Include LMBWLU17.
Activate the function module if necessary.
Important for Release 2.1:
-------------------------
BEFORE the Put to Release 2.2 the function module
'MB_CREATE_MATERIAL_DOCUMENT_UT' needs to be deleted again, otherwise
conflicts can arise with the installation of Release 2.2.
Then change the following includes:
Include LMBWLU05.
-----------------
FUNCTION MB_CREATE_MATERIAL_DOCUMENT.
PERFORM BUCHEN_AUFBEREITEN(SAPMM07M).
...
PERFORM BUCHEN_NUMMERNVERGABE(SAPMM07M).
PERFORM BUCHEN_AUSFUEHREN(SAPMM07M). <- DELETE
ENDFUNCTION.
Include LMBWLU17. (in Release 2.1: include LMBWLU13)
-----------------
Delete the copied coding up to line
PERFORM BUCHEN_AUSFUEHREN(SAPMM07M), so that the content
of the function module reads:
FUNCTION MB_CREATE_MATERIAL_DOCUMENT_UT.
PERFORM BUCHEN_AUSFUEHREN(SAPMM07M).
ENDFUNCTION.
Include LMBWLU01:
-----------------
FUNCTION MB_CREATE_DELIVERY_GOODS_ISSUE.
...
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
IF NOT SY-SUBRC IS INITIAL.
...
EXIT.
ENDIF.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
SUBRC = 1.
...
ENDFUNCTION.
Include LMBWLU02:
-----------------
FUNCTION MB_CREATE_INVENTORY_DIFFERENCE.
...
*** Für Releasestand < 2.2C gilt zusätzlich ***
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'. <-delete
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
*** Ende der Änderung für vor Releasestand < 2.2C ***
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
*** Ab hier für alle Releasestände das neue Coding einfügen ***
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
CLEAR INDEX_Z.
...
ENDFUNCTION.
Include LMBWLU09: (valid for Release 2.2)
-----------------
FUNCTION MB_CREATE_WO_GOODS_ISSUE.
...
IF NOT ITEM_CREATED IS INITIAL.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
IF NOT SY-SUBRC IS INITIAL.
...
EXIT.
ELSE. <- delete
LOOP AT XWOGIBF WHERE BEAKZ = X. <- delete
TABIXX = SY-TABIX. <- delete
XWOGIBF-MBLNR = XMKPF-MBLNR. <- delete
XWOGIBF-MJAHR = XMKPF-MJAHR. <- delete
MODIFY XWOGIBF INDEX TABIXX. <- delete
ENDLOOP. <- delete
ENDIF.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
LOOP AT XWOGIBF WHERE BEAKZ = X. <- new
TABIXX = SY-TABIX. <- new
XWOGIBF-MBLNR = XMKPF-MBLNR. <- new
XWOGIBF-MJAHR = XMKPF-MJAHR. <- new
MODIFY XWOGIBF INDEX TABIXX. <- new
ENDLOOP. <- new
ENDIF.
SUBRC = 0.
...
ENDFUNCTION.
Include LMBWLU09: (valid for Release 2.1)
-----------------
FUNCTION MB_CREATE_WO_GOODS_ISSUE.
...
IF ITEM_CREATED = X.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
IF NOT SY-SUBRC IS INITIAL.
...
EXIT.
ELSE.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
LOOP AT XWOGIBF ...
...
ENDLOOP.
ENDIF.
ENDIF.
SUBRC = 0.
...
ENDFUNCTION.
Include LMBWLU10:
-----------------
FUNCTION MB_CREATE_USAGE_DECISION.
...
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
IF NOT SY-SUBRC IS INITIAL.
...
EXIT.
ENDIF.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
SUBRC = 1.
...
ENDFUNCTION.
Include LMBWLU14: (only valid for Release 2.2, as the include does
----------------- exist for Release 2.1)
FUNCTION MB_CREATE_GOODS_MOVEMENT.
...
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT'
EXCEPTIONS ERROR_MESSAGE = 4.
IF NOT SY-SUBRC IS INITIAL.
...
EXIT.
ENDIF.
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT' <- new
EXCEPTIONS ERROR_MESSAGE = 4. <- new
IF NOT SY-SUBRC IS INITIAL. <- new
MESSAGE ID SY-MSGID TYPE A NUMBER SY-MSGNO WITH <- new
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. <- new
ENDIF. <- new
...
ENDFUNCTION.
No comments:
Post a Comment