cancel
Showing results for 
Search instead for 
Did you mean: 

ExecuteFromDB Issue: Buffer vs DB

former_member232970
Participant
0 Kudos

Hi all,

I would like to get some help/explanation regarding an issue that I'm facing with ExecuteFromDB.

My goal is to build certain logic by comparing the value of certain attribute before and after a change was performed by the user. To achieve my goal, I want to compare the value of the buffer VS the value of DB.

However, when performing the query ExecuteFromDB, I’m getting/reading the same value as the one on the buffer (UI).


Is there any explanation to the issue that I’m facing?


Please find below an screenshot of my coding + debugging session.



Any tip/suggestion/solution is welcome.


Thanks in advance.


Kind regards,


Andres


BTW: I found 2 similar post but none of them offer a solution/explanation to my problem.

http://scn.sap.com/thread/3874938

http://scn.sap.com/thread/3785028

Accepted Solutions (1)

Accepted Solutions (1)

former_member190818
Active Contributor
0 Kudos

Hello Andres,

As you can see in one my post I had similar issues. From the screenshot of yours, I can see that you are using Execute and ExecuteFromDB function which will return the buffer value and DB value for later one.

If you want to read from DB, then use ExecuteFromDB function. But using this function, I faced an issue that the "this" node gets overwritten from the DB values. You can try passing the current node values to a variable and after getting value from DB, pass it back to "this" node from variable and do your comparison.

Regards,

Mohan Babu

former_member232970
Participant
0 Kudos

Hi Mohan,

in you case you get a copy/reference to the object on DB level.

In my case, I always get a reference to the object in the buffer, even when using ExecuteFromDB function.

did you face this issue?

Is there anyone who can explain this? or should I raise a ticket to SAP?

kind regards,

Andres

former_member190818
Active Contributor
0 Kudos

Hello Andres,

You can raise an incident for the same.

Regards,

MB

sameer_kumar13
Explorer
0 Kudos

Hi Andres,

You can post your SAP incident number here and i will have a look. Kindly mention the steps and the script as I might have to debug this. Ideally you should get the value last saved in the database via the "ExecuteFromDB" function.

Regards,

Sameer

former_member232970
Participant
0 Kudos

Hi Sameer,

The incident "External Reference ID" is "3100931723". I would really appreciate if you could have a look on my incident.

On my incident you can find under attachments a document which explain in detail my problem/issue. Please also find attached to this comment my script (Business Partner - Root - AfterModify).

As you suggested,  I'm already trying to get the last saved version of the object in database via function "ExecuteFromDB", But I receive alway the version on the buffer. In case I'm using this functionality in the wrong way, please let me know.

Test Scenario: Change the "Academic Title" (or any other attribute) and check whether you can observe/find the value assigned on DB level vs value assigned on runtime/buffer.

kind regards,

Andres

sameer_kumar13
Explorer
0 Kudos

Hi Andres,

I checked and there is a bug in 1602 for older SAP business objects like Business Partner and hence the Query.ExecuteFromDB() is not working. You can use the regular Query(if possible) or wait for 1605 release where this will be fixed.

Regards,

Sameer

former_member232970
Participant
0 Kudos

Hi Sameer,

Taking into consideration that this behaviour will be correct on 1605 release, We will wait for the upcoming release.

Thanks in advance.

kind regards,

Andres

former_member232970
Participant
0 Kudos

To All,

For all people following this discussion, please have a look following discussion  . In there I received some feedback coming from SAP related to this topic.

kind regards,

Andres

Answers (0)