In this example we have a new config table that defines a code and its meaning. Let’s say the code is for ‘Cancellation reason’ a two character code (Data element ZCANC_REASON) with a twenty character description (Data element ZCANC_DESC). In a SAP delivered config table this description would be language dependent and whether or not our system is running multiple languages we should really do the same.
So first we create a config table for just the reason code. Create it as defined in part 1 of this blog, but don’t create the maintenance dialog yet.
Next a text table is needed. The convention for naming is to take the config table name and suffix it with _T. Use the same key as the config table, but add a field for language, then the text field.
On the key field (CANC_REASON) in the text table we need to define a Foreign key.
Enter the original config table (ZMM_REASON) as the check table and in the ‘Foreign key field type’ choose the option ‘Key fields of a text table’.
Now this relationship has been defined, create the maintenance dialog for table ZMM_REASON.
When we maintain table ZMM_REASON the maintenance dialog gives us this;
By setting the foreign key the description is included in the maintenance dialog and will store the text in my logon language.
So, if I enter this;
It creates this entry in the text table, as well as the value AB in table ZMM_REASON;
If I then log in using another language, I get this view because the config entry exists but without a text for the logged on language. The heading shows a question mark because I haven’t translated the texts for the DDIC definitions of the tables.
If I enter a text now I have these entries in the text table, but still with only one entry in ZMM_REASON;