-------------**********anonymous block for customer creation as group type*****--------------------
declare
p_group_rec HZ_PARTY_V2PUB.GROUP_REC_TYPE;
x_party_id NUMBER;
x_party_number VARCHAR2(200);
x_return_status VARCHAR2(200);
x_msg_count NUMBER;
x_msg_data VARCHAR2(200);
begin
p_group_rec.group_name:='xx_cust_group';
p_group_rec.group_type:='GROUP';
p_group_rec.created_by_module:='HZ_CPUI';
HZ_PARTY_V2PUB.create_group(
'T',
p_group_rec ,
x_party_id ,
x_party_number ,
x_return_status ,
x_msg_count ,
x_msg_data
);
IF x_return_status ='S'THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('Creation of Customer contact is Successful ');
DBMS_OUTPUT.PUT_LINE('Output information ....');
dbms_output.put_line('Cust contact point id = '||TO_CHAR(x_party_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 contact 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;
declare
p_group_rec HZ_PARTY_V2PUB.GROUP_REC_TYPE;
x_party_id NUMBER;
x_party_number VARCHAR2(200);
x_return_status VARCHAR2(200);
x_msg_count NUMBER;
x_msg_data VARCHAR2(200);
begin
p_group_rec.group_name:='xx_cust_group';
p_group_rec.group_type:='GROUP';
p_group_rec.created_by_module:='HZ_CPUI';
HZ_PARTY_V2PUB.create_group(
'T',
p_group_rec ,
x_party_id ,
x_party_number ,
x_return_status ,
x_msg_count ,
x_msg_data
);
IF x_return_status ='S'THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('Creation of Customer contact is Successful ');
DBMS_OUTPUT.PUT_LINE('Output information ....');
dbms_output.put_line('Cust contact point id = '||TO_CHAR(x_party_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 contact 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;
No comments:
Post a Comment