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: 

Generic lookups

Former Member
0 Kudos

I'm new to SAP generally and RFC/BAPIs/SAP-Tables specifically and I'm also not an ABAP Developer, so I apologize in advance if I'm using the wrong terminology, however, after a good experience in this forum, it seems like people here have the right knowledge/expertise that I need to accomplish what I'm trying to achieve.

------


I'm trying to figure out a generic way to get lookup values + text for fields in SAP programatically.


I already started implementing something based on domain names which can be found under DD03L and it does work well for short list domain names.


For longer lists however, I came across couple of challenges, querying CheckTable/CheckField does allow us to get to some correct values however:


1. It seems like from the SAP Windows client we are getting shorter list of values (potentially filtered) then what I'm getting from querying the table with the right language.

2. I can't seem to find a generic way to get the text description (the label of the value). For instance Exp_Type field in BAPITRMAIN table of BAPI_TRIP_CREATE_FROM_DATA which creates a Travel Expanse, points to check-table T706B1 and check-field MANDT, which returns the values, yet in this check-table there's no text description for the values. Furthermore, I couldn't find a clue on where to look for the text neither.



Any help in understanding how to create a generic lookup mechanism that would bring filtered values and text description would be highly appreciated!



Thanks,

Itzik


1 ACCEPTED SOLUTION

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Itzik Spiten,

Text table for T706B1 is T706B5.

If you enter table in SE16N, system will give the text table name in next row. If text table exist.

Regards,

Arivazhagan S


10 REPLIES 10

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Itzik Spiten,

Text table for T706B1 is T706B5.

If you enter table in SE16N, system will give the text table name in next row. If text table exist.

Regards,

Arivazhagan S


0 Kudos

Hi Arivazhagan,

Thanks for the quick response! I opened SE16 (hopefully I'm at the right place as I assume it's the Data Browser?). I couldn't figure out where to find the Text table as you suggested.

Also, is there programmatic way to get this data? querying metadata table etc?

Thanks,

0 Kudos

Please check DD08L table. It holds the relationships for check tables and text tables.

Or else for display purpose you could use SE11: GoTo->Text Tables.

R

0 Kudos

Thanks Rudra,

I queried DD08L and got the right check-table for Exp_Type field which is T706B1 but I still can't figure out how to find the relation to T706B5 which should be the text table.

I did query T706B5 as Arivazhagan had recommended above, and it does seem like the right texts table, the only question is how do I find that in SAP tables? Obviously the SAP GUI is getting this relation from somewhere.

Again, I do apologize if my questions seem lame, I'm really a rookie at this


Thanks,

0 Kudos

Here are the steps to get the texts table

1. Go to SE 11 and give the original table name: T706B1

2. Click on Display

3. Click on Goto->Text Table

If you want to get programmatically here is the query:

select single tabname fieldname

                     from DD08L

                     into (lv_tname, lv_fname)

                     where checktable = 'T706B1'

                         and frkart = 'TEXT'

                         and as4local = 'A'.

0 Kudos

DD08L-CHECKTABLE = <Your Main Table >

DD08L-FRKART = 'TEXT'.

You get back Text table in DD08L-TABNAME

0 Kudos

Thanks guys, this is extremely helpful, you are awesome

Regards,

Itzik

0 Kudos

Hi Again,

Furthermore on this subject:

Is there a way to programatically find-out what's the text field name? It always appear to be the last field 5th, or 6th in case of compound keys like Country/Region but sometimes it's TEXT25 and sometimes it's different name etc.

Ideas?

Thanks!

0 Kudos

Hi Itzik,

Use function module

F4_GET_TEXTTABLE

Pass TABNAME = 'T706B1'.

Then now you will get

TEXTTABLE                       T706B5

TEXTFIELD                        SPKZL

Hope this will help.

Arivazhagan S

0 Kudos

Hi Arivazhagan,

Thanks for your response, actually SPKZL is the value fields rather then the text field, but for now I have a workaround which works well, which is to grab the last field of the Text table.

Thanks for all the help!

Itzik