Order-level sales credit total () must equal 100% error while booking sales order if created using OE_ORDER_PUB.PROCESS_ORDER in Oracle Apps R12
When creating a copy of order using OE_ORDER_PUB.PROCESS_ORDER, order gets created but when you try to book the order you will get the below error:
Order-level sales credit total () must equal 100%.
This happens due to no sales credit line (in table OE_SALES_CREDITS) generated for the order. To check the sales credit line, go to order header and choose "Sales Credits" in Actions:
You can see there's no line:
Resolution
While creating the order, don't give any value for SOURCE_DOCUMENT_TYPE_ID. This will generate the Sales Credit line and you can book the order successfully:
--v_header_rec.SOURCE_DOCUMENT_TYPE_ID := 2; --Comment this line
v_header_rec.salesrep_id := -3; --value for salesrep
-- Calling the API to create an Order --
OE_ORDER_PUB.PROCESS_ORDER (
p_api_version_number => v_api_version_number
,p_init_msg_list => fnd_api.g_true
,p_org_id => '122'
, p_header_rec => v_header_rec
, p_line_tbl => v_line_tbl
, p_action_request_tbl => v_action_request_tbl
, p_line_adj_tbl => v_line_adj_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_out
, x_msg_count => v_msg_count
, x_msg_data => v_msg_data
);
Comments
Post a Comment