2008 Aug 11 2:58 PM
hi friends,
I have following code .....
DATA:wa_matnr LIKE j_1iexcdtl-matnr.
DATA: l_name1 LIKE thead-tdname.
DATA:p_num2 LIKE j_1iexcdtl-maktx.
DATA:p_vtweg TYPE vtweg.
DATA:p_vkorg TYPE vkorg.
DATA:p_matnr TYPE matnr.
READ TABLE in_tab WITH KEY 'J_1IEXCDTL-MATNR'.
MOVE in_tab-value TO wa_matnr.
SELECT SINGLE matnr vkorg vtweg FROM mvke into (p_matnr,p_vkorg,p_vtweg) where matnr = wa_matnr.
CONCATENATE p_matnr p_vkorg p_vtweg INTO l_name1.
I'm now getting the values for p_matnr p_vkorg & p_vtweg.
i have a value in wa_matnr.
thanks in advance.
2008 Aug 11 3:02 PM
hi,
what is exactly not working in this code i mean where is not working?
is the select not working or the Concatenate.. or the Read?
2008 Aug 11 3:03 PM
2008 Aug 11 3:05 PM
following line is not populated even though i have value in wa_matnr which is same as matnr in table mvke.
SELECT SINGLE matnr vkorg vtweg FROM mvke into (p_matnr,p_vkorg,p_vtweg) where matnr = wa_matnr.
2008 Aug 11 3:07 PM
use the FM CONVERSION_EXIT_ALPHA_INPUT which is a conversion routine for the field matnr..
2008 Aug 11 3:09 PM
2008 Aug 11 3:09 PM
Do as below
READ TABLE in_tab INDEX 1.
wa_matnr = in_tab-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_matnr
IMPORTING
OUTPUT = wa_matnr.
SELECT SINGLE matnr vkorg vtweg FROM mvke into (p_matnr, p_vkorg, p_vtweg) where matnr = wa_matnr.
2008 Aug 11 3:09 PM
2008 Aug 11 3:09 PM
Also try declaring your data like this
DATA:wa_matnr LIKE mvke-matnr.
and then assign the value to it and try the select.
Hope this helps.
Franc
2008 Aug 11 3:10 PM
You need to first check if the entry or values exist in MVKE for the material number that is in wa_matnr.
Go to SE16, MVKE table and put the MATNR as the value which is in wa_matnr.
Check what are the values in MVKE for fields VKORg and VTWEG.
Probably then you can understand whats going wrong.
2008 Aug 11 3:05 PM
specify key field whilereading from table.
READ TABLE in_tab WITH KEY <MATNR> eq 'J_1IEXCDTL-MATNR'.
thanks
suman
2008 Aug 11 3:05 PM
Make sure that the value in wa_matnr is in internal format. This means that if the values is numeric, then it must have leading zeros.
Example, value = 1234, internal format 000000000000001234.
You can use this function module to translate the value to the internal format, before you do the SELECT statement.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_matnr
IMPORTING
OUTPUT = wa_matnr.
Regards,
Rich Heilman
Edited by: Rich Heilman on Aug 11, 2008 10:06 AM