How to close OLD POs which are in Closed or Cancelled ?

Hi All,
We are working on Oracle Applications : 11.5.10.2
Our client wants to Finally Close the OLD POs which are in Closed or Cancelled state in order for them to be Purged as part of Archiving Project.
For the same I am trying with the API - po_actions.close_po
Follwoing is the code I tried to close one PO, by simply hardcoding the values -
DECLARE
   lv_result     BOOLEAN;
   return_code   VARCHAR2 (20);
BEGIN
   lv_result :=
      po_actions.close_po (p_docid              => 1834281,
                           p_doctyp             => 'PO',
                           p_docsubtyp          => 'STANDARD',
                           p_lineid             => 0,
                           p_shipid             => 0,
                           p_action             => 'FINALLY CLOSED',
                           p_reason             => 'Finally CLosed',
                           p_calling_mode       => 'PO',
                           p_conc_flag          => 'N',
                           p_return_code        => return_code,
                           p_auto_close         => 'N',
                           p_action_date        => TRUNC(SYSDATE),
                           p_origin_doc_id      => 50386
   COMMIT;
   IF lv_result = TRUE
   THEN
      DBMS_OUTPUT.put_line ('Successfully closed PO#');
   ELSE
      DBMS_OUTPUT.put_line ('Cannot close PO#');
   END IF;
END;
But for all PO's the return code is returning FALSE.
Can anyone please advise me where I may be going wrong or if the above API does not work then what is the other means to close POs.
Also I read many questions on the forums for the same, but none has a definite answer.
Please advise..as there are many PO's and cant be closed manually.
Regards,
Shruti

Hi Shruti,
Please have a loot at notes:
How Are Purchase Orders Closed Automatically? Closed Status Rolled Up? PO's Are Not Closing? (Doc ID 1265680.1)
Manually Closed for Receiving Purchase Order Lines, Open Upon PO Reapproval (Doc ID 469330.1)
Why Po Lines Are Not Getting Closed When Invoices Are Matched To 3-Way ? (Doc ID 561253.1)
Also have a look at the following links:
https://forums.oracle.com/thread/2372938
http://jyotioraapps.blogspot.com/2009/08/api-for-closingfinally-closing-po-using.html
Cancelling PO Using API PO_Document_Control_PUB.control_document : Oracle ERP Apps Guide
Hope this helps!
Best Regards

Similar Messages

  • How to close open POs which are open for more than two month

    I am new to MM please somebody help me with this
    Thank you

    there is NO STD SAP program which will help u closing the open PO (more than two months)
    you need to go each and every PO and mark it as Del completed (item level in deleivery tab)
    but this is only stastestical indicator. System wont stop you creating further GR against such PO if any Qty leftout.
    for example - PO order 10EA, you recd 8EA and marked the indicator , still you can make the GR for 2EA
    there is SPRO setting as well to mark the PO as delivery completed once PO Qty and MIGO QTy is equal or with some variance . but this will work on real time
    Another way to set the final invoice indicator in invoice tab
    system will allow you to post the further invoices but all be blocked.
    somebody need to go and verify the blocked invoices and take necessary action
    This is again a manual activity, there is no such STD setting or T code exist
    Another way is you can create a program with the help of abaper
    built a logic on date / QTy and Amount and update the PO for del complete ( EKPO-ELIKZ) and final inv indicator (EKPO-EREKZ) by using BAPI PO change
    hope this will help you

  • How to close the pos

    Hi All,
    We have 50 pos ,we need how to close these pos .Please help me on this .
    thanks
    Happy

    1. You can set Delivery Completed Indicator in Purchase Order or at time of doing goods receipt. That simply means you cannot do further GR for that item. You can still process Open Invoices . 
    2. You can block material at purchase order level which means, you will not be able to do any GR , Invoice against that specific item in PO.
    The recommended is the first option though.
    Second option is used in case of : - 
    1. to cancel an item
    2. An item is closed and can be archived

  • How can I import songs which are filed basis one album/compilation as one folder?

    How can I import songs which are filed basis one album/compilation as one folder?
    i can drag and drop one folder which is a proper album into itunes under playlist. if i drag and drop two proper albums into itunes it is also ok but if itunes does not know my own compliations and i drag and rop my 3000 folders in one shot into itunes i get only one playlist containing all songs.
    pleased to hear if anybody know how i can avoid to do 3000 times drag and drop a folder into itunes.
    rgds, alexander

    Before you begin the import, edit the properties of the tracks to set the Album Artist to Various Artists and Part of a Compilation to Yes.
    For more info. see Grouping tracks into albums.
    tt2

  • How can i send videoes which are not in camera roll via whatss app to others ?

    hi,
    I am going to know that how can i transfer video which are not in camera roll via whatss app to others ?
    thnaks in advanced.

    Where are the videos?
    If WhatsApp supports sending videos from the Camera Roll only and that is your only option, that is it.
    Contact WhatsApp. They have a website.

  • How can I unmark photos which are marked for republish to Flickr?

    I am currently using Lightroom 3 to publish photos to Flickr. I have a free Flickr account.
    My problem is that I have a set of photos I am publishing to flickr. For some reason some of my photos lost their keywords, only the files on my computer lost them, the photos on Flickr still have the keywords intact. Also I applied a colour code to a couple of the photos on my hard disk that are being published to Flickr.
    Now Lightroom has detected these changes and the photos appear under 'Modified Photos to repblish' the thing is the changes I made were either putting keywords back in that were already in Flickr anyway, and colour coding which makes no different to flickr. Because I have a free account if I republish the photos I will lose all the comments and stats on Flickr, so I don't want to republish them.
    Whenever I click the publish button I get a warning that republishing the changed photos will lose any information on flickr and I have the option to skip them, and just publish new photos. But if I ever do want to republish a photo I won't be able to do this without also republishing all the photos marked for republish.
    Is there any way I can remove these photos from the republish list?

    All,
    This is an issue with the LR programming, as it does NOT allow you to unmark images it feels need to be republished. Oftentimes it's only a matter of adding a keyword or tweaking the develop settings that triggers this. I for one wish that choice was available.
    Here's what you can do: simply disconnect from the Flickr service. Doing so will have NO detrimental effect on the images in Lightroom or the images you have already uploaded to Flickr. What you will lose, however, is the "library" of images that you have already uploaded to Flickr. Since this is really only a collection there's no harm. Besides, if you need to review which of your images have been uploaded to Flickr at a later time, just reference Flickr. Oh, you'll also lose Lightroom's ability to download any comments your Flickr contacts make on your uploaded images. If it's important for you have that data in Lightroom, rethink the disconnect option. After disconnecting, reconnect using the same parameters you had before. Your Lightroom/Flicker collection will be cleared of all previously uploaded images and you can begin adding new images to upload.
    Again, disconnecting has no effect on your Flickr content. However, if you REMOVE images from the collection using Lightroom, they will also be removed from Flickr. Please understand the distinction between disconnecting from the Service and removal of images using Lightroom.
    All that being said, republishing images from Lightroom to Flickr, in my experience, should not cost you anything in terms of number of views, favorites, comments, etc. It should be seamless.
    Judson Rhodes, Photographer
    www.flickr.com/jrcp/show
    www.judsonr.com
    Date: Tue, 29 Mar 2011 09:43:18 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I unmark photos which are marked for republish to Flickr?
    Hi,
    I'm using LR 3.2 and am having the same issue. I see that no one from Adobe has replied to this and that the previous reply was from August, 2010. There seem to be no answers to this one...
    I have several images that LR feels should be republished, and ONE image that I want to republish. I CAN'T republish just that one image though without republishing ALL the other images.
    Can someone (maybe someone from Adobe) help me with this? How can I simply UNmark the other images to not be republished? I do not want to remove them from the collection, but simply do not want to republish them at this time.
    Why can't Adobe simply ask us if an image should be republished or not? Why can't they allow us to UNmark an image to be republished once it's marked?
    Ideas??  HELP!
    Thanks!
    Steve
    >

  • HT204053 i just brought new i phone 5 yesterday and now i can see all paid applications and i dont use or have credit card also now how i can buy applications which are important for me? can i buy them online? or use debit card

    i just brought new i phone 5 yesterday and now i can see all paid applications and i dont use or have credit card also now how i can buy applications which are important for me? can i buy them online? or use debit card and trust me all my friends are regretting buying phone because of this problem.Kindly help.Cant it can be deducted from our mobile charges?i would be much easier then

    You can buy apps using iTunes Gift cards without needing to register your debit card.
    http://store.apple.com/us/personalize/itunes

  • How to identify the SQLs which are using the tables and new columns

    Hi
    I m using oracle 10G Database in windows. Developers have added some columns in some of the database tables and were asking to check whether there is some impact on performance or not. I have not done this performance tuning before. Kindly help me how to proceed further.
    How to obtain the sqls which are touching the tables and the new columns? It would be really great if you can help me with this.
    Thanks

    You can try to use DBA_DEPENDENCIES to get PL/SQL objects using tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#i1576452.
    However if SQL code is not stored in database in a trigger, a procedure, a function, a package or a view, it is impossible to retrieve all SQL code referencing some table from database dictionary: for this you would have to analyze application source code.

  • How to use xml forms which are built by using xml forms builder?

    Hi Experts,
    please explain How to use xml forms which are built by using xml forms builder in Web page composer?
    Thanks,
    Anil.

    hi buddy u can try the following page:
    http://help.sap.com/saphelp_nw70/helpdata/en/8f/fe743c74fa6449e10000000a11402f/frameset.htm

  • How to unreleased Appraisal templates which are alreay being in used

    Hi Experts,
    I am looking for the solution how to unreleased appraisal templates which are already released and also used by the Employees for their PDD process.
    We are facing one problem in PDD templates, so we want to make some changes in already released templates.
    Is there any way or solution by any Functional method/settings or by ABAP program?
    Please reply as it is very critical and important for us to solve ASAP.
    Thanks & Regards,
    Ashish Mehta.

    Now that might work (actually it will work). But you need to be 100% sure that your changes will not infleunce the appraisal process. Because it is not that hard to cause unrepairable data inconsistencies on already existing appraisal documents!!
    There is a very good reason for not being able to unrelease templates once they are in use!
    One is that you can create incorrect appraisal documents from a business point of view.
    Say your document end appraisal is a 1-10 scale, one being the worst. The appraisal gets a 3 as final score, meaning in this scale quite bad. Now you unrelease the template and change the used scale to a 1-4 scale. Your very bad employee turns all of a sudden in a quite good employee!
    Even worse, <b>you can create database inconsistencies on document level</b>. Just remove elements or columns from the template and you will get very strange results after releasing again.
    I don't recommend changing templates once documents are based on them but if you use this option then be carefull!
    Regards and Groetjes,
    Maurice

  • How to remove the tasks which are not manually recoverable?

    How to remove the tasks which are not manually recoverable?
    I tried performing manual recovery for the BPEL processes but there are few tasks which cant be manually recoverable..
    Could you please tell me how to remove those tasks and also tell me which information in the console is the task_id in the database?

    This article explains how to cleanup bpel process instances, you can find task instance id by searching for data in payload using api.
    Managing a BPEL Production Environment
    http://www.oracle.com/technology/pub/articles/bpel_cookbook/blanvalet.html
    Cheers,
    Rad

  • How to extract vendors numbers which are included in a particular payment program variant or from a payment identification?

              How to extract vendors numbers which are included in a particular payment program variant or from a payment identification?

    Hi ,
    That's not a Problem as well.
    Go to F110 nd then see as below screen shot . This will give you everything that has included in payment .
    you have an option of diplay which will give same list but vendor included for paid . You have option  to get paymnet summary and all other . Please check them out and let me know if you need more help

  • How to close Retail POS Client

    Hello Experts,
    I am starter in Oracle Retail Suite, could someone advise me how to close the POS Client application once it is started (any hot key etc). I have tried all function keys available but no luck ....
    Thanks in Advance
    KKJ

    Hi,
    There is no hot key as such for closing the ORPOS Client, but wat you can do is either directly close the client conduit batch window or you can change the entry env = PROD to env = DEV in the application.properties file of your client. This will enable a normal window property for your client.
    Regards

  • HT1420 How can I deauthorise computers which are no longer functional within the 12 month period.

    How can i deauthorise computers which are no longer functional & are within the 12 month period?

    Click here and ask the iTunes Store staff for assistance. Only they can perform a second Deauthorize All before the year ends.
    (94736)

  • In tiger, how do i list files which are open by some application.

    In tiger, how do i list files which are open by some application without using "lsof" command.

    Thanks,
    But i m looking for the function to list the files opened by some application.
    As i want to check whether a file is opened or not by some application.

Maybe you are looking for

  • Synchronising contract data in R3 AND CRM

    Hi All , Greetings for the day!! I had appended a new field in contract (VBAP-ZZFIELD) in R3.This contract first get created in CRM and gets copied in R3. Whatever changes i make to new field in R3 must gets copied to same contract in  CRM & vice ver

  • Structure with min!=max without mapping

    Hi, At Message Mapping - Test Tab, we have the following error: "Mapping object  incomplete. Unable to continue execution Structure with min!=max without mapping" We did added some custom segments to the standard idoc, but we already validate the xml

  • ERP2004: ESS JCO session handling in Web Dynpro apps?

    Hello, we run ESS/MSS Web Dynpro scenarios, running on WAS 6.40, SP12 in Enterprise Portal EP6 SP2 Patch 32. Our go live will be with > 1000 ESS users. 1. When will the sessions in R/3 backend system be terminated by the Web Dynpro Application? How i

  • Trying to add podcasts to shuffle I tunes says they are there but when I play them only a few are available?

    trying to add podcasts to shuffle I tunes says they are there but when I play them only a few are available?

  • Setting JTree icons

    Hi there, I'm working on a sample JTree project where I wanted to render my own icons for open/closed folders and leaf nodes. So I subclassed DefaultTreeCellRenderer and used the inherited ods to set the appropriate icons: setClosedIcon(), setOpenIco