I have 2 blocks(blockname,forecastcontrol(non-database)), 5 items are there in two blocks with having lov's , my requirement is that when i select any one of the lov , display all other 4 records , so, write below code for 1st lov(organisation_code) item the all other 4 records are displays it is fine and same code i wrote for another 2nd(fiscal_year) item it not shows records, except first record(organisation_code), what is the problem for this can any one please help me.
Your question seems like enter and execute query. I assume that you are having one database block with 5 fields. If you give value for any one of the 5 fields relevant records are to be displayed. For this there is no button(search) is required just enter query and execute query will do the job. If not then post your program codings inside the find button.
I take & created lov's query from d/f tables are for 5 items , i mean i am not create LOV's based on BLOCK Table and having all columns of 5 lov's are having in custom table also, when i select any one of the LOV's and click on FIND Button to display remaining records
My understanding of your problem:
In all the 5 items or any of the five items of datablock you can enter data using LOV and based on this data when you click FIND button, you want the block to be queried. i.e. these 5 items act like a search criteria / filter.
If this is the case, then 2 triggers created on your block can help:
KEY-ENTQRY - Here you form a dynamic sql statement with dynamic WHERE conditions and AND conditions based on data in the 5 fileds.
KEY-EXEQRY - This must be called on your FIND button using do_key.
You can also form the dynamic WHERE condition on PRE-QUERY trigger of the block instead of KEY-ENTQRY.
On Find button , then you must do a GO_BLOCK and execute_query.