Close open PO from the Backend.

Hi Guru's
                 How can we close the open PO from the backend with Zero dollar. As I understood PO_action.po_close would be the solution but can we close the Open PO without using API is there any script to close please share it I highly appreciate your help
Thanks & regards
AT

Following is a sample script to cancel the purchase order using Cancel PO API:
To cancel the whole PO, submit the cancel API using sqlplus as follows:
DECLARE
   l_return_status   VARCHAR2 (1);
BEGIN
   fnd_global.apps_initialize (1053, 50578, 201);
   -- mo_global.init('PO'); -- need for R12
   --call the Cancel API for PO
   PO_Document_Control_PUB.control_document (1.0,  -- p_api_version
                                             FND_API.G_TRUE, -- p_init_msg_list
                                             FND_API.G_TRUE,       -- p_commit
                                             l_return_status, -- x_return_status
                                             'PO',               -- p_doc_type
                                             'STANDARD',      -- p_doc_subtype
                                             NULL,                 -- p_doc_id
                                             '23975',             -- p_doc_num
                                             NULL,             -- p_release_id
                                             NULL,            -- p_release_num
                                             NULL,            -- p_doc_line_id
                                             NULL,           -- p_doc_line_num
                                             NULL,        -- p_doc_line_loc_id
                                             NULL,       -- p_doc_shipment_num
                                             'CANCEL',             -- p_action
                                             SYSDATE,         -- p_action_date
                                             NULL,          -- p_cancel_reason
                                             'N',        -- p_cancel_reqs_flag
                                             NULL,             -- p_print_flag
                                             NULL);        -- p_note_to_vendor
   -- 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;
The first run of the API will demonstrate cancelling shipment number 3 on line number 1 of the PO. Submit the cancel API using sqlplus as follows:
DECLARE
   l_return_status   VARCHAR2 (1);
BEGIN
   fnd_global.apps_initialize (1053, 50578, 201);
   -- mo_global.init('PO'); -- need for R12
   --call the Cancel API for PO
   PO_Document_Control_PUB.control_document (1.0,  -- p_api_version
                                             FND_API.G_TRUE, -- p_init_msg_list
                                             FND_API.G_TRUE,       -- p_commit
                                             l_return_status, -- x_return_status
                                             'PO',               -- p_doc_type
                                             'STANDARD',      -- p_doc_subtype
                                             NULL,                 -- p_doc_id
                                             '23975',             -- p_doc_num
                                             NULL,             -- p_release_id
                                             NULL,            -- p_release_num
                                             NULL,            -- p_doc_line_id
                                             '1',            -- p_doc_line_num
                                             NULL,        -- p_doc_line_loc_id
                                             '3',        -- p_doc_shipment_num
                                             'CANCEL',             -- p_action
                                             SYSDATE,         -- p_action_date
                                             NULL,          -- p_cancel_reason
                                             'N',        -- p_cancel_reqs_flag
                                             NULL,             -- p_print_flag
                                             NULL);        -- p_note_to_vendor
   -- 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;
This time, the API will be used to cancel all of line 1. Submit the cancel API using sqlplus as follows:
DECLARE
   l_return_status   VARCHAR2 (1);
BEGIN
   fnd_global.apps_initialize (1053, 50578, 201);
   -- mo_global.init('PO'); -- need for R12
   --call the Cancel API for PO
   PO_Document_Control_PUB.control_document (1.0,  -- p_api_version
                                             FND_API.G_TRUE, -- p_init_msg_list
                                             FND_API.G_TRUE,       -- p_commit
                                             l_return_status, -- x_return_status
                                             'PO',               -- p_doc_type
                                             'STANDARD',      -- p_doc_subtype
                                             NULL,                 -- p_doc_id
                                             '23975',             -- p_doc_num
                                             NULL,             -- p_release_id
                                             NULL,            -- p_release_num
                                             NULL,            -- p_doc_line_id
                                             '1',            -- p_doc_line_num
                                             NULL,        -- p_doc_line_loc_id
                                             NULL,       -- p_doc_shipment_num
                                             'CANCEL',             -- p_action
                                             SYSDATE,         -- p_action_date
                                             NULL,          -- p_cancel_reason
                                             'N',        -- p_cancel_reqs_flag
                                             NULL,             -- p_print_flag
                                             NULL);        -- p_note_to_vendor
-- 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;
Reference:Oracle Apps Cancel PO API Training | Oracle Apps Scripts & Tips

