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: 

How do i use ranges and parameters together?

Former Member
0 Kudos

Plz help me...

I have a selection screen with about 8 parameters out of which two are mandatory, i.e. a flag and the date of creation. What I need to do is delete certain entries from a database table based on the parameters input by the user. Now the problem is when i am using the delete statement using where statement..

delete from zinbd_delv where vbeln = vbeln and

posnr = posnr and

lfimg = lfimg and

lfdat = lfdat and

created = created and

status = status.

But suppose the user enters data in only the two mandatory fields and say status = 'X' and created = 'XX/XX/XXXX'. In that case it should delete all the entries from the table where status = X and creation date as specified but since it will find the other parameters as blank it will fail. Can we use range table for this...plz tell me how to do it.

3 REPLIES 3

Former Member
0 Kudos

Sayan,

Yes, this is the difference in using parameters and select-options.

Parameter if initial, checks for initial value in the query. But Select-options if initial, checks for all values in query.

So, you have two options:

1> Check the value of parameter you are using, and use if condition accordingly for your query, OR

2> Use select-options instead of parameters.

reward points if helpful.

regards,

G@urav.

Former Member
0 Kudos

i think if you are using parameters then you have to enter the value in that.

or

select-options : sop for mara-matnr no intervals no-extension.

for single entry.

data : itab like zinbd_delv occurs 0 with header line.

select * from zinbd_delv ito table itab where vbeln in vbeln and

posnr in posnr and

lfimg in lfimg and

lfdat in lfdat and

created in created and

status in status.

delete zinbd_delv from table itab.

commit work.

regards

shiba dutta

Former Member
0 Kudos

Thank you very much for your help.