cancel
Showing results for 
Search instead for 
Did you mean: 

delete datapackage data

Former Member
0 Kudos

Hi all,

Anyone can help me check what's wrong with the following code? I am trying to delete records from ODS datapackage. Those records are not in an internal table.

*LOOP AT DATA_PACKAGE ASSIGNING <fs>.

*READ TABLE INTERNALTABLE ASSIGNING <fsit>.

*IF <fs>-/BIC/id = <fsit>-id AND

  • <fs>-/BIC/password = <fsit>-password.

*CONTINUE.

*ELSE.

*DELETE DATA_PACKAGE.

*ENDIF.

*ENDLOOP.

Thanks a lot. Points will be rewarded later.

Lin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this....

DATA: data_pkg_idx like sy-tabix.

LOOP at DATA_PACKAGE.

data_pkg_idx = sy-tabix.

IF <your condition>

CONTINUE.

ELSE.

DELETE DATA_PACKAGE index data_pkg_idx.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

Thanks!

One quick question.

Does it matter if the internal table is a standard one? I did not create index when I defined the internal table?

Lin

Former Member
0 Kudos

Hi Lin,

It depends on the size of the internal table. The code you should write:

DATA: v_indx like sy-tabix.

LOOP at DATA_PACKAGE.

v_indx = sy-tabix.

Read table internaltable where id = DATA_PACKAGE-/BIC/id and password = DATA_PACKAGE-/BIC/password .

If sy-subrc ne 0.

DELETE DATA_PACKAGE index v_indx.

ENDIF.

ENDLOOP.

Regards,

Rohit

Former Member
0 Kudos

Thanks. It helped me solve the problem.

Lin

Answers (0)