cancel
Showing results for 
Search instead for 
Did you mean: 

How to form 'select statement' based on user Search in BSP page...??

Former Member
0 Kudos

Hi Good evening to all...

I have BSP page that contain search Fields..If user enter some  value in search fields, The  'SELECT' statement should form based on user input value..

ex:

user enter "Male" in Gender search field..The select statement should change like below..

SELECT * from ZDATABASEVIEW  into data_table where ZCAND_GENDER = 'Male'.

similarly for some more fields...

Please any one suggest me how to proceed...

I already searched some sdn forum discussion but i didn't get what i need..

thanks and regards

santhosh..

View Entire Topic
Former Member
0 Kudos

Hi good morning ...

Thanks for your reply...

My questions is if suppose user want to search two fields  say like 'gender' and 'Location'.

Select statement will change to

SELECT * from ZDATABASEVIEW  into data_table where ZCAND_GENDER = 'Male' AND ZCAND_LOCATION = 'Bangalore'.

If suppose user want to search 3 fields From BSP page,select statement should contain 3 where conditions..

Like

SELECT * from ZDATABASEVIEW  into data_table where ZCAND_GENDER = 'Male' AND ZCAND_LOCATION = 'Bangalore' AND ZCAND_SKILLS = 'SAP'.

This select query should  change based on user  input values...

Please let me know how to proceed...

Thanks and regards

santhosh

Former Member
0 Kudos

Hi santhosh,

create check boxes for different options like male [] ,location[] ,SAP[] and in select statement  put if condition like;

if  male = X and  location = X

SELECT * from ZDATABASEVIEW  into data_table where ZCAND_GENDER = 'Male' AND ZCAND_LOCATION = 'Bangalore' this is one of the way.
else you can use dropdown box method.

CREATE DROPDOWN BOX WHICH CONTAINS THREE PLACES KOLKATA ,CHENNAI,mumbai..create global constants.

put condition if loc = gc_1.

l_loc = chennai.put else if etc...

SELECT * from ZDATABASEVIEW  into data_table where ZCAND_GENDER = l_gen AND ZCAND_LOCATION = l_loc.

I think it might be helpful,,