Application Development and Automation 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: 
Read only

Displaying '001' on the selection screen using numc type

Former Member
0 Likes
1,306

Hi All,

I'm having a report program and have a parameter on the selection screen. The parameter is of NUMC type and is having 3 characters. I want to initialize this field with the value '001'. But when the selection screen appears the displayed value is 1 and not 001. The zeroes get truncated. Is there any way by which i can use numc itself and display 001. if i use character type, i'll have to do the validation for non-numeric characters. Can someone help me out?

Thanks,

Sandeep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
887

Hi Sandeep,

This is not possible with numeric fields in selection screen beacuse of automatic conversions on screen output . You have to define a char field on screen, put validations for numeric in AT SELECTION-SCREEN and later pass it to a numeric field in program and use it .

Cheers

Hi All,

I'm having a report program and have a parameter on the selection screen. The parameter is of NUMC type and is having 3 characters. I want to initialize this field with the value '001'. But when the selection screen appears the displayed value is 1 and not 001. The zeroes get truncated. Is there any way by which i can use numc itself and display 001. if i use character type, i'll have to do the validation for non-numeric characters. Can someone help me out?

Thanks,

Sandeep

5 REPLIES 5
Read only

Former Member
0 Likes
888

Hi Sandeep,

This is not possible with numeric fields in selection screen beacuse of automatic conversions on screen output . You have to define a char field on screen, put validations for numeric in AT SELECTION-SCREEN and later pass it to a numeric field in program and use it .

Cheers

Read only

0 Likes
887

Thanks Sanjay. Also could you please tell me how to find out the length of a character string?

Sandeep

Read only

0 Likes
887

You can use STRLEN for this.

Read only

0 Likes
887

Hi,

data z type i.

z = strlen( field1 ).

Andreas

Read only

Vinod_Chandran
Active Contributor
0 Likes
887

Hi Sandeep,

Even if you see only '1' in the selection screen, inside the program the value will be '001'.

Cheers

Vinod