Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

KUNNR to be displayed without leading zeroes and in end blanks to be filled

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

hi,

use this fm.

CONVERSION_EXIT_ALPHA_OUTPUT .

17 REPLIES 17

Former Member
0 Kudos

hi,

use the Function module

CONVERSION_EXIT_ALPHA_OUTPUT for supressing the leading zeroes

GauthamV
Active Contributor
0 Kudos

hi,

use this fm.

CONVERSION_EXIT_ALPHA_OUTPUT .

Former Member
0 Kudos

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

0 Kudos

>

> Hi,

>

> Other use this abap command before query

>

>


> SHIFT <InputValue> LEFT DELETING TRAILING '0'.
> 

quote}

WRONG SYNTEX

0 Kudos

> WRONG SYNTEX

wrong syntax! 😜

0 Kudos

Hmmmm

former_member705122
Active Contributor
0 Kudos

Check FM

CONVERSION_EXIT_ALPHA_OUTPUT

Link:

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

VERY SORRY for that...


SHIFT <lv_field> LEFT DELETING LEADING '0'.

Former Member
0 Kudos

declare kunnr of integer type p decimals 3.

hope it helps

0 Kudos

> 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

0 Kudos

aww ..blesss

Former Member
0 Kudos

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

Former Member
0 Kudos

hello,

use the conversion routine for kunner : ie the functional module :

CONVERSION_EXIT_ALPHA_OUTPUT .

hope this will help

Former Member
0 Kudos

shift <inputvalue> left deleting leading '0'.

Reg

SwapnilkumarL1
Participant
0 Kudos

Unpack is a command.

Ashoak Naryandas Advani

0 Kudos

Unpack is to remove zero

pack is to add zero

Ashoak Narayandas Advani