ABAP Forum
cancel
Turn on suggestions
Showing results for
Search instead for
Did you mean:
The next set of progression badges have been announced! Let's Discuss!
Read only

Why clearing SELECT-OPTIONS of TIME field makes it = 00:00:00 instead of select all?

Sandra_Rossi
Active Contributor

4 weeks ago - last edited 3 weeks ago

0 Kudos
635

Steps to reproduce:

Create an ABAP executable program with this code:

REPORT zdemo.
SELECT-OPTIONS s_time FOR sy-uzeit DEFAULT '000000' TO sy-uzeit.

Run the program:

Sandra_Rossi_0-1761219402780.png

Clear the two fields:

Sandra_Rossi_1-1761219450304.png

Press Enter:

Sandra_Rossi_0-1761225499489.png

Sandra_Rossi_3-1761219563595.png

I would expect to have S_TIME[] empty (it means select any time).

  1. Why one line, why EQ ? (it means select time = 000000)
  2. Did it always work like this?
  3. Is this behavior officially documented (and possibly argumented) somewhere?
  4. What custom workaround could be proposed to the user? (like adding a button to select all, define the screen field as type character and convert to time yourself)

Thanks.

Sandra

My system: ABAP 7.58 SP 1 (on-premises/private cloud)

Labels
1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor

4 weeks ago - last edited 4 weeks ago

606

I got this problem long time ago.

The system's reaction to the default conversion of the TIMS field can also generate this.

RaymondGiuseppi_0-1761220728544.pngRaymondGiuseppi_1-1761220850904.png

  • The system is unable to distinguish an empty field and the time 00:00:00, so unable to remove an empty record.
  • Only contextual menu, right click, allows to remove the initialrecord.

Usually I used a text field with a custom conversion-exit that handle initial text and text with only 0 and : in a different way.

4 REPLIES 4
Read only

Ryan-Crosby
Active Contributor

4 weeks ago

621

I think it has always been a thing (though I never noticed it) because I checked our 7.55 system including a common standard transaction that I use and happens for both - must have something to do with conversion exits and that 00:00:00 is treated as the representation of space for time values.

Regards,

Ryan Crosby

Read only

Sandra_Rossi

4 weeks ago

608

I also reproduced with ABAP 7.31 and 7.40.

Read only

RaymondGiuseppi
Active Contributor

4 weeks ago - last edited 4 weeks ago

607

I got this problem long time ago.

The system's reaction to the default conversion of the TIMS field can also generate this.

RaymondGiuseppi_0-1761220728544.pngRaymondGiuseppi_1-1761220850904.png

  • The system is unable to distinguish an empty field and the time 00:00:00, so unable to remove an empty record.
  • Only contextual menu, right click, allows to remove the initialrecord.

Usually I used a text field with a custom conversion-exit that handle initial text and text with only 0 and : in a different way.

Read only

Sandra_Rossi

4 weeks ago

574

I confirm, the solution with a custom conversion exit works.

Code here: Alternative to "SELECT-OPTIONS s_time FOR type_t_v... - SAP Community

AltStyle によって変換されたページ (->オリジナル) /