2019 May 31 2:12 PM
Hello AbapExperts,
data : begin of wa_final,
bukrs type t001-bukrs,
butxt type t001-butxt,
lifnr type lfb1-lifnr,
end of wa_final.
data it_final like table of wa_final.
select t001~bukrs t001~butxt lfb1~lifnr into table it_final
from t001 inner join lfb1 on t001~bukrs = lfb1~bukrs.
sort it_final by bukrs.
loop at it_final into wa_final.
write : / wa_t00l-bukrs,
wa_t001-butxt,
wa_lfb1-lifnr,
endloop.
when i compile the above program i got error msg like " field "wa_t001-bukrs" is unknown.It is neither in one of specified tables nor defined by "data" statement". Can you please help me find out the error.
suggestions apreciated.
Thanks.
Hello AbapExperts,
data : begin of wa_final,
bukrs type t001-bukrs,
butxt type t001-butxt,
lifnr type lfb1-lifnr,
end of wa_final.
data it_final like table of wa_final.
select t001~bukrs t001~butxt lfb1~lifnr into table it_final
from t001 inner join lfb1 on t001~bukrs = lfb1~bukrs.
sort it_final by bukrs.
loop at it_final into wa_final.
write : / wa_t00l-bukrs,
wa_t001-butxt,
wa_lfb1-lifnr,
endloop.
when i compile the above program i got error msg like " field "wa_t001-bukrs" is unknown.It is neither in one of specified tables nor defined by "data" statement". Can you please help me find out the error.
suggestions apreciated.
Thanks.
2019 May 31 2:29 PM
HI Bhavani ,
loop at it_final into wa_final.
write : / wa_t00l-bukrs,wa_t001-butxt,wa_lfb1-lifnr.
endloop.
In the above code you are looping into one workarea and you are displaying some other workarea data which you didnt even declared.
2019 May 31 3:49 PM
I also see that there's a typo error: wa_t00l <> wa_t001 (l versus 1)
2019 May 31 4:25 PM
2019 May 31 4:25 PM
In future, use the "code" button. It makes your code easier to read if it's formatted nicely.
data :
begin of wa_final,
bukrs type t001-bukrs,
butxt type t001-butxt,
lifnr type lfb1-lifnr,
end of wa_final.
data it_final like table of wa_final.
select t001~bukrs t001~butxt lfb1~lifnr into table it_final
from t001
inner join lfb1
on t001~bukrs = lfb1~bukrs.
sort it_final by bukrs.
loop at it_final into wa_final.
write : / wa_t00l-bukrs,wa_t001-butxt,wa_lfb1-lifnr.
endloop.
Now, why would you expect it to work, if you've not declared wa_t001?
Also, don't select from the database and then sort. Put ORDER BY in your select.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |