Skip to Content
avatar image
Former Member

Key/Text table - usage in an ABAP program

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 06, 2007 at 11:30 AM

    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...

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • Oct 05, 2007 at 05:54 PM

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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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