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

Parameter entry & standard DB field length

Former Member
0 Likes
400

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

2 REPLIES 2
Read only

Former Member
0 Likes
368

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

Read only

Former Member
0 Likes
368

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.