0% found this document useful (0 votes)
153 views7 pages

ProgramUnit INVTVXN (PB)

This document contains the body of a package named INVTVTXN in Oracle. It includes several procedures used for handling multi-select functionality, retrieving organization information, controlling visibility of items, setting lookup parameters, and dynamically setting flexfield values based on transaction source type.

Uploaded by

Rockey Zap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views7 pages

ProgramUnit INVTVXN (PB)

This document contains the body of a package named INVTVTXN in Oracle. It includes several procedures used for handling multi-select functionality, retrieving organization information, controlling visibility of items, setting lookup parameters, and dynamically setting flexfield values based on transaction source type.

Uploaded by

Rockey Zap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

PACKAGE BODY INVTVTXN IS

procedure multi_return_action is
action varchar2(64);
blockname varchar2(30);
begin
--if(:parameter.module <> 'CST') then --Bug 2298435
-- return;
--end if;
blockname := :GLOBAL.APPCORE_MULTI_BLOCK;
action := :GLOBAL.APPCORE_MULTI_ACTION;
-- fnd_message.debug('action: ' || action || ' ' || :results.item);
if blockname = 'FORM-LEVEL' then
if action = 'KEY-CLRFRM' then
-- Include the label changes for all multi-select blocks
app_multi.change_label('RESULTS','SPECIAL.SPECIAL3','MENU_ITEM');
end if;
elsif blockname = 'RESULTS' then
if action = 'LABEL_CHANGE' then
-- Include the label changes only for this block
if(Get_Group_Row_Count(Find_group('results_multi')) > 0) then
app_special.enable('SPECIAL4',PROPERTY_ON);
app_special.enable('SPECIAL5',PROPERTY_ON);
app_multi.change_label('RESULTS','SPECIAL.SPECIAL4','MENU_ITEM');
else
app_special.enable('SPECIAL5',PROPERTY_OFF);

app_special.instantiate('SPECIAL4',get_group_char_cell('special_menu.column4',1),NU
LL,FALSE,NULL);
end if;
elsif action = 'KEY-CLRREC' then
clear_record;
if not(FORM_SUCCESS) then
raise FORM_TRIGGER_FAILURE;
end if;
end if;

-- Developer named events below


if blockname = 'RESULTS' then
if action = 'SUBMIT_SELECTED_RECORDS' then
if(:results.costed_flag = 'E' or :results.pm_cost_collected = 'E') then
invinq_flags.update_error_to_no;
end if;
APP_MULTI.DESELECT_RECORD('RESULTS',to_number(:system.cursor_record));
end if;
end if;
else
-- This is to catch errors
fnd_message.debug('There is no multi-select block '
||:GLOBAL.APPCORE_MULTI_BLOCK||'. Action: '
||action);
end if;
end multi_return_action;

PROCEDURE GET_ORG_INFO
/* chart_of_accounts is usually set if the form is invoked
normally from the menu. However, we call this form from some other forms
with only org_id as the parameter and hence chart_of_accounts should be
populated in that case. set_of_books is anyway needed for XLA. So changing
the function name from get_set_of_books_id to get_org_info and adding the
chart_of_accounts_id as well. sdirisal@us. Bug#906897
*/
IS
BEGIN
SELECT SET_OF_BOOKS_ID,CHART_OF_ACCOUNTS_ID
INTO :parameter.set_of_books_id,
:parameter.chart_of_accounts_id
FROM
/* Bug# 9127972: Fetching SOB and COA ID from cst_organization_definitions
instead of ORG_ORGANIZATION_DEFINITIONS */
/* ORG_ORGANIZATION_DEFINITIONS */
CST_ORGANIZATION_DEFINITIONS
WHERE ORGANIZATION_ID = :parameter.org_id;
END GET_ORG_INFO;

--
-- This procedure is used to hide J Release items from pre-J release installation
--

