DECLARE
lv_return_status VARCHAR2 (1);
lv_msg_count NUMBER;
lv_msg_data VARCHAR2 (20000);
lv_resp_name VARCHAR2 (100) := 'Oracle Trade Management User';
lv_user_name VARCHAR2 (100) := 'SYED';
lv_appl_id NUMBER;
lv_resp_id NUMBER;
lv_user_id NUMBER;
lv_org_id NUMBER;
lv_claim_id NUMBER;
lv_child_claim_tbl ozf_claim_pub.split_claim_tbl_type;
BEGIN
SELECT application_id,
responsibility_id
INTO lv_appl_id,
lv_resp_id
FROM fnd_responsibility_vl
WHERE responsibility_name = lv_resp_name;
SELECT user_id
INTO lv_user_id
FROM fnd_user
WHERE user_name = lv_user_name;
fnd_global.apps_initialize (lv_user_id,
lv_resp_id,
lv_appl_id
);
mo_global.init ('OZF');
mo_global.set_policy_context ('S', '85');
fnd_msg_pub.g_msg_level_threshold := 1;
lv_claim_id := 229600;
lv_child_claim_tbl (1).amount := 5000;
ozf_claim_pub.create_split_claims (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => lv_return_status,
x_msg_data => lv_msg_data,
x_msg_count => lv_msg_count,
p_parent_claim_id => lv_claim_id,
px_child_claim_tbl => lv_child_claim_tbl
);
DBMS_OUTPUT.put_line ( 'lv_return_status Main:'
|| lv_return_status);
IF lv_return_status = 'S'
THEN
DBMS_OUTPUT.put_line ('Split Claims Created');
DBMS_OUTPUT.put_line ( 'lv_return_status :'
|| lv_return_status);
FOR j IN 1 .. lv_child_claim_tbl.COUNT
LOOP
DBMS_OUTPUT.put_line ( 'Split Claim ID : '
|| lv_child_claim_tbl (j).split_claim_id);
END LOOP;
ELSE
DBMS_OUTPUT.put_line ('API Execution failed ');
DBMS_OUTPUT.put_line ( 'lv_return_status :'
|| lv_return_status);
END IF;
fnd_msg_pub.count_and_get (p_encoded => fnd_api.g_false,
p_count => lv_msg_count,
p_data => lv_msg_data
);
FOR i IN 1 .. lv_msg_count
LOOP
DBMS_OUTPUT.put_line (SUBSTR (fnd_msg_pub.get (p_msg_index => i, p_encoded => 'F'),
1,
254
));
END LOOP;
END;
lv_return_status VARCHAR2 (1);
lv_msg_count NUMBER;
lv_msg_data VARCHAR2 (20000);
lv_resp_name VARCHAR2 (100) := 'Oracle Trade Management User';
lv_user_name VARCHAR2 (100) := 'SYED';
lv_appl_id NUMBER;
lv_resp_id NUMBER;
lv_user_id NUMBER;
lv_org_id NUMBER;
lv_claim_id NUMBER;
lv_child_claim_tbl ozf_claim_pub.split_claim_tbl_type;
BEGIN
SELECT application_id,
responsibility_id
INTO lv_appl_id,
lv_resp_id
FROM fnd_responsibility_vl
WHERE responsibility_name = lv_resp_name;
SELECT user_id
INTO lv_user_id
FROM fnd_user
WHERE user_name = lv_user_name;
fnd_global.apps_initialize (lv_user_id,
lv_resp_id,
lv_appl_id
);
mo_global.init ('OZF');
mo_global.set_policy_context ('S', '85');
fnd_msg_pub.g_msg_level_threshold := 1;
lv_claim_id := 229600;
lv_child_claim_tbl (1).amount := 5000;
ozf_claim_pub.create_split_claims (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => lv_return_status,
x_msg_data => lv_msg_data,
x_msg_count => lv_msg_count,
p_parent_claim_id => lv_claim_id,
px_child_claim_tbl => lv_child_claim_tbl
);
DBMS_OUTPUT.put_line ( 'lv_return_status Main:'
|| lv_return_status);
IF lv_return_status = 'S'
THEN
DBMS_OUTPUT.put_line ('Split Claims Created');
DBMS_OUTPUT.put_line ( 'lv_return_status :'
|| lv_return_status);
FOR j IN 1 .. lv_child_claim_tbl.COUNT
LOOP
DBMS_OUTPUT.put_line ( 'Split Claim ID : '
|| lv_child_claim_tbl (j).split_claim_id);
END LOOP;
ELSE
DBMS_OUTPUT.put_line ('API Execution failed ');
DBMS_OUTPUT.put_line ( 'lv_return_status :'
|| lv_return_status);
END IF;
fnd_msg_pub.count_and_get (p_encoded => fnd_api.g_false,
p_count => lv_msg_count,
p_data => lv_msg_data
);
FOR i IN 1 .. lv_msg_count
LOOP
DBMS_OUTPUT.put_line (SUBSTR (fnd_msg_pub.get (p_msg_index => i, p_encoded => 'F'),
1,
254
));
END LOOP;
END;
No comments:
Post a Comment