2008 Jun 11 12:59 PM
Hi,
Can any one please tell me how we will add leading zeros to a field.
I was declared the field field(10) type c, in internal table.
Now i upload the data from flat file to IT.
in flat file the value is '1254367'
Now for this field i want to add leading zeros.
Thanks in advance.
2008 Jun 11 12:59 PM
use Fm conversion_exit_alpha_input
2008 Jun 11 12:59 PM
2008 Jun 11 1:00 PM
Hi,
insted of char take it as numc.
data : field(10) type n.
or use the function module 'CONVERSION_EXIT_ALPHA_INPUT'
data : field(10) value '12345'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = field
IMPORTING
OUTPUT = field.
write : field.
regards
prasanth
2008 Jun 11 1:01 PM
2008 Jun 11 1:01 PM
Hi,
Please use FM CONVERSION_EXIT_ALPHA_INPUT to add leading zero's to the field.
Thanks,
Sriram Ponna.
2008 Jun 11 1:04 PM
Hi,
use the FM "CONVERSION_EXIT_ALPHA_INPUT".
loop at itab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = itab-fldname
IMPORTING
OUTPUT = itab-fldname
.
modify itab.
endloop.
After this your internal table will have values appended with zeros.
Regards,
Yellappa.
2008 Jun 11 1:08 PM
hii
you can use
ls_data-matnr = ls_excel-value.
w_matnr = ls_data-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_matnr
IMPORTING
output = w_matnr.
ls_data-matnr = w_matnr.thx
twinkal
2008 Jun 11 1:25 PM
hi PB,
catch d value in a local char10 variable. then check its length with strlen. if value is 1234567 den length will b 7. den concatenate '000' local var into internal table field.
hope ur problem is resolved.
plz assign points if it is helpful.
rgds,
Avijit
2008 Jun 11 1:32 PM
Hi,
goto the domain of the field you are using, check if there is any conversion exit, use appropriate conversion_exit_XXXX_input
to convert into internal format.
Thanks,
Keerthi.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |