实现客制化接收(采购订单接收、销售退货接收、采购退货接收等)有2种方式:
1.把相应的数据INSERT到rcv_transactions_interface等表中,然后调用请求,完成接收
2.直接调用API,完成接收
INSERT INTO RCV_HEADERS_INTERFACE
(HEADER_INTERFACE_ID,
GROUP_ID,
PROCESSING_STATUS_CODE,
RECEIPT_SOURCE_CODE,
TRANSACTION_TYPE,
AUTO_TRANSACT_CODE,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
VENDOR_ID,
SHIP_TO_ORGANIZATION_ID,
EXPECTED_RECEIPT_DATE,
VALIDATION_FLAG)
VALUES
(v_header_interface_id, --Header_Interface_Id
v_group_id, --Group_Id
'PENDING', --Processing_Status_Code
'VENDOR', --Receipt_Source_Code
'NEW', --Transaction_Type
'DELIVER', --Auto_Transact_Code
SYSDATE, --Last_Update_Date
v_user_id, --Last_Updated_By
v_user_id, --Last_Update_Login
SYSDATE, --Creation_Date
v_user_id, --Created_By
c_po_info.vendor_id, --Vendor_Id
p_organization_id, --Ship_To_Organization_Id,
SYSDATE, --Expected_Receipt_Date
'Y' --Validation_Flag
);
INSERT INTO RCV_TRANSACTIONS_INTERFACE
(INTERFACE_TRANSACTION_ID,
GROUP_ID,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
TRANSACTION_TYPE,
TRANSACTION_DATE,
PROCESSING_STATUS_CODE,
PROCESSING_MODE_CODE,
TRANSACTION_STATUS_CODE,
QUANTITY,
UNIT_OF_MEASURE,
ITEM_ID,
ITEM_DESCRIPTION,
EMPLOYEE_ID,
AUTO_TRANSACT_CODE,
SHIP_TO_LOCATION_ID,
RECEIPT_SOURCE_CODE,
VENDOR_ID,
SOURCE_DOCUMENT_CODE,
PO_HEADER_ID,
PO_LINE_ID,
PO_LINE_LOCATION_ID,
DESTINATION_TYPE_CODE,
po_distribution_id,
DELIVER_TO_PERSON_ID,
LOCATION_ID,
DELIVER_TO_LOCATION_ID,
SUBINVENTORY,
locator_id,
HEADER_INTERFACE_ID,
DOCUMENT_NUM,
TO_ORGANIZATION_ID,
CURRENCY_CONVERSION_TYPE,
VALIDATION_FLAG)
Values
(v_interface_transaction_id, --INTERFACE_TRANSACTION_ID,
v_group_id, --GROUP_ID,
sysdate, --LAST_UPDATE_DATE,
v_user_id, --LAST_UPDATED_BY,
sysdate, --CREATION_DATE,
v_user_id, --CREATED_BY,
v_user_id, --LAST_UPDATE_LOGIN,
'RECEIVE', --TRANSACTION_TYPE,
sysdate, --TRANSACTION_DATE,
'PENDING', --PROCESSING_STATUS_CODE,
'IMMEDIATE', --PROCESSING_MODE_CODE,
'PENDING', --TRANSACTION_STATUS_CODE,
v_trans_qty, --QUANTITY,
c_po_info.unit_meas_lookup_code, --UNIT_OF_MEASURE,
c_po_info.item_id, --ITEM_ID,
c_po_info.item_description,--ITEM_DESCRIPTION
0, --EMPLOYEE_ID,
'DELIVER', --AUTO_TRANSACT_CODE,
v_location_id,--c_po_info.ship_to_location_id, --SHIP_TO_LOCATION_ID,
'VENDOR', --RECEIPT_SOURCE_CODE,
c_po_info.vendor_id, --VENDOR_ID,
'PO', --SOURCE_DOCUMENT_CODE,
c_po_info.po_header_id, --PO_HEADER_ID,
c_po_info.PO_LINE_ID, --PO_LINE_ID,
v_line_location_id, --PO_LINE_LOCATION_ID,
v_destination_type_code, --DESTINATION_TYPE_CODE,
v_po_distribution_id,--po_distribution_id
v_DELIVER_TO_PERSON_ID, --DELIVER_TO_PERSON_ID,
v_location_id, --200,--LOCATION_ID,
v_location_id, --200,--DELIVER_TO_LOCATION_ID,
'NA01', --SUBINVENTORY,
v_locator_id, --locator_id,
v_header_interface_id, --HEADER_INTERFACE_ID,
c_po_info.segment1, --DOCUMENT_NUM,
p_organization_id, --TO_ORGANIZATION_ID,
'Corporate',
'Y' --VALIDATION_FLAG
);
If v_lot_control = 2 then
INSERT INTO mtl_transaction_lots_interface
(TRANSACTION_INTERFACE_ID,
ORIGINATION_TYPE,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
LOT_NUMBER,
TRANSACTION_QUANTITY,
PRIMARY_QUANTITY,
--SERIAL_TRANSACTION_TEMP_ID,
PRODUCT_CODE,
PRODUCT_TRANSACTION_ID)
VALUES
(v_interface_id, --TRANSACTION_INTERFACE_ID
3, --ORIGINATION_TYPE
SYSDATE, --LAST_UPDATE_DATE
v_user_id, --LAST_UPDATED_BY
SYSDATE, --CREATION_DATE
v_user_id, --CREATED_BY
v_user_id, --LAST_UPDATE_LOGIN
'Un-invoiced-CON', --LOT_NUMBER
v_trans_qty, --TRANSACTION_QUANTITY
v_trans_qty, --PRIMARY_QUANTITY
--0,--MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL, --SERIAL_TRANSACTION_TEMP_ID
'RCV', --PRODUCT_CODE
v_interface_transaction_id --PRODUCT_TRANSACTION_ID
);
End if;
End if;
End loop;
l_request_id := fnd_request.submit_request('PO', --APPLICATIONI SHORT NAME;
'RVCTP', --PROGRAME SHORT NAME;
'',
'',
FALSE,
'IMMEDIATE',
v_group_id
--104--104,
--CHR(0)
);
l_request_id2 := fnd_request.submit_request('PO', --APPLICATIONI SHORT NAME;
'RCVDLPDT', --PROGRAME SHORT NAME;
'',
'',
FALSE,
'P_group_id=' || v_group_id,
'P_receipt_source_type=Supplier',
'P_qty_precision=2',
'P_org_id=' || p_organization_id);
FND_FILE.put_line(2,
'Receiving Transaction Processor: ' || l_request_id ||
' Receipt Traveller Concurrent program: ' ||
l_request_id2);