|

- UID
- 3206
- 帖子
- 153
- 精华
- 0
- 积分
- 135
- 人气值
- 52 点
- 努力值
- 1809 点
- 推广注册人数
- 1 个人
- 阅读权限
- 50
- 性别
- 男
- 在线时间
- 577 小时
- 注册时间
- 2006-7-3
- 最后登录
- 2008-12-2
|
6楼
发表于 2007-12-31 11:39
| 只看该作者
我在你提供的檔案做了一些修改,你參考看看
1. 在查詢畫面增加兩個欄位 : START_DATE 及 END_DATE ,用來與 main block 的 START_DATE_ACTIVE 做區間比較(見 pic1)
2. 在 find 的 trigger : when-button-pressed 改寫如下 :
-- 2007/12/31 add by blueworm
declare
ls_where varchar2(1000);
ls_this_where varchar2(1000);
begin
if :control.distribution_num is null
and :control.distribution_type is null
and :control.target_name is null
and :control.inventory_item_num is null
and :control.item_num is null
and :control.start_date_active is null
and :control.start_date is null
and :control.end_date is null
then
:parameter.g_query_find := 'FALSE';
Fnd_Message.Set_Name('FND','請務必輸入一樣查詢資料!');
Fnd_Message.Error;
else
:parameter.g_query_find := 'TRUE';
ls_where := GET_BLOCK_PROPERTY('NS_MODEL_DISTRIBUTIONS',DEFAULT_WHERE);
if ls_where is null
then
ls_this_where := '1=1 ';
else
ls_this_where := ls_where;
end if;
-- 我另外增加兩個欄位 start_date / end_date 與 起始日期(start_date_active) 做區間比較
if :control.start_date is not null
then
ls_this_where := ls_this_where||' and start_date_active >= :control.start_date';
end if;
if :control.end_date is not null
then
ls_this_where := ls_this_where||' and start_date_active <= :control.end_date';
end if;
SET_BLOCK_PROPERTY('NS_MODEL_DISTRIBUTIONS',DEFAULT_WHERE,LS_THIS_WHERE);
app_find.find('NS_MODEL_DISTRIBUTIONS');
-- 因為 default_where 已被變更,所以在查詢後要還原
SET_BLOCK_PROPERTY('NS_MODEL_DISTRIBUTIONS',DEFAULT_WHERE,LS_WHERE);
end if;
:parameter.g_query_find := 'FALSE';
end;
3. 在 main block : NS_MODEL_DISTRIBUTIONS 增加兩個 trigger : PRE-QUERY / QUERY-FIND
< PRE-QUERY >
-- 2007/12/31 add by blueworm
IF :parameter.G_query_find = 'TRUE'
THEN
copy( :CONTROL.DISTRIBUTION_NUM , 'NS_MODEL_DISTRIBUTIONS.DISTRIBUTION_NUM' ); -- 攤提案號
copy( :CONTROL.DISTRIBUTION_TYPE , 'NS_MODEL_DISTRIBUTIONS.DISTRIBUTION_TYPE' ); -- 交易類型
copy( :CONTROL.TARGET_NAME , 'NS_MODEL_DISTRIBUTIONS.TARGET_NAME' ); -- 往來對象
copy( :CONTROL.INVENTORY_ITEM_NUM , 'NS_MODEL_DISTRIBUTIONS.INVENTORY_ITEM_NUM' ); -- 攤提料號
copy( :CONTROL.ITEM_NUM , 'NS_MODEL_DISTRIBUTIONS.ITEM_NUM' ); -- 模具料號
copy( :CONTROL.START_DATE_ACTIVE , 'NS_MODEL_DISTRIBUTIONS.START_DATE_ACTIVE' ); -- 起始日期
:parameter.G_query_find := 'FALSE';
END IF;
< QUERY-FIND >
-- 2007/12/31 add by blueworm
-- app_find.query_find('<Result Block Window Name>',
-- '<Find Window Name>',
-- '<Find Window Block Name>');
app_find.clear;
APP_FIND.QUERY_FIND('NS_MODEL_DISTRIBUTIONS',
'CONTROL',
'CONTROL'); |
附件: 您所在的用户组无法下载或查看附件
|