Skip to Main Content

E-Business Suite

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

WSH_DELIVERY_DETAILS_PKG.update_delivery_details

DC pvtFeb 10 2025

Hello everyone,

I've been working on the Order to Cash API integration, specifically focusing on the process_order, create_delivery, and auto-generating lot numbers. I’ve written a PL/SQL script to update the generated lot number to the designated delivery.

While the script runs without any errors and produces the unexpected output (which I've included as a comment at the end of the script), the desired delivery is not being updated with the lot number. Despite several modifications and attempts to troubleshoot, I haven't seen any improvement.

I'm reaching out to the community for assistance. If anyone has experience with this type of integration or can offer insights into potential solutions, share your thoughts in the comments. Your help would be greatly appreciated!

Thank you!

DECLARE
-- Declare variables for output parameters
v_return_status VARCHAR2(1); 
v_msg_count number;
v_msg_data varchar2(2000);

-- Declare variables for input parameters
v_rowid VARCHAR2(20);
v_delivery_details_info WSH_GLBL_VAR_STRCT_GRP.Delivery_Details_Rec_Type; -- Initialize as needed

BEGIN
-- Initialize variables
v_rowid := NULL;

-- Initialize the delivery details record as needed
v_delivery_details_info.delivery_detail_id := 001;
v_delivery_details_info.source_header_id := 0001;
v_delivery_details_info.source_line_id := 00001;
v_delivery_details_info.inventory_item_id := 1234;
v_delivery_details_info.subinventory := NULL;
v_delivery_details_info.lot_number := 'LOT11';
v_delivery_details_info.cust_po_number := '00/00000084'; 
v_delivery_details_info.source_document_type_id := 0;

-- Debug output for initialized variables
DBMS_OUTPUT.PUT_LINE('DEBUG: Initializing variables...');
DBMS_OUTPUT.PUT_LINE('Row ID: ' || NVL(v_rowid, 'NULL'));
DBMS_OUTPUT.PUT_LINE('Delivery Detail ID: ' || v_delivery_details_info.delivery_detail_id);
DBMS_OUTPUT.PUT_LINE('Source Header ID: ' || v_delivery_details_info.source_header_id);
DBMS_OUTPUT.PUT_LINE('Source Line ID: ' || v_delivery_details_info.source_line_id);
DBMS_OUTPUT.PUT_LINE('Inventory Item ID: ' || v_delivery_details_info.inventory_item_id);
DBMS_OUTPUT.PUT_LINE('Subinventory: ' || NVL(v_delivery_details_info.subinventory, 'NULL'));
DBMS_OUTPUT.PUT_LINE('Lot Number: ' || v_delivery_details_info.lot_number);
DBMS_OUTPUT.PUT_LINE('Customer PO Number: ' || v_delivery_details_info.cust_po_number);
DBMS_OUTPUT.PUT_LINE('Source Document Type ID: ' || v_delivery_details_info.source_document_type_id);
DBMS_OUTPUT.PUT_LINE('Released Status: ' || v_delivery_details_info.released_status);

-- Call the procedure
DBMS_OUTPUT.PUT_LINE('DEBUG: Calling update_delivery_details procedure...');
WSH_DELIVERY_DETAILS_PKG.update_delivery_details (
p_rowid => v_rowid,
p_delivery_details_info => v_delivery_details_info,
x_return_status => v_return_status,
);

-- Handle output parameters as needed
DBMS_OUTPUT.PUT_LINE('DEBUG: Procedure call completed.');
DBMS_OUTPUT.PUT_LINE('Return Status: ' || v_return_status);

EXCEPTION
WHEN OTHERS THEN
-- Capture detailed error information
DBMS_OUTPUT.PUT_LINE('ERROR: An exception occurred: ' || SQLERRM);
DBMS_OUTPUT.PUT_LINE('ERROR CODE: ' || SQLCODE);
DBMS_OUTPUT.PUT_LINE('DEBUG: Return Status before error: ' || NVL(v_return_status, 'NULL'));
END;


--OUTPUT IT GIVEN AS
-- DEBUG: Initializing variables... 
-- Row ID: NULL 
-- Delivery Detail ID: 001 
-- Source Header ID: 0001 
-- Source Line ID: 00001 
-- Inventory Item ID: 1234 
-- Subinventory: NULL 
-- Lot Number: LOT11 
-- Customer PO Number: 000/00000084 
-- Source Document Type ID: 0 
-- Released Status: 
-- DEBUG: Calling update_delivery_details procedure... 
-- DEBUG: Procedure call completed. 
-- Return Status: U

Comments

thatJeffSmith-Oracle Feb 13 2025

Your ENTRA users will get authenticated via JSON Web Tokens, and their Entra roles will determine which ORDS REST APIs they can hit.

When they hit an endpoint, it'll execute code in the database as the database user that owns the schema where the REST API is defined, not as Entra defiend end user. In fact, the Entra users won't have accounts in the database (they could, but wont' need to).

The :current_user field as far as ords is concerned would be the corresponding oauth2 client or JWT issued for the authorizied session.

Your prehook should be able to alter the session to set the context that would put your RLS/VPD security policy in play.

1 - 1

Post Details

Added on Feb 10 2025
1 comment
335 views