0% found this document useful (0 votes)
128 views3 pages

Allocate Move Order

This procedure allocates move orders by: 1. Looping through a line table and calling a create_suggestions procedure to generate suggestions for each line. 2. If the return status is successful, it updates transaction details and statuses for each line in the suggestions. 3. It returns the status, message count, and any messages to the caller.

Uploaded by

deepthi412
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)
128 views3 pages

Allocate Move Order

This procedure allocates move orders by: 1. Looping through a line table and calling a create_suggestions procedure to generate suggestions for each line. 2. If the return status is successful, it updates transaction details and statuses for each line in the suggestions. 3. It returns the status, message count, and any messages to the caller.

Uploaded by

deepthi412
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/ 3

/* Formatted on 2008/07/08 17:57 (Formatter Plus v4.8.

8) */
DECLARE
x_return_status VARCHAR2 (1);
x_msg_data
VARCHAR2 (4000);
x_msg_count
NUMBER;
l_line_tbl
inv_move_order_pub.trolin_tbl_type;
PROCEDURE allocate_move_order (
p_line_tbl
IN
inv_move_order_pub.trolin_tbl_type
, x_return_status OUT
VARCHAR2
, x_msg_data
OUT
VARCHAR2
, x_msg_count
OUT
NUMBER
)
IS
x_line_tbl
inv_move_order_pub.trolin_tbl_type;
l_trolin_tbl
inv_move_order_pub.trolin_tbl_type;
l_mold_tbl
inv_mo_line_detail_util.g_mmtt_tbl_type;
l_qty_detailed
NUMBER;
l_qty_delivered NUMBER;
l_return_status VARCHAR2 (1);
v_msg_index_out NUMBER;
l_rsr_type
inv_reservation_global.mtl_reservation_tbl_type;
i
INTEGER;
l_trolin_rec
inv_move_order_pub.trolin_rec_type;
BEGIN
x_line_tbl := p_line_tbl;
IF x_line_tbl.COUNT > 0
THEN
FOR j IN x_line_tbl.FIRST .. x_line_tbl.LAST
LOOP
DBMS_OUTPUT.put_line (x_line_tbl (j).line_id);
BEGIN
inv_ppengine_pvt.create_suggestions (p_api_version

> 1.0
, p_init_msg_list

, p_commit

, p_validation_level

, x_return_status

, x_msg_count

, x_msg_data

, p_transaction_temp_id

, p_reservations

, p_suggest_serial

, p_plan_tasks

, p_quick_pick_flag

, p_organization_id

> fnd_api.g_false
> fnd_api.g_false
> fnd_api.g_valid_level_none
> x_return_status
> x_msg_count
> x_msg_data
> x_line_tbl (j).line_id
> l_rsr_type
> fnd_api.g_true
> FALSE
> 'N'
> 207

);
DBMS_OUTPUT.put_line ('Return Status is :' || x_return_status);
DBMS_OUTPUT.put_line ('Message Count is :' || x_msg_count);
IF x_return_status = 'S'
THEN
BEGIN
l_trolin_tbl := x_line_tbl;
IF (l_trolin_tbl.COUNT <> 0)
THEN
i := l_trolin_tbl.FIRST;
WHILE i IS NOT NULL
LOOP
IF (
l_trolin_tbl (i).return_status <> fnd_api.g_r
et_sts_unexp_error
AND l_trolin_tbl (i).return_status <> fnd_api.g_r
et_sts_error
)
THEN
l_trolin_rec := inv_trolin_util.query_row (l_troli
n_tbl (i).line_id);
l_trolin_tbl (i) := l_trolin_rec;
l_qty_detailed := l_trolin_tbl (i).quantity_detail
ed;
l_qty_delivered := NVL (l_trolin_tbl (i).quantity_
delivered, 0);
IF NVL (l_qty_detailed, 0) = 0
THEN
l_mold_tbl := inv_mo_line_detail_util.query_row
s (p_line_id => l_trolin_tbl (i).line_id);
FOR j IN 1 ..
LOOP
l_mold_tbl
l_mold_tbl
l_mold_tbl

l_mold_tbl.COUNT
(j).transaction_status := 3;
(j).transaction_mode := 1;
(j).source_line_id := l_trolin_tb

l (i).line_id;
inv_mo_line_detail_util.update_row (l_return
_status, l_mold_tbl (j));
END LOOP;
SELECT transaction_header_id, transaction_quant
ity
INTO l_trolin_tbl (i).transaction_header_id,
l_trolin_tbl (i).quantity_detailed
FROM mtl_material_transactions_temp
WHERE move_order_line_id = l_trolin_tbl (i).li
ne_id;
l_trolin_tbl (i).last_update_date := SYSDATE;
l_trolin_tbl (i).last_update_login := fnd_globa
l.login_id;
IF l_trolin_tbl (i).last_update_login = -1
THEN
l_trolin_tbl (i).last_update_login := fnd_gl
obal.conc_login_id;

END IF;
l_trolin_tbl (i).last_updated_by := fnd_global.
user_id;
l_trolin_tbl (i).program_id := fnd_global.conc_
program_id;
l_trolin_tbl (i).program_update_date := SYSDATE
;
l_trolin_tbl (i).request_id := fnd_global.conc_
request_id;
l_trolin_tbl (i).program_application_id := fnd_
global.prog_appl_id;
inv_trolin_util.update_row (l_trolin_tbl (i));
END IF;
END IF;
i := l_trolin_tbl.NEXT (i);
END LOOP;
END IF;
END;
ELSE
ROLLBACK;
END IF;
IF x_msg_count > 0
THEN
FOR v_index IN 1 .. x_msg_count
LOOP
fnd_msg_pub.get (p_msg_index
=> v_index
, p_encoded
=> 'F'
, p_data
=> x_msg_data
, p_msg_index_out
=> v_msg_index_out
);
x_msg_data := SUBSTR (x_msg_data, 1, 200);
DBMS_OUTPUT.put_line (x_msg_data);
DBMS_OUTPUT.put_line ('====================================
========================');
END LOOP;
END IF;
END;
END LOOP;
END IF;
END;
BEGIN
l_line_tbl (1).line_id := 3929705;
allocate_move_order (l_line_tbl, x_return_status, x_msg_data, x_msg_count);
COMMIT;
END;

You might also like