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: 

How to display zero in the screen's input field using numc type

trevor_zhang
Explorer
0 Kudos

Hi,

I want to display the zero value in the input field , when I using the NUMC input field on the screen .

The zero will be changed to blank ,when I click the Enter key.

What I should do for it?

Any help is appreciated.

Regards,

Trevor

1 ACCEPTED SOLUTION

graghavendra_sharma
Contributor
0 Kudos

Hi

Try using the command UNPACK in AT SELECTION-SCREEN event.

8 REPLIES 8

graghavendra_sharma
Contributor
0 Kudos

Hi

Try using the command UNPACK in AT SELECTION-SCREEN event.

0 Kudos

Hi ,

Thanks for your quickly answer!

I use the numc input field in the dialog's screen.

I am not sure how to do the realize the function like 'UNPACK'?

In fact, I can't changed my input field's data type.

When the status of my input field is display, I can display the zero on the screen. But when the input field is input status , there is blank!

Regards

Trevor

former_member181962
Active Contributor

Have it as a char field. If you still want restrict the user to enter only numeric field, you should use the fm, NUMERIC_CHECK in the pai section.

usage:

CALL FUNCTION 'NUMERIC_CHECK'

EXPORTING

STRING_IN = VALUEIN

IMPORTING

STRING_OUT = HFELD

HTYPE = TYPE.

IF TYPE NE 'NUMC'.

message e000 'Enter numeric values only'.

ENDIF.

Regards,

Ravi

Former Member

hi

check this FM

CONVERSION_EXIT_ALPHA_INPUT

it will convert the numeric value with leading zeros if you want to process further with that value.

regards

shiba dutta

Former Member
0 Kudos

Hi Trevor

I guess below example will give you some idea:

data: pos type posnr.
parameters: p_posnr like (pos) default '000000'.
parameters: p_pos type posnr default '000000'.

P_POSNR will work the way you need whereas P_POS wont...

Kind Regards

Eswar

trevor_zhang
Explorer
0 Kudos

Hi ,

Thanks for your quickly answer!

I use the numc input field in the dialog's screen.

I am not sure how to do the realize the function like 'UNPACK'?

In fact, I can't chang my input field's data type.

When the status of my input field is display, I can display the zero on the screen. But when the input field is input status , there is blank!

Regards

Trevor

trevor_zhang
Explorer
0 Kudos

Hi all,

I have the good solution about this issue from the other forume.

<http://www.sapfans.com/forums/viewtopic.php?p=808026#808026>

'In the screen field attributes give the conversion exit as ALPHA.'

Thanks

Trevor

trevor_zhang
Explorer
0 Kudos

Hi all,

I have the good solution about this issue from the other forum.

<http://www.sapfans.com/forums/viewtopic.php?p=808026#808026>

'In the screen field attributes give the conversion exit as ALPHA.'

Thanks

Trevor