Create ASN in 'EXPECTED' or 'FULLY_RECEIVED' Status.
We can create an ASN in Oracle apps in either 'EXPECTED' or 'FULLY RECEIVED' Status.
This can be achieved or bifurcated using 'AUTO_TRANSACT_CODE' Column.
A)- In case of ASN to be created in 'EXPECTED' Status then
Insert in RHI and RTI with below values.
AUTO_TRANSACT_CODE = 'SHIP'
INTO rcv_headers_interface (header_interface_id,
GROUP_ID,
processing_status_code,
receipt_source_code,
transaction_type,
last_update_date,
last_updated_by,
creation_date,
created_by,
shipped_date,
vendor_id,
employee_id,
validation_flag,
ship_to_organization_code,
expected_receipt_date,
shipment_num,
asn_type,
auto_transact_code)
VALUES (v_header_interface_id,
v_group_id,
'PENDING',
'VENDOR',
'NEW',
gd_date,
gn_user_id,
gd_date,
gn_user_id,
gd_date,
v_vendor_id,
v_agent_id,
'Y',
v_organization_code,
gd_date,
'REFERENCE_VALUE'--- user specified value
'ASN',
'SHIP');
--------------------------------------------------------------------------------
INSERT
INTO rcv_transactions_interface (
interface_transaction_id,
header_interface_id,
GROUP_ID,
last_update_date,
last_updated_by,
creation_date,
created_by,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
quantity,
unit_of_measure,
auto_transact_code,
receipt_source_code,
source_document_code,
po_header_id,
po_line_id,
po_line_location_id,
ship_to_location_id,
validation_flag,
to_organization_code,
item_num)
VALUES (v_interface_transaction_id,
v_header_interface_id,
v_group_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
'SHIP',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
a_detail.shipped_quantity,
v_unit_of_measure,
'SHIP',
'VENDOR',
'PO',
a_detail.PO_HEADER_ID,
a_detail.PO_LINE_ID,
v_line_location_id,
v_ship_to_location_id,
'Y',
v_org_code,
v_item_num);
----------------------------------------------------------------------------------
INSERT
INTO mtl_transaction_lots_interface (
transaction_interface_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
lot_number,
lot_expiration_date,
transaction_quantity,
primary_quantity,
product_code,
product_transaction_id)
VALUES (mtl_material_transactions_s.NEXTVAL,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
v_lot_number,
v_exp_date,
a_detail.shipped_quantity,
v_primary_quantity,
'RCV',
v_interface_transaction_id);
----- *******************************************************************------
B)- In case of ASN to be created in 'FULLY_RECEIVED' Status then
Insert in RHI and RTI with below values.
AUTO_TRANSACT_CODE = 'RECEIVE'
INTO rcv_headers_interface (header_interface_id,
GROUP_ID,
processing_status_code,
receipt_source_code,
transaction_type,
last_update_date,
last_updated_by,
creation_date,
created_by,
shipped_date,
vendor_id,
employee_id,
validation_flag,
ship_to_organization_code,
expected_receipt_date,
shipment_num,
asn_type,
auto_transact_code)
VALUES (v_header_interface_id,
v_group_id,
'PENDING',
'VENDOR',
'NEW',
gd_date,
gn_user_id,
gd_date,
gn_user_id,
gd_date,
v_vendor_id,
v_agent_id,
'Y',
v_organization_code,
gd_date,
'REFERENCE_VALUE'--- user specified value
'ASN',
'RECEIVE');
--------------------------------------------------------------------------------
INSERT
INTO rcv_transactions_interface (
interface_transaction_id,
header_interface_id,
GROUP_ID,
last_update_date,
last_updated_by,
creation_date,
created_by,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
quantity,
unit_of_measure,
auto_transact_code,
receipt_source_code,
source_document_code,
po_header_id,
po_line_id,
po_line_location_id,
ship_to_location_id,
validation_flag,
to_organization_code,
item_num)
VALUES (v_interface_transaction_id,
v_header_interface_id,
v_group_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
'RECEIVE',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
a_detail.shipped_quantity,
v_unit_of_measure,
'RECEIVE',
'VENDOR',
'PO',
a_detail.PO_HEADER_ID,
a_detail.PO_LINE_ID,
v_line_location_id,
v_ship_to_location_id,
'Y',
v_org_code,
v_item_num);
----------------------------------------------------------------------------------
INSERT
INTO mtl_transaction_lots_interface (
transaction_interface_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
lot_number,
lot_expiration_date,
transaction_quantity,
primary_quantity,
product_code,
product_transaction_id)
VALUES (mtl_material_transactions_s.NEXTVAL,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
v_lot_number,
v_exp_date,
a_detail.shipped_quantity,
v_primary_quantity,
'RCV',
v_interface_transaction_id);
C)- Then Call receiving Transaction processor
fnd_request.submit_request (application => 'PO',
program => 'RVCTP',
start_time => SYSDATE,
description => NULL,
sub_request => FALSE,
argument1 => 'BATCH',
argument2 => v_group_id);
We can create an ASN in Oracle apps in either 'EXPECTED' or 'FULLY RECEIVED' Status.
This can be achieved or bifurcated using 'AUTO_TRANSACT_CODE' Column.
A)- In case of ASN to be created in 'EXPECTED' Status then
Insert in RHI and RTI with below values.
AUTO_TRANSACT_CODE = 'SHIP'
INTO rcv_headers_interface (header_interface_id,
GROUP_ID,
processing_status_code,
receipt_source_code,
transaction_type,
last_update_date,
last_updated_by,
creation_date,
created_by,
shipped_date,
vendor_id,
employee_id,
validation_flag,
ship_to_organization_code,
expected_receipt_date,
shipment_num,
asn_type,
auto_transact_code)
VALUES (v_header_interface_id,
v_group_id,
'PENDING',
'VENDOR',
'NEW',
gd_date,
gn_user_id,
gd_date,
gn_user_id,
gd_date,
v_vendor_id,
v_agent_id,
'Y',
v_organization_code,
gd_date,
'REFERENCE_VALUE'--- user specified value
'ASN',
'SHIP');
--------------------------------------------------------------------------------
INSERT
INTO rcv_transactions_interface (
interface_transaction_id,
header_interface_id,
GROUP_ID,
last_update_date,
last_updated_by,
creation_date,
created_by,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
quantity,
unit_of_measure,
auto_transact_code,
receipt_source_code,
source_document_code,
po_header_id,
po_line_id,
po_line_location_id,
ship_to_location_id,
validation_flag,
to_organization_code,
item_num)
VALUES (v_interface_transaction_id,
v_header_interface_id,
v_group_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
'SHIP',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
a_detail.shipped_quantity,
v_unit_of_measure,
'SHIP',
'VENDOR',
'PO',
a_detail.PO_HEADER_ID,
a_detail.PO_LINE_ID,
v_line_location_id,
v_ship_to_location_id,
'Y',
v_org_code,
v_item_num);
----------------------------------------------------------------------------------
INSERT
INTO mtl_transaction_lots_interface (
transaction_interface_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
lot_number,
lot_expiration_date,
transaction_quantity,
primary_quantity,
product_code,
product_transaction_id)
VALUES (mtl_material_transactions_s.NEXTVAL,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
v_lot_number,
v_exp_date,
a_detail.shipped_quantity,
v_primary_quantity,
'RCV',
v_interface_transaction_id);
----- *******************************************************************------
B)- In case of ASN to be created in 'FULLY_RECEIVED' Status then
Insert in RHI and RTI with below values.
AUTO_TRANSACT_CODE = 'RECEIVE'
INTO rcv_headers_interface (header_interface_id,
GROUP_ID,
processing_status_code,
receipt_source_code,
transaction_type,
last_update_date,
last_updated_by,
creation_date,
created_by,
shipped_date,
vendor_id,
employee_id,
validation_flag,
ship_to_organization_code,
expected_receipt_date,
shipment_num,
asn_type,
auto_transact_code)
VALUES (v_header_interface_id,
v_group_id,
'PENDING',
'VENDOR',
'NEW',
gd_date,
gn_user_id,
gd_date,
gn_user_id,
gd_date,
v_vendor_id,
v_agent_id,
'Y',
v_organization_code,
gd_date,
'REFERENCE_VALUE'--- user specified value
'ASN',
'RECEIVE');
--------------------------------------------------------------------------------
INSERT
INTO rcv_transactions_interface (
interface_transaction_id,
header_interface_id,
GROUP_ID,
last_update_date,
last_updated_by,
creation_date,
created_by,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
quantity,
unit_of_measure,
auto_transact_code,
receipt_source_code,
source_document_code,
po_header_id,
po_line_id,
po_line_location_id,
ship_to_location_id,
validation_flag,
to_organization_code,
item_num)
VALUES (v_interface_transaction_id,
v_header_interface_id,
v_group_id,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
'RECEIVE',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
a_detail.shipped_quantity,
v_unit_of_measure,
'RECEIVE',
'VENDOR',
'PO',
a_detail.PO_HEADER_ID,
a_detail.PO_LINE_ID,
v_line_location_id,
v_ship_to_location_id,
'Y',
v_org_code,
v_item_num);
----------------------------------------------------------------------------------
INSERT
INTO mtl_transaction_lots_interface (
transaction_interface_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
lot_number,
lot_expiration_date,
transaction_quantity,
primary_quantity,
product_code,
product_transaction_id)
VALUES (mtl_material_transactions_s.NEXTVAL,
SYSDATE,
fnd_global.user_id,
SYSDATE,
fnd_global.user_id,
v_lot_number,
v_exp_date,
a_detail.shipped_quantity,
v_primary_quantity,
'RCV',
v_interface_transaction_id);
C)- Then Call receiving Transaction processor
fnd_request.submit_request (application => 'PO',
program => 'RVCTP',
start_time => SYSDATE,
description => NULL,
sub_request => FALSE,
argument1 => 'BATCH',
argument2 => v_group_id);