Application Development 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: 

Table Maintenance

Former Member
0 Kudos

Hi,

I have created a maintenance view for a custom table.

The table has customer and customer description fields. I would like to get the description automatically populated with I enter the customer number in SE30 and save the data.

I checked relevant topics in this forum, but could not implement the solutions. Could any one describe how to do this in detail, as I am a novice in this area.

I tried creating events, but I am not sure how I do this. When I select entry 01 and a mention Form Name, I get a dialog box asking me to select from a grounp of modules (strarting with L*****). And when I click on okay, with out selecting any module, I get a message -- 'Changes to program L**** forbidden by SAP'

Please advise.

Rajesh.

Message was edited by: Rajesh Yerragunta

9 REPLIES 9

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Of course, you would have to hack the table maintenance program. Are you looking to get the description from KNA1?

Regards,

Rich Heilman

0 Kudos

Rich, Thanks for prompt reply

The customer field is KNA1-KUNNR and the description is KNA1-NAME1.

0 Kudos

Right, so in your custom table, what are the fields. Is it just KUNNR. I hope you are not have NAME1 in this table also. What are the fields of the custom table.

Regards,

Rich Heilman

0 Kudos

I have both the Customer and Description fields in the Custom table.

MANDT

KUNNR

NAME1

ZLAB....

The rest of the fields are custom ones .

Thanks Rich.

Rajesh.

0 Kudos

Having the NAME1 field as part of your custom table is probably not a good idea. What happens when the customer master is changed and the name changes. Are you going to have a program which will sync up the customer names in KNA1 and your custom table. I would highly suggest not haveing the NAME1 field in your custom table. Just have the key(the customer number) KUNNR and the custom values. Always get the description from KNA1.

Regards,

Rich Heilman

0 Kudos

Rich,

Thats a good suggestion. But I need to have the description in the maintenance view. I am not sure, if I can have the description in the maintenance view (SM30), with out having it in the actual Z Table. If this can be done, I would definitely remove the description from the Table, as it is not mandatory.

Thanks,

Rajesh.

0 Kudos

Do you think writing your own table maintenance program is a possibility? Instead of using the table maintenance generator?

Regards,

Rich Heilman

0 Kudos

Hi Rajesh,

In SE11, go to your maintenance view definition and KNA1 as the secondary table for your Z table (if you have defined the foreign key for customer field in your Z table then KNA1 will appear in Relationships section).

Then go to Table Fields, add KNA1-NAME1 and mark it as Read only (enter R in the 4th column titled "P").

Hope this helps..

And please remove NAME1 from your Z table..

Sri

Message was edited by: Srikanth Pinnamaneni

0 Kudos

Here are the steps that you need to follow.

Create your table without the NAME1 field in it. Don't forget to create the foreign key relationship for the field KUNNR with KNA1.

Create a maintenance view. In the Tables column, enter your table name. Click the button below 'Relationships'. It will bring up a pop-up window with your table name and KNA1. Select the checkbox and press 'copy'. Now you will see both your table and KNA1.

In the view fields tab, enter all your ztable fields and NAME1 field from KNA1 and select 'R' under the column 'P'. Save it and activate it.

Next go to SE54, enter your view name, select 'Generated Objects' and press 'Create'. A pop-up will come to confirm. Once you create the maintenance dialogue, you can now go to SM30 and enter your maintenance view name there and maintain it. <b>Remember, you will not use your table name for maintenance, you will use this view instead.'</b>

Srinivas