Cancel PO Programatically

Hello All,
I need to cancel a Purchase Order Programatically. Can this be done?
Thanks for any help,
Bradley

It should be taken from po_document_types_all. You can find document_type and sub_type there.
Have you changed the fnd_global.apps_initialize parameters right? Like user_id and responsibility_id and appl_id? Not sure your site setup for the security. If you navigate to setup-->Purchasing-->Document Types and select Purchase Order Standard, you can see Control options there.
To avoid doubt, select user_id of the buyer and initialize apps.
select b.user_id into l_user_Id from po_agents a, fnd_user b, po_headers_all c
where a.agent_id=b.employee_id
and a.agent_id=c.agent_id
and c.segment1='5396';
select wf_item_type,wf_item_key from po_agents a, fnd_user b, po_headers_all c
where a.agent_id=b.employee_id
and a.agent_id=c.agent_id
and c.segment1='5396';
select number_value
into l_responsibility_id
from wf_item_attribute_values
where item_type='POAPPRV' --wf_item_type from above
and item_key='81411-392214' --wf_item_key from above
and name in ('RESPONSIBILITY_ID');
select number_value
into l_application_id
from wf_item_attribute_values
where item_type='POAPPRV'
and item_key='81411-392214'
and name in ('APPLICATION_ID');
fnd_global.apps_initialize(l_user_id,l_responsibility_id,l_application_id);
then call po_document_control_pub.
You can enable FND Debug Profiles and check fnd_log_messages.
Also call this procedure to get any session specifif messages;
PROCEDURE get_error_stack (x_msg_data OUT VARCHAR2)
IS
l_msg_index NUMBER;
l_msg_data VARCHAR2 (32000);
BEGIN
l_msg_index := 1;
x_msg_data := '';
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);
x_msg_data := x_msg_data || l_msg_data;
DBMS_OUTPUT.put_line (x_msg_data);
END LOOP;
END get_error_stack;
THanks
Nagamohan

