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

Problem in creating a Persistent Class

Former Member
581

Hi All,

I am working on Persistent Classes for the first time. I have tried to gain some info by going through some related threads and of course Thomas' Blog on Persistent Classes.

My Problem:

I have been trying to create a Persistent Class that takes fields from multiple database tables (KNA1 and KNVV).

I wasn't able to generate mapping successfully.

So, the solution was to create 2 Persistent Classes and create a data model class for these two (It was mentioned in one of the threads)

I have been trying to create a Persistent Class for the fields from table KNA1 (I need only some 11 fields)

When I activate, I again get a warning 'No mapping exists for the fields' as a result of which the main class is not activated.

I read somewhere that all fields from a table needs to be included in the 'Inclusion area', otherwise, the class doesn't activate.

So I tried creating a view, but I get another warning message saying 'Database operations with view are not allowed' and the main class remains unactivated.

Please suggest.

Also, if there are any related materials on how to deal with multiple tables, I would be more than glad.

Thanks for all your time.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
523

If you are creating a persistent class for SAP tables, then effectively you are attempting to update the tables directly. And that is a really bad idea.

See [here|; and [here |; for more discussion on that topic.

Only create persistent classes for database operations on your own tables.

I guess your classes are failing because you haven't done the mapping. Did you click on the button marked "persistence" on the SE24 view of your ZCL class?

matt

One more thing - it's against the forum rules to ask for material and links...

2 REPLIES 2
Read only

Former Member
0 Likes
523

This message was moderated.

Read only

matt
Active Contributor
524

If you are creating a persistent class for SAP tables, then effectively you are attempting to update the tables directly. And that is a really bad idea.

See [here|; and [here |; for more discussion on that topic.

Only create persistent classes for database operations on your own tables.

I guess your classes are failing because you haven't done the mapping. Did you click on the button marked "persistence" on the SE24 view of your ZCL class?

matt

One more thing - it's against the forum rules to ask for material and links...