API : Contracts Migration API

Contract migration does not happen as the same traditional way of copying data from legacy systems to Interface tables and from interface tables to base tables because oracle does not provide any interface tables for Contracts, but of course provided some other methodology of importing data through the API.

Contracts constitutes the following data,

Contracts headers

OKE_IMPORT_CONTRACT_PUB.create_contract_header
Contract Party
OKC_CONTRACT_PARTY_PUB.create_k_party_role

Contract Contact
OKC_CONTRACT_PARTY_PUB.create_contact
Contract Terms
OKE_TERMS_PUB.create_term

Contracts Lines

OKE_IMPORT_CONTRACT_PUB.create_contract_line

Contract Deliverables
OKE_IMPORT_CONTRACT_PUB.create_deliverable

Contract Billing events
OKE_DELIVERABLE_BILLING_PVT.create_billing_event

Contract Funding and Fund Allocations
OKE_FUNDING_PUB.create_funding and OKE_ALLOCATION_PVT.add_allocation

1 comments:

  1. /* OKE_IMPORT_CONTRACT_PUB.create_deliverable Sample Example */
    DECLARE
    l_api_version NUMBER := 1;
    l_init_msg_list VARCHAR2 (1000) DEFAULT OKE_API.G_FALSE;
    l_return_status VARCHAR2 (1000);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2 (1000);
    l_del_rec APPS.OKE_IMPORT_CONTRACT_PUB.del_rec_type;
    x_del_rec APPS.OKE_CONTRACT_PUB.del_rec_type;
    x_line_id number;
    l_msg_index_out NUMBER;

    l_data VARCHAR2 (2000);
    x_n number;
    BEGIN


    fnd_global.APPS_INITIALIZE(user_id=>1157,
    resp_id=>50104,
    resp_appl_id=>777);

    l_del_rec.DELIVERABLE_ID := 12300156;
    l_del_rec.DELIVERABLE_NUM := '12345';
    l_del_rec.PROJECT_ID := 8001;
    l_del_rec.TASK_ID := 8001;
    -- l_del_rec.ITEM_ID := null;
    l_del_rec.K_HEADER_ID := '39019';--x_n;
    l_del_rec.K_LINE_ID :=193743154526746735496177874006189187638;--x_line_id;
    l_del_rec.DELIVERY_DATE := null;
    l_del_rec.STATUS_CODE := 'ENTERED';
    l_del_rec.CREATION_DATE :=sysdate;
    l_del_rec.CREATED_BY := fnd_global.user_id;
    l_del_rec.LAST_UPDATE_DATE :=sysdate;
    l_del_rec.LAST_UPDATED_BY := fnd_global.user_id;
    l_del_rec.start_date := sysdate+1;
    l_del_rec.LAST_UPDATE_LOGIN := fnd_global.user_id;
    l_del_rec.UNIT_NUMBER := null;
    l_del_rec.DIRECTION := 'IN';
    l_del_rec.QUANTITY := 10;
    l_del_rec.UNIT_PRICE :=10;
    l_del_rec.UOM_CODE :='EA';
    l_del_rec.CURRENCY_CODE := 'INR';
    l_del_rec.BILLABLE_FLAG := 'Y';
    l_del_rec.SHIP_TO_ORG_ID :=101;
    l_del_rec.SHIP_TO_LOCATION_ID :=142;
    l_del_rec.SHIP_FROM_ORG_ID := null;
    l_del_rec.SHIP_FROM_LOCATION_ID := null;
    l_del_rec.INVENTORY_ORG_ID := 101;
    l_del_rec.DESTINATION_TYPE_CODE := null;
    l_del_rec.PROMISED_SHIPMENT_DATE := null;
    -- l_del_rec.READY_TO_PROCURE :='N';

    OKE_IMPORT_CONTRACT_PUB.create_deliverable(
    p_api_version =>l_api_version,
    p_init_msg_list =>l_init_msg_list,
    x_return_status =>l_return_status,
    x_msg_count =>l_msg_count,
    x_msg_data =>l_msg_data,
    p_del_rec =>l_del_rec,
    x_del_rec =>x_del_rec);


    FOR i IN 1 .. l_msg_count
    LOOP
    pa_interface_utils_pub.get_messages (
    p_encoded => 'F',
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_data => l_data,
    p_msg_index_out => l_msg_index_out);

    DBMS_OUTPUT.put_line (l_msg_data);

    DBMS_OUTPUT.put_line (l_data);
    END LOOP;
    COMMIT;

    DBMS_OUTPUT.PUT_LINE('Status:'||l_return_status);
    DBMS_OUTPUT.PUT_LINE('Message:'||l_msg_data);


    END;

    --select * from oke_k_deliverables_b where k_header_id =39019-- 23002--39019

    ReplyDelete