cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Journal Entry ID after saving the Outgoing Check in SAP Applications Studio

Hi Experts,

I want to get the Journal Entry ID after saving the Outgoing Check in SAP Applications Studio, I am using the aftermodify script in PaymentOrder XBO. The Journal Entry ID is supposed to be in the AccountingDocument Node but upon debugging the node is always returning "the object is not set", is there a way for me to get the Journal Entry ID in the script that I've created?

Here are some images for your reference:

Above is the image of the Journal Entry ID that I wanted to get in the script and below is the code in my script, as you can see I am trying to check if the AccountingDocument is set. If it is set then I will get the Journal Entry ID and store it in the variable sample. The problem is that the AccountingDocument is always empty but after debugging I checked the Outgoing Check and saw that there is a Journal Entry ID in the Accounting Data in SAP ByD (please see the image above to see the Accounting Data).

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183363
Active Contributor

Christian,

A couple of things:

1) Try putting it on the BeforeSave; the journal entry ID might not save properly until after the event's run.

2) Have you had a look at the data in the BO for other fields with 'reference' or what have you in the name, in case the value is saved elsewhere?

Lewis

0 Kudos

Hi Lewis,

Thank you for answering but I already tried both AfterModify and BeforeSave but the AccountingDocument is still empty. Also, AccountingDocument is the only field that carries the Journal Entry ID. Is there any other way for me to get the Journal Entry ID? Thank you.

Regards,

Christian

former_member183363
Active Contributor
0 Kudos

You might try doing it the other way --- look for cheque references on any created journal entry vouchers/journal entries and write back that way.

0 Kudos

Hi Lewis,

I tried doing it the other way around but still, I cannot get the Journal Entry ID. The available events for the script are the ff: BeforeSave, AfterModify, and OnSave Validation. Now is there an event that works after saving the data? I believe the reason why I cannot get the ID is that the Journal Entry is not yet created because all the script events are happening before saving. Thank you.

Regards,

Christian

former_member183363
Active Contributor
0 Kudos

How about a bit of a three-way process? Look for cheque references on a journal entry and if there is one then write the UUID of the journal entry back to the cheque. Then on the cheque object's save script, look up the journal entry using the UUID and return the ID.