09-17-2007 1:00 PM
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.
09-17-2007 1:03 PM
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)
09-17-2007 1:03 PM
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)
09-17-2007 1:07 PM
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.
09-17-2007 1:12 PM
HI,
u ca write like that.
why can't u use parameters in case u are using only p_cdate-low.
rgds,
bharat.
09-17-2007 1:13 PM
<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.
09-17-2007 1:44 PM
hi rajesh,,
if i written like this in select-options it wasa deleting entire data.
vkr.
09-18-2007 9:39 AM
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
09-18-2007 9:48 AM
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!!!
09-17-2007 1:16 PM
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