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

Problem with Select-Option Values

Former Member
0 Likes
4,855

Hi,

I have developed a selection screen with a select-option for ‘time’. 00:00:00 is displayed by default while executing, bus no value has been taken to the select-option as usual. When I select some ‘time’, say 08:30:00 and 10:00:00 for the select-option, and executes, value is fetched correctly and getting output. The problem is that when I click back button from the output ALV screen, the previously selected time will be there (not a problem) and when I clear the time and press enter key, the time changes to 00:00:00 in both the fields, but a = mark is shown adjacent to the select-option. When I execute, the program takes it as select-option-HIGH = 000000 and LOW as 000000, resulting in wrong execution. My requirement is that when I press BACK, the select-options should be cleared. (Cannot use AT SCREEN-SELECTION OUTPUT as the enter key will also clear the time).

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,282

SELECT-OPTIONS define range internal table, so in your BACK function handler you have to delete every row of the table (Do REFRESH the table, not clear the header line or first record)

Regards,

Raymond

14 REPLIES 14
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,283

SELECT-OPTIONS define range internal table, so in your BACK function handler you have to delete every row of the table (Do REFRESH the table, not clear the header line or first record)

Regards,

Raymond

Read only

0 Likes
3,282

Hi,

clear the select option at the event "INITIALIZATION"


regards

Stefan Seeburger

Read only

0 Likes
3,282

INITIALIZATION.
refresh s_itime.



does't work for me.

Read only

0 Likes
3,282

This message was moderated.

Read only

0 Likes
3,282

Hi Ray,

May I know how to use the BACK function handler ?

Read only

0 Likes
3,282

Dear SAJAN

,

Use below Code , I tried it works.

SELECTION SECREEN    BEGIN OF BLOCK b! WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_TIME FOR SY-UZEIT,

                                 S_TIME1 FOR SY-UZEIT NO-DISPLAY. "

SELECTION SCREEN END OF BLOCK B1.

AT SELECTION SCREEN ON S_TIME.

LOOP AT s_time.

MOVE-CORRESPONDING s_time TO s_time1.

APPEND s_time1.

ENDLOOP.

IF   SY-UCOMM = 'ONLI'.

CLEAR s_time.

REFRESH s_time[].

ENDIF.

START-OF-SELECTION.

   

write your code on the basis of  S_TIME1.

regards,

Pradeep Mishra

Read only

0 Likes
3,282

Hi Pradeep,

Thanks! It works fine.

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
3,282

Hi, that is really strange behavior. I tested it and I have same problem.

Can not find any program way to set values as it was when first run.

Write output is: '   000000000000'.


SELECT-OPTIONS s_time FOR sy-uzeit.

START-OF-SELECTION.

   WRITE: s_time.

Only way I found is manualy go to "Multiple selection" (button on right side of sel. opt.) and there trash icon.


Clearing s_time at INITIALIZATION does not work...

-- Tomas --
Read only

Former Member
0 Likes
3,282

Refresh the select options at the start of the program under INITIALIZATION event.

REFRESH S_XXXX.


Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
3,282

Does it work, when you test it?

-- Tomas --
Read only

0 Likes
3,282

I have tested, but not working fine. The 'INITIALIZATION' event itself is not getting triggered in my program.

Read only

Former Member
0 Likes
3,282

Dear Sajan,

Write your Code as fallows..

SELECT-OPTIONS : s_time  for SY-UZEIT,

                                   s_time1 for Sy-UZEIT NO-DISPLAY.   " Use this for your data Selection.

AT SELECTION SCREEN.

Loop at S_TIME.

Move-Corresponding s_time to S_TIME1.

Append S_TIME1.

Endloop.

CLear S_TIME.

REFRESH S_TIME[].

Use S_TIME1 for further Data Selection.

Regards,

Pradeep Mishra.

Read only

0 Likes
3,282

Sorry, its not working when I use back button. The time values in the select-option is not even reset to 00:00:00.

Read only

Former Member
0 Likes
3,282

Hi,

yea quite strange. i was sure the refresh should work. testet it myself and figured that the standard behaviour of selection screens is to keep the values if returning from execution.

(SE16 works the same)

but if you want another solution as the standard, check this treat. i did not test it myself, but sounds like it should work.

Refresh Selection Screen with Free memory

regards

Stefan Seeburger