-----------******anonymous block for customer creaton organization type*******----------------
declare
p_organization_rec hz_party_v2pub.organization_rec_type;
x_return_status varchar2(200);
x_msg_count number;
x_msg_data varchar2(200);
x_party_id number;
x_party_number number;
x_profile_id number;
begin
p_organization_rec.organization_name :='xx_org_rel_test123';
p_organization_rec.created_by_module :='TCA_FORM_WRAPPER';
hz_party_v2pub.create_organization ('T',
p_organization_rec,
x_return_status,
x_msg_count,
x_msg_data,
x_party_id,
x_party_number,
x_profile_id );
IF x_return_status ='S' THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('Creation of Customer Profile is Successful ');
DBMS_OUTPUT.PUT_LINE('Output information ....');
dbms_output.put_line('Cust party Id = '||TO_CHAR(x_party_id));
dbms_output.put_line('Cust party number = '||TO_CHAR(x_party_number));
dbms_output.put_line('Cust profile Id = '||x_profile_id);
dbms_output.put_line('Return Status Of Api = '||x_return_status);
dbms_output.put_line('No of err msgs = '||x_msg_count);
dbms_output.put_line('err information = '||x_msg_data);
ELSE
DBMS_OUTPUT.put_line ('Creation of Customer Profile got failed:'||x_msg_data);
ROLLBACK;
FOR i IN 1 .. x_msg_count
LOOP
x_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');
dbms_output.put_line( i|| ') '|| x_msg_data);
END LOOP;
END IF;
DBMS_OUTPUT.PUT_LINE('Completion of API');
end;
Awesome Post.
ReplyDeleteReally Useful