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

Code not working.........

Former Member
0 Likes
1,278

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.

11 REPLIES 11
Read only

Former Member
0 Likes
1,250

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?

Read only

former_member585060
Active Contributor
0 Likes
1,250

Elaborate ur requirment

Read only

0 Likes
1,250

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.

Read only

0 Likes
1,250

use the FM CONVERSION_EXIT_ALPHA_INPUT which is a conversion routine for the field matnr..

Read only

0 Likes
1,250

post your complete code here

Read only

0 Likes
1,250

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.

Read only

0 Likes
1,250

thanks richi.........thread is closed

Read only

0 Likes
1,250

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

Read only

0 Likes
1,250

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.

Read only

Former Member
0 Likes
1,250

specify key field whilereading from table.

READ TABLE in_tab WITH KEY <MATNR> eq 'J_1IEXCDTL-MATNR'.

thanks

suman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,250

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