Skip to Content
0
Former Member
Dec 13, 2006 at 08:24 PM

Deletion of packages based on data.

15 Views

I currently have written two selection conditions when my infopackage loads from an ODS to a cube.

The first routine is on the fiscal period as displayed below:

data: l_idx like sy-tabix.

Data: L_DATE TYPE SY-DATUM,

w_period LIKE t009b-poper,

w_year LIKE t009b-bdatj,

w_Periodc(7) Type c.

L_DATE = SY-DATUM.

CLEAR: w_period, w_year, w_Periodc.

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

EXPORTING

i_date = L_DATE

i_periv = 'Z1'

IMPORTING

e_buper = w_period

e_gjahr = w_year

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

OTHERS = 4.

IF sy-subrc = 0.

CONCATENATE w_year w_period INTO w_periodc.

ENDIF.

read table l_t_range with key

fieldname = 'FISCPER'.

l_idx = sy-tabix.

l_t_range-sign = 'I'.

l_t_range-option = 'EQ'.

l_t_range-low = w_periodc.

l_t_range-high = w_periodc.

modify l_t_range index l_idx.

p_subrc = 0.

The second is on fiscal week as displayed below:

data: l_idx like sy-tabix.

DATA: z_mrpfiscweek LIKE /BIC/AXMMPOCMT00-/BIC/XMRPFWEEK,

zfiscyear like t009b-bdatj,

zfiscweek(2) type c.

call function 'Z_GET_FISCAL_WEEK'

exporting

DATE = sy-datum

importing

FISCAL_YEAR = zfiscyear

FISCAL_WEEK = zfiscweek

FISCAL_YEAR_WEEK = z_mrpfiscweek.

read table l_t_range with key

fieldname = '/BIC/XMRPFWEEK'.

l_idx = sy-tabix.

l_t_range-sign = 'I'.

l_t_range-option = 'EQ'.

l_t_range-low = z_mrpfiscweek.

l_t_range-high = z_mrpfiscweek.

modify l_t_range index l_idx.

p_subrc = 0.

Now what I need to do is delete any request where the fiscal period only matches the fiscal period of the data coming in. I looked into using the delete request selection from routine, but I dont think this allows me to compare a value in a field of the incoming data to the last request.

Any suggestions would be appreciated.