Add and Update price list lines
-- Purpose: to add row information based on the existing price list Header-- Restriction: this api has some problems. If the header information is forcibly added, there will be many problems. Therefore, this example only adds row information based on the existing header information.-- Part of the parameter that needs to be manually transferred: See the comment-- Note: you do not need to simulate logon.
DECLARE p_list_header_id NUMBER (10); p_inventory_item_id NUMBER (10); p_product_uom_code VARCHAR2 (50); p_primary_uom_flag VARCHAR2 (50); p_operand NUMBER (10); p_start_active_date DATE; p_end_active_date DATE; x_return_status VARCHAR2 (10); x_msg_count NUMBER (10); x_msg_data VARCHAR2 (2000); l_price_list_rec limit; x_price_list_rec limit; x_qualifiers_tbl limit; x_qualifiers_val_tbl limit; x_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type; x_pricing_attr_val_tbl limit; BEGIN
Rochelle price_list_rec.list_header_id: = p_list_header_id;-- Business entity + price list name confirmationRochelle price_list_rec.list_type_code: = 'mp ';-- FixedRochelle price_list_rec.operation: = qp_globals.g_opr_update;-- Fixed
Rochelle price_list_line_tbl (1). list_header_id: = p_list_header_id;-- Business entity + price list name confirmationL_price_list_line_tbl (1). list_line_id: = fnd_api.g_miss_num; l_price_list_line_tbl (1). list_line_type_code: = 'pll ';-- FixedRochelle price_list_line_tbl (1). operation: = qp_globals.g_opr_create;-- FixedRochelle price_list_line_tbl (1). operand: = p_operand;-- ValueRochelle price_list_line_tbl (1). arithmetic_operator: = 'unit _ price ';-- Fixed
Rochelle price_list_line_tbl (1). start_date_active: = p_start_active_date;-- Directly input the start dateRochelle price_list_line_tbl (1). end_date_active: = p_end_active_date;-- Directly input the deadline
Rochelle price_list_line_tbl (1). organization_id: = NULL;-- Directly pass nullRochelle price_list_line_tbl (1). primary_uom_flag: = p_primary_uom_flag;-------- Pass in directly according to the main unit/* L_price_list_line_tbl (1). end_date_active: = '24-12-2013 '; -- directly input the varchar deadline*/Response (1). pricing_attribute_id: = fnd_api.g_miss_num; l_pricing_attr_tbl (1). list_line_id: = response; Response (1). product_attribute_context: = 'item ';-- FixedRochelle pricing_attr_tbl (1). product_attribute: = 'pricing _ ATTRIBUTE1 ';-- FixedRochelle pricing_attr_tbl (1). product_attr_value: = p_inventory_item_id;-- Input inventory_item_idRochelle pricing_attr_tbl (1). product_uom_code: = p_product_uom_code;-- Directly input the UnitRochelle pricing_attr_tbl (1). excluder_flag: = 'n ';--? Temporary fixedRochelle pricing_attr_tbl (1). attribute_grouping_no: = 1;-- FixedRochelle pricing_attr_tbl (1). price_list_line_index: = 1;-- FixedRochelle pricing_attr_tbl (1). operation: = qp_globals.g_opr_create;-- Fixed
Values (values => 1, p_init_msg_list => values, p_return_values => values, p_commit => values, x_return_status => x_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data, p_price_list_rec => l_price_list_rec, records => records, records => records, x_price_list_rec => x_price_list_rec, records => records, response => x_pricing_attr_tbl, response => response, response => response); IF x_return_status = running THEN dbms_output.put_line ('x _ return_status: '| x_return_status ); dbms_output.put_line ('added successfully '); ELSE dbms_output.put_line ('x _ return_status:' | x_return_status); dbms_output.put_line ('add error '); end if; END;