01-09-2008 8:26 AM
Hi all,
I'm using an ECC 6.0 system.
I've just created a persistent class and defined the persistence. When I try to activate the class activating fails and I get the message "There is no mapping for one or more fields."
I did not, in fact, use all the fields of the database table I defined the persistence on. When I do use all the fields activating the class works without a problem.
However, as far as I know it should be possible to select only some of the fields when defining the persistence (the only fields I have to select are all the key fields of the table and I've done this).
Has anybody encountered the same problem or has anybody any idea on this?
Cheers,
Kathy
01-09-2008 9:11 AM
I did not, in fact, use all the fields of the database table I defined the persistence on. When I do use all the fields activating the class works without a problem.
However, as far as I know it should be possible to select only some of the fields when defining the persistence (the only fields I have to select are all the key fields of the table and I've done this).
Unfortunately it doesn't work this way.
All columns of a database table must be mapped to attributes. If you dont want to do this, then define a database view, with the fields you need.
Regards,
Hristo
01-10-2008 9:33 AM
Hi Hristo,
Thanks for the info and for your suggestion.
I had the information that one doesn't have to map all the fields of the table from a tutorial which was recently made. I asked the presenter of the tutorial on this point. He had a bit more information and another suggestion to get around the problem. Here is his answer:
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/cs/user/view/cs_msg/28713
Thanks again for your post.
Regards,
Kathy
01-11-2008 9:32 AM
Hi,
a little follow-up note:
I got a new SAP book yesterday on Advanced Techniques and Tools and it says in there that all fields need to be mapped, indeed. The content of the book refers to Release 6.40 (NetWeaver '04).
Kathy
01-14-2008 12:00 PM
Hi Kathy,
this is exactly what I meant.
If you'd like, then you can also take a look at the documentation: http://help.sap.com/saphelp_nw04/helpdata/en/b0/9d0a3ad259cd58e10000000a11402f/frameset.htm
There under Mapping, you can find:
"You must map all columns of a database table to attributes. If you only want to manage some of the columns using Object Services, you must create a database view."
Making attributes private doesn't change the fact, that you still map all fields. If you have a lot of fields, which you don't want to map, then I will again suggest, that you define a DB-view. This will boost the performance of your implementation.
In case you need "quality 1st" performance, then I would suggest to use an ABAP implementation with internal tables, instead of the Persistent Service.
HTH,
Hristo
01-15-2008 4:14 PM
Hi Hristo,
Thanks for your follow-up. Helpful information!
Regards,
Kathy