Receipt Creation Process
Procedure To Populate Data In HEADERS INTERFACE:
-----------------------------------------------------------------------------------------------------------------
PROCEDURE insert_hdr_int(p_hdr_rec IN OUT rcv_headers_interface%rowtype
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2 )
IS
ls_processing_status_code VARCHAR2(100);
ls_receipt_source_code VARCHAR2(100);
ls_transaction_type VARCHAR2(100);
ls_validation_flag VARCHAR2(100);
BEGIN
ls_processing_status_code := 'PENDING';
ls_receipt_source_code := 'VENDOR';
ls_transaction_type := 'NEW';
ls_validation_flag := 'Y';
x_result_out := 0;
x_error_code := 0;
x_error_msg := 'SUCCESS';
INSERT INTO rcv_headers_interface( header_interface_id
,group_id
,last_update_date
,last_updated_by
,last_update_login
,creation_date
,created_by
,processing_status_code
,receipt_source_code
,transaction_type
,vendor_id
,expected_receipt_date
,validation_flag
,shipped_date
,ship_to_organization_id
)
VALUES
(p_hdr_rec.header_interface_id
,p_hdr_rec.group_id
,SYSDATE
,g_user_id
,g_login_id
,SYSDATE
,g_user_id
,ls_processing_status_code
,ls_receipt_source_code
,ls_transaction_type
,p_hdr_rec.vendor_id
,SYSDATE
,ls_validation_flag
,SYSDATE
,p_hdr_rec.ship_to_organization_id
);
EXCEPTION
WHEN OTHERS THEN
x_result_out :=-1;
x_error_code :=sqlcode;
x_error_msg :=sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.insert_hdr_int',null,null,x_error_code,x_error_msg,g_user_id);
END insert_hdr_int;
-----------------------------------------------------------------------------------------------------------------------------
Procedure To Populate Data Into RCT LINES INTERFACE
PROCEDURE insert_transac_int( p_tr_rec IN OUT rcv_transactions_interface%rowtype
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2 )
IS
ls_transaction_type VARCHAR2(100);
ls_processing_status_code VARCHAR2(100);
ls_processing_mode_code VARCHAR2(100);
ls_transaction_status_code VARCHAR2(100);
ls_auto_transact_code VARCHAR2(100);
ls_receipt_source_code VARCHAR2(100);
ls_source_document_code VARCHAR2(100);
ls_validation_flag VARCHAR2(100);
BEGIN
ls_transaction_type := 'RECEIVE';
ls_processing_status_code := 'PENDING';
ls_processing_mode_code := 'BATCH';
ls_transaction_status_code := 'PENDING';
ls_auto_transact_code := 'DELIVER';
ls_receipt_source_code := 'VENDOR';
ls_source_document_code := 'PO';
ls_validation_flag := 'Y';
x_result_out := 0;
x_error_code := 0;
x_error_msg :='Success';
INSERT INTO rcv_transactions_interface(interface_transaction_id
,header_interface_id
,group_id
,last_update_date
,last_updated_by
,last_update_login
,creation_date
,created_by
,transaction_type
,transaction_date
,processing_status_code
,processing_mode_code
,transaction_status_code
,quantity
,unit_of_measure
,ship_to_location_id
,receipt_source_code
,source_document_code
,po_header_id
,po_line_id
,validation_flag
,expected_receipt_date
)
VALUES (p_tr_rec.interface_transaction_id
,p_tr_rec.header_interface_id
,p_tr_rec.group_id
,SYSDATE
,g_user_id
,g_login_id
,SYSDATE
,g_user_id
,ls_transaction_type
,SYSDATE
,ls_processing_status_code
,ls_processing_mode_code
,ls_transaction_status_code
,p_tr_rec.quantity
,p_tr_rec.unit_of_measure
,p_tr_rec.ship_to_location_id
,ls_receipt_source_code
,ls_source_document_code
,p_tr_rec.po_header_id
,p_tr_rec.po_line_id
,ls_validation_flag
,SYSDATE
);
EXCEPTION
WHEN OTHERS THEN
x_result_out := -1;
x_error_code := sqlcode;
x_error_msg := sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.insert_transac_int',null,null,x_error_code,x_error_msg,g_user_id);
END insert_transac_int;
-------------------------------------------------------------------------------------------------------------------------------------
Receipt Concurrent Process
PROCEDURE rct_concurrent(p_group_id IN NUMBER
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2)
IS
v_request_phase VARCHAR2(30);
v_request_status VARCHAR2(30);
v_dev_request_phase VARCHAR2(30);
v_dev_request_status VARCHAR2(30);
v_request_status_mesg VARCHAR2(250);
ln_receipt_no NUMBER;
v_interval NUMBER ;
v_max_wait NUMBER ;
cc_req_id NUMBER;
lb_wait_status BOOLEAN;
BEGIN
x_result_out := 0;
x_error_code := 0;
x_error_msg := 'Success';
cc_req_id := fnd_request.submit_request('PO' --APPLICATIONI SHORT NAME;
,'RVCTP' --PROGRAM SHORT NAME;
,''
, ''
, FALSE
,'BATCH'
,p_group_id
);
COMMIT;
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request ID',cc_req_id,x_error_msg,g_user_id);
v_interval:=20;
v_max_wait:=120;
lb_wait_status := FND_CONCURRENT.wait_for_request(cc_req_id
,v_interval
,v_max_wait
,v_request_phase
,v_request_status
,v_dev_request_phase
,v_dev_request_status
,v_request_status_mesg
);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request_phase',null,v_dev_request_phase,g_user_id);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request_status',null,v_dev_request_status,g_user_id);
IF v_dev_request_phase = 'COMPLETE' AND v_dev_request_status = 'NORMAL' THEN
x_result_out := 0;
ELSE
x_result_out := -1;
END IF;
EXCEPTION
WHEN OTHERS THEN
x_result_out :=-1;
x_error_code :=sqlcode;
x_error_msg :=sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,null,x_error_code,x_error_msg,g_user_id);
END rct_concurrent;
Procedure To Populate Data In HEADERS INTERFACE:
-----------------------------------------------------------------------------------------------------------------
PROCEDURE insert_hdr_int(p_hdr_rec IN OUT rcv_headers_interface%rowtype
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2 )
IS
ls_processing_status_code VARCHAR2(100);
ls_receipt_source_code VARCHAR2(100);
ls_transaction_type VARCHAR2(100);
ls_validation_flag VARCHAR2(100);
BEGIN
ls_processing_status_code := 'PENDING';
ls_receipt_source_code := 'VENDOR';
ls_transaction_type := 'NEW';
ls_validation_flag := 'Y';
x_result_out := 0;
x_error_code := 0;
x_error_msg := 'SUCCESS';
INSERT INTO rcv_headers_interface( header_interface_id
,group_id
,last_update_date
,last_updated_by
,last_update_login
,creation_date
,created_by
,processing_status_code
,receipt_source_code
,transaction_type
,vendor_id
,expected_receipt_date
,validation_flag
,shipped_date
,ship_to_organization_id
)
VALUES
(p_hdr_rec.header_interface_id
,p_hdr_rec.group_id
,SYSDATE
,g_user_id
,g_login_id
,SYSDATE
,g_user_id
,ls_processing_status_code
,ls_receipt_source_code
,ls_transaction_type
,p_hdr_rec.vendor_id
,SYSDATE
,ls_validation_flag
,SYSDATE
,p_hdr_rec.ship_to_organization_id
);
EXCEPTION
WHEN OTHERS THEN
x_result_out :=-1;
x_error_code :=sqlcode;
x_error_msg :=sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.insert_hdr_int',null,null,x_error_code,x_error_msg,g_user_id);
END insert_hdr_int;
-----------------------------------------------------------------------------------------------------------------------------
Procedure To Populate Data Into RCT LINES INTERFACE
PROCEDURE insert_transac_int( p_tr_rec IN OUT rcv_transactions_interface%rowtype
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2 )
IS
ls_transaction_type VARCHAR2(100);
ls_processing_status_code VARCHAR2(100);
ls_processing_mode_code VARCHAR2(100);
ls_transaction_status_code VARCHAR2(100);
ls_auto_transact_code VARCHAR2(100);
ls_receipt_source_code VARCHAR2(100);
ls_source_document_code VARCHAR2(100);
ls_validation_flag VARCHAR2(100);
BEGIN
ls_transaction_type := 'RECEIVE';
ls_processing_status_code := 'PENDING';
ls_processing_mode_code := 'BATCH';
ls_transaction_status_code := 'PENDING';
ls_auto_transact_code := 'DELIVER';
ls_receipt_source_code := 'VENDOR';
ls_source_document_code := 'PO';
ls_validation_flag := 'Y';
x_result_out := 0;
x_error_code := 0;
x_error_msg :='Success';
INSERT INTO rcv_transactions_interface(interface_transaction_id
,header_interface_id
,group_id
,last_update_date
,last_updated_by
,last_update_login
,creation_date
,created_by
,transaction_type
,transaction_date
,processing_status_code
,processing_mode_code
,transaction_status_code
,quantity
,unit_of_measure
,ship_to_location_id
,receipt_source_code
,source_document_code
,po_header_id
,po_line_id
,validation_flag
,expected_receipt_date
)
VALUES (p_tr_rec.interface_transaction_id
,p_tr_rec.header_interface_id
,p_tr_rec.group_id
,SYSDATE
,g_user_id
,g_login_id
,SYSDATE
,g_user_id
,ls_transaction_type
,SYSDATE
,ls_processing_status_code
,ls_processing_mode_code
,ls_transaction_status_code
,p_tr_rec.quantity
,p_tr_rec.unit_of_measure
,p_tr_rec.ship_to_location_id
,ls_receipt_source_code
,ls_source_document_code
,p_tr_rec.po_header_id
,p_tr_rec.po_line_id
,ls_validation_flag
,SYSDATE
);
EXCEPTION
WHEN OTHERS THEN
x_result_out := -1;
x_error_code := sqlcode;
x_error_msg := sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.insert_transac_int',null,null,x_error_code,x_error_msg,g_user_id);
END insert_transac_int;
-------------------------------------------------------------------------------------------------------------------------------------
Receipt Concurrent Process
PROCEDURE rct_concurrent(p_group_id IN NUMBER
,x_result_out OUT NUMBER
,x_error_code OUT NUMBER
,x_error_msg OUT VARCHAR2)
IS
v_request_phase VARCHAR2(30);
v_request_status VARCHAR2(30);
v_dev_request_phase VARCHAR2(30);
v_dev_request_status VARCHAR2(30);
v_request_status_mesg VARCHAR2(250);
ln_receipt_no NUMBER;
v_interval NUMBER ;
v_max_wait NUMBER ;
cc_req_id NUMBER;
lb_wait_status BOOLEAN;
BEGIN
x_result_out := 0;
x_error_code := 0;
x_error_msg := 'Success';
cc_req_id := fnd_request.submit_request('PO' --APPLICATIONI SHORT NAME;
,'RVCTP' --PROGRAM SHORT NAME;
,''
, ''
, FALSE
,'BATCH'
,p_group_id
);
COMMIT;
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request ID',cc_req_id,x_error_msg,g_user_id);
v_interval:=20;
v_max_wait:=120;
lb_wait_status := FND_CONCURRENT.wait_for_request(cc_req_id
,v_interval
,v_max_wait
,v_request_phase
,v_request_status
,v_dev_request_phase
,v_dev_request_status
,v_request_status_mesg
);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request_phase',null,v_dev_request_phase,g_user_id);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,'Request_status',null,v_dev_request_status,g_user_id);
IF v_dev_request_phase = 'COMPLETE' AND v_dev_request_status = 'NORMAL' THEN
x_result_out := 0;
ELSE
x_result_out := -1;
END IF;
EXCEPTION
WHEN OTHERS THEN
x_result_out :=-1;
x_error_code :=sqlcode;
x_error_msg :=sqlerrm(x_error_code);
XXEY_TMS_INTEGRATION_PKG.Error_Log('TMS Interface','PO Receipts','xxey_tms_receipt_pkg.rct_concurrent',null,null,x_error_code,x_error_msg,g_user_id);
END rct_concurrent;
No comments:
Post a Comment