Hi,
the statement marked as bold is giving me an error:
"You have not specified the key field "MANDT". However, field "MANDT" is contained in the key of table "I_CAUFV". -
how shd i write the delete statement.
IF NOT I_CAUFV[] IS INITIAL.
*Select the material from mara that matches the current material from
*i_caufv.
SELECT * FROM MARA INTO TABLE I_MARA FOR ALL ENTRIES IN I_CAUFV
WHERE MATNR = I_CAUFV-PLNBEZ.
LOOP AT I_MARA.
*Select everything from ztype where the part type is equal to the part
*type for the current line in the loop at i_mara.
SELECT SINGLE * INTO IZTYPE FROM ZTYPE
WHERE ZTYPE = I_MARA-WRKST.
IF SY-SUBRC = 0.
*If this is a make part.
IF IZTYPE-ZMAKEBUY = 'M'.
*Move like fields from iztype to data_iztype.
MOVE IZTYPE-ZTYPE TO DATA_IZTYPE-ZTYPE.
*If this is a make part.
ELSEIF IZTYPE-ZMAKEBUY NE 'M'.
<b> DELETE TABLE i_Caufv WITH TABLE KEY PLNBEZ = I_MARA-MATNR .</b>
*Move the leading work order to the superior work order space.
MOVE: I_CAUFV-LEAD_AUFNR TO I_CAUFV-MAUFNR.
ENDIF.
ENDIF.
I assume this may be a table with the key defined, so you need to always keep the key in mind when operating on the internal table. For example.
data: i_caufv type hashed table of caufv with unique <b>key mandt</b> plnbez with header line. DELETE TABLE i_Caufv WITH TABLE KEY <b>MANDT = sy-mandt</b> PLNBEZ = I_MARA-MATNR . .
REgards,
Rich Heilman
Add a comment