2004 Oct 26 9:56 PM
Hello,
I am trying to build a method that will return the results in a internal table. But I am finding that I can only get the header row back.
Here is the code in my method:
class c1 implementation.
method m1.
select bukrs belnr bschl dmbtr koart kostl lifnr
from bseg
into gt_bseg
where bukrs = w_bukrs
and belnr = w_belnr.
endselect.
endmethod. "m1
endclass. "c1 IMPLEMENTATION
Here is my method call:
call method oref->m1
EXPORTING
w_bukrs = gt_bkpf-bukrs
w_belnr = gt_bkpf-belnr
RECEIVING
gt_bseg_t = gt_bseg.
I can see that the correct data is being passed to my method, but why doesn't it populate my internal table with rows.
If I put the select statement from my method in a loop of my internal table of gt_bkpf , it works fine.
Thanks!
2004 Oct 26 10:32 PM
Because the <i><b>append</b></i> is missing.
select bukrs belnr bschl dmbtr koart kostl lifnr
from bseg
into gt_bseg
where bukrs = w_bukrs
and belnr = w_belnr.
<i><b>append gt_bseg .</b></i>
endselect.
better option:
select bukrs belnr bschl dmbtr koart kostl lifnr
from bseg
into <i><b>table</b></i> gt_bseg
where bukrs = w_bukrs
and belnr = w_belnr.
Regards
Raja
Message was edited by: Durairaj Athavan Raja
2004 Oct 26 10:45 PM
You forgot "TABLE" in "into gt_bseg" statement. It should be "into table gt_bseg"