Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mix transient and persistent data

Former Member
0 Likes
1,812

Hi,

I'm new to BOPF and have looked at the tutorials and blogs. I know the ABAP Object Services, and there we can create transient and persistent instances of the same object. In BOPF I can have transient attributes or transient nodes. Is there a way to have one node containing transient and persistent entries?

The reason behind the question: I want to display in a uniform table data that is for some rows persisted on the database, and for some other rows comes from a different web service. The data from comming from the web service is read only, but the data from the DB should be possible to change. In ABAP Object Services I simple can create transient objects for the data comming from the webservice and persistent objects for the data from the DB and combine them easyliy in a table and operate on them in the same way, as they are of the same class type.

Any ideas how to achieve that in BOPF?

Thanks for all your input,

Peter

6 REPLIES 6
Read only

former_member190794
Active Participant
0 Likes
1,261

Hello Peter,

"transient attributes" are non-persisted attributes located on a "persistent node". A "persistent node" has at least one "persistent attribute", otherwise the node would be a "transient node" as it has only "transient attributes".

So "transient attributes" is required in your scenario. In addition you can use "static readonly properties" to disable the transient fields from being edited in your scenario.

Best regards

Tilmann

Read only

0 Likes
1,261

Hi Tilmann,

Thanks for you answer.

Is it also possible to have some instances of a same node that are transient (in my case persisted somewhere else) and other instances that are persisted? The transient instances, are really transient, they cannot be changed by the consumer.

Kind regards,

Jacques

Read only

0 Likes
1,261

Hi Tilman,

also thanks from my side for your answer.

However, the question was exactly what Jacques asks: How can I mix at the node level transient and persistent data ("rows"), not how one can mix transient and persistent attributes at one node.

I guess that should be possible implementing my own data access classes and use a transient attribute to distinguish transient and persistent records.

I'm asking if someone did that before or is there an easier way to achieve that?

Read only

0 Likes
1,261

Hi Peter,

Yes, in my opinion implementing an own Data Access Class is the way how to achieve this.

Just cause I'm curious: can you give me some more details about the use case? Do you have several database tables for the data of one BO node?

Cheers,
Martin

Read only

0 Likes
1,261

Take for example if you would like to display a month in a list (eg for every day in the month one line). For some days you have entries in your database, for others you dont't. In order to display every day of the month you would have to mix "transient" rows for days without entries and "persistent" rows for the other days.

Of course you could mix that at the application layer, but if you use FBI to display your data, that would not be possible.

Read only

0 Likes
1,261

Hi Peter,

possibly another approach could be to define a purely persisted node which contains the non-transient entries. In addition, you could define another transient node which returns all instances from the persisted node plus the additional transient instances.

By doing so you could avoid implementing your own DAC.An additional advantage would be that you could consume the persisted node with SADL, which would not be possible at all with a custom DAC.

Kind Regards,

Ivo