‎2007 Nov 07 4:18 AM
Hi gurus,
I have used following select statemenet and I ma getting this error, <b>The work area "IT_T158B" is not long enough .</b>can you please tell me what is the problem :
data : begin of it_t158b occurs 0,
tcode like t158b-tcode,
bwart like t158b-bwart,
end of it_t158b.
SELECT single * FROM T158B
into it_t158b WHERE TCODE = MIGO
AND BWART = 261.
‎2007 Nov 07 4:42 AM
Hi Rajeev,
Try this code and I hope it will work 4 u...
reward points if helpful....
data : begin of it_t158b occurs 0,
tcode like t158b-tcode,
bwart like t158b-bwart,
end of it_t158b.
SELECT single tcode bwart FROM T158B
into it_t158b WHERE TCODE = MIGO
AND BWART = 261.
Thanks,
Ashish
‎2007 Nov 07 4:19 AM
Hi
It should be
U should declare a work area not internal table like
data : it_t158b like T158B.
SELECT single * FROM T158B
into it_t158b WHERE TCODE = MIGO
AND BWART = 261.
Thanks
Vasudha
Message was edited by:
Vasudha L
Message was edited by:
Vasudha L
‎2007 Nov 07 4:22 AM
HI thanks for the reply but now i am getting this error:
<b>Field "TABLE" is unknown. It is neither in one of the specified tables </b>
Thanks
Rajeev
‎2007 Nov 07 4:24 AM
Hi
Declare it as a work area as i have edited and in the declaration part of ur prgram add this:
TABLES: T158B.
Thanks
Vasudha
Reward points if found useful.
Message was edited by:
Vasudha L
‎2007 Nov 07 4:20 AM
structure miss match
data : begin of it_t158b occurs 0,
tcode like t158b-tcode,
bwart like t158b-bwart,
end of it_t158b.
<b>
this correct one</b>
SELECT single tcode bwart FROM T158B
into it_t158b WHERE TCODE = MIGO
AND BWART = 261.
‎2007 Nov 07 4:21 AM
If you are using single * you can not use into table
data : IS_T158B type T158B.
SELECT single * FROM T158B
into IS_t158b WHERE TCODE = MIGO
AND BWART = 261.Regards
Gopi
‎2007 Nov 07 4:42 AM
Hi Rajeev,
Try this code and I hope it will work 4 u...
reward points if helpful....
data : begin of it_t158b occurs 0,
tcode like t158b-tcode,
bwart like t158b-bwart,
end of it_t158b.
SELECT single tcode bwart FROM T158B
into it_t158b WHERE TCODE = MIGO
AND BWART = 261.
Thanks,
Ashish
‎2007 Nov 07 5:01 AM
Hi Rajeev,
Delete the occurs 0 statement from data declaration
Change the code to the following:
data : begin of wa_t158b,
tcode type t158b-tcode,
bwart type t158b-bwart,
end of wa_t158b.
SELECT SINGLE tcode bwart
FROM T158B
INTO wa_t158b
WHERE TCODE = MIGO
AND BWART = 261.
The first error occurs because you use "*" in the select clause, it will cause all fields to be selected, while the structure you defined only containes two fields which is TCODE and BWART. The structure and what is selected must match.
The second error, since you are using select single, which is only going to result in one record, you cannot put the result in a table, simply put it in a structure by omitting the "TABLE" from your select statement.