‎2007 Nov 02 8:20 AM
Hi,
I have a internal table with materal number. The sample records are
000000000007509644
000000000000000698
000000007500980011
I want to remove the Zero's if its present infront of numbers.
i need like below only
7509644
698
7500980011
Plz give me a idea.
Mohana
‎2007 Nov 02 8:28 AM
Hi,
use code as below :
data : a(25), b(25).
a = '000000000007509644'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = a
IMPORTING
OUTPUT = b
.
write 😕 a.
write 😕 b.
Regards,
Sandeep Kaushik
‎2007 Nov 02 8:23 AM
Hi,
Use condense. It will remove leading zeroes
or use CONVERSION_EXIT_ALPHA_OUTPUT
Regards
Shiva
‎2007 Nov 02 8:24 AM
Hi
u can use SHIFT text RIGHT DELETING LEADING '0' or use CONDENSE.
Thanks
Vasudha.
Message was edited by:
Vasudha L
‎2007 Nov 02 8:27 AM
use
SHIFT V_CHAR LEFT DELETING LEADING '0'.
or
REPLACE '0' WITH SPACE INTO L_VAR.
CONDENSE L_VAR.
‎2007 Nov 02 8:27 AM
Hi,
Use shift statement and delete left leading zeros.
ex.
first convert matnr in char format
SHIFT matnr LEFT DELETING LEADING SPACE.
Regards,
Prashant
‎2007 Nov 02 8:28 AM
Hi,
use code as below :
data : a(25), b(25).
a = '000000000007509644'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = a
IMPORTING
OUTPUT = b
.
write 😕 a.
write 😕 b.
Regards,
Sandeep Kaushik
‎2007 Nov 02 8:30 AM
If this is a "problem" with an ALV report you can just tell the system in the fieldcatalog to suppress the zeroes:
wa_fcat-no_zero = 'X'.
‎2007 Nov 02 8:35 AM
Hi,
Try using Pack statement. You cah search in SAP help(F1)
Deserve Reward.
Gaurav.
‎2007 Nov 02 8:39 AM
Hi Mohana,
1. If this is a "problem" with an ALV report you can just tell the system in the fieldcatalog to suppress the zeroes:
wa_fcat-no_zero = 'X'.
or
2. Use the FM
ws_number = 0000000000000001.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = ws_number
IMPORTING
OUTPUT = ws_number.
or
3. Use CONDENSE stmt
Reward If USeful.
Regards,
Chitra
‎2007 Nov 02 8:41 AM
Hi,
Copy this code and run in se38.You will find the solution.
REPORT Zxya .
data: n type i value '0000011'.
write:/ n no-zero.
Reward for helpful solutions.
Regards,
Harini.S
‎2007 Nov 02 8:54 AM
Hi
try this
1.take the value into variable <b>v1=000000000007509644</b>
2.use the command <b>shift v1 left deleting leading '0'.</b>
3.print v1.
it wl be helpful
plz reward
‎2007 Nov 02 8:54 AM
There already exists a conversion exit for Material Number. You can use it
CONVERSION_EXIT_MATN1_OUTPUT.
Just execute the FM with input as 000000000007509644, you will get the output as 7509644
Regards
Gopi