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

Initial values for time field

Former Member
0 Likes
3,352

Hi all,

I am using time field in my custom screen table control. I want to display blank when there is no entry in the field not '00:00:00'. Now what happend i tried to push the blank value by checking the condition if the time field is initial or not. Now my problem is: It is not displaying as expected, it is displaying as ' : : ', The values were wiped out, but the value is coming as like this..........How can i correct that, Please share your views. Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,199

before diplaying time field ,move the value to charcter field.

once you get the value in charcter ,do your validation

Thanks

Seshu

7 REPLIES 7
Read only

Former Member
0 Likes
2,200

before diplaying time field ,move the value to charcter field.

once you get the value in charcter ,do your validation

Thanks

Seshu

Read only

0 Likes
2,199

seshu,

how can we do that? say i have an internal table intb1-c4 is the field of uzeit.

Though you move to char and do all the validation, the field is displayed as time format(because the screen field is time field), after removing the zeros, according to the time field's charactersitics it will display (default display length is 😎 as ' : : '

Read only

0 Likes
2,199

if you use time field then it displays 00:00:00 if it is initial.

try to keep the field as char type,and do the validation as Rich Said.

Thanks

Seshu

Read only

0 Likes
2,199

Thanks Seshu and Rich,

You know, I cannot declare that field as character field. The field is available for input in the customized screen. Which requires input help for time entering and all(calculation also happened for this time field like 24 hours and 365 days). Still stranding to get rid off the problem. (If it is report I will go ahead and play with that)

Guys is there any other way to get rid off the standard formatting, anything I can set in the attributes for this particular field in Screen.(Or else SAP has this restriction)

Thanks a bunch.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,199

Hi, I think that if the field is define as a "time" field, the internal formatting will be apply regardless, so you would have to define the field as a character type field of length 8, and if there is a time to be written, then write the time to the field, else do not.

write sy-uzeit to itab-timefield.

The write statement here will apply the formatting including :

REgards,

RIch Heilman

Read only

Former Member
0 Likes
2,199

Hi

Its the time field restriction. You cannot get rid of the ' : : ' unless it is changed into character type.

Regards

Raj

Read only

Former Member
0 Likes
2,199

Thanks buddies, I will try convincing my functional peoples. Thanks a lot.