2006 Jul 14 8:10 AM
&----
*
*& Report ZPRACTISE1 *
*& *
&----
*& *
*& *
&----
REPORT ZPRACTISE1 .
tables : mara,makt.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
meins like mara-meins,
end of it_mara.
data : begin of it_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of it_makt.
data : begin of itab occurs 0,
matnr like mara-matnr,
meins like mara-meins,
maktx like makt-maktx,
end of itab.
selection-screen : begin of block b1 with frame title text-001.
select-options : s_matnr for mara-matnr.
selection-screen : end of block b1.
select * from mara into corresponding fields of table it_mara
where matnr in s_matnr.
*select * from makt into corresponding fields of table it_makt
where maktx = it_makt-maktx.
select * from makt into corresponding fields of table it_makt
for all entries in it_mara
where matnr = it_mara-matnr.
loop at it_mara.
move it_mara to itab.
append itab.
clear itab.
modify itab.
endloop.
loop at it_mara.
read table it_mara with key matnr = it_mara-matnr.
move it_makt to itab.
move it_mara to itab.
move it_mara-matnr to itab-matnr.
move it_mara-meins to itab-meins.
move it_makt-maktx to itab-maktx.
append itab.
refresh itab.
clear itab.
endloop.
loop at itab.
write : itab-matnr,
itab-meins,
itab-maktx.
endloop.
The above pgm i am not getting materialdescription in the o/p.please slove my problem
&----
*
*& Report ZPRACTISE1 *
*& *
&----
*& *
*& *
&----
REPORT ZPRACTISE1 .
tables : mara,makt.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
meins like mara-meins,
end of it_mara.
data : begin of it_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of it_makt.
data : begin of itab occurs 0,
matnr like mara-matnr,
meins like mara-meins,
maktx like makt-maktx,
end of itab.
selection-screen : begin of block b1 with frame title text-001.
select-options : s_matnr for mara-matnr.
selection-screen : end of block b1.
select * from mara into corresponding fields of table it_mara
where matnr in s_matnr.
*select * from makt into corresponding fields of table it_makt
where maktx = it_makt-maktx.
select * from makt into corresponding fields of table it_makt
for all entries in it_mara
where matnr = it_mara-matnr.
loop at it_mara.
move it_mara to itab.
append itab.
clear itab.
modify itab.
endloop.
loop at it_mara.
read table it_mara with key matnr = it_mara-matnr.
move it_makt to itab.
move it_mara to itab.
move it_mara-matnr to itab-matnr.
move it_mara-meins to itab-meins.
move it_makt-maktx to itab-maktx.
append itab.
refresh itab.
clear itab.
endloop.
loop at itab.
write : itab-matnr,
itab-meins,
itab-maktx.
endloop.
The above pgm i am not getting materialdescription in the o/p.please slove my problem
2006 Jul 14 8:13 AM
Hello,
Change the bold part...
loop at it_mara.
<b>read table it_MAKT with key matnr = it_mara-matnr.</b>* move it_makt to itab.
move it_mara to itab.
move it_mara-matnr to itab-matnr.
move it_mara-meins to itab-meins.
move it_makt-maktx to itab-maktx.
append itab.
refresh itab.
clear itab.
endloop.
Regards,
Naimesh
2006 Jul 14 8:16 AM
loop at <b>it_mara</b>.
read table <b>it_mara</b> with key matnr = it_mara-matnr.
silly mistake...
loop at <b>it_mara</b>.
read table <b>it_makt</b>a with key matnr = it_mara-matnr.
2006 Jul 14 8:15 AM
Yes, you are reading from it_mara table rather form it_makt.
Change the read statement to
read table <b>it_makt</b> with key matnr = it_mara-matnr.
Regds
Manohar
2006 Jul 14 9:44 AM
Hai Reddy
Check the following Code
<b>tables : mara,makt.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
meins like mara-meins,
end of it_mara.
data : begin of it_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of it_makt.
data : begin of itab occurs 0,
matnr like mara-matnr,
meins like mara-meins,
maktx like makt-maktx,
end of itab.
selection-screen : begin of block b1 with frame title text-001.
select-options : s_matnr for mara-matnr.
selection-screen : end of block b1.
clear it_mara.
refresh it_mara.
select matnr
meins
from mara
into table it_mara
up to 10 rows
where matnr in s_matnr.
if sy-subrc = 0.
sort it_mara by matnr.
endif.
if not it_mara[] is initial.
clear it_makt.
refresh it_makt.
select matnr
maktx
from makt
into table it_makt
for all entries in it_mara
where matnr = it_mara-matnr and
spras = sy-langu.
endif.
loop at it_mara.
read table it_makt with key matnr = it_mara-matnr.
move it_mara-matnr to itab-matnr.
move it_mara-meins to itab-meins.
move it_makt-maktx to itab-maktx.
append itab.
clear itab.
endloop.
loop at itab.
write 😕 itab-matnr,
itab-meins,
itab-maktx.
endloop.</b>
Regards
Sreeni
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |