Saturday, December 11, 2021

API to Update Customer Sites and assign Tax code in Oracle apps

 

DECLARE

 x_return_status varchar2(10);

 l_init_msg_list VARCHAR2 (1000) := FND_API.G_TRUE;

 x_msg_count number(10);

 x_msg_data varchar2(1200);

 p_object_version_number number(10):=18;

 

 l_cust_site_use_rec APPS.hz_cust_account_site_v2pub.cust_site_use_rec_type;

 

 

 

begin

 

fnd_global.apps_initialize(61477,61595,222);

 dbms_output.put_line('API STARTED' );

    mo_global.set_policy_context('S',5674);

 fnd_profile.initialize(61470,61515,222);

 l_cust_site_use_rec.SITE_USE_ID:=264031;

 l_cust_site_use_rec.cust_acct_site_id:=225246;

 l_cust_site_use_rec.TAX_CODE := ‘XX_VAT_5';

 --l_cust_site_use_rec.status := 'I';

dbms_output.put_line('API STARTED EXECUTION' );

hz_cust_account_site_v2pub.update_cust_site_use(fnd_api.g_true,

l_cust_site_use_rec,

p_object_version_number,

 x_return_status,

 x_msg_count,

 x_msg_data);IF x_return_status = 'S' THEN

 dbms_output.put_line(' Now site use is active' );

 ELSE

 IF NVL (x_msg_count, 0) > 1 THEN

  FOR i IN 1 .. x_msg_count LOOP

  dbms_output.put_line(' Error Status ' ||x_return_status);

  dbms_output.put_line(Error message ' ||x_msg_data);

  END LOOP;

  ELSE

  dbms_output.put_line(' Error message ' ||x_msg_data);

  END IF;

  END IF;


  commit;

 

 exception when others then

  dbms_output.put_line(' Error Here'||sqlcode||sqlerrm);

  end;

No comments:

Post a Comment

SQL Important Queries

  How to delete rows with no where clause The following example deletes  all rows  from the  Person.Person  the table in the AdventureWork...