有时,开发需求需要创建AR收款并且核销AR事务处理一起完成,Oracle EBS官方提供如API方法:Ar_Receipt_Api_Pub.Create_And_Apply。
实例代码如下:
DECLARE
Lv_Ret_Status VARCHAR2(1);
Ln_Msg_Count NUMBER;
Lv_Msg_Data VARCHAR2(240);
Ln_Cash_Receipt_Id NUMBER; --收款标识
--收款说明弹性域
Lt_Rec_Att Ar_Receipt_Api_Pub.Attribute_Rec_Type;
--收款全局说明弹性域
Lt_Rec_Gatt Ar_Receipt_Api_Pub.Global_Attribute_Rec_Type;
--核销行说明弹性域
Lt_App_Att Ar_Receipt_Api_Pub.Attribute_Rec_Type;
--核销行全局说明弹性域
Lt_App_Gatt Ar_Receipt_Api_Pub.Global_Attribute_Rec_Type;
BEGIN
-- 1) Set the applications context
Fnd_Global.Apps_Initialize(User_Id => 18585
,Resp_Id => 50660
,Resp_Appl_Id => 222);
Mo_Global.Init('AR');
Mo_Global.Set_Policy_Context('S', 81);
--Call Api
Ar_Receipt_Api_Pub.Create_And_Apply(p_Api_Version => 1.0