Skip to Content
0
Former Member
Jul 31, 2007 at 03:21 PM

problem with material number

14 Views

I created a material 20070730a1 using mm01 tcode. But in my program when i am trying to retrieve info for that material the select statement is unsuccessfully. But when i go for that material in mm03 i am able to view info for that material. Even i am using CONVERSION_EXIT_MATN1_INPUT FM to convert my materal number and i am using the return value from this function in my select statement. But still the select statement fails.

code is as follows:

****************************************************************************************************

FORM conversion_exit USING pv_matnr TYPE matnr

CHANGING pr_temp_matnr TYPE char18.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

input = pv_matnr

IMPORTING

output = pr_temp_matnr

EXCEPTIONS "#EC *

length_error = 1

OTHERS = 2.

ENDFORM. " conversion_exit

pr_temp-matnr is send to an internal table i_cabn from there it used in select statement.

FORM get_mat_type.

IF NOT i_cabn IS INITIAL. "check for initial

SELECT matnr "#EC CI_NOFIELD

matkl

pstat

FROM mara

INTO TABLE i_matn

FOR ALL ENTRIES IN i_cabn

WHERE matnr = i_cabn-old_matnr

AND lvorm <> c_x.

IF sy-subrc = 0.

SORT i_matn BY matnr.

ENDIF. " IF sy-subrc = 0

ENDIF. " IF NOT i_cabn IS INITIAL

ENDFORM. " get_mat_type

********************************************************************************

Any suggestion on this problem.

Thanks