Application Development and Automation 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: 
Read only

Is a loop really needed?

Former Member
0 Likes
424

Hello everyone,

I have my internal table and want to delete the rows with more less than 5 characters. I do not want to use a loop because of perfomance issues, rather I am trying to use the DELETE statement, but I am not being successful.


  DATA: it_bseg type STANDARD TABLE OF bseg,
             wa_bseg type bseg.


  SELECT * FROM bseg
    INTO CORRESPONDING FIELDS OF TABLE it_bseg
    WHERE bukrs EQ pa_bukrs and
                 belnr  IN so_belnr   and
                 gjahr EQ pa_gjahr.


delete it_bseg WHERE strlen(dbmtr) > pa_min_value.

Thank you in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
392

Many reasons:

instead of dbmtr, try DMBTR;

But strlen only works on characters, not currency amounts.

You probably want to use:

delete it_bseg WHERE DMBTR > pa_min_value.

But it wouldn't be a performance problem anyway.

Rob

I should have added that it's really a mug's game. ABAP will have to do an internal loop anyway to read each row and decide whether or not to delete it.

Edited by: Rob Burbank on Jan 13, 2010 2:05 PM

2 REPLIES 2
Read only

Former Member
0 Likes
393

Many reasons:

instead of dbmtr, try DMBTR;

But strlen only works on characters, not currency amounts.

You probably want to use:

delete it_bseg WHERE DMBTR > pa_min_value.

But it wouldn't be a performance problem anyway.

Rob

I should have added that it's really a mug's game. ABAP will have to do an internal loop anyway to read each row and decide whether or not to delete it.

Edited by: Rob Burbank on Jan 13, 2010 2:05 PM

Read only

Former Member
0 Likes
392

Sorry...Duplicate post

Edited by: PRITAM MOHANTY on Jan 13, 2010 10:57 AM