OEBS API: Деактивация контрагента в HZ_PAPTIES (тип organization)
6 Октябрь 2014
Нет комментариев
Пример использования API для перевода контрагента (таблица HZ_PAPTIES) с типом «organization» в статус “Неактивно”:
declare p_party_id number := 2661479911; -- l_organization_rec HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE; l_party_rec HZ_PARTY_V2PUB.PARTY_REC_TYPE; l_object_version_number number; -- x_profile_id NUMBER; x_return_status VARCHAR2(1); x_msg_count NUMBER; x_msg_data VARCHAR2(4000); begin fnd_global.apps_initialize(-1, 20639, 200); --Диспетчер кредиторов - Кредиторы l_party_rec.party_id := p_party_id; l_party_rec.status := 'I'; l_organization_rec.party_rec := l_party_rec; select hp.object_version_number into l_object_version_number from hz_parties hp where hp.party_id = l_party_rec.party_id; HZ_PARTY_V2PUB.update_organization(p_init_msg_list => fnd_api.g_false, p_organization_rec => l_organization_rec, p_party_object_version_number => l_object_version_number, x_profile_id => x_profile_id, x_return_status => x_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data); dbms_output.put_line(x_return_status); if (x_return_status <> 'S') then fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false, p_count => x_msg_count, p_data => x_msg_data); dbms_output.put_line('ERROR update for party_id='||l_party_rec.party_id||':'); if x_msg_count = 1 then dbms_output.put_line(x_msg_data); else FOR i IN 1 .. x_msg_count LOOP dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false)); END LOOP; end if; end if; commit; end;
Categories: API, Oracle e-Business Suite API, contragent, HZ_PARTIES, HZ_PARTY_V2PUB, organization, status, update, update_organization
Последние комментарии