cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an instance of BO AccountingDocument programmaticly in ByD?

abelousov
Active Participant
0 Kudos

Hi,

It seems there is not Create method in BO AccountingDocument. So, How can I create an instance in ABSL?

We found a Web service ManageJounalEntryIn in ByD Service Explorer (Application and User Management Work Center).

However, there is not the Web service in SAP Cloud Applications Studio in Repository Explorer.

Please, could you help us?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Aleksei,

yes, Horst is right. If you want to create accounting documents, you need to start with the business transaction. Please check if the

Business Object AccountingEntry is what you were looking for. This Business Object creates Journal Entry Vouchers. If you have different requirements, please share more details.

Best regards
Marlene.

Answers (2)

Answers (2)

abelousov
Active Participant
0 Kudos

Thank you, Marlene,

As far as I can see we can use BO AccountingEntry (Journal Entry Voucher) for that purpose. If I am not mistaken it does the same what BO AccountingDocument does - creates a new accounting entry in the accounting journal.

In our case, we have invoices where the gross amount value is different from the exact value (=quantity*price*(1*tax%) - it is rounded in some irregular way (it is supposed to be input manually).

If invoices let negative items we could just create one more item in the invoice - for the rounding difference (negative or positive)

For now, we have found some work around by creating a Credit Memo for each invoice, quite complicated way, though.

Thank you.

Aleksei

former_member535186
Participant
0 Kudos

Hi experts,b

I can't add entry to AccountingEntry BO,

i have an action in custom business object called Post, using data in elements of BO i want to create manual journal entry voucher i have tried to create instance in accounting Entry but errors says that elements is read only.

Do i have to create instance in another BO, please support

Regards,

  //Get all Accounting Entires on the system 
var qry = AccountingDocument.QueryByElements.Execute();
if (qry.Count() == 0 ) { Root.ID.content = "1" ; Root.CompanyUUID = "AREEGY" ; Root.PostingDate = "12/11/2017";
Root.AccountingDocumentTypeCode = "00047" ;
Root.BusinessTransactionTypeCode = "601" ;
Root.TransactionCurrencyCode = "EGP" ;
NewIns = AccountingEntry.CreateWithReference(Root) ;
VVancalbergh
Contributor
0 Kudos

Motaz, First of all CompanyUUID expects an UUID. You're giving it a normal ID.

Secondly AccountingEntry is in Deployment Unit "Financial". You cannot write across Deployment Units, you have to use an "Internal Communication" object for that or a web service call. You will probably also need to create a BO that is IN Deployment Unit "Financial".

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Aleksei,

As the documenation of an AccountingDOcument states:

  • A representation of changes to values of general ledger and subledger accounts resulting from a business transaction and relating to a company and a set of books.

it is the result of transactions. It can not manually be created or maintained. The system takes care of that.
Of course you can query for it retrieve the data.

HTH,
. Horst

0 Kudos

Hi Horst,

I have been trying to retrieve or query an accounting document instance using its ID and fiscal year. It never worked although it gave me the result in the repository explorer. Can you help me with that? Please see the code below.

var query = AccountingDocument.QueryByElements;

var sel_par = query.CreateSelectionParams();

sel_par.Add(query.ID.content, "I", "EQ", this.ID_JE.content);

sel_par.Add(query.FiscalYearID, "I", "EQ", this.fiscal_yr);

result = query.Execute(sel_par);

Here the result is empty.

Thanks,

Neenu

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Neenu,

Sometimes an ID has leading zeros which are not handled as expected.

Try first with only the fiscal year and compare the returned ID with the value from "this.ID_JE.content"

HTH,
. Horst

0 Kudos

Hi Horst,

This is weird. I tried passing fiscal year alone still no results. I can see that the leading zeroes are already added by the system.

Thanks,

Neenu

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Neenu,

Can your provide the example using the Repository Explorer (which returns some result) together with the data for the ABSL code (which does not)?

Bye,
. Horst