CURSOR cur_lines
IS SELECT requisition_header_id,
FROM po_requisition_lines_all
WHERE cancel_flag='N'
and requisition_header_id=57199;
l_return_status VARCHAR2 (1000);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (1000);
lv_header_id po_tbl_number;
lv_line_id po_tbl_number;
m NUMBER := NULL;
l_msg_dummy VARCHAR2 (2000);
l_output VARCHAR2 (2000);
BEGIN
FND_GLOBAL.APPS_INITIALIZE (1318,50578,201);
m := 1;
FOR rec_lines IN cur_lines
LOOP
lv_header_id := po_tbl_number (rec_lines.requisition_header_
lv_line_id := po_tbl_number (rec_lines.requisition_line_
po_req_document_cancel_grp.
(p_api_version => 1.0,
p_req_header_id => lv_header_id,
p_req_line_id => lv_line_id,
p_cancel_date => SYSDATE,
p_cancel_reason => 'Cancelled Requisition',
p_source => 'REQUISITION',
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data
);
DBMS_OUTPUT.put_line (l_return_status);
IF l_return_status <> 'S'
THEN
fnd_msg_pub.get (m, fnd_api.g_false, l_msg_data, l_msg_dummy);
l_output := (TO_CHAR (m) || ': ' || l_msg_data);
DBMS_OUTPUT.put_line (l_output);
END IF;
END LOOP;
COMMIT;
END;
No comments:
Post a Comment