‎2016 May 11 5:45 PM
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
‎2016 May 19 5:58 AM
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
‎2016 May 30 2:42 PM
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
‎2016 May 31 12:33 PM
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?
‎2016 May 31 1:02 PM
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
‎2016 Jul 11 11:12 AM
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.
‎2016 Jul 11 1:30 PM
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