功能:POP需求审批管理
错误:not data found
原因:pre-query中的default_where有问题
1
declare2
v_where varchar2(200);3
begin4
if :parameter.p_second_app_user = 0 then5
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 then10
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

18
end;19

20

解决方法:在post-query中最后添加
set_block_property('HEK_OM_POP_HEADERS_V',DEFAULT_WHERE,' 1 = 1 ');