Friday, 30 November 2018

Oracle party merge api:Sample PLSQL code for Merging the Two Parties in Oracle Apps

Oracle party merge api

In this post , We will be discuss about Oracle party merge api. In Party Merge , there could be a merging of many other business level Entities Like as per my previous example Party A has both Supplier and Customer so if we will do the Merging of This Party A Both supplier A and Customer A will be merged to another Party B. To Learn more about Party Merge Click Here. Here below is the API to merge parties in oracle apps.
 
 
Oracle party merge api
 

Sample PLSQL code for Oracle party merge api

Declare
l_batch_party_id NUMBER;
l_batch_id NUMBER;
l_from_party_id NUMBER;
l_to_party_id NUMBER;
BEGIN
/* Here below we are extracting the Party informations for Merging these two Parties */
SELECT hz_merge_parties_s.nextval
INTO l_batch_party_id
FROM dual;
BEGIN
SELECT batch_id
INTO l_batch_id
FROM hz_merge_batch
WHERE orig_system_reference=p_batch_id;
SELECT party_id
INTO l_from_party_id
FROM hz_parties
WHERE orig_system_reference = p_from_party_num;
SELECT party_id
INTO l_to_party_id
FROM hz_parties
WHERE orig_system_reference = p_to_party_num;
EXCEPTION
WHEN OTHERS THEN
oracle_error('Party Information Extraction Error. ' || p_from_party_num
||' ' || p_to_party_num);
END;
INSERT INTO hz_merge_parties
( BATCH_PARTY_ID
,BATCH_ID
,MERGE_TYPE
,FROM_PARTY_ID
,TO_PARTY_ID
,MERGE_REASON_CODE
,MERGE_STATUS
,CREATED_BY
,CREATION_DATE
,LAST_UPDATE_LOGIN
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,ORIG_SYSTEM_REFERENCE )
VALUES( l_batch_party_id
,l_batch_id
,p_merge_type
,l_from_party_id
,l_to_party_id
,p_merge_reason_code
,p_merge_status
,'0'
,SYSDATE
,'0'
,SYSDATE
,'0'
,p_batch_party_id );
COMMIT;
oracle_error('Party Merge success!', 'atch Party ID: ' || p_batch_party_id );
EXCEPTION
WHEN OTHERS THEN
oracle_error('Party Merge Error Out', 'Orig Batch Party ID: ' || p_batch_party_id || ' ' || sqlerrm);
END;
 

1 comments:

Rifath said...

Such a pleasant blog, I truly like what you write in this blog, I additionally have some significant Information like your blog.
Oracle Fusion HCM Online Training
Oracle Fusion Financials Online Training

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *