Beruflich Dokumente
Kultur Dokumente
accounts-----------------------DECLARE
p_cust_account_rec
p_organization_rec
p_customer_profile_rec
x_cust_account_id
x_account_number
x_party_id
x_party_number
x_profile_id
x_return_status
x_msg_count
x_msg_data
BEGIN
hz_cust_account_v2pub.cust_account_rec_type;
hz_party_v2pub.organization_rec_type;
hz_customer_profile_v2pub.customer_profile_rec_type;
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
fnd_global.apps_initialize (1318,50559,222);
p_cust_account_rec.account_name := 'Satya Tech';
-- p_cust_account_rec.account_number :='12345';
p_cust_account_rec.status := 'A';
p_cust_account_rec.created_by_module := 'HZ_CPUI';
--------------------mandatory field
p_customer_profile_rec.profile_class_id := 0;
p_customer_profile_rec.created_by_module := 'HZ_CPUI';
p_organization_rec.organization_name := 'sesh_org';
--------------------mandatory field
p_organization_rec.created_by_module := 'HZ_CPUI';
hz_cust_account_v2pub.create_cust_account ('T',
p_cust_account_rec,
p_organization_rec,
p_customer_profile_rec,
'F',
x_cust_account_id,
x_account_number,
x_party_id,
x_party_number,
x_profile_id,
x_return_status,
x_msg_count,
x_msg_data
);
DBMS_OUTPUT.put_line ('***************************');
DBMS_OUTPUT.put_line ('Output information ....');
DBMS_OUTPUT.put_line ('x_cust_account_id: ' || x_cust_account_id);
DBMS_OUTPUT.put_line ('x_account_number: ' || x_account_number);
DBMS_OUTPUT.put_line ('x_party_id: ' || x_party_id);
DBMS_OUTPUT.put_line ('x_party_number: ' || x_party_number);
DBMS_OUTPUT.put_line ('x_profile_id: ' || x_profile_id);
DBMS_OUTPUT.put_line ('x_return_status: ' || x_return_status);
DBMS_OUTPUT.put_line ('x_msg_count: ' || x_msg_count);
DBMS_OUTPUT.put_line ('x_msg_data: ' || x_msg_data);
DBMS_OUTPUT.put_line ('***************************');
END;
/
COMMIT ;
***************************
END;
/
***************************
Output information ....
p_location_rec.address1:addr1_sw
x_location_id: 18779
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
SELECT * FROM hz_locations where location_id=19881;
--------------------u cannot see the address location output in applications fro
ntend now, after creating site only u can see it-----------------------------------
hz_party_site_v2pub.party_site_rec_type;
NUMBER;
VARCHAR2 (2000);
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
fnd_global.apps_initialize (1318,50559,222);
p_party_site_rec.party_id := 402680;
p_party_site_rec.location_id := 26395;
-- p_party_site_rec.party_site_number:= 98989898;
p_party_site_rec.identifying_address_flag := 'Y';
p_party_site_rec.created_by_module := 'HZ_CPUI';
hz_party_site_v2pub.create_party_site ('T',
p_party_site_rec,
x_party_site_id,
x_party_site_number,
x_return_status,
x_msg_count,
x_msg_data
);
DBMS_OUTPUT.put_line ('***************************');
DBMS_OUTPUT.put_line ('Output information ....');
DBMS_OUTPUT.put_line ('x_party_site_id: ' || x_party_site_id);
DBMS_OUTPUT.put_line ('x_party_site_number: ' || x_party_site_number);
DBMS_OUTPUT.put_line ('x_return_status: ' || x_return_status);
DBMS_OUTPUT.put_line ('x_msg_count: ' || x_msg_count);
DBMS_OUTPUT.put_line ('x_msg_data: ' || x_msg_data);
DBMS_OUTPUT.put_line ('***************************');
END;
/
COMMIT ;
***************************
Output information ....
x_party_site_id: 29276
x_party_site_number: 17697
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
SELECT * FROM
---------------------DECLARE
p_cust_acct_site_rec
x_return_status
x_msg_count
x_msg_data
x_cust_acct_site_id
BEGIN
hz_cust_account_site_v2pub.cust_acct_site_rec_type;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
NUMBER;
fnd_global.apps_initialize (1318,50559,222);
p_cust_acct_site_rec.cust_account_id := 117735;
p_cust_acct_site_rec.party_site_id := 222632;
-- p_cust_acct_site_rec.LANGUAGE := 'US';
p_cust_acct_site_rec.created_by_module := 'HZ_CPUI';
hz_cust_account_site_v2pub.create_cust_acct_site ('T',
p_cust_acct_site_rec,
x_cust_acct_site_id,
x_return_status,
x_msg_count,
x_msg_data
);
DBMS_OUTPUT.put_line ('***************************');
DBMS_OUTPUT.put_line ('Output information ....');
DBMS_OUTPUT.put_line ('x_cust_acct_site_id: ' || x_cust_acct_site_id);
DBMS_OUTPUT.put_line ('x_return_status: ' || x_return_status);
DBMS_OUTPUT.put_line ('x_msg_count: ' || x_msg_count);
DBMS_OUTPUT.put_line ('x_msg_data: ' || x_msg_data);
DBMS_OUTPUT.put_line ('***************************');
END;
/
COMMIT ;
***************************
Output information ....
x_cust_acct_site_id: 7697
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
SELECT * FROM hz_cust_acct_sites_all where cust_account_id=26309;
----------------------------------now u can see the address location output in a
pplications frontend-----------------------------------------step 5 ------------------for creating records in hz_cust_site_uses_all-----------------------------DECLARE
p_cust_site_use_rec
p_customer_profile_rec
xbillto_site_use_id
x_site_use_id
x_return_status
x_msg_count
x_msg_data
BEGIN
hz_cust_account_site_v2pub.cust_site_use_rec_type;
hz_customer_profile_v2pub.customer_profile_rec_type;
NUMBER;
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
fnd_global.apps_initialize (1318,50559,222);
p_cust_site_use_rec.cust_acct_site_id := 11275;
p_cust_site_use_rec.site_use_code := 'BILL_TO';
p_cust_site_use_rec.location:='same billto n shipto'; ----in place of number
we can specify location name ---optional
p_cust_site_use_rec.created_by_module := 'HZ_CPUI';
hz_cust_account_site_v2pub.create_cust_site_use ('T',
p_cust_site_use_rec,
p_customer_profile_rec,
'',
'',
x_site_use_id,
x_return_status,
x_msg_count,
x_msg_data
);
DBMS_OUTPUT.put_line ('***************************');
DBMS_OUTPUT.put_line ('Output information ....');
DBMS_OUTPUT.put_line ('p_cust_site_use_rec.location for Bill_To: ' || p_cust_
site_use_rec.location);
DBMS_OUTPUT.put_line ('x_site_use_id: ' || x_site_use_id);
DBMS_OUTPUT.put_line ('x_return_status: ' || x_return_status);
DBMS_OUTPUT.put_line ('x_msg_count: ' || x_msg_count);
DBMS_OUTPUT.put_line ('x_msg_data: ' || x_msg_data);
DBMS_OUTPUT.put_line ('***************************');
/* p_cust_site_use_rec.cust_acct_site_id := 8071;
p_cust_site_use_rec.site_use_code := 'SHIP_TO';
p_cust_site_use_rec.bill_to_site_use_id := x_site_use_id; --billto_site_use_i
d
p_cust_site_use_rec.created_by_module := 'RECEIVABLES';
hz_cust_account_site_v2pub.create_cust_site_use ('T',
p_cust_site_use_rec,
p_customer_profile_rec,
'',
'',
x_site_use_id,
x_return_status,
x_msg_count,
x_msg_data
);
DBMS_OUTPUT.put_line ('***************************');
DBMS_OUTPUT.put_line ('Output information ....');
DBMS_OUTPUT.put_line ('x_site_use_id: ' || x_site_use_id);
DBMS_OUTPUT.put_line ('x_return_status: ' || x_return_status);
DBMS_OUTPUT.put_line ('x_msg_count: ' || x_msg_count);
DBMS_OUTPUT.put_line ('x_msg_data: ' || x_msg_data);
DBMS_OUTPUT.put_line ('***************************'); */
END;
/
COMMIT ;
***************************
Output information ....
p_cust_site_use_rec.location for Bill_To: same billto n shipto
x_site_use_id: 10027
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
***************************
Output information ....
x_site_use_id: 10028
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
select * from hz_cust_site_uses_all where cust_acct_site_id=8030;
-----------------------------------------------------end of creating cust detail
s--------------------------------------------------------====================NOT NECESSARY========================================
Step 6 ------------------for creating contact in hz_parties at site-level----------------DECLARE
p_create_person_rec
x_party_id
x_party_number
x_profile_id
x_return_status
x_msg_count
x_msg_data
BEGIN
hz_party_v2pub.person_rec_type;
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
***************************
SELECT * FROM hz_parties where party_id=67493;
-- In this back-end approach when u create a contact as above, u will get extra
record whose party_type is person in hz_parties table
where as if u do in front-end u will not get that record created in hz_parties t
able */
--------u cannot see the contacts now, it can be seen after creating cust_accoun
t_roles in applications frontend------------------------
step 7
DECLARE
p_org_contact_rec
x_org_contact_id
x_party_rel_id
x_party_id
x_party_number
x_return_status
x_msg_count
x_msg_data
BEGIN
hz_party_contact_v2pub.org_contact_rec_type;
NUMBER;
NUMBER;
NUMBER;
VARCHAR2 (2000);
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
END;
/
COMMIT;
***************************
Output information ....
x_org_contact_id: 18231
x_party_rel_id: 18479
x_party_id: 67494
x_party_number: 32473
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
SELECT * FROM hz_parties WHERE TRUNC(creation_date)=TRUNC(SYSDATE);
SELECT * FROM HZ_RELATIONSHIPS WHERE TRUNC(creation_date)=TRUNC(SYSDATE);
SELECT * FROM HZ_ORG_CONTACTS WHERE TRUNC(creation_date)=TRUNC(SYSDATE);
hz_cust_account_role_v2pub.cust_account_role_rec_typ
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
x_return_status,
x_msg_count,
x_msg_data
);
('***************************');
('Output information ....');
('x_cust_account_role_id: ' || x_cust_account_role_id);
('x_return_status: ' || x_return_status);
('x_msg_count: ' || x_msg_count);
('x_msg_data: ' || x_msg_data);
('***************************');
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
END;
/
COMMIT;
***************************
Output information ....
x_cust_account_role_id: 13344
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
hz_contact_point_v2pub.contact_point_rec_type;
hz_contact_point_v2pub.phone_rec_type;
hz_contact_point_v2pub.edi_rec_type;
hz_contact_point_v2pub.email_rec_type;
hz_contact_point_v2pub.telex_rec_type;
hz_contact_point_v2pub.web_rec_type;
NUMBER;
VARCHAR2 (2000);
NUMBER;
VARCHAR2 (2000);
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
DBMS_OUTPUT.put_line
END;
/
COMMIT;
p_telex_rec_type,
p_web_rec_type,
x_contact_point_id,
x_return_status,
x_msg_count,
x_msg_data
);
('***************************');
('Output information ....');
('x_contact_point_id: ' || x_contact_point_id);
('x_return_status: ' || x_return_status);
('x_msg_count: ' || x_msg_count);
('x_msg_data: ' || x_msg_data);
('***************************');
***************************
Output information ....
x_contact_point_id: 28175
x_return_status: S
x_msg_count: 0
x_msg_data:
***************************
SELECT * FROM HZ_CONTACT_POINTS WHERE TRUNC(creation_date)=TRUNC(SYSDATE);
================================================================================
==========================================