PROCEDURE CONTROL_J_RELEASE_ITEMS
IS
BEGIN
APP_ITEM_PROPERTY.SET_PROPERTY('FINDSCREEN.SUPPLIER_NAME',
VISIBLE,PROPERTY_FALSE);
APP_ITEM_PROPERTY.SET_PROPERTY('FINDSCREEN.CONSUMPTION_ADVICE_STATUS_CODE',
VISIBLE,PROPERTY_FALSE);

SET_TAB_PAGE_PROPERTY('CONSUMPTION_ADVICE_INFO',
VISIBLE, PROPERTY_FALSE);

END CONTROL_J_RELEASE_ITEMS;

--
-- Store the lookups for use in post query
--

PROCEDURE SET_CONSUMPTION_PARAMETERS
IS
BEGIN
:parameter.lookup_type := 'MTL_CONSUMPTION_ADVICE_STATUS';
:parameter.lookup_code := '1';

SELECT meaning
INTO :parameter.CONSUMPTION_ADVICE_CREATED
FROM mfg_lookups
WHERE lookup_type = :parameter.lookup_type
AND lookup_code = :parameter.lookup_code;

:parameter.lookup_code := '2';

SELECT meaning
INTO :parameter.CONSUMPTION_ADVICE_ERROR
FROM mfg_lookups
WHERE lookup_type = :parameter.lookup_type
AND lookup_code = :parameter.lookup_code;

:parameter.lookup_code := '3';
SELECT meaning
INTO :parameter.CONSUMPTION_ADVICE_PENDING
FROM mfg_lookups
WHERE lookup_type = :parameter.lookup_type
AND lookup_code = :parameter.lookup_code;
EXCEPTION
WHEN OTHERS THEN
NULL;
END SET_CONSUMPTION_PARAMETERS;

PROCEDURE SET_SOURCE
IS
--
-- Description
-- This code is called only from the When-New-Record_Instance Trigger
-- of RECORDS block. It enables or disables the flex field definition
-- depending upon the transaction source type id.
-- It was written for the bug 3296404.
--
Sales_Order CONSTANT NUMBER := 2;
Account CONSTANT NUMBER := 3;
Move_Order CONSTANT NUMBER := 4;
WIP_Job_or_Schedule CONSTANT NUMBER := 5;
Account_Alias CONSTANT NUMBER := 6;
Requisition CONSTANT NUMBER := 7;
Internal_Order CONSTANT NUMBER := 8;
Physical_inventory CONSTANT NUMBER := 10;
Cost_update CONSTANT NUMBER := 11;
RMA CONSTANT NUMBER := 12;
Inventory CONSTANT NUMBER := 13;
Cycle_count CONSTANT NUMBER := 9;
PO CONSTANT NUMBER := 1;
txn_src_type NUMBER;
txn_src_name VARCHAR2(240);
txn_src_id NUMBER;
org_id NUMBER;
chart_acct_id NUMBER;
BEGIN
txn_src_type := TO_NUMBER(name_in('results.transaction_source_type_id'));
if ( txn_src_type = Account_Alias ) then
COPY('MDSP','control.results_flex_code');
COPY('INV', 'control.results_flex_app_name');
COPY(name_in('control.account_alias_num'), 'control.results_flex_num');
COPY(name_in('parameter.org_id'), 'control.results_flex_dataset');
FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'Y');

elsif (txn_src_type = Cost_update) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif (txn_src_type = Cycle_Count ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif ( txn_src_type = Account ) then


COPY('GL#','control.results_flex_code');
COPY('SQLGL', 'control.results_flex_app_name');
COPY(name_in('parameter.chart_of_accounts_id'), 'control.results_flex_num');
COPY('-1', 'control.results_flex_dataset');
FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'Y');

