Application Development 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: 

remove leading zero of matnr

Former Member
0 Kudos

hi,

    I facing problem with remove leading zero. simply I use this SHIFT a LEFT DELETING LEADING '0'. so this statement remove all leading zeros     but my problem is if some material start with zero i.e 01234567 like this i want to show same and using this SHIFT a LEFT DELETING LEADING '0'. all zero removed.   so is there any solution to find exact no. or length. if i am using strlen or describe field it gives me length 18 can any tell me how to find length 01234567 i.e.8 or is any solution

and matnr length is not fix it will be 11, 9 or 10 or any no.

can anyone help for this

regards,

dipti

9 REPLIES 9

Former Member
0 Kudos

Hi Dipti,

you can use one of the several Conversion Routines.

You find them if you search in the Tx se84 with *Conversion*Matnr* or have a look at the domains in the Data Dictionary there are sometimes Conversion Routines in the Domain.

Regards

Tobi

raymond_giuseppi
Active Contributor
0 Kudos

Call transaction SE11 and look at domain MATNR, depending on your system you can find a conversion routine as ALPHA, MATN1, MATN2 or another value I'm not aware of. As your material id begin with a zero in your system, you cannot/must not find ALPHA in the domain, else you got a serious problem (try to execute transaction MM03 on your material id to check for problem that would prevent use of this reference by user of any standard SAP transaction...)

Then use the associated input FM (double-click on conversion routine field), e.g. CONVERSION_EXIT_MATN1_INPUT.

Regards,

Raymond

0 Kudos

HI ALL,

I am using this function but using this it removes all zero .

i want to show if in mara table material is 0988665543 then it show same no 0988665543

regards,

dipti

0 Kudos

What is the conversion routine of MATNR in your system?

From where do you get the original number with multiple zeroes, note that if 0988665543 00988665543 and 988665543 are valid material id and if someone used Excel on a file where id was considered a numeric field, this guy may have messed up the data to a nearly unrecoverable point. Be ready to check database (tables like MARA or MATERIALID) for existence of every possible number of zeroes (SELECT with values

988665543 to 000000000988665543 !)

Regards,

Raymond

Former Member
0 Kudos

hi,

  In table mara material is like 0123456789 (here first zero is important) or 123456789.

  but in internal table in both cases it shows like this  000000000123456789 & same can be seen in output also.

  so i want to delete leading zero for material which start with zero.

Former Member
0 Kudos

thanks all of u

0 Kudos

Hi Dipti,

You can check the value if the value has matnr+0(2) = 00. then use leading zeors,

If the matnr+0(2) = 0X. then leave it.

Thanks,

Sivandh

0 Kudos

At the risk of repeating myself, what is the conversion routine of MATNR in your system, a 0123456 may not comply with your system parameters and would mess up your database ?

Former Member
0 Kudos

thank u