使用ABSL的日记帐凭证未保存

2020-08-19 04:19发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家们,

我有一个ABSL来创建日记帐凭证,我尝试调试并执行代码,但没有保存。 下面是代码。

关于

威尔逊

导入ABSL;
 将AP.Common.GDT导入为apCommonGDT;
 导入AP.FinancialAccounting.Global;


 var accountingEntryData:AccountingEntry的元素;
 accountingEntryData.AccountingClosingStepCode =" 010";
 accountingEntryData.AccountingDocumentTypeCode =" 00047";
 accountingEntryData.BusinessTransactionTypeCode =" 601";


 accountingEntryData.CompanyID =" 21200";
 accountingEntryData.EntryDate = ABSL:Date.ParseFromString(" 2020-05-11");
 accountingEntryData.PostingDate = ABSL:Date.ParseFromString(" 2020-05-11");
 accountingEntryData.TransactionCurrencyCode =" PHP";
 accountingEntryData.Note.languageCode = ABSL:LanguageCode.ParseFromString(" EN");
 accountingEntryData.Note.content ="硬币ID";


 var accountingEntry = AccountingEntry.Create(accountingEntryData);

 var accountingEntryItemData1:AccountingEntry.Item的元素;
 var accountingCodingBlockTypeCode:AccountingCodingBlockTypeCode;
 accountingCodingBlockTypeCode.content =" ACC";
 accountingEntryItemData1.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData1.ChartOfAccountsItemCode.content =" 4000";
 accountingEntryItemData1.DebitCreditCode =" 1";
 accountingEntryItemData1.TransactionCurrencyAmount.content = 150;
 accountingEntry.Item.Create(accountingEntryItemData1);


 var accountingEntryItemData2:AccountingEntry.Item的元素;
 accountingEntryItemData2.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData2.ChartOfAccountsItemCode.content =" 00011000";


 accountingEntryItemData2.DebitCreditCode =" 2";


 accountingEntryItemData2.TransactionCurrencyAmount.content =(-1 * 100);


 accountingEntry.Item.Create(accountingEntryItemData2);


 var accountingEntryItemData3:AccountingEntry.Item的元素;
 accountingEntryItemData3.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData3.ChartOfAccountsItemCode.content =" 111101";


 accountingEntryItemData3.DebitCreditCode =" 2";


 accountingEntryItemData3.TransactionCurrencyAmount.content =(-1 * 50);


 accountingEntry.Item.Create(accountingEntryItemData3);

 accountingEntry.SubmitForPosting();
 accountingEntry.Post(); 

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家们,

我有一个ABSL来创建日记帐凭证,我尝试调试并执行代码,但没有保存。 下面是代码。

关于

威尔逊

导入ABSL;
 将AP.Common.GDT导入为apCommonGDT;
 导入AP.FinancialAccounting.Global;


 var accountingEntryData:AccountingEntry的元素;
 accountingEntryData.AccountingClosingStepCode =" 010";
 accountingEntryData.AccountingDocumentTypeCode =" 00047";
 accountingEntryData.BusinessTransactionTypeCode =" 601";


 accountingEntryData.CompanyID =" 21200";
 accountingEntryData.EntryDate = ABSL:Date.ParseFromString(" 2020-05-11");
 accountingEntryData.PostingDate = ABSL:Date.ParseFromString(" 2020-05-11");
 accountingEntryData.TransactionCurrencyCode =" PHP";
 accountingEntryData.Note.languageCode = ABSL:LanguageCode.ParseFromString(" EN");
 accountingEntryData.Note.content ="硬币ID";


 var accountingEntry = AccountingEntry.Create(accountingEntryData);

 var accountingEntryItemData1:AccountingEntry.Item的元素;
 var accountingCodingBlockTypeCode:AccountingCodingBlockTypeCode;
 accountingCodingBlockTypeCode.content =" ACC";
 accountingEntryItemData1.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData1.ChartOfAccountsItemCode.content =" 4000";
 accountingEntryItemData1.DebitCreditCode =" 1";
 accountingEntryItemData1.TransactionCurrencyAmount.content = 150;
 accountingEntry.Item.Create(accountingEntryItemData1);


 var accountingEntryItemData2:AccountingEntry.Item的元素;
 accountingEntryItemData2.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData2.ChartOfAccountsItemCode.content =" 00011000";


 accountingEntryItemData2.DebitCreditCode =" 2";


 accountingEntryItemData2.TransactionCurrencyAmount.content =(-1 * 100);


 accountingEntry.Item.Create(accountingEntryItemData2);


 var accountingEntryItemData3:AccountingEntry.Item的元素;
 accountingEntryItemData3.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData3.ChartOfAccountsItemCode.content =" 111101";


 accountingEntryItemData3.DebitCreditCode =" 2";


 accountingEntryItemData3.TransactionCurrencyAmount.content =(-1 * 50);


 accountingEntry.Item.Create(accountingEntryItemData3);

 accountingEntry.SubmitForPosting();
 accountingEntry.Post(); 
