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

Maintenance view and TMG program issue

shivangi_pant
Participant
0 Likes
13,956

Hi, i have made 2 custom tables with emp data. 1 is master table and 1 is value table with foreign key on emp id.

I have entered values also through TMG. Till here everything is fine. But when i am creating maintenance view and selecting master table and going on relationship to select custom table then nothing is happening. The view table on clicking relation is showing under 'Relationship with unsuitable cardinality'. What does that mean? How can i get both the tables so that i can go ahead with maintenance view? When i am trying this with SAP tables then everything is working fine so i am unable to understand the problem and there are no error generated too.

Hi, i have made 2 custom tables with emp data. 1 is master table and 1 is value table with foreign key on emp id.

I have entered values also through TMG. Till here everything is fine. But when i am creating maintenance view and selecting master table and going on relationship to select custom table then nothing is happening. The view table on clicking relation is showing under 'Relationship with unsuitable cardinality'. What does that mean? How can i get both the tables so that i can go ahead with maintenance view? When i am trying this with SAP tables then everything is working fine so i am unable to understand the problem and there are no error generated too.

32 REPLIES 32
Read only

anujawani242683
Active Participant
0 Likes
13,743

Hi,

Try this.

While creating maintenance view, first enter the table which have foreign key then enter master table.

Regards,

Anuja Kawadiwale

Read only

0 Likes
13,743

Yes I tried that also but it is showing the same message. I don't know if this message holds any relevance but i am just assuming because otherwise I don't find any error in table or contents or the process and also there are no error messages to debug.

Read only

anujawani242683
Active Participant
0 Likes
13,743

Hi,

I think wrong relationship is define between two tables. if first table is your master table having key field as Employee id and second table with foreign key on employee id.

First thing no need to define second table as value table for the first table. Both tables are already related to each other by defining the foreign key.

So if you remove value table as second table then you will be able to create maintenance view.

Second thing if you want value table then master table should be the value table for employee id in master table only.

I hope this is helpful.

Regards,

Anuja Kawadiwale

Read only

0 Likes
13,743

I did not define it as value table separately I named it as emp_valuetable to distinguish from master table then it should work??

Read only

0 Likes
13,743

Hi Shivangi,

Ok. I thought you have defined second table as Value Table.

Can you please share screenshot of both the tables. Also the screenshot of foreign key relationship where you define.

Read only

0 Likes
13,743

Hi,

While defining foreign key cardinality needs to mentioned. check this one.

Read only

0 Likes
13,743

Hi, I am new to abap so could you guide me how to do the above with steps???

Read only

0 Likes
13,743

Hi Shivangi,

Can you please share screenshot of both the tables. Also the screenshot of foreign key relationship where you define so that will be able to help you.

Read only

0 Likes
13,743

Sure will do that in sometime

Read only

0 Likes
13,743

Also, I have one more question. Can i replace any field value of a table which is having tmg? I mean for example I have entered country as india and now I want to change it to us in one of the field? Can i do this without events and coding or they are required for doing any changes in table?

Read only

0 Likes
13,743

Hi Shivangi,

Yes, you can change the value of field.

Read only

0 Likes
13,743

@ anuja can you let me know how can i replace the value without events?

Read only

0 Likes
13,743

Hi Shivangi,

for example except primary key all the other fields are editable. So i directly go to Utilities and then create entries then i can edit existing entries.

Read only

0 Likes
13,743

@Anuja- got it thanks. Also, i have shared the screenshots if you could chec

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,743

Please show the details how you defined your foreign key, your source field (where you attached the foreign key), and the key fields of the value table you referred to in the foreign key.

Read only

shivangi_pant
Participant
0 Likes
13,743

@sandra sure will do it in sometime

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,743

The tables shown below 'Relationship with unsuitable cardinality' are those with foreign key not being 1:1, 1:C or text table.

Read only

shivangi_pant
Participant
0 Likes
13,743

@ sandra but the table I made os standard table and if I am not wrong in standard table we do not have to maintain any relationship. Pls correct me if I am wrong.

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,743

You must not modify the standard, you may just extend it.

Please explain with real names, not just "master table" and "value table", because I don't understand which one is custom, which one is standard.

I guess the master table is custom, you defined a foreign key to the value table, which is standard.

So, the foreign key is defined in the custom table, not the standard one.

Please correct me if I'm wrong.

Read only

shivangi_pant
Participant
0 Likes
13,742

Is this sufficient? emp-master.pngemp-child.png

Read only

shivangi_pant
Participant
0 Likes
13,742

Emp id is primary key in mtable and foreign key is established on this in vtable.maintview.png

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,742

No, the most important thing is missing, the definition of the foreign key for YEMP_MTABLE-EID, to point to YEMP_VTABLE, and its cardinality.

Read only

anujawani242683
Active Participant
0 Likes
13,740

Hi Shivangi,

Have you created foreign key ? If not please follow below steps to create foreign key.

Because tables grouped in maintenance view must be joined using foreign key. Once you define foreign key you will be able to create maintenance view.

Step 1: Click on key icon.

Step 2: Enter your master table name and click on create proposal.

It will show you the field on which table will be join using foreign key.

Step 3: Click on Copy.

Here foreign key is created. Just activate the table. Then try to create maintenance view.

Read only

0 Likes
13,740

yes Anuja i created foreign key also. These are the steps which I followed

Read only

0 Likes
13,740

Step 1: Create a table by name ‘mtable’ with records.

Step 2: Create another table by name vtable with records.

Step 3: Create the foreign key relation as below

1. Open the table vtable

2. Select eid field

3. Click on foreign keys button or Icon

4. Provide the check table name as mtable(master data table)

5. Click on generate proposal button

6. Click on copy button

7. Save and activate

Read only

shivangi_pant
Participant
0 Likes
13,740

@ Sandra sorry my system has stopped working suddenly I don't know why. I am sharing the steps though which I followed to generate foreign key

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,740

Thanks. Waiting for the steps then, I'll check tomorrow.

Read only

shivangi_pant
Participant
0 Likes
13,740

Step 1: Create a table by name ‘mtable’ with records.

Step 2: Create another table by name vtable with records.

Step 3: Create the foreign key relation as below

1. Open the table vtable

2. Select eid field

3. Click on foreign keys button or Icon

4. Provide the check table name as mtable(master data table)

5. Click on generate proposal button

6. Click on copy button

7. Save and activate

Read only

shivangi_pant
Participant
0 Likes
13,740

foreign-key.png
sandra.rossi anujawani2426 pls check the foreign key relation.

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,740

OK, do you see what the issue is, now? (check what I said previously, I won't repeat myself)

Anuja also told you: "cardinality needs to mentioned".

Read only

shivangi_pant
Participant
0 Likes
13,740

@ sandra @anuja thanks a lot for all the guidance and support. I will try this and check the same.

Read only

Sandra_Rossi
Active Contributor
0 Likes
13,740

If you want to target someone, if this person has posted an Answer, use the button COMMENT, if this person is the Original Poster of the question he/she will be automatically informed, otherwise copy/paste their hyperlinked name so that the person receives a warning (NB: @ doesn't work/but typing this character will suggest hyperlinked names). e.g. good way: shivangi_pant