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

time field content

glauco
Active Contributor
0 Likes
636

Hi friends.

I have the following doubt about a screen field with time format (CI_FLEET-time type sy-uzeit).

It only happens in field content in a screen exit in XTOB function group to IE01/IE02 transactions.

We have a time field added in a new custom screen, inside XTOB.

When user deletes its original 00:00:00 content and press ENTER key, then the PAI is executed, so I check its value in a module in chain/field.

So I put a condition to check its content, but for my surprise, this condition is not true (even field value = space).


IF CI_FLEET-time = ''.

* Do some check here ...but is never true ...so abap execution never enters here ...

ENDIF.

So, a friend asked me to check with space instead of ''....then, it works fine.


IF CI_FLEET-time = space.

* Here it works fine. The field is empty and execution enters here ...

ENDIF.

Main doubt is because I created a test Online program ( module pool ) with a same format field on the screen.

So when I delete its content and debug the PAI, my IF wa_xpto-time = '' works fine.


IF wa_xpto-time = ''.

* do check here, works fine in a test new online ...

ENDIF.

But why it does not work in XTOB like that ?

best regards.

Glauco

2 REPLIES 2
Read only

former_member196651
Contributor
0 Likes
588

Hi Glauco,

If your requirement is to check whether the content is initial, use IS INITIAL.

Regards,

Abijith

Read only

0 Likes
588

Hi friend.

I have not said it. I forgot to say that IS INITIAL did not work in XTOB exit function group, to this time field.

I solved it comparing the field with SPACE.

But I want to know why it does not work with IF time_field = ''. Because it works in my test online program.

So I still looking for an answer about it.

best regards.

Glauco