Question:
dear friends,
how can i delete the leading zero from any column in ABAP.
like 0000000013524.
i need like 13524.
how can i achive this.
thanks with regards.
Malik
Answer:
How about this?
Hi,
You can use the SHIFT statement for this.
SHIFT <variable> LEFT DELETING LEADING '0'.
In this manner you can delete any leading characters.
That you can, but it's wrong.
Strings like this are stored this way so that they sort correctly in the database.
A Parameter statement or a write statement call conversion exits either inbound or outbound to convert from human-usable to database-usable and back. To see the difference this makes have a look at PRPR in SE11, display the data with and without conversion exits. Take a look at the wbs element number.
The reason why you should use conversion exits is quite simple. If SAP change any of their conversion exits internally then your code will still work.
Do the conversion yourself and it may break your program.
Secondly, if the variable you are trying to output is defined correctly, as noted above it will display without the zeroes when you use write, and can be accepted without the user entering a million zeroes in a parameter statement.
Shameek, look at the question and please don't answer unless you know what the answer is as conversion exits are there for a purpose and should be used at all times when you need to convert data from internal to external and vice versa..
_________________
Regards
R
Abap KC
SFMDR
Answer:
And don't let anyone tell you to use Shift.....
_________________
The Doc
Magna Grand Docot of the Tuly Idiot Order
2007 Basic Rules