Search This Blog

Tuesday, June 10, 2008

Date List of Value(LOV) for Concurrent Request Parameter

We are aware that it is not possible to display calendar window for concurrent request parameter. Here I am discussing on an alternative to create Date List of values.
This is addition to my earlier post Calender in Concurrent program.
Create a table value set as shown in the screenshot below.


click on Edit Information and Enter following in the table name field

(SELECT (TO_DATE (SYSDATE - 1 + LEVEL, 'DD-MON-RRRR')) date_range
, (TO_CHAR (SYSDATE - 1 + LEVEL, 'Month, DD RRRR')) date_word
FROM DUAL CONNECT BY LEVEL <= 1000)




This is how concurrent program looks when a value is attached to it.


Related Post: Calender in Concurrent program.

7 Comments:

Lakki Reddy Sreehari Reddy said...

hi suresh
i am using a formula column in my report.

If i execute the report i am always getting following error.

REP-1401: 'cf_designatorformula': Fatal PL/SQL error occurred.
ORA-01403: no data found


If i run the code in TOAD which i used in formula column,its returning rows in TOAD.

Please help me on this issue.Where is the exact problem.

Lakki Reddy Sreehari Reddy said...

Hi Suresh,

I am using following code;

function CF_DesignatorFormula return Char is
v_designator varchar2(15);
begin
SELECT brd.component_reference_designator into v_designator
FROM
bom_reference_designators brd,
bom_inventory_components bic,
bom_bill_of_materials bbom
WHERE brd.component_sequence_id = bic.component_sequence_id
and bic.bill_sequence_id = bbom.bill_sequence_id
and bbom.organization_id = :P_ORGANIZATION_ID
--and bbom.assembly_item_id =:Assembly_ID
and bic.component_item_id=:MSI_INVENTORY_ITEM_ID;
return(v_designator);
end;

Suresh Vaishya said...

Write exception in your trigger, may be one of the bom that your report is trying to retrieve do not have designators and hence raising no_Data_found error.

Anonymous said...

suresh,

Thanks for this posting. The date valueset you mentioned is the one I was searching for.Only difference is instead of sysdate, I want to refere $FLEX$.valueset name of From Date. Do you see any option to get the List of Value of 2 years in the TO_DATE field based on FROM_DATE value.FROM_DATE and TO_DATE are mandatory

thanks
Matthews

Suresh Vaishya said...

Mathew,
Below is what can be done .. which is crude but will serve the purpose

Create a view something like this that will create date ranges

create or replace view xx_date as (
(SELECT (TO_DATE ((SYSDATE -10000) - 1 + LEVEL, 'DD-MON-RRRR')) date_range
FROM DUAL CONNECT BY LEVEL <= 20000))

Then you can create a value set against this view using $flex$ condition as follows

select date_range from xx_date
where date_range between :$FLEX$.xx_start_date and add_months(:$FLEX$.xx_start_date,24)

Please let us know if this worked.

Anonymous said...

thank you Suresh. Along with this option I have tried Special value set to pop up a message and restrict the user the date range within 2 years. Now this special valueset is working and I am planning to use that special valueset as it will give the message.

thanks
Mathews

Suresh Vaishya said...

Would appreciate if you can give more information/steps on how you used special value set.

Copyright (c) All rights reserved. Presented by Suresh Vaishya