Key word: Output determination, goods receipt/issue slip, output type WLB3
On a collective slip for the provision of components (subcontracting), each component is printed twice.
For each component, two material document items are created with movement type 541. However, only one item should be taken into account when printing.
SolutionInsert the line marked "new" below in program M07DRAUS:
FORM LESEN_WLBS USING OBJKY.
NAST_KEY = OBJKY.
CLEAR RETCO.
PERFORM OPEN_FORM_SAMMEL.
ZAEHLER_M = 1.
SELECT SINGLE * FROM MKPF WHERE MBLNR = NAST_KEY-MBLNR
AND MJAHR = NAST_KEY-MJAHR.
SELECT * FROM MSEG WHERE MBLNR = MKPF-MBLNR
AND MJAHR = MKPF-MJAHR.
CHECK MSEG-SOBKZ IS INITIAL. "new ==========> insert
IF SY-SUBRC NE 0.
...
ENDFORM.
No comments:
Post a Comment