‎2006 Jul 26 2:04 PM
hai SDNs,
i have a small problem for retrieving data. i want to get data of material numbers along with material description form MAKT table ( material numbers are 1000,1015.1002,1006,1025,1018,1000,1020,1009,1010,1006,1023). can anyone help me in this regard.
thanks in advance.
aravind.
‎2006 Jul 26 2:08 PM
You can build a range and put all of those material numbers in it. Then all you need to do is hit MAKT.
tables: makt.
ranges: r_matnr for makt-matnr.
data: imakt type table of makt with header line.
clear r_matnr. refresh r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = '000000000000001000'.
append r_matnr.
r_matnr-low = '000000000000001015'.
append r_matnr.
r_matnr-low = '000000000000001001'.
append r_matnr.
r_matnr-low = '000000000000001006'.
append r_matnr.
* etc, etc
select * into table imakt from makt
where matnr in r_matnr
and spras = sy-laugu.
loop at imakt.
write:/ imakt-matnr, imakt-maktx.
endloop.
Regards,
Rich heilman
‎2006 Jul 26 2:06 PM
Go to the SE16N transaction.
Open MAKT tablke with selcted material numbers and your language thats all. (you can inser you matnr's by clicking an icon in "more" column in the grid.
BR, JAcek
Message was edited by: Jacek Slowikowski
‎2006 Jul 26 2:07 PM
you can use inner join for two tables i.e. mara and makt and mention all the material nos. in where class or you can pass the material no. in select-options also
regards
-Harkamal
‎2006 Jul 26 2:08 PM
You can build a range and put all of those material numbers in it. Then all you need to do is hit MAKT.
tables: makt.
ranges: r_matnr for makt-matnr.
data: imakt type table of makt with header line.
clear r_matnr. refresh r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = '000000000000001000'.
append r_matnr.
r_matnr-low = '000000000000001015'.
append r_matnr.
r_matnr-low = '000000000000001001'.
append r_matnr.
r_matnr-low = '000000000000001006'.
append r_matnr.
* etc, etc
select * into table imakt from makt
where matnr in r_matnr
and spras = sy-laugu.
loop at imakt.
write:/ imakt-matnr, imakt-maktx.
endloop.
Regards,
Rich heilman
‎2006 Jul 26 2:09 PM
Select a~matnr
b~maktx
into table itab
from mara as a inner join makt as b
on amatnr = bmatnr
where a~matnr in ('000000000000001000','000000000000001015','000000000000001002','000000000000001006','000000000000001025','000000000000001018','000000000000001000','000000000000001020','000000000000001009','000000000000001010','000000000000001006','000000000000001023').
Pls adard points if useful.
Vinodh.
Message was edited by: vinodh balasubramaniam
‎2006 Jul 26 2:09 PM
HI,
look into this query.
<b>SELECT matnr maktx INTO TABLE itab
WHERE ( matnr = 1000 OR
matnr = 1015 OR
matnr = .... ).</b>REgards,
Wasim Ahmed
‎2006 Jul 26 2:10 PM
Do you wish to write an ABAP or SE16. It is possible to do through both. Surely SE16 is the better way if it is one off and you do not wish to do massage the data.
SE16-
just select the data and enter the below materials in the Select-Option.
ABAP-
SELECT-OPTIONS SO_MATNR FOR MAKT-MATNR.
start-of-selection.
select * from makt where matnr in so_matnr and
spras = sy-spras.
write : / makt-matnr, makt-maktx.
endselect.
Regards
Anurag
‎2006 Jul 26 2:10 PM
Hi,
Use the following code to retrieve the text from MAKT,
SELECT SINGLE MAKTX
INTO LV_MAKTX
FROM MAKT
WHERE MATNR = LV_MATNR
AND SPRAS = SY-LANGU,
Rgds,
‎2006 Jul 26 2:13 PM
Hi Aravind,
1) You can have JOIN on MARA and MAKT tables.
2) Try with this code.
DATA:
BEGIN OF ITAB OCCURS 0,
MATNR TYPE MAKT-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF ITAB.
<b>SELECT AMATNR BMAKTX
FROM MARA AS A INNER JOIN MAKT AS B
ON AMATNR = BMATNR
INTO TABLE ITAB
WHERE B~SPRAS = SY-LANGU
AND A~MATNR IN (1000,1015.1002,1006,1025,1018,1000,1020,1009,1010,1006,1023).</b>
(OR)
<b>SELECT MATNR MAKTX
FROM MAKT
INTO TABLE ITAB
WHERE MATNR IN (1000,1015.1002,1006,1025,1018,1000,1020,1009,1010,1006,1023).</b>
Thanks,
Vinay
‎2006 Jul 26 2:14 PM
Hai Aravind
Go to se11
Give Table Name as 'MAKT'
then go to Contents by pressing CtrlShiftF10
then go to the Matnr in the High value you will find an Arrow Mark
that is Multiple Selections
Click on that arrow mark then give one by one Material Numbers
then click on Execute Button
you will get all the materials along with Descriptions
Regards
Sreenivasulu P
‎2006 Jul 26 2:16 PM
Hi,
Selecet * from MAKT where matnr in ('1000','1015.1002','1006,1025','1018','1000','1020','1009','1010','1006','1023')
Write: /mandt,matnr, spras, maktx,maktg.
Regards,
Amit
Please award any useful answer