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?

Former Member
0 Kudos

hi,

i am getting data from a table besed on different input parameters.

in those P_CDATE is a select option and ints a OPTIONAL field.

if user enters date in this i have to filter the output data.

it means i have to delete other records which r not equal to input DATE.

vkr.

1 ACCEPTED SOLUTION

franois_henrotte
Active Contributor
0 Kudos

when you get data from table (with SELECT statement I guess ?) you just specify WHERE date IN p_date and it will work in any case (select-options is empty or not)

this would not work with a PARAMETER: in this case you have to check if it is empty then do a SELECT accordingly (with or without WHERE field EQ p_param)

8 REPLIES 8

franois_henrotte
Active Contributor
0 Kudos

when you get data from table (with SELECT statement I guess ?) you just specify WHERE date IN p_date and it will work in any case (select-options is empty or not)

this would not work with a PARAMETER: in this case you have to check if it is empty then do a SELECT accordingly (with or without WHERE field EQ p_param)

0 Kudos

hi,

this input field i have not to use in where clause.

so that i am asking.

any other way to delect it.

i am writing like...

if p_cdate is not initial.

delete int_outtab where andat ne p_cdate-low.

if int_outtab[] is initial.

message s958(ZKKI).

stop.

endif.

endif.

0 Kudos

HI,

u ca write like that.

why can't u use parameters in case u are using only p_cdate-low.

rgds,

bharat.

0 Kudos

<b>If u've declared p_cdate as a select-option then use the following code</b>

if p_cdate is not initial.

delete int_outtab where andat NOT IN p_cdate.

if int_outtab[] is initial.

message s958(ZKKI).

stop.

endif.

endif.

<b>If u've declared p_cdate as a parameter then use the following code</b>

if p_cdate is not initial.

delete int_outtab where andat NE p_cdate.

if int_outtab[] is initial.

message s958(ZKKI).

stop.

endif.

endif.

0 Kudos

hi rajesh,,

if i written like this in select-options it wasa deleting entire data.

vkr.

0 Kudos

beware to check contents of table select-options ! (not header line)

you can do it with brackets:

if p_cdate[] is not initial.

delete int_outtab where andat NOT IN p_cdate.

endif.

I would recommend to use SO_CDATE in place of P_CDATE in order to make it clear if it is a parameter or a select-options

0 Kudos

see the changes made in second line of your code,

i hope it serves your purpose

if p_cdate is not initial.

delete int_outtab where NOT andat IN p_cdate. "Changes made here

if int_outtab[] is initial.

message s958(ZKKI).

stop.

endif.

endif.

Reward points if useful, get back in case of query...

Cheers!!!

Former Member
0 Kudos

Hello,

I think u have to check this parameter only if the user enters any value here.

Hope by using this event u can solve ur problem.

AT SELECTION-SCREEN ON field name

<b>The Event AT SELECTION-SCREEN ON field name</b>

This event is assigned to the selection screen fields corresponding to the report parameter or selection criterion psel.

Write the filtering code inside this event.

Reward if helpful,

Regards,

LIJO