170:
171:
172: BEGIN
173:
174: l_appl_id := FND_GLOBAL.RESP_APPL_ID;
175:
176: IF QP_ATTR_MAPPING_PUB.G_REQ_TYPE_CODE = 'ONT' THEN
177: --passing null org_id to OE_Sys_Parameters for moac so that it will return MASTER_ORGANIZATION_ID
178: --for the org_context set -- build_contexts API or calling app would have set 'single' org context
390: and mtl.category_set_id = l_category_set_id
391: and eni.object_type = 'CATEGORY_SET'
392: and eni.object_id = sets.category_set_id
393: and mtl.category_id = eni.child_id
394: and sets.functional_area_id = decode(FND_GLOBAL.RESP_APPL_ID, 201,
395: 2, 11)
396: and (mtl.organization_id = p_org_id or p_org_id IS NULL)
397: and eni.parent_id = p_category_id)
398: and rownum=1;