2 Replies Latest reply on Aug 15, 2007 12:51 PM by 465762

    Document control failed due to error in [DOCMGR-CANCEL], return code = [OTH

    558662
      Hi,

      When i tried using the cancel PO API, it resulted in the following error.

      Document control failed due to error in [DOCMGR-CANCEL], return code = [OTHER]

      I searched the metalink and found out that it was a bug as p_doc_num variable was a number and in PO_HEADERS_ALL segment1 is VARCHAR2. But now the bug is fixed.

      I tried both ways, with and without quotes but it is still giving this error. Please suggest.

      I used the API in the following way.

      DECLARE
      l_return_status VARCHAR2(1);
      BEGIN
      fnd_global.apps_initialize(4480,20707,201);
      --call the Cancel API
      PO_Document_Control_PUB.control_document (
      p_api_version=>1.0, -- p_api_version
      p_init_msg_list=>FND_API.G_TRUE, -- p_init_msg_list
      p_commit=>FND_API.G_TRUE, -- p_commit
      x_return_status=>l_return_status,-- x_return_status
      p_doc_type=>'PO', -- p_doc_type
      p_doc_subtype=>'STANDARD', -- p_doc_subtype
      p_doc_id=>34, -- p_doc_id
      p_doc_num=>null, -- p_doc_num
      p_release_id=>null, -- p_release_id
      p_release_num=>null, -- p_release_num
      p_doc_line_id=>null, -- p_doc_line_id
      p_doc_line_num=>null, -- p_doc_line_num
      p_doc_line_loc_id=>null, -- p_doc_line_loc_id
      p_doc_shipment_num=>null, -- p_doc_shipment_num
      p_action=>'CANCEL', -- p_action
      p_action_date=>SYSDATE, -- p_action_date
      p_cancel_reason=>null, -- p_cancel_reason
      p_cancel_reqs_flag=>'N', -- p_cancel_reqs_flag
      p_print_flag=>null, -- p_print_flag
      p_note_to_vendor=>null ); -- p_note_to_vendor
      commit;
      -- Get any messages returned by the Cancel API
      FOR i IN 1..FND_MSG_PUB.count_msg
      LOOP
      DBMS_OUTPUT.put_line(FND_MSG_PUB.Get(p_msg_index => i,
      p_encoded => 'F'));
      END LOOP;
      END;
      /