付费偷看设置
发送
5条回答
callcenter油条
1楼 · 2020-08-19 04:37.采纳回答

你好,

调试时是否有任何错误或警告消息?

如何进行一些更改并尝试这样操作。 我们可以使用以下逻辑成功创建。

导入ABSL;
 将AP.Common.GDT导入为apCommonGDT;
 导入AP.FinancialAccounting.Global;




 var accountingEntryData:AccountingEntry的元素;

 accountingEntryData.Note.languageCode = ABSL:LanguageCode.ParseFromString(" EN");
 accountingEntryData.Note.content ="硬币ID";
//首先创建根
 var accountingEntry = AccountingEntry.Create(accountingEntryData);

 accountingEntry.AccountingClosingStepCode =" 010";
 accountingEntry.AccountingDocumentTypeCode =" 00047";
 accountingEntry.BusinessTransactionTypeCode =" 601";


 accountingEntry.CompanyID =" 21200";
//accountingEntry.EntryDate = ABSL:Date.ParseFromString(" 2020-05-11");
//accountingEntry.PostingDate = ABSL:Date.ParseFromString(" 2020-05-11");
 accountingEntry.TransactionCurrencyCode =" PHP";

 var accountingEntryItemData1:AccountingEntry.Item的元素;
 var accountingCodingBlockTypeCode:AccountingCodingBlockTypeCode;
 accountingCodingBlockTypeCode.content =" ACC";
 accountingEntryItemData1.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData1.ChartOfAccountsItemCode.content =" 4000";
 accountingEntryItemData1.DebitCreditCode =" 1";
 accountingEntryItemData1.TransactionCurrencyAmount.content = 150;
 accountingEntry.Item.Create(accountingEntryItemData1);




 var accountingEntryItemData2:AccountingEntry.Item的元素;
 accountingEntryItemData2.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData2.ChartOfAccountsItemCode.content =" 00011000";




 accountingEntryItemData2.DebitCreditCode =" 2";




 accountingEntryItemData2.TransactionCurrencyAmount.content =(-1 * 100);




 accountingEntry.Item.Create(accountingEntryItemData2);




 var accountingEntryItemData3:AccountingEntry.Item的元素;
 accountingEntryItemData3.AccountingCodingBlockTypeCode = accountingCodingBlockTypeCode;
 accountingEntryItemData3.ChartOfAccountsItemCode.content =" 111101";




 accountingEntryItemData3.DebitCreditCode =" 2";




 accountingEntryItemData3.TransactionCurrencyAmount.content =(-1 * 50);




 accountingEntry.Item.Create(accountingEntryItemData3);

 accountingEntry.SubmitForPosting();
 accountingEntry.Post();
 

问候,

May

clever101
2楼-- · 2020-08-19 04:42

嗨威尔逊,

您是否已在UI设置(绑定位置)上选中了此复选框 按钮)。

此致

可能

太Q了
3楼-- · 2020-08-19 04:35

嗨,约翰,

请检查以下内容:

1。 您是否可以通过ByD UI添加具有相同数据的日记帐凭证? 这是为了检查数据的有效性。 如果没有,请修正数据。

2。 要发布日记帐凭证或保存任何数据,您的absl代码应在BeforeSave()或OnSave()事件中执行,或调用BO的保存操作,这些操作将最终在当前BO实例中准备的所有数据结构保存到数据库中。 如果不对当前BO实例进行任何保存操作,则不会有任何数据到达数据库。

Yatsea的致谢

灬番茄
4楼-- · 2020-08-19 04:49

Yatsea的嗨,

谢谢。

95年老男孩
5楼-- · 2020-08-19 04:51

嗨,May/Yatsea,

感谢您的所有评论。 现在可以解决。

一周热门 更多>