28
2014
Fiyat Listesine Kayıt Ekleme API
Merhaba,
Sipariş yönetiminde fiyat listesine kayıt ekleyebilmek için aşağıdaki proceduru kullanabilirsiniz.
CREATE OR REPLACE PROCEDURE price_add_p (
p_list_header_id IN NUMBER,
p_curr_header_id IN NUMBER,
p_inventory_item_id IN NUMBER,
p_uom_code IN VARCHAR2,
p_price IN NUMBER,
p_return_status IN OUT VARCHAR2,
p_message IN OUT VARCHAR2
)
AS
gpr_return_status VARCHAR2 (1) := NULL;
gpr_msg_count NUMBER := 0;
gpr_msg_data VARCHAR2 (2000);
gpr_price_list_rec qp_price_list_pub.price_list_rec_type;
gpr_price_list_val_rec qp_price_list_pub.price_list_val_rec_type;
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;
gpr_qualifiers_tbl qp_qualifier_rules_pub.qualifiers_tbl_type;
gpr_qualifiers_val_tbl qp_qualifier_rules_pub.qualifiers_val_tbl_type;
gpr_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type;
gpr_pricing_attr_val_tbl qp_price_list_pub.pricing_attr_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;
k NUMBER := 1;
j NUMBER := 1;
i NUMBER;
l_list_line_id qp_list_lines.list_line_id%TYPE;
l_start_date_active DATE := SYSDATE;
BEGIN
gpr_price_list_rec.list_header_id := p_list_header_id;
gpr_price_list_rec.currency_header_id := p_curr_header_id;
gpr_price_list_rec.operation := qp_globals.g_opr_update;
k := 1;
gpr_price_list_line_tbl (k).list_header_id := p_list_header_id;
gpr_price_list_line_tbl (k).list_line_id := fnd_api.g_miss_num;
gpr_price_list_line_tbl (k).list_line_type_code := ‘PLL’;
gpr_price_list_line_tbl (k).operation := qp_globals.g_opr_create;
gpr_price_list_line_tbl (k).operand := p_price;
gpr_price_list_line_tbl (k).arithmetic_operator := ‘UNIT_PRICE’;
gpr_price_list_line_tbl (k).start_date_active := l_start_date_active;
gpr_price_list_line_tbl (k).product_precedence := 220;
j := 1;
gpr_pricing_attr_tbl (j).pricing_attribute_id := fnd_api.g_miss_num;
gpr_pricing_attr_tbl (j).list_line_id := fnd_api.g_miss_num;
gpr_pricing_attr_tbl (j).product_attribute_context := ‘ITEM’;
gpr_pricing_attr_tbl (j).product_attribute := ‘PRICING_ATTRIBUTE1’;
gpr_pricing_attr_tbl (j).product_attr_value := p_inventory_item_id;
gpr_pricing_attr_tbl (j).product_uom_code := p_uom_code;
gpr_pricing_attr_tbl (j).excluder_flag := ‘N’;
gpr_pricing_attr_tbl (j).attribute_grouping_no := 1;
gpr_pricing_attr_tbl (j).price_list_line_index := 1;
gpr_pricing_attr_tbl (j).operation := qp_globals.g_opr_create;
qp_price_list_pub.process_price_list
(p_api_version_number => 1,
p_init_msg_list => fnd_api.g_true,
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_rec => gpr_price_list_rec,
p_price_list_line_tbl => gpr_price_list_line_tbl,
p_pricing_attr_tbl => gpr_pricing_attr_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
);
IF gpr_return_status <> fnd_api.g_ret_sts_success
THEN
FOR k IN 1 .. gpr_msg_count
LOOP
gpr_msg_data := oe_msg_pub.get (p_msg_index => k, p_encoded => ‘F’);
fnd_file.put_line (fnd_file.LOG,
‘err msg ‘ || k || ‘ -> ‘ || gpr_msg_data
);
END LOOP;
p_return_status := ‘E’;
p_message := gpr_msg_data;
fnd_global.apps_initialize (g_user_id, g_resp_id, g_resp_appl_id);
ELSE
p_return_status := fnd_api.g_ret_sts_success;
p_message := ‘Kalem Belirtilen Fiyat Listesine Basari Ile Eklendi !’;
fnd_global.apps_initialize (g_user_id, g_resp_id, g_resp_appl_id);
END IF;
END price_add_p;
Kaan Sertaç Bozatlı
profesyonel kariyerine Oracle ERP Developer olarak devam etmektedir.
Mail: kbozatli@gmail.com
LinkedIn: Profili Görüntüleyin
Latest posts by Kaan Sertaç Bozatlı (see all)
- Satınalma Siparişinin Kapalı Statüsüne Getirilmesi (API) - 08 Şubat 2018
- Oracle ERP Alert Nasıl Silinir? - 13 Kasım 2017
- Oracle Kullanıcı Şifresi Sıfırlama - 06 Aralık 2015