Hi,
while debugging values are populating for mkpftbl but not to msegtbl. can anyone suggest where i am going wrong.
if sy-batch = 'X'.
select mblnr mjahr bldat cputm
from mkpf
into table mkpftbl
where bldat eq wtoday
and tcode2 eq ctcode2.
else.
select mblnr mjahr bldat cputm
into table mkpftbl
from mkpf
where mblnr in mblnr
and mjahr in mjahr
and tcode2 eq ctcode2.
endif.
if not mkpftbl[] is initial.
loop at mkpftbl.
select zeile charg matnr werks menge
into corresponding fields of table msegtbl
from mseg
Appending table msegtbl
for all entries in mkpftbl
where mblnr eq mkpftbl-wmblnr
and mjahr eq mkpftbl-wmjahr
and bwart eq cbwart
and werks eq splant.
*endloop.
Hi Nihi
W.r.t the code that i have seen yesterday, i guess your MSEGTBL is declared with fiels like wmblnr, wmjahr etc..
So use <b>into table</b> instead of <b>into corresponding fields of table</b>.
INTO CORRESPONDING FIELDS OF TABLE will work only when both the field names are same.
Also note the order shoould be the same.
Hope this helps you.
Kind Regards
Eswar
Hi,
Check in SE11 whether there exists record in mseg table which satisfies the condition
where mblnr eq mkpftbl-wmblnr
and mjahr eq mkpftbl-wmjahr
and bwart eq cbwart
and werks eq splant.
Or another easiest way is to command the conditions in where clause one by one and find out which one is not satisfied.Then try in SE11,for the condition.
Moreover as mentioned,<i>into corresponding fields</i> will work only if the field name matches.
Message was edited by: Jayanthi Jayaraman
Add a comment