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

Using text table

Former Member
0 Likes
2,247

Hi there..

I have a question about using text tables, to translate F4-help..

My table "ZTYPE" has the fields/data element ZTYPEID, ZTYPEID_P, ZTYPENAME and ZTYPEDESCR. The fields ZTYPENAME and ZTYPEDESCR of this table should be able to use a text table to translate in the right language.

I read about that I have to create a table like "ZTYPE_TEXT" in which I have to define the used language, an unique ID and the appropriate text. The fields of this table are f.e. SPRAS, VARID and TEXT..... and I have to fill the table like:

EN     001     hello

DE     001     Hallo

EN     002     street

DE     002     Strasse

...

Now my questions:

Where could I define the ID of the fields ZTYPENAME and ZTYPEDESCR!? Is it possible to do this definition in the table "ZTYPE" somehow? Or I have to implement an own table for every of the used fields, f.e the table "ZTYPEID_HELP" with the field ZTYPEID and VARID?!

How could I set the VARID of the fields, which should be translatable?!

Because I have more than this table "ZTYPE": Could I also define the fields of the other tables in the "ZTYPE_TEXT" table!?

I hope you could understand my problem and have some help..

Greetings,

Andi

1 ACCEPTED SOLUTION
Read only

arindam_m
Active Contributor
0 Likes
1,668

Hi,

No the TEXT table architecture is about having two seperate table one with KEYS and other with the various texts maintained for the keys.

The KEY table will have just the key value in your case say table1 has entries for fields ZTYPEID, ZTYPEID_P both acting as key values then have another text table which have ZTYPEID, ZTYPEID_P, and LANG field as primary KEY in the text table then you can have thedesc that you want.

Table1 fields:

ZTYPEID    ZTYPEID_P

Table2 fields:

ZTYPEID    ZTYPEID_P     LANG    ZTYPENAME     ZTYPEDESCR

This way you can maintain various language descriptions for for a set of ZTYPEID, ZTYPEID_P. And in maintainance view you can code the updation of table1 and 2 to save the descriptions with language key in table 2. Hope it helps.

Cheers,

Arindam

4 REPLIES 4
Read only

arindam_m
Active Contributor
0 Likes
1,669

Hi,

No the TEXT table architecture is about having two seperate table one with KEYS and other with the various texts maintained for the keys.

The KEY table will have just the key value in your case say table1 has entries for fields ZTYPEID, ZTYPEID_P both acting as key values then have another text table which have ZTYPEID, ZTYPEID_P, and LANG field as primary KEY in the text table then you can have thedesc that you want.

Table1 fields:

ZTYPEID    ZTYPEID_P

Table2 fields:

ZTYPEID    ZTYPEID_P     LANG    ZTYPENAME     ZTYPEDESCR

This way you can maintain various language descriptions for for a set of ZTYPEID, ZTYPEID_P. And in maintainance view you can code the updation of table1 and 2 to save the descriptions with language key in table 2. Hope it helps.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,668

Hi Arindam,

thanks for your fast reply.

I think, I understand the function of the text table - but i didn't explain it very good 😕

The table "AGGREGATION" should be merge the attributes (..for example of a car of a car pool) with the fields: ZTYPEID, ZTYPEID_P, ZTYPENAME, ZTYPEDESCR.

A01     VW     little car     yellow car with four wheels

B28     MG     van               car of the manager

...

From this table two of the fields should be translatable: the fields ZTYPENAME and ZTYPEDESCR. This fields could have different entries.

Actually I know, that my "TEXTTABLE" has to have the fields: LANG, ATTRIBUTE_ID, TEXT for the translation.

EN     001     little car

DE     001     kleines Auto

EN     002     van

DE     002     Transporter

EN     111     yellow car with four wheels

DE     111     gelbes Auto mit vier Rädern

...

But where and how I have to define:

"The field ZTYPENAME could have the ATTRIBUTE_ID 001 or 002 or ...."

"The field ZTYPEDESCR could have the ATTRIBUTE_ID 111or 112 or ...."

I have to implement one table for every attribute, which only contents the field ATTRIBUTE_ID - like for the table "ZTYPENAME":

001

002

...

Or is it possible to to have one central table like "SET_IDs" where I could administrate the translatable attributes in one table:

ZTYPENAME     001, 002, ...

ZTYPEDESCR     111, 112, ...

And what about the primary and foreign keys than!?

Thanks for your help..

Andi

Read only

Former Member
0 Likes
1,668

Ahhh - damn..

I didn't get that I'm able to "translate" more than one field in the text table.

fields of main table:     ZTYPEID [primary key], ZTYPEID_P (in this context equal varible)

fields of text table:     ZTYPEID [primary key], SPRAS [primary key], ZTYPENAME, ZTYPEDESCR

...where SPRAS has to have foreign key to "T002"

...and ZTYPEID has a foreign key to the main table field ZTYPEID with changing "semantic attribute" in key fields of a text table (you can see in the following picture)

To set some content in the tables you first have to define some ZTYPEs in the main table.

After that you are able to insert to the ZTYPEs language-based entries.

Read only

Former Member
0 Likes
1,668

Or is this a possible solution:

I have to to create a table ZTYPE with the fields ZTYPEID, which contents all of the id's of possible names of the field: "001", "002", ...

For this table I define a ZTYPE_TEXT as a texttable which includes the fields ZTYPEID, LANG, TEXT. So that the content looks like this: "001 - DE - Auto", "001 - EN - car", "002 - EN - house", ...

And the table, where I want to show this field ZTYPE (..and many other translated fields..) I have to define a key to the ZTYPE-table??

Or a value help table??

Would be great if someone has some information for me.

Thanks,

Andi