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

'CONVERSION_EXIT_MATN1_INPUT'

Former Member
0 Likes
2,305

DATA : lv_matnr LIKE mard-matnr,

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

input = itab-matnr

IMPORTING

output = lv_matnr.

i made this and get ERR

entry is too long format is ____-_____-_____

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,599

How is itab-matnr defined? It should be only 18 characters. You can insure this by moving the value from ITAB-MATNR into your local varialbe, then doing the conversion.

DATA : lv_matnr LIKE mard-matnr.
<b>
lv_matnr = itab-matnr.</b>
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = <b>lv-matnr</b>
IMPORTING
output = <b>lv_matnr</b>.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Read only

Former Member
0 Likes
1,599

Check the type of the field ITAB-MATNR. It should not be GT 18.

-Kiran

Read only

Former Member
0 Likes
1,599

Dear Rani,

u can use only 18 char length MATNR, otherwiseit will gave no result but gave an error msg,

so use only 18 char MATNR.

hope it will help u

with regard

chetan vishnoi

Read only

Former Member
0 Likes
1,599

Hi,

pls. check d itab-matnr field also declared as itab-matnr,

if u decladred other than this it will throuws an error.

pls rectify that and check d program.

Ramesh.

Read only

0 Likes
1,599

Hi,

pls. check d itab-matnr field also declared as LIKE mard-matnr,

if u decladred other than this it will throuws an error.

pls rectify that and check d program.

Ramesh.

Read only

Former Member
0 Likes
1,599

Hi,

Use the FM <b>CONVERSION_EXIT_MATN2_INPUT</b>.

Consider this code.


DATA : it_mard TYPE STANDARD TABLE OF mard WITH HEADER LINE.
DATA : lv_matnr TYPE mard-matnr.

LOOP AT it_mard.

  lv_matnr = it_mard-matnr.

  CALL FUNCTION 'CONVERSION_EXIT_MATN2_INPUT'
    EXPORTING
      input  = lv_matnr
    IMPORTING
      output = lv_matnr.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.


ENDLOOP.


Regards,

Arun Sambargi.

Read only

Former Member
0 Likes
1,599

Hai Rani

Check the following Code

data : v_matnr like mard-matnr.

data : begin of itab occurs 0,

matnr like mara-matnr,

end of itab.

select matnr from mara up to 10 rows into table itab.

delete adjacent duplicates from itab comparing matnr.

loop at itab.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

input = itab-matnr

IMPORTING

output = v_matnr

EXCEPTIONS

length_error = 1

OTHERS = 1.

IF sy-subrc = 0.

write 😕 v_matnr.

ENDIF.

endloop.

Thanks & regards

Sreenivasulu P