Similar Messages

  • Programatically cancel concurrent request

    Hi,
    How to cancel concurrent request from plsql ?
    Thanks a lot.

    Thanx,
    but it seems that it does not work in a trigger on fnd_concurrent_requests table.
    like this one:
    CREATE OR REPLACE TRIGGER aaaa
    after insert on apps.fnd_concurrent_requests
    for each row
    DECLARE
    pragma autonomous_transaction;
    req_id number;
    BEGIN
    if :NEW.concurrent_program_id = 11111
    THEN
    req_id := :NEW.request_id;
    update fnd_concurrent_requests
    set status_code = 'D', phase_code='C'
    where request_id = req_id;
    commit;
    ELSE null;
    END IF;
    END;
    trigger fires but update does not work when i exec the concurrent. Why ??
    if i manually execute this update it works.

  • How can I change the state of a runtime menu item programati​cally?

    Using LabView 6.1, I would like to change the state of the runtime menu item "Operate/Print at completion".
    The goal here is to print the VI front panel according to the operator choice (OK ->print, Cancel ->don't print)
    In a first release, I put a Stop function at the dialog output (activated by the cancel button) but this function stop the complete application and my idea where to stop only the VI in which the dialog is running.
    In a second release, I've tried to use the "Application
    control/Menu" but I receive every time an error:
    Error 88 occured at Cannot modify application menu item in the printtest.vi.
    Possible reasons: LabView, Runtime menu error...
    Any suggestion is appreciated.
    Re
    gards,
    phidu

    Instead of using the print at completion option, print the VI programatically if the user selects to print...open a reference to the VI you want to print and use an invoke node to print vi to printer.
    Alternatively create another VI with a layout optimized for printout, set it to print at completion and run and load the data into that VI if and only if the user OKs the print...
    Mads
    MTO

  • How to cancel multiple lines for an Purchase Order

    Hello everyone,
    Does anyone know a way to cancel multiple purchase order lines, without having to do it manually?
    Is there a way to do it automatically?
    Thanks and regards,
    Ankit

    Hi,
    Not sure if it's possible through PO screen. You may cancel PO lines programatically using po_document_control_pub.control_document with p_action = 'CANCEL'. You could use it inside a loop to cancel multiple lines.
    Hope it helps.

  • How to cancel Auto Renewable purchase programmatically.

    I have a scenario where user can subscribe to auto renewable in-app purchase. Once he/she has puchased, we have an option "cancel subscription". Means I have to cancel auto renewablt in-app purchase programatically.
    Please let me know
    Is it possible or not ?
    If yes, please let me know the process.

    Yes it is possible and you can refer to the link below for the steps:
    http://support.apple.com/kb/HT4098

  • How to Cancel Long Running Report

    Hello
    I'm looking for a way to cancel the printing of a long running report programatically? I'm using the CrystalDecisions.CrystalReports.Engine.ReportDocument() class.
    Thanks for your help

    Hi Syed,
    The old viewer was COM based and the new viewer is .NET. CR has the ability if the DB server supports Async communication. Most DB's don't so it wasn't of much use. For those that did the functionality was through custom coding within the Designer only. Async would allow CR to send a stop processing command to the DB server. If the server did not have the ability then CR can only wait for the data to start coming back before stopping the viewer from updating.
    In any event I don't believe the Windows Viewer in .NET has the ability but I will suggest it to the Product group to add the ability in some future version.
    Thank you
    Don

  • Training Attendance cancellation

    Can someone tell me which infotype stores the flag for Training attendance cancellation of an employee?

    Hi,
    Training related information is not stored in Personnel Administration infotypes but in Organizational Management infotypes instead.
    To get the cancellation details of an attendee for a particular event:
    PP01 : Object type E Object ID event ID.
    Check relationships :
    Relationship B040.
    Programatically you can reach the info as follows:
    HRP1001 where OTYPE = P OBJID = Personnel Number
    RSIGN = B
    RELAT = 040
    SCLAS = E
    SOBID = Business event.
    Get ADATANR field.
    Go to table HRPAD25.
    Paste ADATNR Field value.
    Here CAATR field has the cancellation reason value.
    Regards,
    Dilek

  • Cancel a Event and it's further execution from a Subroutine called from that event.

    First I will explain my requirement:
    Consider the following snippet.
    Private Sub SomeEvent(Byval sender as Object) Handles SomeControl.SomeEvent
    --Do Something_1
    --Do Something_2
    --Do Something_3
    call A()
    --Do Something_4
    --Do Something_5
    --Do Something_6
    End Sub
    Private Sub Procedure_A ()
    --Do Something_1
    --Do Something_2
    --Do Something_3
    call B()
    --Do Something_4
    --Do Something_5
    --Do Something_6
    End Sub
    Private Sub Procedure_B ()
    --Do Something_1
    --Do Something_2
    --Do Something_3
    'Exception Ocurs...Here
    --Do Something_4
    --Do Something_5
    --Do Something_6
    End Sub
    In the above exception, if the exception occurs at the said location in Procedure_B then, 
    1. Remaining Statements in Procedure_B should not execute.
    2. Remaining Statements in Procedure_A should not execute.
    3. Remaining Statements in SomeEvent should not execute.
    Please not that:
    I know this can be handled by using Try..Catch in every Subroutine and Raise an exception from there. But it cannot be implemented due to some reason.
    The solution I am looking for is
    1. To somehow cancel the ProcessThread the SomeEvent has started.
    Or
    2. If I could programatically Set Next Statement

    I think that you only need Try-Catch in
    SomeEvent, not in every procedure:
        --Do Something_1
        --Do Something_2
        --Do Something_3
        Try
            Call A()
            --Do Something_4
            --Do Something_5
            --Do Something_6
        Catch
        End Try
    It is also possible to distinguish specific exceptions.
    It is not clear why you cannot use Try-Catch. Then use
    On Error instead:
        --Do Something_1
        --Do Something_2
        --Do Something_3
        On Error GoTo Error1
        Call A()
         --Do Something_4
         --Do Something_5
         --Do Something_6
        Return
    Error1:

  • Cancel a running job

    Hi,
            How to cancel a running job programatically. Any function modules available for this. I don't want to delete the job, but have to cancel it.
    Thanks in advance,
    Vishnu Priya

    Hi,
    You can use SM37 and SM50 for this purpose
    SM50 - Select corresponding your PID - Process Menu -Cancel without core
    Regards,
    Satyendra

  • Cancel / Kill Concurrent Program

    Hi
    Wanted to know if there is any ORACLE API to cancel the concurrent program, programaticly...
    Scenario
    I have a parent concurrent program which is of a package, in side the package i have a for loop which calls another concurrent program(child concurrent program) using fnd_request.submit_request.
    i cancelled the parent concurrent program, but the child concurrent program which is called inside the package is submitted depending upon the loop data.
    can i know how to cancel the child program programaticly..
    Regards
    Yram

    Hi,
    Please refer to these documents.
    Note: 280295.1 - REQUESTS.sql Script for Parent/Child Request IDs and Trace File IDs
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=280295.1
    Note: 187504.1 - bde_request.sql - Process and Session info for one Concurrent Request (11.5)
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=187504.1
    Note: 735119.1 - How to Find Database Session & Process Associated with a Concurrent Program Which is Currently Running.
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=735119.1
    Regards,
    Hussein

  • Open and cancelled Quote Report

    Hi,
    Can anyone give me the information  for getting open and cancelled Quote Report?

    I hope you are using reason for rejection for cancelling quotations. If that is the case, you can use transaction VA25 to view the list of quotations. Here you can filter on two columns status and reason for rejection to view the report as per your requirement.
    Regards,
    GSL.

  • Timeouts and "cancelled" notifications...

    Greetings,
    We are using the standard (unmodified) version of the iExpense workflows (11.5.5 on Windows, WF 2.6.1), and have a curious and annoying problem...
    1. User submits expense report
    2. "Approval Request" notification times-out (after 5 days)
    3. "No Response" e-mail notification sent back to original user.
    4. "No Response" notification times-out (after 7 days)
    5. NEW "No Response" e-mail notification generated, and sent to original user.
    6. OLD "No Response" notification cancelled automatically.
    7. "CANCELLED: No Response" e-mail notification immediately sent to original user.
    8. Same pair of notifications generated one week later (new "No Response", plus "CANCELLED: No Response" notification referring the previous week's notification), and again a week after that, and so on...
    This is maddening to our users who miss the first message, because (after that first week), they are getting PAIRS of messages every week (only seconds apart) that seem to say to them...
    Message #1: Hey, there's a problem!!
    Message #2: Oh, never mind, no problem at all.
    Has anyone else encountered this problem? How did you handle it? Any ideas?
    Thanks a bunch!! -- Tom
    [email protected]

    Hm. I've confirmed 2396373 is the patch number. Here are the steps I used to locate the patch on MetaLink:
    1) Click the Patches button on the MetaLink navigation menu.
    2) In the Patch Download page, enter 2396373 in the Patch Number field.
    3) Click Submit. This should display the platforms where the patch is available.
    Could you try one more time with these steps and see if you can access it this way?
    Regards,
    Clara
    Thanks for the feedback.
    I searched MetaLink for both the specific patch number you gave, and also the phrase (description) you gave - with no results on either search. (???) Is this patch only visible by requesting it with a TAR, or by some other means?
    Please clarify, or double-check the patch number. Thanks a bunch!! -- Tom

  • Training and Event Management - report on list of cancelled courses

    Hi All,
    Is there any standard report available to get the list of cancelled courses (be it business event grp , type or business event) Would appreciate your inputs on this.
    Kind regards
    Sathya

    S_AHR_61016216 - Cancellations per Attendee , i think there is no standard report for cencelation of business events, type and group.
    for cancellations per attendee reports is available in the system.
    good luck
    Devi

  • Depot excise invoice is open and delivery is cancelled.

    Dear Friends,
    User has created depot excise invoice (commercial invoice not created), but later he has rversed the PGI and cancelled the delivery document.  So now how to cancel the depot excise invoice.  Because system is asking for the delivery doc. number but the delivery doc. number was cancelled.
    And also please tell me how to block if excise invoice is created system should not allow the user to reverse the PGI (only when the excise invoice is cancelled then only it should allow to cancel)
    Please tell me the process how to resolve it.
    Regards,
    Sreehari
    Message was edited by:
            Sreehari Kondapalli

    Hi,
    There is no standard procedure available to cancel this as you have already cancelled the Delivery, you will have to write a ABAP code to correct this entry in RG23D table.
    Regards,
    Murali

  • Cancelled Dunning Report

    Hi Friends,
    Is there any standard tcode to display all Cancelled dunnings.
    Something like to see the list of all cancelled dunnings between 01.08.2014 till 15.08.2014 and not w.r.t to Dunning Run.
    OR
    Someone needs to write an ABAP program by hitting tables FKKMAKO, FKKMAZE and so on..
    Thanks,
    Lakshmi.

    Hi Lakhsmi
    You can see all reversed Dunning in T.code FPM3 (Dunning History). you need to select Display Reversed Dunning Not.
    Regards
    Rehan

Maybe you are looking for

  • Print crystal report to a specific printer tray

    Greetings - I need to print out a report to a specific printer tray, can you please let me know how I set it up? Thanks, Lava

  • Balance Carryforward problem

    Dear Experts, Please help When there is no balance in fiscal year 2010 for a particular GL Account , but still there is a balance carryforward amount that appears in fiscal year 2011 in FS10N/FAGLB03 how can this be rectified Regards, Charmaine Marti

  • Runtime analysis(SE30) for a Background job

    Hi Experts, How to get runtime analysis for a Background job in SE30 transaction. Please advise. Thanks in advance, Vivenchandar R

  • Difficulties in installing Acrobat XI Pro

    Installing Acrobate XI looks impossible, I get alway error (previous instllation cannot be removed, error 1603) while CC and Photoshop is correctly installed, thus it cannot be only a windows problem. Is there any suggestion?

  • Css capability question

    We are an ASP providing a java application that has custom built in load balancing. We're starting to outgrow the model and I'm wondering if a CSS is a possible solution (I use one for a web application as well). The problem is this: if a server goes