09-19-2008 12:28 PM
hi all,
I am working on an interface. while downloading the file I need to get the sold-to-party number (KUNNR) without the leading zeroes and it should start directly at the first position and end of the field should be filled with blanks.
for eg. kunnr no. 0000131673 the leading zeroes should be removed and output should start at 1st position and end of the field kunnr should be filed with blanks.
given kunnr : 0000131673
desired o/p : 131673 and end of trimmed KUNNR value
should be filled with blanks.
please give me a solution.
thanks in advance.
09-19-2008 12:33 PM
09-19-2008 12:32 PM
hi,
use the Function module
CONVERSION_EXIT_ALPHA_OUTPUT for supressing the leading zeroes
09-19-2008 12:33 PM
09-19-2008 12:34 PM
Hi,
Other use this abap command before query
SHIFT <InputValue> LEFT DELETING TRAILING '0'.
OR
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = <InputValue>
importing
output = <InputValue>.
Hope it will helps
09-19-2008 12:43 PM
>
> Hi,
>
> Other use this abap command before query
>
>
> SHIFT <InputValue> LEFT DELETING TRAILING '0'.
>
quote}
WRONG SYNTEX
09-19-2008 1:36 PM
09-19-2008 1:38 PM
09-19-2008 12:34 PM
09-19-2008 12:48 PM
HI
FOR EXAMPLE .
DATA: KUNNR (5) VALUES '00012'.
WRITE KUNNR.
SHIFT KUNNR LEFT DELETING LEADING '0'.
WRITE / KUNNR.
OR
DATA: T(14) VALUE ' abcdefghij',
STRING LIKE T,
STR(6) VALUE 'ghijkl'.
STRING = T.
WRITE STRING.
SHIFT STRING LEFT DELETING LEADING SPACE.
WRITE / STRING.
STRING = T.
SHIFT STRING RIGHT DELETING TRAILING STR.
WRITE / STRING.
CHECK THIS HOPE PROBLEM WILL RESOLVE.
REGARDS
ANIL CHAUDHARY
Edited by: anil chaudhary on Sep 19, 2008 1:50 PM
09-19-2008 12:57 PM
Hi,
VERY SORRY for that...
SHIFT <lv_field> LEFT DELETING LEADING '0'.
09-19-2008 1:02 PM
09-19-2008 1:11 PM
> declare kunnr of integer type p decimals 3.
>
> hope it helps
Really You made my Weekend
But it helps me lot to leave a big laugh on my face by kunnr with decimal ????????
Edited by: Ámit Güjärgoüd on Sep 19, 2008 2:12 PM
09-19-2008 3:36 PM
09-19-2008 1:09 PM
hi,
these are various solution of ur requirement:
CALL FUNCTION 'GUI_DOWNLOAD'*
filetype = 'ASC' "--------> change file type to 'DBF'
or
you have to download the value in character format with preceding single qoute .
for example -
if you are downloading 000010 means, assign that value as '000010.
So that, excel can treat it as character & the zeros will be retained.
either after download the excel do the change of properties of excel.
or
*CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'*
EXPORTING
input = wl_kunnr-low
IMPORTING
output = wl_kunnr-low.
hope it will help you
regards
rahul
Edited by: RAHUL SHARMA on Sep 19, 2008 2:09 PM
Edited by: RAHUL SHARMA on Sep 19, 2008 2:10 PM
09-19-2008 1:12 PM
hello,
use the conversion routine for kunner : ie the functional module :
CONVERSION_EXIT_ALPHA_OUTPUT .
hope this will help
09-19-2008 3:33 PM
09-20-2008 6:21 PM
09-20-2008 6:30 PM
Unpack is to remove zero
pack is to add zero
Ashoak Narayandas Advani