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

Delete itab From 2 To.

muhammad_sohail
Participant
0 Likes
908

Dear All,

I want to delete itab on the basis of input which I enter on selection screen. Means I want to use delete as a between operator. e.g; delete field values between input_from to input_to.

I am using the following statement. It is not fullfilling my requirements, not deleteing all values from 2 to.

DELETE itab where field LE input_from AND field LE input_to.

Which statement I should use.

Thanks and Regards,

Sohail

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
876

I guess you can directly use the BETWEEN addition


DELETE itab where field BETWEEN input_from AND input_to.

Vikranth

Dear All,

I want to delete itab on the basis of input which I enter on selection screen. Means I want to use delete as a between operator. e.g; delete field values between input_from to input_to.

I am using the following statement. It is not fullfilling my requirements, not deleteing all values from 2 to.

DELETE itab where field LE input_from AND field LE input_to.

Which statement I should use.

Thanks and Regards,

Sohail

7 REPLIES 7
Read only

Former Member
0 Likes
876

hi,

please check GE( equal or greater) at your code.

DELETE itab where field GE input_from AND field LE input_to.

regards,

orhan

Read only

Former Member
0 Likes
877

I guess you can directly use the BETWEEN addition


DELETE itab where field BETWEEN input_from AND input_to.

Vikranth

Read only

Former Member
0 Likes
876

Hi Sohail,


DELETE itab WHERE field GE input_from AND field LE input_to.

This code will delete the record from itab the data of the field is between the range input_from & input_to.

Regards

Dillip

Read only

Former Member
0 Likes
876

>

>

DELETE itab where field *LE* input_from AND field LE input_to.

>

Could it be GE.

--

Reddy

Read only

Former Member
0 Likes
876

Hi

s_field-low = input_from.

s_field-sign = 'I'.

s_field-option = 'BT'.

s_filed-high = input_to.

append s_field.

DELETE itab where field in s_field.

Thanks

Regards

I.Muthukumar.

Read only

Former Member
0 Likes
876

Hi,

try this:


TABLES: MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
*
DATA: IT_ITAB TYPE TABLE OF MARA.
DATA: wa_ITAB TYPE          MARA.
*
SELECT * FROM MARA UP TO 100 ROWS INTO TABLE IT_ITAB.
*
LOOP AT IT_ITAB INTO WA_ITAB. WRITE: / WA_ITAB-MATNR. ENDLOOP.
DELETE IT_ITAB WHERE MATNR IN S_MATNR.
LOOP AT IT_ITAB INTO WA_ITAB. WRITE: / WA_ITAB-MATNR. ENDLOOP.

Regards, Dieter

Read only

Former Member
0 Likes
876

Hi,

TYPES : BEGIN OF t_ekko,

ebeln TYPE ekko-ebeln,

END OF t_ekko.

DATA : it_ekko TYPE TABLE OF t_ekko,

wa_ekko TYPE t_ekko,

line TYPE i.

PARAMETERS : p_ebeln TYPE ekko-ebeln.

START-OF-SELECTION.

wa_ekko-ebeln = '4500109249'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109250'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109251'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109252'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109253'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109254'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109255'.

APPEND wa_ekko to it_ekko.

wa_ekko-ebeln = '4500109256'.

APPEND wa_ekko to it_ekko.

CLEAR : line.

DELETE it_ekko where ebeln BETWEEN '4500109250' AND '4500109255'.

DESCRIBE TABLE it_ekko LINES line.

WRITE : line.

With Regards,

Sumodh.P