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: 

How to select data from sub Text Table

0 Kudos

I am new to SAP programming and trying to pull data from this table AGR_DEFINE which has a Text Table AGR_TEXTS apart of it. The data I need is the Role(AGR_NAME) and Short Description(TEXT), which the Role I have no problem grabbing but the Description is causing problems. I defined my types:

TYPES: BEGIN OF TY_AGR,<br>        AGR_NAME LIKE AGR_DEFINE-AGR_NAME,<br>        TEXT LIKE AGR_TEXTS-TEXT,<br>  END OF TY_AGR.

But selecting the data gives me the error "Unknown column name "Text". until runtime, you cannot specify a field list"

SELECT AGR_NAME<br>         TEXT<br>  FROM AGR_DEFINE INTO CORRESPONDING FIELDS OF TABLE ITAB_AGR.

How am I able to grab this data?

3 REPLIES 3

jerryjanda
Community Manager
Community Manager
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members. Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Kind regards,

--Jerry

Moderation Lead

Make sure to subscribe to What's New!

shivakrishna150
Explorer
0 Kudos

Hi,

Use Inner join instead. This code should work.

Types: Begin of ty_agr,
       agr_name Like agr_define-agr_name,
       text Like agr_texts-text,
      End of ty_agr.
Data: itab type standard table of ty_agr.

Select from agr_define as a 
       inner join agr_texts as b on a~agr_name = b~agr_name 
       fields a~agr_name as a1,
              b~text as b1 into Table @itab. 

Note: Specify your Condition in select Statement.

raymond_giuseppi
Active Contributor
0 Kudos

You have to read the text table too, use some JOIN option in the SELECT, don't forget the language field.

(You may have been tricked by SE16 or SE16n which autimatically add the text table)