Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete data from internal table

Former Member
0 Kudos

Hi All,

I require to read the data from internal table: i_data_new and search for if the data in the internal table are meet for certain condition. If yes, i will deleted the record from that table and proceed with another requirement. Could anyone help me with sample code on how i retrieve the data and delete it from internal table. Thanks

Condition like: s_data = "NEW" and v_test = "ABC".

my sample of current code:

Code for Select statement..........

................................................

.................................................

APPEND LINES OF i_data_tmp TO i_data_new.

REFRESH i_data_tmp.

ENDSELECT.

4 REPLIES 4

Former Member
0 Kudos

hi,

do this way ...


delete  i_data_new where s_data = 'NEW' and v_test = 'ABC'. 

0 Kudos

Hi,

How about if i want to search for the condition in blart = 'RE' and with the tcode = 'FB08'. If meet remove it from internal table.

The problem is the structure of the i_data_new doesn't have the field of TCODE. How does i need to check and remove the data?

SELECT bukrs

belnr

INTO TABLE i_data_tmp PACKAGE SIZE 1000

FROM bkpf

WHERE bukrs IN s_bukrs

AND ( blart = 'RE' or blart = 'ZZ')

AND tcode NE 'FB01'.

APPEND LINES OF i_data_tmp TO i_data_new.

REFRESH i_data_tmp.

ENDSELECT.

Edited by: BlueSky 1 on May 15, 2008 3:28 PM

0 Kudos

hi,

include that field(tcode) in i_data_new even and perform the delete operation.

Regards,

Santosh

prasanth_kasturi
Active Contributor
0 Kudos

hi,

do like this

loop at it where s_date = 'NEW' and v_test = 'ABC'.

delete it.

endloop.

( or )

delete it where s_date = 'NEW' and v_test = 'ABC'.

you can use any of the way

regards

prasanth