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: 

Key/Text table - usage in an ABAP program

igor_bevk
Explorer
0 Kudos

Hi Abapers!

I need help about usage of key and text tables.

I have created key and text table and now i want to use them in the abap program. My problem is, that i don't know how to properly read data into internal table from these two tables, so i can show these data in the table control. I also want to know how to save data from text boxes into key and text table (text boxes: txtid, txtlang, txttext).

Key Table:

name: ztbl1

fields: mandt, id

key fields: mandt, id

Text table:

name: ztbl2

fields: mandt, lang, id, text

key fields: mandt, lang, id

Tables are connected together as they should be.

And i don't want to use sm30 for editing table data.

Regards,

Egi

7 REPLIES 7

gabriel_pill-kahan
Active Participant
0 Kudos

Try rearranging the text table to mandt, id, lang, text. And id must have ztbl1 as a check table.

0 Kudos

Gabriel, thanks for the reply.

The tables are connected together as they should be, and they are working fine. The problem is, that i don't know how to properly use them in an ABAP program (reading, editing, deleting records).

Regards, Egi

Former Member
0 Kudos

My Dear,

u are loosing the concept of Text table...

Text table are generally used for multi lingual F4 (i.e you enter vaious F4 list to be displayed for a perticular field when a user from differenct lang log on)

for eg...

in urr text table u have .. 2 key itemm

item_code || lang || text

10111 || E || Eng_Chicken

10111 || D || Chickeno (translation from eng to germen)

10111 || F || Ghoose..

so when a user with logon lang as 'E' will log on and when he press F4 on item_code he ill see Eng_chicken

but when a user with logon lang as 'D' will log on and when he press F4 on item_code he ill see Chickeno not Eng_chicken..

i hope u understood the whole concept...

No rewards Plz...

0 Kudos

Dear Alnoor,

Yes i do understand that. I have these kind of texts in that tables, but i still wont to create an ABAP program to modify records in the tables.

Regards, Egi

0 Kudos

If you really want to manipulate them in your program, it's the same as any other table. The commands are SELECT, INSERT, DELETE, UPDATE, MODIFY ...

0 Kudos

I have another question about inserting new records. Is there any automatism between these two tables or do you have to insert a new record in both tables?

Regards, Egi

0 Kudos

If you mean does it automatically check or maintain consistency, no. The foreign keys are not enforced at the database level. So you need to be careful, and you'll have to code your program to do that checking/enforcement itself.