Skip to Content
0
Former Member
Oct 26, 2004 at 08:56 PM

Method to read a result set from a select

23 Views

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!