‎2008 Jun 11 10:49 AM
Hi,
Is there any way I can do something like:
SELECT
MATNR
(SELECT MAKTX FROM MAKT WHERE MATNR = M~MATNR AND LANG = 'PT') as PT
(SELECT MAKTX FROM MAKT WHERE MATNR = M~MATNR AND LANG = 'ES') as ES
FROM
MARA as M
I want to return only 1 record instead of 2...
Thanks
Hugo
‎2008 Jun 11 11:35 AM
Thanks for the replies guys but i think you didn't undestand my question
I want to know if there's a way where the result of the select is something like:
MATNR LANG_PT LANG_ES LANG_FR
000000000000000001 Mat PT Mat ES
The result of the select must be only 1 record with the several languages I choose in the select of course.
Thanks again, you will be rewarded
Hugo
‎2008 Jun 11 10:53 AM
Hi,
You can do as below :
select matnr from mara into itab where matnr = 'some value'.
if not itab [ ] is initial.
select matnr maktx from makt into it_final for all entries in
itab where matnr = itab-matnr
and lang = 'PT' or
lang = 'ES'.
endif.
"Write to output list.
Thanks,
Sriram Ponna.
‎2008 Jun 11 10:59 AM
hi ,
select matnr from mara into table it_tab where matnr = ' userinput'.
select single MAKTX from makt into
V_MAKTX for all entries in
it_tab where matnr = it_tab-MATNR
and lang = 'PT' or
lang = 'ES'.
‎2008 Jun 11 11:02 AM
‎2008 Jun 11 11:16 AM
You can use JOINS to achieve the same functionality.
Select maraMatnr amaktx a~spras
into table itab
from mara inner join makt as a on amatnr = maramatnr where
a~spras in ('E', 'P').
itab will have all matnr and material description in both the languages.
Thanks and Regards,
Lakshmi.
‎2008 Jun 11 11:19 AM
hii
SELECT matnr " Material Number
werks " Plants
lgort " Storage Location
FROM mard
INTO TABLE i_mard
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND werks EQ i_marc-werks
AND lgort IN s_lgort.
SELECT matnr " Material Number
maktx " Material Description
FROM makt
INTO TABLE i_makt
FOR ALL ENTRIES IN i_mard
WHERE matnr = i_mard-matnr
AND spras = lc_lang.you can use like this in your program.
thx
twinkal.
‎2008 Jun 11 11:35 AM
Thanks for the replies guys but i think you didn't undestand my question
I want to know if there's a way where the result of the select is something like:
MATNR LANG_PT LANG_ES LANG_FR
000000000000000001 Mat PT Mat ES
The result of the select must be only 1 record with the several languages I choose in the select of course.
Thanks again, you will be rewarded
Hugo
‎2008 Jun 11 1:06 PM
Join MARA to MAKT twice using a different language for each - you'll need to use table aliases to do this.
‎2008 Jun 11 3:27 PM