Similar Messages

  • Force a window browser window close when open docs FROM THE KD

    We have an issue when opening documents from the kd a browser window opens, then the office doc opens. But it leaves the blank browser window there open. I have looked into it, and it appears the ptcommonOpener may be able to be modified with a piece of javascript "currentWin.close" in the href that gets built with the link.
    Does anyone have any experience with this or another way to do it.
    Thanks

    the problem has been solved for me following the process :
    1 -close entourage
    2 - start and follow the complete reconstruction of the entourage database ;
    3 - in the "entourage" menu, disable "office reminds" or "office recall" (i don't know the exact name because my entourage is in french)
    For me it has worked. when i click on the dock entourage shortcut it opens without showing the new message windows at start.

  • The dialog box open twice when open file from the server

    I use the following code to download/open file from the server:
    <%
    String filename = "MengxianhuiDocTest.doc";
    String filepath = "D:\\";
    response.setContentType("APPLICATION/OCTET-STREAM");
    response.setHeader("Content-Disposition",
    ??attachment; filename=\"" + filename + "\"");
    java.io.FileInputStream fileInputStream =
    new java.io.FileInputStream(filepath + filename);
    int i;
    while ((i=fileInputStream.read()) != -1) {
    out.write(i);
    fileInputStream.close();
    out.close();
    %>
    If the application runs, the Open or Save dialog box display.When I select open the file,
    the dialog box will display twice.
    Pls help me.
    Thanks.

    thx
    but I tried it and it did't work.
    The dialog box also display twice.

  • Entourage open from dock opens a new message screen. If I open it from the application window it open to my inbox as normal. Just since upgrading to Mavericks.

    Since upgrading to Mavericks, when I open Entourage from the dock it opens the program and opens a new message window. Very annoying. If I open it from the application folder it opens to my inbox like it always has. Any ideas?
    Thanks
    Dave

    the problem has been solved for me following the process :
    1 -close entourage
    2 - start and follow the complete reconstruction of the entourage database ;
    3 - in the "entourage" menu, disable "office reminds" or "office recall" (i don't know the exact name because my entourage is in french)
    For me it has worked. when i click on the dock entourage shortcut it opens without showing the new message windows at start.

  • When openning firefox from the task bar it opens to the last page viewed how can I change that

    Whenever I open Firefox from the taskbar or the desktop icon it opens to the last session pages. Is there a way to change that back to the homepage.

    hello svicinanza, that is probably caused by the user.js file in your profile (it shouldn't be present anyway in case you haven't created it manually, since it can be used to overwrite your custom preferences).
    in order to resolve that, go to the firefox ''menu ≡ > help ? > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js''' and restart the browser.
    [[How to fix preferences that won't save]]
    afterwards try to set the options for your homepage in the firefox menu again: [[How to set the home page]]

  • I downloaded Maverick and now I can't open pages from the Dock.  The Pages icon just jumps up and down abut doesn't open.  However, I can one pages by clicking on the App. I have an iMac with iWork 08.

    Since upgrading to Maverick from Mountain Lion I am unable to open Pages from the Dock.  When I click on the pages icon in the dock the icon just keeps bouncing up and down.  However, I can open pages by clicking on the icon in the Apps folder.  No problems prior to upgrading to Maverick.

    Quit Pages. Drag its icon out of the Dock. Create a new one by dragging the application into the Dock. Test.

  • I cannot open Pages from the app or from a saved document on the desk top.  I get an error: "The application Pages cannot be opened  -1712"  Any suggestions?

    I cannot open Pages from the app or from a saved document on the desk top.  I get an error: "The application Pages cannot be opened  -1712"  Any suggestions?

    The following previous discussion has a solution that worked for a variety of people with the -1712 error on a variety of applications and may help: The application Safari can't be opened -1712

  • When I open Pages from the dock, the page comes up but immediately hangs up with the

    When I open Pages from the Dock,  the page comes up on the screen but immediately hangs up with the rainbow circle spinning.  I finally have to force quite to make it go away.  It does not ask me to choose a template.  This is sporadic, sometimes working, sometimes not.  What is going on?

    Helo,
    Did you try to delete Pages' preferences file(s) in the folder your-user-name/Library/Preferences ?
    There are one or more (depends on your OS X version) file like "com.apple.iWork.Pages.plist"
    You can also repair permissions with Disk Utility in the folder Applications/Utilities.
    Choose the hard drive were Pages is and click the button "Repair permissions".
    Or you can re-install Pages.
    Hope this will help.

  • When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

    When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

  • The way SharePoint open office documents will differ if the user try to open them from the document library directly, or if users try to open the document from the search result page.

    I have a document library where I have uploaded an excel sheet to it. Now If I click on the excel sheet directly from the document library page , I will get the following error ““The webpage cannot be displayed””. While if I do a search and I open the excel
    sheet from the search result page , it will open the excel sheet using the excel services inside the browser !!.
    So can anyone advice on this ?
    Also if I have a PowerPoint document , and I try to open it from the document library I will get the following error “The webpage cannot be displayed” , and the URL will be prefix with the following “ms-powerpoint:ofv|u|”. while if i do a search and i open
    the PowerPoint from the search result page i will be prompted to either open or save the document ? So why SharePoint is reacting totally different when trying to open document library items from the document library Or from the search result page?

    Hi,
    The behavior in the document library could be probably because of the Documents handling setting. Please try setting it to default behavior (Open in browser) as i hear from you that the default behavior is to open from browser.
    Thanks, Suneetha
    Currently I have set the following;-
    1. On the library advance setting :- I define  “Open in the client application”
    2. On the web application setting:- I define stricked for Browser File Handling
    And I have noted if I delete the browser cache and I access the document , then I will be prompted with the download dialog. but if I re-click on the same document I will be redirected to the
    The webpage cannot be displayed
    And the ms-powerpoint:ofv|u| will be added to the beginning of the URL. So could this be a caching problem ?

  • I am suddenly unable to open mail from the dock. dock shows mail is up and running, but stamp does not respond when clicked, and will not quit. help?

    I am suddenly unable to open mail from the dock. dock shows mail is up and running, but stamp icon does not respond when clicked, there is no mail window opened, and will not quit. when double clicked, get new mail is not an option and I get no response with other actions.
    I am retrieving mail on my phone with no problem. this just began happening, no updates or problems with anything else.
    help?

    command-option-esc keys and force quit Mail. Then relaunch.

  • I am having problems gettting my mail to work ... Mac telling me that my start up disk id full and to delete some files to free up space ... have done this but when i open mail from the dock it just brings up the colour wheel and nothing happening

    I am having problems gettting my mail to work ... Mac telling me that my start up disk id full and to delete some files to free up space ... have done this but when i open mail from the dock it just brings up the colour wheel and nothing happening ... it shows when you right click on the mail icon that " application not responding"

    If your hard drive is getting full, you need to free up, at least, 20 GBs of space on your iMac's hard drive.
    If your Mac is running a fairly recent version of OS X, here are some general guidelines.
    Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
    Have you emptied your iMac's Trash icon in the Dock?
    If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
    If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
    Other things you can do to gain space.
    Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
    Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
    Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
    Download an app called OnyX for your version of OS X.
    When you install and launch it, let it run the automatic ans S.M,A.R.T. tests,  then go to the cleaning and maintenance tabs and run the tabs that have the ability to clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
    Typically, iTunes and iPhoto libraries are the biggest users of HD space.
    move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
    If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
    Good Luck!

  • I keep getting the message, "Windows cannot find 'c:\Program Files (x86)\Mozilla Firefox\firefox.exe'. Make sure you typed the name correctly, and then try again." I get it when I either try to open it from the Start menu or from the desktop icon.

    I've just installed Firefox on my laptop and keep getting the message, "Windows cannot find 'c:\Program Files (x86)\Mozilla Firefox\firefox.exe'. Make sure you typed the name correctly, and then try again." I get this message whenever I either try to open it from the Start menu or from the desktop icon. I've never gotten it to work and even uninstalled it and then redownloaded it and still cannot get it to open. Any help would be greatly appreciated!!!!

    Are you installing from the official site? http://www.mozilla.com/firefox
    If you use Windows Explorer (My Computer) to check that path, is the Mozilla Firefox folder there? That is the normal installation location, but I think it's worth checking.
    If the folder isn't there or firefox.exe is not in it, I wonder whether some other software might be interfering. You might want to run some supplemental security scans. These two tools are highly regarded:
    Malwarebytes Anti-malware : http://www.malwarebytes.org/products/malwarebytes_free
    SUPERAntiSpyware : http://www.superantispyware.com/

  • Creation of Collaboration Room from the backend.

    Hi,
         I need to create the collaboration room from the backend. When I tried to do so, its showing the error "Error in RFC Connection". I checked the RFC connection, its working fine.
    Do i need to set any configuration properties either in portal or R/3  to enable the creation of collaboration room from the backend.
    Kinldy provide your valuable inputs.
    Thank you.
    Regards,
    Eben

    Hi,
    If ur talking abt creating rooms from backend in e-learning then thier is some configuration document for that
    Please check..
    Thanks and regards,
    sarang

  • Problem to open websides from the meny in a Ipad

    I have made a website with dreamwaver CS 5,5 and everything
    working just fine, but on a Ipad it is sometime problem to open
    page from the drop meny? Is there anybody who can tell me
    why it is so? is there any solution ?
    Try it if you have access to Apple Ipad Air, http://www.ornskoldsvikshamn.se 
    Greatful for answers
    Mats

    The problem is the Spry Menu system that was included in your version of DW.
    Spry is not good at handling touch displays since it requires a mouse to make the drop down menus appear and those devices do not have mice.
    This is one of the reasons Adobe abandoned Spry back in 2012.
    You would be better served using a different menu system, either jQuery or pure css. Do a search in Google for either and you will be given many, many options to choose from. If you aren't comfortable with the copy/paste and minor tweak coding from the how-to instructions, you can also obtain the Menu Magic extension for DW from Project VII that would allow you to use DW's design view interface to make the menus.

Maybe you are looking for