elsif (txn_src_type = Inventory or txn_src_type >= 100) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif (txn_src_type = Physical_inventory ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif ( txn_src_type = PO ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif (txn_src_type = Requisition ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif ( (txn_src_type = Sales_Order) OR (txn_src_type = Internal_Order)


OR (txn_src_type = RMA)) then

COPY('MKTS','control.results_flex_code');
COPY('INV', 'control.results_flex_app_name');
COPY(name_in('control.sales_order_num'), 'control.results_flex_num');
COPY('-1', 'control.results_flex_dataset');
FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'Y');

elsif (txn_src_type = WIP_Job_or_Schedule ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

elsif (txn_src_type = Move_Order ) then


FND_KEY_FLEX.UPDATE_DEFINITION(
BLOCK =>'RESULTS',
FIELD => 'TRANSACTION_SOURCE_NAME',
ENABLED => 'N');

end if;
END SET_SOURCE;

/* Bug #5337683
* Added a new function that splits the SQL into two parts with a UNION
* for fetching logical transactions
*/
FUNCTION GET_LOGICAL_WHERE
RETURN VARCHAR2 IS
l_where_part1 varchar2(20000);
l_select_part2 varchar2(4000);
l_from_part2 varchar2(100);
l_where_part2 varchar2(20000);
x_logical_where varchar2(32000);
l_temp LONG;
BEGIN
l_where_part1 := get_block_property('RESULTS', DEFAULT_WHERE);
l_where_part1 := l_where_part1 || ' AND (parent_transaction_id IS NULL) ';
l_select_part2 := ' UNION ALL
SELECT ROWID
, subinventory_code
, mcc_code
, revision
, transfer_subinventory
, ship_to_location_id
, cost_group_id
, transfer_cost_group_id
, lpn_id
, content_lpn_id
, transfer_lpn_id
, transfer_organization_id
, owning_organization_id
, planning_tp_type
, owning_tp_type
, planning_organization_id
, transaction_date
, transaction_id
, transaction_quantity
, transaction_uom
, primary_quantity
, secondary_transaction_quantity
, secondary_uom_code
, shipment_number
, waybill_airbill
, freight_code
, number_of_containers
, transaction_reference
, costed_flag
, opm_costed_flag
, pm_cost_collected
, pm_cost_collector_group_id
, transaction_group_id
, vendor_lot_number
, source_code
, source_line_id
, transfer_transaction_id
, parent_transaction_id
, logical_transaction
, transaction_set_id
, rcv_transaction_id
, move_transaction_id
, completion_transaction_id
, operation_seq_num
, source_project_id
, source_task_id
, project_id
, task_id
, to_project_id
, to_task_id
, expenditure_type
, pa_expenditure_org_id
, ERROR_CODE
, error_explanation
, transaction_source_name
, xfr_owning_organization_id
, transfer_owning_tp_type
, attribute_category
, attribute1
, attribute2
, attribute3
, attribute4
, attribute5
, attribute6
, attribute7
, attribute8
, attribute9
, attribute10
, attribute11
, attribute12
, attribute13
, attribute14
, attribute15
, last_updated_by
, creation_date
, created_by
, last_update_login
, request_id
, program_application_id
, program_id
, program_update_date
, last_update_date
, inventory_item_id
, organization_id
, locator_id
, reason_id
, transfer_locator_id
, transaction_type_id
, transaction_action_id
, transaction_source_type_id
, transaction_source_id
, employee_code
, department_id
, master_schedule_update_code
, receiving_document
, pick_strategy_id
, pick_rule_id
, put_away_strategy_id
, put_away_rule_id
, original_transaction_temp_id ';

l_from_part2 := ' FROM MTL_MATERIAL_TRANSACTIONS ';


l_where_part2 := ' WHERE PARENT_TRANSACTION_ID IS NOT NULL ';
l_where_part2 := l_where_part2 || ' AND parent_transaction_id IN ( ';
l_where_part2 := l_where_part2 || ' SELECT parent_transaction_id ';
l_where_part2 := l_where_part2 || ' FROM MTL_MATERIAL_TRANSACTIONS';
l_where_part2 := l_where_part2 || ' WHERE ' ||
get_block_property('RESULTS', DEFAULT_WHERE) || ' ) ';
--l_where_part2 := l_where_part2 || ' AND (1 = 1 ';
x_logical_where := l_where_part1 || l_select_part2 || l_from_part2 ||
l_where_part2;

RETURN x_logical_where;

END GET_LOGICAL_WHERE;
END;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy