Skip to Content
0
Former Member
Oct 20, 2006 at 03:54 PM

Deletion of a record.

22 Views

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.