Many times for bulk processing there will be a need to update price lists for Eg , when we want to end date lines in bulk. In such a scenario we can use the API.
gpr_price_list_line_tbl (l_num_count).list_line_id :=
list_line_rec.list_line_id;
gpr_price_list_line_tbl (l_num_count).operation :=
QP_GLOBALS.G_OPR_UPDATE;
gpr_price_list_line_tbl (l_num_count).start_date_active :=
list_line_rec.START_DATE_ACTIVE;
gpr_price_list_line_tbl (l_num_count).end_date_active :=
'21-SEP-2016';
-- call to API
QP_PRICE_LIST_PUB.Process_Price_List (
p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
Some of these are record type variables and some table type variables
gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
p_api_version_number NUMBER := 1;
p_init_msg_list VARCHAR2 (1) := Fnd_Api.G_FALSE;
p_return_values VARCHAR2 (1) := Fnd_Api.G_FALSE;
p_commit VARCHAR2 (1) := Fnd_Api.G_TRUE;
If the script is run as an anonymous block then note that API will not do an implicit commit and user needs to do a COMMIT explicitly to ensure changes are reflected in the system
gpr_price_list_line_tbl (l_num_count).list_line_id :=
list_line_rec.list_line_id;
gpr_price_list_line_tbl (l_num_count).operation :=
QP_GLOBALS.G_OPR_UPDATE;
gpr_price_list_line_tbl (l_num_count).start_date_active :=
list_line_rec.START_DATE_ACTIVE;
gpr_price_list_line_tbl (l_num_count).end_date_active :=
'21-SEP-2016';
-- call to API
QP_PRICE_LIST_PUB.Process_Price_List (
p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
Some of these are record type variables and some table type variables
gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
p_api_version_number NUMBER := 1;
p_init_msg_list VARCHAR2 (1) := Fnd_Api.G_FALSE;
p_return_values VARCHAR2 (1) := Fnd_Api.G_FALSE;
p_commit VARCHAR2 (1) := Fnd_Api.G_TRUE;
If the script is run as an anonymous block then note that API will not do an implicit commit and user needs to do a COMMIT explicitly to ensure changes are reflected in the system