2008 May 06 5:59 AM
Hi,
Any function to remove the preceeding zeros from a number type.
I cannot be using integers because i need to append it to a string.
Thanks and regards,
Ronita
2008 May 06 6:04 AM
DATA : v TYPE maktx.
START-OF-SELECTION.
v = '000000material desc'.
SHIFT v LEFT DELETING LEADING '0'.
WRITE : v.
reward if helpful
Hi,
Any function to remove the preceeding zeros from a number type.
I cannot be using integers because i need to append it to a string.
Thanks and regards,
Ronita
2008 May 06 6:02 AM
Hi,
USE FM CONVERSION_EXIT_ALPHA_OUTPUT.
Regards
Raju Chitale
Edited by: Raju Chitale on May 6, 2008 8:01 AM
2008 May 06 6:02 AM
Hi,
do like this.
DATA:num(4) value '0020'.
WRITE:/ num.
SHIFT num LEFT DELETING LEADING '0'.
WRITE:/ num.
rgds,
bharat.
2008 May 06 6:04 AM
DATA : v TYPE maktx.
START-OF-SELECTION.
v = '000000material desc'.
SHIFT v LEFT DELETING LEADING '0'.
WRITE : v.
reward if helpful
2008 May 06 6:05 AM
Hi,
You have the following options:
1. write integer left-justified no-grouping to charvariable.
2. charvariable = integer. shift left charvariable deleting leading '0'.
3. CONVERSION_EXIT_ALPHA_OUTPUT.
Thanks and regards,
S. Chandramouli.
2008 May 06 6:05 AM
Hi,
Use the following statement.
SHIFT num LEFT DELETING LEADING ZEROS..
Regrads,
madan.
2008 May 06 6:05 AM
do this way ..
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = it_sales-matnr
importing
output = it_sales-matnr.
2008 May 06 6:22 AM
hi,
conversion exitalpha_output is used to remove leading zeros.
example.
DATA : num(5) TYPE n VALUE '0002'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = v_num
IMPORTING
output = v_num.
reward if useful.
thanks and regards.
2008 May 06 6:38 AM
Hi Ronita,
Use the below Function to remove the preceeding zeroes.
CONVERSION_EXIT_ALPHA_OUTPUT: converts any number with zeroes right into a simple integer
Example:
input = 00000000000123
output = 123
pls reward if useful.
Thanks,
Sirisha.
2008 May 06 6:42 AM
Hi,
Try this simple code.
data : num type i value '0000098'.
pack num to num.
write num.
Output : 98
Reward pts if helpful
2008 May 06 6:44 AM
Hi Ranita,
U can use anyone of the following options.
DATA:num(10) value '0000000100'.
SHIFT num LEFT DELETING LEADING '0'.
WRITE:/ num.
Or
DATA : num(10) TYPE n VALUE '0000000100'.
DATA : l_num type n.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = num
IMPORTING
output = l_num.
write: l_num.
If it is helpfull pls reward pts.
Regards
Srimanta
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |