04-24-2009 10:57 AM
hi experts,
i am new to abap, i have a screen 1000. if user enter 123 as value in text field, i want to make it to consider as 00123(number length 5). can u ppl guide me how to proceed with this.
thanks in advance...
regards,
Viral
04-24-2009 11:01 AM
Hello,
Declare it as follows.
parameters : p_num(5) type n.
When u enter 12. it wil take it has 00012
Regards,
Mansi.
04-24-2009 11:01 AM
Hello,
Declare it as follows.
parameters : p_num(5) type n.
When u enter 12. it wil take it has 00012
Regards,
Mansi.
04-24-2009 11:01 AM
Hi Viral,
Take a Variable of type n, sya
Data: num(5) type n.
Move that value into num.
u will have 00123. Zeroes will precede the number..
Ram.
04-24-2009 11:02 AM
Hi Viral,
In the PAI of screen 1000, convert the value of field 123 as '00123'.
You can use FM CONVERSION_EXIT_ALPHA_INPUT.
For Example:
Declare the a variable F1 of length 5.
data: F1(5).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = value of field from screen "123
IMPORTING
OUTPUT = F1.
The value of F1 would be 00123.
Thanks,
Sowmya.
04-24-2009 11:02 AM
Hi Viral,
In the PAI of screen 1000, convert the value of field 123 as '00123'.
You can use FM CONVERSION_EXIT_ALPHA_INPUT.
For Example:
Declare the a variable F1 of length 5.
data: F1(5).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = value of field from screen "123
IMPORTING
OUTPUT = F1.
The value of F1 would be 00123.
Thanks,
Sowmya.
04-24-2009 11:05 AM
04-24-2009 11:06 AM
Hi,
Take numeric data type on that field. It will solve your problem.
Regards,
Himanshu
04-24-2009 11:13 AM
Hi try this
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
or
data: t_num(10) type n.
Select-options : so_locco for t_num.
check these codes this will add zeros in the front for select options.