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: 

add zeros in the field value in fronts

Former Member
0 Kudos

hi experts

i have an issue to be solved out..... I want to fill the field with 0's in front for the value

ie for eg 1456 of 10 digit value ,,,,,,,,means when it goes inside the field it should take it as 0000001456

i dont want to add any number of zerops particularly,,,its should just adjust to the value entered

previously the requirment was such that it was asked in parameters so declared as

pr_locco(10) TYPE n OBLIGATORY.

now,,, parameter is changed as select option so dont know how to pack and unpack the value

can you pls help me out....

Thanks in advance

Rachel

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This is my select query befor which i have added the FM

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = so_locco

IMPORTING

OUTPUT = so_locco

SELECT akunnr aname1 alocco bbukrs a~ktokd

FROM kna1 AS a INNER JOIN knb1 AS b ON akunnr = bkunnr

INTO CORRESPONDING FIELDS OF TABLE it_kna1

WHERE locco in so_locco.

can you tell me this is how i should give my input in FM or ????

Thanks for response

12 REPLIES 12

Former Member
0 Kudos

Use FM:

CONVERSION_EXIT_ALPHA_INPUT - This converts number to a string filled with zeroes

CONVERSION_EXIT_ALPHA_OUTPUT - This converts number with zeroes into an integer

GauthamV
Active Contributor
0 Kudos

Plz SEARCH in SCN before posting you will get so many posts

with this fm.

CONVERSION_EXIT_ALPHA_INPUT

Former Member
0 Kudos

use

CONVERSION_EXIT_ALPHA_INPUT

rejish_balakrishnan
Contributor
0 Kudos

Hi,

Use right shift with leading zeros .

Former Member
0 Kudos

Hi,

Try this.

data: g_vbeln TYPE vbeln_vl.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = g_vbeln

IMPORTING

output = g_vbeln.

Edited by: ShaliniSinha on Apr 3, 2009 7:34 AM

Former Member
0 Kudos

Hi !

use FM

CONVERSION_EXIT_ALPHA_INPUT

Former Member
0 Kudos

This is my select query befor which i have added the FM

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = so_locco

IMPORTING

OUTPUT = so_locco

SELECT akunnr aname1 alocco bbukrs a~ktokd

FROM kna1 AS a INNER JOIN knb1 AS b ON akunnr = bkunnr

INTO CORRESPONDING FIELDS OF TABLE it_kna1

WHERE locco in so_locco.

can you tell me this is how i should give my input in FM or ????

Thanks for response

0 Kudos

hi,

try this..

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = so_locco-low

IMPORTING

OUTPUT = so_locco-low

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = so_locco-high

IMPORTING

OUTPUT = so_locco-high

and then write ur query.

SELECT akunnr aname1 alocco bbukrs a~ktokd

FROM kna1 AS a INNER JOIN knb1 AS b ON akunnr = bkunnr

INTO CORRESPONDING FIELDS OF TABLE it_kna1

WHERE locco in so_locco.

0 Kudos
data: w_num(10) type n.

Select-options : so_locco for w_num.

Just check these codes this will padd zeros in the front for select options.

Regards,

Gurpreet

0 Kudos

hi

thanks i tried this way too but zero's is not getting appended ...

0 Kudos

thank you so much gurpreet sing problem is solved

0 Kudos

hi,

just check ur datatypes for so_loc..

or u can take to another varible

like

move so_loc-low to var1.

move so_loc-high to var2.

then write this parameter into export.

orelse vice a versa.