Skip to Content
author's profile photo
Former Member

Start Routine: delete some data in ODS

Hi,

I need some help. I have the following business requirement:

1. I have an ODS with some data

2. When I upload these ODS I need this behavior: the routine shoud see which data is in the datapackage that was upload to PSA (for instante field Z data A), and if in ODS this field Z had the data A then this data in ODS should be deleted.

I had tried the following code:

Data: itab type table of /BIC/AZGDOS*****.

DATA: work_area like line of itab.

data: WA_SOURCE like line of SOURCE_PACKAGE.

data: z_tabix type sy-tabix.

LOOP AT SOURCE_PACKAGE into wa_source.

z_tabix = sy-tabix.

select single * from /BIC/AZGDOS***** into work_Area where

/BIC/Z******** = wa_source-/BIC/Z********.

if sy-subrc = 0.

move-corresponding /BIC/AZGDOS***** to work_area.

append work_area into itab.

ENDIF.

ENDLOOP.

delete /BIC/AZGDOS***** from table itab.

if sy-subrc eq 0.

commit work.

endif..

But this code isn't working.

suggestions?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on May 03, 2011 at 02:29 PM

    Try it:

    Data: itab type table of /BIC/AZGDOS*****.

    DATA: work_area like line of itab.

    data: WA_SOURCE like line of SOURCE_PACKAGE.

    data: z_tabix type sy-tabix.

    LOOP AT SOURCE_PACKAGE into wa_source.

    z_tabix = sy-tabix.

    select single * from /BIC/AZGDOS***** into work_Area where

    /BIC/Z******** = wa_source-/BIC/Z********.

    if sy-subrc = 0.

    move-corresponding /BIC/AZGDOS***** to work_area. ERROR,delete it

    append work_area into itab.

    ENDIF.

    ENDLOOP.

    delete /BIC/AZGDOS***** from table itab.

    commit work and wait.

    Edited by: gang qin on May 3, 2011 4:29 PM

    Edited by: gang qin on May 3, 2011 4:31 PM

    Add comment
    10|10000 characters needed characters exceeded