Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to achieve oracle ebs purchase order closure by PL/SQL

Shulou Source: shulou.com Published: 2022-06-01 11:21:07 09月17日 Update

Today, I will talk to you about how PL/SQL realizes the closure of oracle ebs purchase orders. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

In response to customer requirements, you need to write a script to batch close purchase orders of Bonus Item type, and search for some methods on metalink, but all of them fail to test. It turns out that the code needs to be generated into a concurrent program. The following is the code that tested successfully.

1. First create a stored procedure, and then call PO_ACTIONS.CLOSE_PO in the stored procedure

two。 Register a concurrent program of stored procedure type

3. Test the results in application.

CREATE OR REPLACE PROCEDURE xx_po_close

(

Err_buff OUT VARCHAR2

Retcode OUT NUMBER

P_reason_desc VARCHAR2

P_po_from VARCHAR2

P_po_to VARCHAR2)

AS

L_return_code VARCHAR2 (2000)

L_result BOOLEAN

CURSOR PO_CLOSE_CUR

IS

SELECT poh.segment1

Poll.po_header_id

Poll.po_line_id

Poll.line_location_id

FROM po_line_locations_all poll

Po_headers_all poh

Po_lines_all pol

WHERE poll.po_header_id = poh.po_header_id

AND poll.po_line_id = pol.po_line_id

AND pol.po_header_id = poh.po_header_id

AND upper (poh.authorization_status) = 'APPROVED'

AND UPPER (poll.closed_code) = 'CLOSED FOR RECEIVING'

AND (pol.unit_price = 0 or poh.quantity_billed-poh.quantity > = 0)

AND poh.segment1 between p_po_from and p_po_to

BEGIN

FOR PO_CLOSE_REC IN PO_CLOSE_CUR

LOOP

L_result: = po_actions.close_po (

P_docid = > PO_CLOSE_REC.po_header_id

P_doctyp = > 'PO'

P_docsubtyp = > 'STANDARD'

P_lineid = > PO_CLOSE_REC.po_line_id

P_shipid = > PO_CLOSE_REC.line_location_id

P_action = > 'CLOSE'

P_reason = > p_reason_desc

P_calling_mode = > 'PO'

P_conc_flag = >'N'

P_return_code = > l_return_code

P_auto_close = >'N'

P_action_date = > SYSDATE

P_origin_doc_id = > NULL)

IF l_result THEN

FND_FILE.PUT_LINE (FND_FILE.OUTPUT,PO_CLOSE_REC.segment1 | |'is Closed. ')

ELSE

FND_FILE.PUT_LINE (FND_FILE.OUTPUT,PO_CLOSE_REC.segment1 | |'is not Closed. ')

END IF

END LOOP

END

After reading the above, do you have any further understanding of how PL/SQL can close oracle ebs purchase orders? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Orders purchases content procedures storage testing code programs types success code generation customers methods more knowledge articles results scripts industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Shulou Tech Info macOS OPPO Reno