1 Reply Latest reply: Nov 26, 2013 9:35 PM by user3880687 RSS

    SR created using cs_servicerequest_pub.Create_ServiceRequest is not able to search it in Contact Center.

    Hawkeye 11

      Hi All ,

         I have created a SR using following sql api

      declare

      lx_msg_count NUMBER;

      lx_msg_data VARCHAR2(2000);

      lx_request_id NUMBER;

      lx_request_number VARCHAR2(50);

      lx_interaction_id NUMBER;

      lx_workflow_process_id NUMBER;

      lx_msg_index_out NUMBER;

      lx_return_status VARCHAR2(1);

      l_service_request_rec CS_ServiceRequest_PUB.service_request_rec_type;

      l_notes_table CS_SERVICEREQUEST_PUB.notes_table;

      l_contacts_tab CS_SERVICEREQUEST_PUB.contacts_table;

       

       

      begin

       

       

      -- Populate the SR Record type

       

       

      l_service_request_rec.request_date := to_date('19-NOV-2013 16:27:34', 'dd-MON-YYYY

      HH24:MI:SS');

      l_service_request_rec.type_id := 4;

      l_service_request_rec.status_id := 1;

      l_service_request_rec.urgency_id := 44;

      l_service_request_rec.inventory_item_id := 2530;

      l_service_request_rec.inventory_org_id := 204;

      l_service_request_rec.severity_id := 6;

      l_service_request_rec.summary := 'TEST IBIZ';

      l_service_request_rec.caller_type := 'ORGANIZATION';

      l_service_request_rec.customer_id := 3532;

      l_service_request_rec.verify_cp_flag := 'N';

      l_service_request_rec.sr_creation_channel := 'PHONE';

      l_service_request_rec.resource_type := null;

      l_service_request_rec.group_type := null;

      l_service_request_rec.owner_id := null;

      l_service_request_rec.owner_group_id := null;

      l_service_request_rec.bill_to_site_use_id := 1583;

      l_service_request_rec.ship_to_site_use_id := 2359;

      l_service_request_rec.exp_resolution_date := to_date('19-DEC-2013 16:27:34', 'dd-MON-YYYY

      HH24:MI:SS');

      l_service_request_rec.install_site_use_id := 178401;

      l_service_request_rec.account_id := 3670;

      l_service_request_rec.obligation_date := to_date('22-NOV-2013 16:27:34', 'dd-MON-YYYY

      HH24:MI:SS');

      l_service_request_rec.category_id := 1376;

      l_service_request_rec.last_update_channel := 'PHONE';

      l_service_request_rec.category_set_id := 27;

      l_service_request_rec.incident_occurred_date :=to_date('19-NOV-2013 16:27:34', 'dd-MON-YYYY

      HH24:MI:SS');

      l_service_request_rec.incident_location_id :=178401;

      l_service_request_rec.incident_country :='US';

      l_service_request_rec.last_update_program_code :='CSXSRTAB';

      l_service_request_rec.creation_program_code :='CSXSRTAB';

      l_service_request_rec.bill_to_account_id :=3670;

      l_service_request_rec.ship_to_account_id :=3670;

      l_service_request_rec.bill_to_party_id :=3532;

      l_service_request_rec.ship_to_party_id :=3532;

      l_service_request_rec.bill_to_site_id :=2915;

      l_service_request_rec.ship_to_site_id :=2915;

      l_service_request_rec.incident_location_type :='HZ_PARTY_SITE';

       

       

      dbms_output.put_line('before calling public sr');

       

       

      FND_GLOBAL.APPS_INITIALIZE(

      user_id => 0,

      resp_id => 21739,

      resp_appl_id => 514);

       

       

      cs_servicerequest_pub.Create_ServiceRequest (

      p_api_version => 2.0,

      p_init_msg_list => FND_API.G_TRUE,

      p_commit => FND_API.G_FALSE,

      x_return_status => lx_return_status,

      x_msg_count => lx_msg_count,

      x_msg_data => lx_msg_data,

      p_resp_appl_id => 514,

      p_resp_id => 21739,

      p_user_id => 0,

      p_login_id => NULL,

      p_request_id => NULL,

      p_request_number => NULL,

      p_service_request_rec => l_service_request_rec,

      p_notes => l_notes_table,

      p_contacts => l_contacts_tab,

      x_request_id => lx_request_id,

      x_request_number => lx_request_number,

      x_interaction_id => lx_interaction_id,

      x_workflow_process_id => lx_workflow_process_id );

       

       

      dbms_output.put_line('Return Status : ' || lx_return_status);

      dbms_output.put_line('Inserted request id: ' || lx_request_id );

      dbms_output.put_line('Inserted request num : ' || lx_request_number );

      dbms_output.put_line('Interaction ID : ' || lx_interaction_id );

       

       

      IF (lx_return_status <> FND_API.G_RET_STS_SUCCESS) then

      IF (FND_MSG_PUB.Count_Msg > 1) THEN

      --Display all the error messages

      FOR j in 1..FND_MSG_PUB.Count_Msg LOOP

      FND_MSG_PUB.Get(

      p_msg_index => j,

      p_encoded => 'F',

      p_data => lx_msg_data,

      p_msg_index_out => lx_msg_index_out);

       

       

      DBMS_OUTPUT.PUT_LINE(lx_msg_data);

      END LOOP;

      ELSE

      --Only one error

      FND_MSG_PUB.Get(

      p_msg_index => 1,

      p_encoded => 'F',

      p_data => lx_msg_data,

      p_msg_index_out => lx_msg_index_out);

      DBMS_OUTPUT.PUT_LINE(lx_msg_data);

      DBMS_OUTPUT.PUT_LINE(lx_msg_index_out);

      END IF;

      END IF;

       

       

      exception

      when others then dbms_output.put_line('in others main ' || sqlerrm);

      commit;

      end;

      /

       

      I am able to create SR using above code but when i try to search using the SR number it say no LOV is found from Contact Center . Please

      help me out.

      Thanks

      Mark