Wednesday, July 31, 2013

Sample update script using oe_order_pub.process_order api

DECLARE
   v_header_rec   oe_order_pub.header_rec_type;
   v_line_tbl     oe_order_pub.line_tbl_type;
BEGIN
 
-- Line Record --
   v_line_tbl (1) := oe_order_pub.g_miss_line_rec; --oe_order_pub.G_MISS_LINE_TBL;
   v_line_tbl (1).last_update_date := SYSDATE;
   v_line_tbl (1).last_updated_by := fnd_global.user_id;
   v_line_tbl (1).last_update_login := fnd_global.login_id;
   v_line_tbl (1).header_id := l_header_id; --fetch the value
   v_line_tbl (1).line_id := l_line_id; --fetch the value
   v_line_tbl (1).operation := oe_globals.g_opr_update;
   v_line_tbl (1).change_reason := 'MANUAL';
   v_line_tbl (1).ship_to_org_id := 2456;

-- API Begin
   oe_order_pub.process_order (
      p_api_version_number=> v_api_version_number,
      p_header_rec=> v_header_rec,
      p_line_tbl=> v_line_tbl
-- OUT variables
                             ,
      x_header_rec=> v_header_rec_out,
      x_header_val_rec=> v_header_val_rec_out,
      x_header_adj_tbl=> v_header_adj_tbl_out,
      x_header_adj_val_tbl=> v_header_adj_val_tbl_out,
      x_header_price_att_tbl=> v_header_price_att_tbl_out,
      x_header_adj_att_tbl=> v_header_adj_att_tbl_out,
      x_header_adj_assoc_tbl=> v_header_adj_assoc_tbl_out,
      x_header_scredit_tbl=> v_header_scredit_tbl_out,
      x_header_scredit_val_tbl=> v_header_scredit_val_tbl_out,
      x_line_tbl=> v_line_tbl_out,
      x_line_val_tbl=> v_line_val_tbl_out,
      x_line_adj_tbl=> v_line_adj_tbl_out,
      x_line_adj_val_tbl=> v_line_adj_val_tbl_out,
      x_line_price_att_tbl=> v_line_price_att_tbl_out,
      x_line_adj_att_tbl=> v_line_adj_att_tbl_out,
      x_line_adj_assoc_tbl=> v_line_adj_assoc_tbl_out,
      x_line_scredit_tbl=> v_line_scredit_tbl_out,
      x_line_scredit_val_tbl=> v_line_scredit_val_tbl_out,
      x_lot_serial_tbl=> v_lot_serial_tbl_out,
      x_lot_serial_val_tbl=> v_lot_serial_val_tbl_out,
      x_action_request_tbl=> v_action_request_tbl_out,
      x_return_status=> v_return_status,
      x_msg_count=> v_msg_count,
      x_msg_data=> v_msg_data
   );
END;

1 comment: