Sunday, November 23, 2014

Using Service Contracts Test Import Program

After the Service Contract Import functionality has been introduced, its been a rough ride to understand the interface table and identify bare minimum fields that are required to populate to import a contract successfully. To overcome that, the developer’s of Service Contract Import program built a Service Contract Import Test Program that uses a sample contract and populates required columns in interface tables that can create a replica of the original contract. This program is just a testing tool to understand the import functionality behavior.
To get more details about Service Contract Import Program you can visit following posts :-
There are SIX interface tables created for this interface :-
OKS_HEADERS_INTERFACE
OKS_LINES_INTERFACE
OKS_COVERED_LEVELS_INTERFACE
OKS_USAGE_COUNTERS_INTERFACE
OKS_SALES_CREDITS_INTERFACE
OKS_NOTES_INTERFACE
Now let’s understand how to use Service Contract Import Test Program. This program is defined but its not enabled. Before using it we have to first enable it.
1) Navigate to Concurrent -> Program –> Define
a) Search for 'Service Contracts Import Test Program' and then enable the concurrent program. 
b) Add the program to the list of available reports for the desired responsibility.
2) Identify a sample contract that will be used to populate date into interface tables.  Following fields are required in original contract in addition to the normal requirements, so that it populates all the required field. 
a) Bill To and Ship To accounts / addresses at contract and line levels.
b) At least one Customer contact role and contact
c) Vendor contact with role = Salesperson
d) A 'Billing Contact' and 'Shipping Contact' for each contract line
3) Submit the Service Contracts Test Import Program with following parameters :-
a) Model Contract = Source Contract Number
b) Model Contract Modifier = Source Contract Number modifier
c) Target Contract = Desired Contract Number for the new contract
d) Number of Copies = number of copies for this contract
4) The program will load the data for the selected contract into the interface tables. Run this update scripts after this process is done:
Note:  Keep in mind that this is a skeleton program, one that does basic data loading.  Users have to manipulate the data to fit specific requirements.
a)   
UPDATE oks_headers_interface
   SET po_required = NULL,
       estimation_date = NULL,
       payment_instruction_details = NULL, –- If old contract has pay details of Credit Card
       payment_method_code = NULL, –- If old contract has pay details of Credit Card
       fully_billed = 'Y', –- If you don’t wanna bill the new contract
       bill_services  = 'N'; –- If you don’t wanna bill the new contract
       currency_conversion_type = NULL
WHERE batch_id = &batch_id;

b)   
UPDATE oks_lines_interface
   SET first_bill_upto_date = NULL,
       first_billed_amount = NULL,
       last_billed_amount = NULL,
       po_required = NULL
WHERE header_interface_id = &header_interface_id;

c) For usage items:
UPDATE oks_usage_counters_interface
   SET print_invoice = 'N';
d) For contracts with covered products, set the price_uom code.
UPDATE oks_covered_levels_interface
   SET price_uom = 'MTH';

e) Set the fields for the billing schedule. Enter these values to create a schedule consisting of 24 periods of 1 month (in the appropriate entries in OKS_LINES_INTERFACE):
billing_interval_duration = 1
billing_interval_period = MO/MTH(use appropriate uom_code from okc_time_code_units_v)
recur_bill_occurances = 24

UPDATE oks_lines_interface
   SET billing_interval_duration = 1,
       billing_interval_period = 'MTH',-- use appropriate uom_code from okc_time_code_units_v
       recur_bill_occurances = 24
WHERE header_interface_id = &header_interface_id;

Note :- I have seen that when using MTH, line/sublines records was not getting create… After using ‘MO’ it worked great. I have not validate what was the issue with ‘MTH’.
5) Run this script if there is a need to reprocess a contract that failed:
UPDATE oks_headers_interface
   SET interface_status = 'R'
WHERE contract_number = '&contract_number';

6) Identify the batch_id that is assigned to the desired contract in OKS_HEADERS_INTERFACE.
7) Submit the 'Service Contracts Import' program with these parameters:
Mode = Import
Batch Number = batch id

1 comment :

SeachBox