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: 

data is there in mseg...but sy-subrc is 4

Former Member
0 Kudos

my select statement is like this:

SELECT * FROM Mseg

INTO TABLE it_mseg

WHERE mblnr = itab-mblnr

and matnr = s_mate.

loop at it_mseg.

it_item-matnr = it_mseg-matnr.

it_item-dmbtr = it_mseg-dmbtr.

it_item-mblnr = it_mseg-mblnr.

it_item-bwart = it_mseg-bwart.

it_item-budat = itab-budat.

it_item-erfmg = it_mseg-erfmg.

it_item-rate = it_item-dmbtr / it_item-erfmg.

append it_item.

endloop.

while debugging it is showing sy-subrc is 4 and not retrieving data...

pls help me

3 REPLIES 3

Former Member
0 Kudos

Hi,

Is s_mate is select-option then change code as follows. Does the itab has contents, if yes then check below code:

SELECT * FROM Mseg
INTO TABLE it_mseg
for all entries in itab
WHERE mblnr = itab-mblnr
and matnr in s_mate.

if itab is just a workarea kind then,

SELECT * FROM Mseg
INTO TABLE it_mseg
WHERE mblnr = itab-mblnr
and matnr in s_mate.

Thanks & Regards,

Navneeth K.

Former Member
0 Kudos

Hi Rajkamal,

In debugging check value of itab-mblnr

and s_mate .

check S_MATE value and declaration type of S_MATE.

Regards,

Rajitha.

former_member181995
Active Contributor
0 Kudos

>

> my select statement is like this:

>

> SELECT * FROM Mseg

> INTO TABLE it_mseg

> WHERE mblnr = itab-mblnr

> and matnr = s_mate.

>

Mseg is looking at only one value if your table(itab) is with header line.

either use For all entries in selcct query else use select single * in a loop at itab.

Better use for all entries.