05-15-2008 2:07 PM
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.
05-15-2008 2:11 PM
hi,
do this way ...
delete i_data_new where s_data = 'NEW' and v_test = 'ABC'.
05-15-2008 2:25 PM
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
05-15-2008 2:35 PM
hi,
include that field(tcode) in i_data_new even and perform the delete operation.
Regards,
Santosh
05-15-2008 2:20 PM
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