Sunday, 2 September 2018

api to update oe_order_lines_all

api to update oe_order_lines_all

In this post , We will discuss , how we can update the sales order lines in oracle apps. We often have an Requirment in oracle apps to do some changes in the sales order lines. In this post , We are trying to update the  sales order lines through standard api to update oe_order_lines_all from backend. With the help of this API , we can easily update the schedule ship date. Here below is the sample code using oracle standard api to update oe_order_lines_all.
 

Example of api to update oe_order_lines_all.



DECLARE

l_user_id NUMBER;

l_resp_id NUMBER;

l_appl_id NUMBER;

l_header_rec_in oe_order_pub.header_rec_type;

v_ltbl_line_in oe_order_pub.line_tbl_type;

l_action_request_tbl_in oe_order_pub.request_tbl_type;

l_header_rec_out oe_order_pub.header_rec_type;

l_line_tbl_out oe_order_pub.line_tbl_type;

l_header_val_rec_out oe_order_pub.header_val_rec_type;

l_header_adj_tbl_out oe_order_pub.header_adj_tbl_type;

l_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type;

l_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type;

l_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type;

l_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type;

l_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type;

l_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type;

l_line_val_tbl_out oe_order_pub.line_val_tbl_type;

l_line_adj_tbl_out oe_order_pub.line_adj_tbl_type;

l_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type;

l_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type;

l_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type;

l_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type;

l_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type;

l_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type;

l_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type;

l_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type;

l_action_request_tbl_out oe_order_pub.request_tbl_type;

l_chr_program_unit_name VARCHAR2 (100);

l_chr_ret_status VARCHAR2 (1000) := NULL;

l_msg_count NUMBER := 0;

l_msg_data VARCHAR2 (2000);

l_num_api_version NUMBER := 1.0;

p_line_id NUMBER := :P_ORDER_LINE_ID; --PARAMTER TO PUT THE ORDER LINE ID---

p_sched_ship_date DATE := :P_ORDER_SCHEDULED_DATE; --PARAMTER TO PUT THE SCHEDULED TO BE UPDATED IN ORDER LINES--

BEGIN

 

 

fnd_global.apps_initialize (0,344442,660);

 

v_ltbl_line_in (1) := oe_order_pub.g_miss_line_rec;

v_ltbl_line_in (1).line_id := p_line_id;

v_ltbl_line_in (1).schedule_ship_date := p_sched_ship_date;

v_ltbl_line_in (1).operation := oe_globals.g_opr_update;

oe_msg_pub.delete_msg;

 

oe_order_pub.process_order

(p_api_version_number => l_num_api_version,

p_init_msg_list => fnd_api.g_false,

p_return_values => fnd_api.g_false,

p_action_commit => fnd_api.g_false,

p_line_tbl => v_ltbl_line_in,

x_header_rec => l_header_rec_out,

x_header_val_rec => l_header_val_rec_out,

x_header_adj_tbl => l_header_adj_tbl_out,

x_header_adj_val_tbl => l_header_adj_val_tbl_out,

x_header_price_att_tbl => l_header_price_att_tbl_out,

x_header_adj_att_tbl => l_header_adj_att_tbl_out,

x_header_adj_assoc_tbl => l_header_adj_assoc_tbl_out,

x_header_scredit_tbl => l_header_scredit_tbl_out,

x_header_scredit_val_tbl => l_header_scredit_val_tbl_out,

x_line_tbl => l_line_tbl_out,

x_line_val_tbl => l_line_val_tbl_out,

x_line_adj_tbl => l_line_adj_tbl_out,

x_line_adj_val_tbl => l_line_adj_val_tbl_out,

x_line_price_att_tbl => l_line_price_att_tbl_out,

x_line_adj_att_tbl => l_line_adj_att_tbl_out,

x_line_adj_assoc_tbl => l_line_adj_assoc_tbl_out,

x_line_scredit_tbl => l_line_scredit_tbl_out,

x_line_scredit_val_tbl => l_line_scredit_val_tbl_out,

x_lot_serial_tbl => l_lot_serial_tbl_out,

x_lot_serial_val_tbl => l_lot_serial_val_tbl_out,

x_action_request_tbl => l_action_request_tbl_out,

x_return_status => l_chr_ret_status,

x_msg_count => l_msg_count,

x_msg_data => l_msg_data

);

l_msg_data := NULL;

 

IF l_chr_ret_status <> 'S'

THEN

FOR iindx IN 1 .. l_msg_count

LOOP

l_msg_data := l_msg_data || ' ' || oe_msg_pub.get (iindx);

END LOOP;

END IF;

 

DBMS_OUTPUT.ENABLE (10000);

DBMS_OUTPUT.put_line ('Return Status: ' || l_chr_ret_status);

DBMS_OUTPUT.put_line ('Error Message: ' || l_msg_data);

END;

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *