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: 

Cannot Get Column "Description" to Populate

keega1
Participant
0 Kudos

Greetings!

Yes, I am new at ABAP; apologies for the lack of knowledge in advance.

I'm hoping someone can help me get the description field for the Target Region to populate.

There is obviously more code, but here's what I have tried thus far:

TABLES : mara, marc, makt, mvke , t023t, tvprt.
* Class Definitions
TYPES : BEGIN OF gty_final,
          matnr             TYPE mara-matnr,
          maktx             TYPE makt-maktx,
          ersda             TYPE mara-ersda,
          matkl             TYPE mara-matkl,
          wgbez             TYPE t023t-wgbez,
          werks             TYPE marc-werks,
          vtext             TYPE tvprt-vtext,
          provg             TYPE mvke-provg,
          vkorg             TYPE mvke-vkorg,

SELECT vtext
FROM TVPRT
INTO TABLE @DATA(IT_TVPRT2).
&---------------------------------
SELECT SINGLE vtext
INTO TABLE @DATA(IT_TVPRT2).
FROM TVPRT

I should add that I already have the Target Region (two-digit) populating, but this one is in a different table (tvprt) and I'm not sure how to go about getting it out.

Thank you in advance.

Keega

15 REPLIES 15

matt
Active Contributor

TABLES is obsolete. You don't need it and shouldn't use it.

Your select will put the contents of the field vtext in TVPRT into the matnr field. When you use INTO TABLE; it take the result set from the selection, and then just puts it to the table. It doesn't care about the structure of the internal table.

Use INTO CORRESPONDING FIELDS OF.

Please take the time to read the ABAP keyword documentation for ... well any ABAP statement you're having trouble with. Often you'll find the answer right there. It's what I had to do when I was learning. We didn't really have the internet to help us then.

Hi Matthew!

Yes, I've read that about tables, but I am modifying someone else's code and that person is long gone. I don't want to reinvent the entire thing right now since I'm on a deadline.

I'm still not able to get it to display using INTO CORRESPONDING FIELDS OF., but will continue to try.

Thanks for your response.

If it's any consolation, the Internet has not been very helpful. I too grew up without the Internet. I love my books!

0 Kudos

Here's what I have done thus far but still no results:

*TYPES: BEGIN OF t_tvprt,
**  include structure tvprt.
*  mandt LIKE tvprt-mandt,
*  spras LIKE tvprt-spras,
*  provg LIKE tvprt-provg,
*  vtext LIKE tvprt-vtext,
* END OF t_tvprt.
*
*DATA: it_tvprt TYPE t_tvprt,
*      wa_tvprt TYPE t_tvprt.
*
*SELECT vtext
*  FROM tvprt
*  INTO CORRESPONDING FIELDS OF TABLE it_tvprt.

matt
Active Contributor
0 Kudos

That's because it's all commented out. 😉

It looks fine to me. There is data in the table? That field is populated?

0 Kudos

Ha! It wasn't at the time 😉 I'm going to play around with it a bit more.

Thanks so much Matthew.

0 Kudos

When I implement this code:

  TYPES: BEGIN OF t_tvprt,
*  include structure tvprt.
  mandt LIKE tvprt-mandt,
  spras LIKE tvprt-spras,
  provg LIKE tvprt-provg,
  vtext LIKE tvprt-vtext,
 END OF t_tvprt .

DATA: it_tvprt TYPE t_tvprt,
      wa_tvprt TYPE t_tvprt .

SELECT vtext
  FROM tvprt
  INTO CORRESPONDING FIELDS OF TABLE it_tvprt.

I get this error message:

"IT_TVPRT" is not an internal table. "OCCURS n" specification is missing.

I'm researching and working on it.

matt
Active Contributor
0 Kudos

TYPE STANDARD TABLE OF

That should see you right.

0 Kudos

I got Type "T_TVPRT" is unknown. I'm not sure how else to make it "known"

Any help would be greatly appreciated.

matt
Active Contributor
0 Kudos

Have you considered going on an ABAP training course? That would cover this.

DATA: it_tvprt TYPE STANDARD TABLE OF t_tvprt WITH DEFAULT KEY,
      wa_tvprt TYPE t_tvprt .

Try this book: https://www.sap-press.com/abap_4955/

0 Kudos

Yes, I have. I am doing an online tutorial, but with working and learning at the same time, I sometimes need some help. I have nobody else to ask.

Thanks for your help.

0 Kudos

I continue to get the "Type t_tvprt is unknown". I've researched, read, applied, cursed, and still cannot get this to behave. No big deal. Kind of done with this anyway.

0 Kudos

FWIW, I did get the book you mentioned. I just started it, so since I cannot necessarily port the info into my fool head, I will continue to have questions.

My apologies for asking basic questions. I figured this was a place where I could learn.

matt
Active Contributor
0 Kudos

It's fine. I'm just trying hard to teach rather than just supply the answer.

The problem is, as everyone who knows me well testify, I'm a terrible teacher because to me it's all so obvious.

I totally get it, Matthew. I prefer learning rather than just being told what/where. All good 😉 I'm just kind of stuck without many resources, but it will be fine. A couple of months from now, I'll be answering other people's questions and thinking how silly they must be for asking such basic things :^)

Here's what I've learned since our last communication:

There's an INCLUDE "top" to this report. I dropped the DATA (statement) into it and the error went away (yay!) but it's still not pulling data. It may simply be the test data I was given - I've since asked for a known-working sample.

Thank you again Matthew for your time.