功能:POP需求审批管理
错误:not data found
原因:pre-query中的default_where有问题
Code
1declare
2 v_where varchar2(200);
3begin
4 if :parameter.p_second_app_user = 0 then
5 v_where := get_block_property('HEK_OM_POP_HEADERS_V',default_where);
6 v_where:=v_where || ' and sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||' and application = ''POP'')';
7 set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,v_where);
8
9 elsif :parameter.p_second_app_user = 1 then
10 v_where := get_block_property('HEK_OM_POP_HEADERS_V',default_where);
11 --v_where:=v_where || ' and ((flow_status = ''enter'' and sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||'))';
12 v_where:=v_where || ' and ((sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||' and application = ''POP''))';
13 v_where:=v_where || ' or (flow_status = ''approval_first'')) ';
14 fnd_message.debug(v_where);
15 set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,v_where);
16 end if;
17
18end;
19
20
1declare
2 v_where varchar2(200);
3begin
4 if :parameter.p_second_app_user = 0 then
5 v_where := get_block_property('HEK_OM_POP_HEADERS_V',default_where);
6 v_where:=v_where || ' and sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||' and application = ''POP'')';
7 set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,v_where);
8
9 elsif :parameter.p_second_app_user = 1 then
10 v_where := get_block_property('HEK_OM_POP_HEADERS_V',default_where);
11 --v_where:=v_where || ' and ((flow_status = ''enter'' and sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||'))';
12 v_where:=v_where || ' and ((sold_to_org_id in (select ctl.CUSTOMER_ID from hek_om_user_ctl_v ctl where ctl.user_id = '|| :parameter.p_user_id ||' and application = ''POP''))';
13 v_where:=v_where || ' or (flow_status = ''approval_first'')) ';
14 fnd_message.debug(v_where);
15 set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,v_where);
16 end if;
17
18end;
19
20
解决方法:在post-query中最后添加
set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,' 1 = 1 ');