10-09-2007 7:59 AM
Hi all,As you know mara-matnr field's lenght is 18 char, however in some cases the users do not fill all the length, for example they make it 15 char.
Here I need to add zeros at the beginning of the matnr, as it requires.
For instance, if the user has entered the matnr as 13 char: 1234567891234
then I need to make it as 000001234567891234..
How can I do it?
Thanks.
10-09-2007 8:00 AM
10-09-2007 8:01 AM
10-09-2007 8:01 AM
Hi,
use Fm,.
CONVERSION_EXIT_MATN1_INPUT
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = zzmat
IMPORTING
output = zzmat.
Thanks.
10-09-2007 8:02 AM
USE THE FUNCTION MODULE,
<b>conversion_exit_alpha_input.</b>
conversion_exit function modules are for the purpose of converting a fiedl from user format to sap format and vise versa. there are many conversion exit fn modules.
u can give converion_exit* in se37 and see many fn modules.
example: conversion_exit_alpha_output this is to convert from sap format to user format.
this means example in mara table the length of matnt would be 18. but if we give 1 value . it takes 0000000000...1. but the user needs the output as only 1. then we can use conversion_exit_alpha_input to convert from sap to user format.
conversion_exit_alpha_input cn be used viceversa.
Message was edited by:
Hymavathi Oruganti
10-09-2007 8:02 AM
hi try it like this
TRANSLATE temp1 USING ' 0'.
temp1 -> is the field name which one u want to fill '0'.
regards
baskaran
10-09-2007 8:36 AM
try
data zmatnr TYPE matnr value '123'.
data zch(18).
data zint type i.
data i TYPE i VALUE 1.
zint = 18 - strlen( zmatnr ).
WHILE i le zint.
CONCATENATE '0' zch into zch.
i = i + 1.
ENDWHILE.
CONCATENATE zch zmatnr into zch.
WRITE / zch.