How suppres left zeros in the matnr

Question:
Hi,
I need suppress left zeros in the matnr code, just for manipulation, not in the table. Its important mention that the matnr code may have letters and number (eg. 0000000000000ACE01 will be ACE01)
TIA
Answer:
USE SHIFT COMMAND TO DELETE THE LEADING ZEROS.
LIKE SHIFT MATNR LEFT DELETING LEADING ' 0'.
Answer:
use SHIFT '00000XYZ' LEFT DELETING LEADING '0'.
saper
Answer:
Thx,
Answer:
Better take a look at Function Modules CONVERSION_EXIT*
Answer:
Hi,
when displaying to List use the option no edit mask for 'write' statements.
Regards,
Sen
Answer:
As ocvantol pointed out you should at the very least use the CONVERSION_EXIT* FM's. However, there a specific conversion FM for MATNR which takes care of leading zeroes regardless of whether there are alpha-numeric characters in it. I just can't remember what it is at the moment. I will look it up and repost a little later.
Dr Sidewalk
_________________
"In the middle of difficulty lies opportunity" - Albert Einstein
"Money isn't everything in life, unless you don't have it". David King
"Fail to plan, plan to fail"
"Success is a journey, not a destination."
Answer:
The replies talkig about SHIFT or OVERLAY are incorrect. As Ocvantol and Dr Sidewalk point out Conversion Exits are the correct way to go.
For more information and code examples on how to use conversion exits, look here: /forums/viewtopic.php?t=22406

R
Answer:
always look on the domaine for the data element for a conversion routine.
For MATNR it is normaly MATN1 (on specific systems others)
Then use CONVERSION_EXIT_<conv-routine>_OUTPUT.
For your problem CONVERSION_EXIT_ALPHA_OUTPUT would also fit the problem.
regards
Hans
Answer:
No, not in this case.
CONVERSION_EXIT_MATN1_OUTPUT suppress the leading zeroes only if the material number is numeric.
Ciao, Giulio.
Answer:
No, not in this case.
CONVERSION_EXIT_MATN1_OUTPUT suppress the leading zeroes only if the material number is numeric.
Ciao, Giulio.
Yes.... but then if a user enters the alphanumeric code withoutn the zeroes the item will not be found so for material numbers that are alpha numeric displaying zeroes is correct if they have them on the front. Therefore the conversion exit is still correct.
Perhaps Tunka can explain a bit more about what he wants to do.
R
Answer:
Thx to all,
Im usign "SHIFT MATNR LEFT DELETING LEADING ' 0'." right now, and i don't have any problem, i want delete the left zeros only for presentation in my table control.
Regards[/quote]
Answer:
Dear tunka:
(eg. 0000000000000ACE01 will be ACE01)
You better talk to your supervisor before you accept the 'solution' you want to go for. While it is possible to have a material 0000000000000ACE01, it is highly unlikely, because you would have to type all the zeroes when you create the material. But deleting the zeroes would actually falsify the value. What if you also have a material ACE01? Suppose 0000000000000ACE01 needs to be deleted and you display it as ACE01. Now the user goes to MM02 and deletes ACE01 (as displayed in your list). S/he would actually delete the wrong material.
Your code would not pass my source code review! Scary to think, that there are actually many people taking that 'shortcut'.
Regards,
Wolfgang
Answer:
Dear Wolfang:
You are rigth at all and clarify a lot of things (unless for me), my example was wrong sorry
Thanks
Best Regards

More Articles:

Performance tuning?
How to compare SAP environments?
how to find table if field and structure is known?
listing tables?
Printing Signature on checks using Signature DIMM?
Calculation field on SELECT statements?