8 Replies Latest reply on Jun 19, 2015 5:37 AM by Sanjay Desai EBS

    Cancel PO Line - API Error

    nanduh

      Team,

       

      We are trying to cancel PO line through API "PO_DOCUMENT_CONTROL_PVT.control_document" but we are getting an ERROR 'Document control failed due to error in [DOCMGR-CANCEL] with a return code of [OTHER].'. When we try to cancel it from front end, it is working fine. But we want to cancel it from API. For the same PO, we tried in lower instance, it is working fine.

       

      but in PROD we are getting the above mentioned error. Could you please help me on this.

        • 1. Re: Cancel PO Line - API Error
          Jagadekara

          Hi,

           

          Provide the code.

          • 2. Re: Cancel PO Line - API Error
            nanduh

            Hello Jaga,

            Below is our code..

             

            DECLARE

               v_api_errors         po_api_errors_rec_type;

               v_last_po_line       VARCHAR2 (2);

               v_max_line           NUMBER;

               v_qty_change_count   NUMBER;

               v_return_status      VARCHAR2 (2);

               v_revision_number    NUMBER;

               v_verify_qty         NUMBER;

               v_qty_update_flag    VARCHAR2 (3);

               v_count              NUMBER;

               v_vendor_num         ap_suppliers.segment1%TYPE;

               v_default_printer    fnd_lookup_values.description%TYPE;

               v_print_option_set   BOOLEAN;

            BEGIN

               fnd_global.apps_initialize (user_id           => 1215,

                                           resp_id           => 50757,

                                           resp_appl_id      => 201

                                          );

               fnd_client_info.set_org_context (92);

               mo_global.set_policy_context ('S', 92);

               apps.po_document_control_pvt.control_document

                                                       (1.0,              -- p_api_version

                                                        fnd_api.g_true, -- p_init_msg_list

                                                        fnd_api.g_true,        -- p_commit

                                                        v_return_status,

                                                                        -- x_return_status

                                                        'PO',                -- p_doc_type

                                                        'STANDARD',       -- p_doc_subtype

                                                        1507816,               -- p_doc_id

                                                        2128492,          -- p_doc_line_id

                                                        1964746,      -- p_doc_line_loc_id

                                                        NULL,                  -- p_source

                                                        'CANCEL',              -- p_action

                                                        SYSDATE,          -- p_action_date

                                                        'CANCEL VIA EDI 855',

                                                       

                                                        -- p_cancel_reason

                                                        'N',         -- p_cancel_reqs_flag

                                                        NULL,              -- p_print_flag

                                                        NULL,          -- p_note_to_vendor

                                                        NULL,              -- p_use_gldate

                                                        'Y'

                                                       );       -- p_launch_approvals_flag

             

             

               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'

                                                        )

                                       );

                  DBMS_OUTPUT.put_line ('TEST ' || v_return_status);

               END LOOP;

            END;

            /

            • 3. Re: Cancel PO Line - API Error
              Jagadekara

              Hi,

               

              Can you post the exact error?

               

              Also check the status of that PO in back end tables.

              • 4. Re: Cancel PO Line - API Error
                nanduh

                Hello Jagadekara,

                 

                API returns Error Status : E and error_message : Document control failed due to error in [DOCMGR-CANCEL] with a return code of [OTHER].

                • 5. Re: Cancel PO Line - API Error
                  Jagadekara

                  Which version u r using?

                  • 6. Re: Cancel PO Line - API Error
                    nanduh

                    APPS version is 12.1.2

                     

                    API version is 1.0

                    • 7. Re: Cancel PO Line - API Error
                      Jagadekara

                      Hmm,

                       

                      when I try to run same script in 12.1.3, it shows wrong number of arguements.

                       

                      So may be wee need to pass p_online_report_id

                      • 8. Re: Cancel PO Line - API Error
                        Sanjay Desai EBS

                        Pl. review following MOS Doc.

                         

                        How To Use the Cancel PO API (Doc ID 1077153.1)