10-05-2007 1:03 PM
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
10-05-2007 6:54 PM
Try rearranging the text table to mandt, id, lang, text. And id must have ztbl1 as a check table.
10-06-2007 9:04 AM
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
10-06-2007 12:30 PM
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...
10-07-2007 8:18 AM
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
10-09-2007 3:06 PM
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 ...
10-10-2007 11:48 AM
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
10-17-2007 6:32 PM
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.