Standard API 开发示例

本文介绍了一种使用PL/SQL过程更新客户账户状态的方法。通过设置记录变量并调用特定的API来更新账户的状态,同时记录操作过程中产生的消息以便于后续的日志审查。
更新客户状态
 
--定义记录变量用来存放待更新或导入的值.

p_cust_account_rec hz_cust_account_v2pub.cust_account_rec_type;

--赋值


-- set value

 

-- set value

p_cust_account_rec.cust_account_id := cust_info.cust_account_id;

p_cust_account_rec.status :=

 

'A';

p_object_version_number := cust_info.object_version_number;

--调用API

 

 

--Call API

 

 

hz_cust_account_v2pub .update_cust_account

(

p_init_msg_list => FND_API.G_TRUE,

p_cust_account_rec => p_cust_account_rec,

p_object_version_number => p_object_version_number,

x_return_status => x_return_status,

x_msg_count => x_msg_count,

x_msg_data => x_msg_data

);

--返回消息


 

--Display message

 

 

 

 

ifx_msg_count>0

if

x_msg_count>0

x_msg_count>0

then

fnd_file.put_line(fnd_file.log,

 

'Record_number = '||to_char(rec_count));

fnd_file.put_line(fnd_file.log,

 

'Account_number = '||cust_info.account_number);

fnd_file.put_line(fnd_file.log,

 

'Return_status = '||substr(x_return_status,1,255));

fnd_file.put_line(fnd_file.log,

 

'Msg_count = '||to_char(x_msg_count));

fnd_file.put_line(fnd_file.log,

'Version_Number = '||to_char(p_object_version_number));

fnd_file.put_line(fnd_file.log,

'Msg_data = '||substr(x_msg_data,1,255));

 

endif;

 

ifx_msg_count >1then

 

forIin1..x_msg_countloop

fnd_file.put_line(fnd_file.log,i||

'.'||substr(fnd_msg_pub.get(p_encoded=> fnd_api.g_false ),1,255));

 

endloop;

 

endif;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值