2014 Jan 13 5:59 PM
Hi,
Can I have a custom field in an SAP standard table and make it a key field?
If yes, please let me know the steps for the same.
Thanks,
Neeraj
Hi,
Can I have a custom field in an SAP standard table and make it a key field?
If yes, please let me know the steps for the same.
Thanks,
Neeraj
2014 Jan 13 7:26 PM
2014 Jan 13 7:32 PM
Hi Martin,
I think, your can do the append structure and then, create a new index using your new field.
Regards,
2014 Jan 13 7:53 PM
Hi,
You could create a index with the field, but the field won't be part of the table's key.
Martin
2014 Jan 13 8:18 PM
Yeah, it's true!
But, will have a new index when do you want do SQL operations on Table.
Regards,
2014 Jan 13 8:20 PM
I think Martin is right. If I add the field using append and create an index for that field, how will I have multiple values for the same?
E.g if I want to add year to MARA. I can append a structure with year but if I create a material valid for 2 separate years, how would year be a key field? How will this scenario work by an index?
Can anyone throw some light on that?
2014 Jan 14 5:08 AM
Hi Neeraj,
Martins answer is correct. You can add additional fields to standard tables using APPEND structures but you can't make them as KEY fields to the same standard table.
Purpose of having APPEND structure is to add new fields, use as foreign keys, attach search helps, etc.
You can create an index using the APPEND fields but this will only be helpful(speed up) when reading data from that table.
So could you tell me why you want to make your append field to be a part of the key to the table?
Chaminda
2014 Jan 14 5:39 AM
Maybe you can consider using the year in the value range of your MARA table - off course this will not inflict your 'old' data. But if you archive it, then in the end you can have the year embedded in the number range.
2014 Jan 15 7:01 PM
The year is a part of our process and needs to be added as a key field for calculations of quantities. I know creating an Index would speed up the query part but that would not help in creating multiple entries of the same part in the table and the requirement is that.
2014 Jan 15 7:02 PM
Can you please explain what you mean by value range in MARA table?
2014 Jan 15 7:35 PM
Via transaction MMNR you can maintain the intervals. I suggest that when you change the interval each year to another 201300000000000001 201399999999999999 (this year into: 201400000000000001 201499999999999999). Then you don't need to have this additional year field.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |