Application Development and Automation 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: 
Read only

get a solution for the pg.

Former Member
0 Likes
570

data : begin of itab occurs 0,

mblnr like mseg-mblnr,

menge like mseg-menge,

meng1 like ekpo-menge,

end of itab.

select amblnr amenge b~menge into corresponding fields of

table itab from mseg as a inner join ekpo as b on bebeln = aebeln.

loop at itab.

write 😕 itab-mblnr,itab-menge,.

endloop.

i cant get the value for the meng1 field, why?

by

karthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
549

remove corresponding fields of and give into table


select a~mblnr a~menge b~menge into 
table itab from mseg as a inner join ekpo as b on b~ebeln = a~ebeln.

loop at itab.
write :/ itab-mblnr,itab-menge,.
endloop.

 

data : begin of itab occurs 0,

mblnr like mseg-mblnr,

menge like mseg-menge,

meng1 like ekpo-menge,

end of itab.

select amblnr amenge b~menge into corresponding fields of

table itab from mseg as a inner join ekpo as b on bebeln = aebeln.

loop at itab.

write 😕 itab-mblnr,itab-menge,.

endloop.

i cant get the value for the meng1 field, why?

by

karthi.

3 REPLIES 3
Read only

Former Member
0 Likes
550

remove corresponding fields of and give into table


select a~mblnr a~menge b~menge into 
table itab from mseg as a inner join ekpo as b on b~ebeln = a~ebeln.

loop at itab.
write :/ itab-mblnr,itab-menge,.
endloop.

 

Read only

Former Member
0 Likes
549

Fristly when you are using CORRESPONDING FIELDS OF, it expects same field name in database table and internal table. In your case MENGE is database table field whereas in internal table it is MENGE1, both do not match so MENGE1 will not be populated. Remove CORRESPONDING FIELDS OF from your statement. Next this statement will execute forever as you are retreiving with conditions andMSEG consists huge data. Try to optimize SELECT query for better performance.

Read only

Former Member
0 Likes
549

Hi

Try like this..

select a~mblnr

a~menge

b~menge AS menge1

into corresponding fields of

table itab

from mseg as a

inner join

ekpo as b

on aebeln = bebeln.

Let us know then..

Thanks . Praveen