Wednesday, November 13, 2013

API Script to Update Cust Acct Sites

DECLARE
   l_init_msg_list           VARCHAR2 (1000) := FND_API.G_TRUE;
   l_cust_acct_site_rec      HZ_CUST_ACCOUNT_SITE_V2PUB.cust_acct_site_rec_type;
   l_return_status           VARCHAR2 (1000);
   l_object_version_number   NUMBER;
   l_msg_count               NUMBER;
   l_msg_data                VARCHAR2 (1000);
   L_SITE_USE_ID             NUMBER;
   p_cust_acct_site_id number;
   p_object_version_number number;

BEGIN
select cust_acct_site_id,
object_version_number
into p_cust_acct_site_id,p_object_version_number
from hz_cust_acct_sites_all where party_site_id=34190;

  l_cust_acct_site_rec.cust_acct_site_id := p_cust_acct_site_id;
  l_cust_acct_site_rec.attribute1:='N';
  l_object_version_number:=p_object_version_number;
  l_cust_acct_site_rec.attribute2:=1;
  l_cust_acct_site_rec.attribute3:=1;
  hz_cust_account_site_v2pub.update_cust_acct_site ('T',
                                                     l_cust_acct_site_rec,
                                                     l_object_version_number,
                                                     l_return_status,
                                                     l_msg_count,
                                                     l_msg_data);

   DBMS_OUTPUT.put_line (l_return_status ||':' ||l_msg_data);
   COMMIT;
END;

1 comment:

Sridevi Koduru said...
This comment has been removed by the author.