-- Set schema to apps
ALTER SESSION SET CURRENT_SCHEMA = APPS;
DECLARE
P_ORGANIZATION_REC APPS.HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
X_PROFILE_ID NUMBER;
X_RETURN_STATUS VARCHAR2(2000);
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2(2000);
P_OBJECT_VERSION_NUMBER NUMBER;
BEGIN
P_OBJECT_VERSION_NUMBER := 5; --<< OBJECT_NUMBER PROVIDED ON STEP 1.C
P_ORGANIZATION_REC.PARTY_REC.PARTY_ID := 22576670; --<< PARTY_ID PROVIDED ON STEP 1.C
P_ORGANIZATION_REC.PARTY_REC.STATUS := 'I';
P_ORGANIZATION_REC.CREATED_BY_MODULE := 'XXXXX';
APPS.HZ_PARTY_V2PUB.UPDATE_ORGANIZATION (
'T',
P_ORGANIZATION_REC,
P_OBJECT_VERSION_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_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;
/
------------------------------------
-- 3. COMMIT THE CHANGES
------------------------------------
COMMIT;
ALTER SESSION SET CURRENT_SCHEMA = APPS;
DECLARE
P_ORGANIZATION_REC APPS.HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
X_PROFILE_ID NUMBER;
X_RETURN_STATUS VARCHAR2(2000);
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2(2000);
P_OBJECT_VERSION_NUMBER NUMBER;
BEGIN
P_OBJECT_VERSION_NUMBER := 5; --<< OBJECT_NUMBER PROVIDED ON STEP 1.C
P_ORGANIZATION_REC.PARTY_REC.PARTY_ID := 22576670; --<< PARTY_ID PROVIDED ON STEP 1.C
P_ORGANIZATION_REC.PARTY_REC.STATUS := 'I';
P_ORGANIZATION_REC.CREATED_BY_MODULE := 'XXXXX';
APPS.HZ_PARTY_V2PUB.UPDATE_ORGANIZATION (
'T',
P_ORGANIZATION_REC,
P_OBJECT_VERSION_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_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;
/
------------------------------------
-- 3. COMMIT THE CHANGES
------------------------------------
COMMIT;
DECLARE
ReplyDeletel_party_rec apps.HZ_PARTY_V2PUB.PARTY_REC_TYPE;
l_organization_rec apps.HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
x_profile_id NUMBER;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
l_obj_ver_number VARCHAR2(10);
l_commit_cnt NUMBER:=0;
CURSOR l_inactive_parties IS
SELECT hp.party_id,hp.party_number,hp.status,
hp.party_name,hp.orig_system_reference,hp.object_version_number,hp.created_by_module
FROM ar.hz_parties hp,
ar.hz_cust_accounts hca
WHERE hp.status = 'I'
and hp.party_id = hca.party_id
and hp.party_number in (127653,127014,130185,154272,377972,405011,643231,645300);
BEGIN
Execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = APPS';
-- apps.mo_global.init('AR' );
-- apps.mo_global.set_org_context( 82,NULL,'AR');
-- apps.fnd_global.set_nls_context('AMERICAN');
--apps.mo_global.set_policy_context('S',82);
DBMS_OUTPUT.PUT_LINE('Party#|PartyName|OFS#|Error');
FOR l_rec in l_inactive_parties
LOOP
l_commit_cnt := l_commit_cnt + 1;
BEGIN
l_obj_ver_number := l_rec.object_version_number;
l_party_rec.party_id := l_rec.party_id;
l_party_rec.status := 'A';
l_organization_rec.created_by_module := l_rec.created_by_module;
l_organization_rec.party_rec := l_party_rec;
apps.hz_party_v2pub.update_organization ( apps.fnd_api.g_true ,
l_organization_rec,
l_obj_ver_number,
x_profile_id,
x_return_status,
x_msg_count,
x_msg_data
);
EXCEPTION
WHEN OTHERS THEN
x_msg_data := SUBSTR(SQLERRM,0,250);
END;
DBMS_OUTPUT.PUT_LINE(l_rec.party_number||'|'||
l_rec.party_name||'|'||
l_rec.orig_system_reference||'|'||
SUBSTR ( x_msg_data, 1, 255 ));
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error: '||SQLERRM );
END;
/