8 Replies Latest reply: Jun 20, 2013 1:21 PM by ThAn RSS

    API's for Installbase and for Creating contract in Service contract Module

    Ragni Gupta_12-26-1990
      Hi Need one more help.

      We are doing a Conversion for Installbase where in we have to bring in the Installbase records from Legacy systems.

      I know the API to Insert records into Installbase which is

      CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE

      Is there any Installbase API which will create the Warranty contract for this Installbase records or do we have to explicitly call the create contract API's to create Contracts in Service Contract Module.

      Thanks and Regards,
      Ragni Gupta
        • 1. Re: API's for Installbase and for Creating contract in Service contract Module
          MAnasO
          Hi Ragni,

          You need to call Contract APIs to create contract.

          Regards,
          Mohammed
          • 2. Re: API's for Installbase and for Creating contract in Service contract Module
            shreevat
            When using the CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE api the following 2 steps are required for a warranty to be created

            1. The warranty needs to be included in the Bill of Material of the item that is being used to create an Item Instance in Install Base.
            2. Th profile option CSI: Contracts Enabled needs to be set to 'Yes' at the Site level.

            Thanks
            Shree
            • 3. Re: API's for Installbase and for Creating contract in Service contract Module
              Ragni Gupta_12-26-1990
              Thanks Shree,

              So if the Item has a Warranty component in the BOM and if we set this profile option will the API
              CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE creates contract in service contract?

              Thanks and Regards,
              Ragni Gupta
              • 4. Re: API's for Installbase and for Creating contract in Service contract Module
                Ragni Gupta_12-26-1990
                Hi Mohammad,

                I used CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE api first to insert the record into Installbase and then used below API's to create the contract.

                oks_contracts_pub.Create_Contract_Header
                oks_contracts_pub.Create_Covered_Line
                okc_contract_pub.create_contract_line

                but i am not able to link the subline with the installbase record. Serial number is not populating in the contract and in all these api's there is no option to pass serial number for the contract.

                Thanks and regards,
                Ragni Gupta
                • 5. Re: API's for Installbase and for Creating contract in Service contract Module
                  shreevat
                  Yes, if the conditions I mentioned are met then this API would create warranty contract.

                  Thanks
                  Shree
                  • 6. Re: API's for Installbase and for Creating contract in Service contract Module
                    Ragni Gupta_12-26-1990
                    I tried a lot with this APi (CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE)but its not creating the contract.
                    Only for the update API( CSI_ITEM_INSTANCE_PUB.update_ITEM_INSTANCE) there is call to Expire the contracts if the IB records are Expired
                    • 7. Re: API's for Installbase and for Creating contract in Service contract Module
                      Ragni Gupta_12-26-1990
                      Declare

                      l_instance_rec csi_datastructures_pub.instance_rec;
                      l_ext_attrib_values_tbl csi_datastructures_pub.extend_attrib_values_tbl;
                      l_party_tbl csi_datastructures_pub.party_tbl;
                      l_party_account_tbl csi_datastructures_pub.party_account_tbl;
                      l_pricing_attribs_tbl csi_datastructures_pub.pricing_attribs_tbl;
                      l_org_assignments_tbl csi_datastructures_pub.organization_units_tbl;
                      l_asset_assignment_tbl csi_datastructures_pub.instance_asset_tbl;
                      l_txn_rec csi_datastructures_pub.transaction_rec;
                      x_instance_id_lst csi_datastructures_pub.id_tbl;

                      lr_party_rec csi_datastructures_pub.party_rec;
                      lr_party_account_rec csi_datastructures_pub.party_account_rec;
                      lr_ext_attrib_value_rec csi_datastructures_pub.extend_attrib_values_rec;

                      l_return_status VARCHAR2(1);
                      l_msg_count NUMBER;
                      l_msg_data VARCHAR2(2000);
                      l_msg_index_out VARCHAR2(100);
                      l_api_version CONSTANT NUMBER := 1.0;

                      l_error_stage VARCHAR2(240);
                      l_start_date DATE;
                      l_start_time DATE;

                      Begin

                      dbms_output.enable('1000000');

                      l_instance_rec.instance_id := NULL;
                      l_instance_rec.instance_number := NULL;
                      l_instance_rec.external_reference := '';
                      l_instance_rec.serial_number := '';
                      l_instance_rec.inventory_item_id := 1106019;
                      l_instance_rec.inv_master_organization_id := 103;
                      l_instance_rec.vld_organization_id := 104;
                      --l_instance_rec.instance_status_id         := 1011;
                      l_instance_rec.object_version_number := 1.0;
                      -- l_instance_rec.location_type_code := 'HZ_PARTY_SITES';
                      l_instance_rec.quantity := 1;
                      l_instance_rec.unit_of_measure := 'EA';
                      l_instance_rec.mfg_serial_number_flag := 'N';
                      l_instance_rec.version_label := 'AS_CREATED';
                      -- l_instance_rec.location_id := l_location_id;
                      l_instance_rec.active_start_date := sysdate;
                      l_instance_rec.install_date := sysdate;
                      --l_instance_rec.rec.active_end_date := l_hdr_rec.ib_end_date;

                      lr_party_rec.party_source_table := 'HZ_PARTIES';
                      lr_party_rec.instance_id := NULL;
                      lr_party_rec.relationship_type_code := 'OWNER';
                      lr_party_rec.party_id := 21604;
                      lr_party_rec.contact_flag := 'N';
                      l_party_tbl(1) := lr_party_rec;

                      --lr_party_account_rec.relationship_type_code := 'OWNER';
                      --lr_party_account_rec.parent_tbl_index := 1;
                      --lr_party_account_rec.party_account_id := 1357;
                      --lr_party_account_rec.bill_to_address := '';
                      --lr_party_account_rec.ship_to_address := '';
                      l_party_account_tbl(1) := lr_party_account_rec;

                      lr_ext_attrib_value_rec.attribute_value_id := NULL;

                      l_txn_rec.transaction_date := sysdate;
                      l_txn_rec.source_transaction_date := sysdate;
                      l_txn_rec.transaction_type_id := 1;

                      l_error_stage := 'Call API CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE';

                      l_msg_data := NULL;
                      l_msg_index_out := NULL;
                      l_msg_count := NULL;

                      CSI_ITEM_INSTANCE_PUB.CREATE_ITEM_INSTANCE
                      (
                      p_api_version => l_api_version
                      ,p_commit => FND_API.G_FALSE
                      ,p_init_msg_list => FND_API.G_FALSE
                      ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
                      ,p_instance_rec => l_instance_rec
                      ,p_ext_attrib_values_tbl => l_ext_attrib_values_tbl
                      ,p_party_tbl => l_party_tbl
                      ,p_account_tbl => l_party_account_tbl
                      ,p_pricing_attrib_tbl => l_pricing_attribs_tbl
                      ,p_org_assignments_tbl => l_org_assignments_tbl
                      ,p_asset_assignment_tbl => l_asset_assignment_tbl
                      ,p_txn_rec => l_txn_rec
                      ,x_return_status => l_return_status
                      ,x_msg_count => l_msg_count
                      ,x_msg_data => l_msg_data
                      );

                      IF(l_return_status IN ('E', 'U'))
                      THEN
                      FOR i IN 1..fnd_msg_pub.count_msg
                      LOOP
                      fnd_msg_pub.get( p_msg_index => i
                      ,p_encoded => 'F'
                      ,p_data => l_msg_data
                      ,p_msg_index_out => l_msg_index_out
                      );
                      dbms_output.put_line('l_return_status: ' || l_return_status);
                      dbms_output.put_line('l_msg_data: ' || SUBSTR(l_msg_data, 1, 250));
                      END LOOP;

                      ELSE

                      dbms_output.put_line('------------------------------------------');
                      dbms_output.put_line('l_return_status: ' || l_return_status);
                      dbms_output.put_line('l_msg_data: ' || SUBSTR(l_msg_data, 1, 250));
                      dbms_output.put_line('The instance ID: ' || to_char(l_instance_rec.INSTANCE_ID));
                      dbms_output.put_line('The instance Number: ' || to_char(l_instance_rec.INSTANCE_NUMBER));
                      dbms_output.put_line('------------------------------------------');

                      COMMIT;

                      END IF;

                      End;
                      /

                      Edited by: Ragni Gupta_12-26-1990 on May 31, 2013 7:57 AM
                      • 8. Re: API's for Installbase and for Creating contract in Service contract Module
                        ThAn

                        Hi,

                         

                        when creating contract service lines you must follow a certain order if you want to attach an iBase item.

                        See answer in following post which describes a similar requirement:

                        http://oracle.ittoolbox.com/groups/technical-functional/oracle-crm-l/trying-to-create-covered-lines-using-oks-api-160393…

                         

                        Regards