Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Delete Data Package records by comparing with internal table

Hi Guys,

I am loading data from an ODS to Cube.

I am trying to read the Data Package in start routine and compare the records with an internal table.

I want to delete the records in the data package when the Order field in data package matches with Order in internal table and the field type is EXT. if it is INT it should load that record into Cube with a prod num which is pulled from mapping table

When I load just the records where the Orders are of field type EXT it is working. Those records are excluded during laod into Cube.

But when I am loading whole data at once they are also loading into cube which I dont want.

Looks like the DELETE DATA_PACKAGE command is being executed only once.

can somebody please help me with this code?

READ TABLE itab_prod WITH KEY

order = DATA_PACKAGE-/BIC/ZORDER

sys = 'CLT80'.

IF SY-SUBRC = 0.

IF itab_prod-ftype = 'EXT'.

DELETE DATA_PACKAGE.

MODIFY DATA_PACKAGE.

ELSE.

IF itab_prod-ftype = 'INT'.

SELECT SINGLE prd_no INTO prodnum

FROM ZPRODUCT

WHERE S_PL = prod.

IF SY-SUBRC = 0.

DATA_PACKAGE-/BIC/ZPRODNO = prodnum.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

Modify DATA_PACKAGE.

ENDLOOP.

If the Order in the Data Package exits in Mapping and table and the field type of that Order in mapping table is EXT that record should be excluded.

Thanks in advance.

Former Member
Not what you were looking for? View more on this topic or Ask a question