07-18-2019 3:56 PM
Hi,
My requirement is to get text from text table. Text table name is not fixed as I am getting it dynamically based upon the domain name given. I need a generic FM or logic to get text for any text table.
07-19-2019 8:37 AM
As what I have understood, you need to get information from a Text Table which is assigned to a main Table, if that's the case then:
First get the attached Text Tables for a Table using FM DDUT_TEXTTABLE_GET,
After that as explained by Sandra you can have a Dynamic Select in place which would fetch from the Text Table fetched above.
In addition go through this blog as well if it aligns with your requirement,
https://blogs.sap.com/2018/05/06/how-to-find-a-text-table-if-it-exists/
Thanks,
Sijin
07-18-2019 10:27 PM
"Text table" is for another table, not for a domain. It seems you might be using wrong terminology. Can you clarify what exactly are you looking for?
07-19-2019 7:15 AM
Are you looking for dynamic SELECT ? Here is the pseudo code:
DATA ref_itab TYPE REF TO DATA.
FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
DATA tablename TYPE tablename VALUE 'T100'.
CREATE DATA ref_itab TYPE TABLE OF (tablename).
ASSIGN ref_itab->* TO <itab>.
SELECT * FROM (tablename) INTO TABLE <itab>.
LOOP AT <itab> ASSIGNING FIELD-SYMBOL(<line>).
ASSIGN COMPONENT 1 OF STRUCTURE <line> TO FIELD-SYMBOL(<comp>).
...
ENDLOOP.
07-19-2019 8:37 AM
As what I have understood, you need to get information from a Text Table which is assigned to a main Table, if that's the case then:
First get the attached Text Tables for a Table using FM DDUT_TEXTTABLE_GET,
After that as explained by Sandra you can have a Dynamic Select in place which would fetch from the Text Table fetched above.
In addition go through this blog as well if it aligns with your requirement,
https://blogs.sap.com/2018/05/06/how-to-find-a-text-table-if-it-exists/
Thanks,
Sijin
07-19-2019 10:31 AM
Thanks Sandra, your solution is quite right but problem is I just need text from text table but syntax ASSIGNCOMPONENT1OFSTRUCTURE<line>TOFIELD-SYMBOL(<comp>) gives all fields of text table.
As I mentioned my requirement is generic. 1 table can have field TEXT for text and another can have DESC/NAME for text at any position. I just need text from text table not all the fields.
Hope I am clear with my requiremnt.
07-19-2019 11:40 AM
07-19-2019 11:45 AM
Sorry I meant to say that position of text field is not known. Text field can be at any column. For example table T100 has text field at 4th coloumn. I need only text field.
07-19-2019 12:55 PM
It's very easy: texts are all columns of a text table which are not part of the primary key. The table DD03L contains all DDIC columns.
07-19-2019 2:23 PM