2006 Jul 31 3:05 PM
Hi All,
I'm accepting parameters entry length as 11 char.May I compair this entry to mara-matnr which length is 18 char.
Pls. suggest...If Possible write code for me.
Thanks.
Singha
Hi All,
I'm accepting parameters entry length as 11 char.May I compair this entry to mara-matnr which length is 18 char.
Pls. suggest...If Possible write code for me.
Thanks.
Singha
2006 Jul 31 3:10 PM
hi,
Parameter should be converetd to 18 char long for the comparasion.
lv_matnr = lv_parameter.
if matnr it is Numeric then do
( do this for numeric check
IF NOT input CO '0123456789 '.
-
non numeric
ENDIF.)
conversion_exit_alpha_input
input = lv_matnr.
output = lv_matnr.
if non numeric about assignment will do.
after this u can compare with matnr field
2006 Jul 31 3:12 PM
Use Converssion Exit to change the field from length 11 to matnr length
Code as follows :
PARAMETERS : p_matnr(11) TYPE c.
DATA : o_matnr LIKE mara-matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = p_matnr
IMPORTING
output = o_matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SELECT SINGLE * FROM mast
WHERE matnr = o_matnr.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |