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

data retrieval

Former Member
0 Likes
1,412

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.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,383

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,383

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

Read only

Former Member
0 Likes
1,383

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,384

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

Read only

Former Member
0 Likes
1,383

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

Read only

dani_mn
Active Contributor
0 Likes
1,383

HI,

look into this query.

<b>SELECT matnr maktx INTO TABLE itab
WHERE ( matnr = 1000 OR 
        matnr = 1015 OR
        matnr = ....   ).</b>

REgards,

Wasim Ahmed

Read only

Former Member
0 Likes
1,383

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

Read only

Former Member
0 Likes
1,383

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,

Read only

Former Member
0 Likes
1,383

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

Read only

Former Member
0 Likes
1,383

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

Read only

Former Member
0 Likes
1,383

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