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

How to do a select before selection screen dsiplayed?

Former Member
0 Kudos
1,227

Hi, experts.
How to do a select before selection screen is displayed.
I need to get a value and set it as default in one of the selection-screen parametrs ( select- option ) ?

7 REPLIES 7
Read only

DominikTylczyn
SAP Champion
SAP Champion
0 Kudos
1,191

Hello @Former Member 

You can use the AT SELECTION-SCREEN OUTPUT event or INITIALIZATION.

Best regards

Dominik Tylczynski

Read only

0 Kudos
1,168

Can you pls explain how it should work?
cause mine example is not works

INITIALIZATION.
  data last_storndate type ZSTORNDATE.

AT SELECTION-SCREEN OUTPUT.
  perform get_date.
  FORM get_date.
  SELECT MAX( zstorndate ) INTO last_storndate FROM zstorn_logs.
  endform.
SELECTION-SCREEN BEGIN OF BLOCK t1 WITH FRAME TITLE text-001.
  SELECT-OPTIONS :
    so_vbeln for ZSTORN_LOGS-vbeln,
    so_reslo for ZSTORN_LOGS-reslo,
    so_wadat for ZSTORN_LOGS-wadat_ist,
    so_user  for ZSTORN_LOGS-USNAM,
    so_storn for zstorn_logs-ZSTORNDATE DEFAULT last_storndate.
SELECTION-SCREEN END OF BLOCK t1.

 

Read only

1,133

Try this

 

DATA last_storndate type ZSTORNDATE.

SELECTION-SCREEN BEGIN OF BLOCK t1 WITH FRAME TITLE text-001.
  SELECT-OPTIONS :
    so_vbeln for ZSTORN_LOGS-vbeln,
    so_reslo for ZSTORN_LOGS-reslo,
    so_wadat for ZSTORN_LOGS-wadat_ist,
    so_user  for ZSTORN_LOGS-USNAM,
    so_storn for zstorn_logs-ZSTORNDATE.
SELECTION-SCREEN END OF BLOCK t1.

INITIALIZATION.
  SELECT MAX( zstorndate ) INTO last_storndate FROM zstorn_logs.
  so_storn[] = VALUE #( ( sign = 'I' option = 'EQ' low = last_storndate ) ).

 

 

 

Read only

0 Kudos
1,116

doesn't work

Read only

1,085

see my updated answer above

Read only

0 Kudos
1,068

Thanks, now it works.
As i understand it clears last_storndate.
Should i always fill parametrs and select-options like this?

Read only

0 Kudos
983

It doesn't actually clear last_storndate. The INITIALIZATION select max zstorndate and puts it into last_storndate. Then it initializes SELECT-OPTIONS so_storn with it. Yes, you should always fill SELECT-OPTIONS like that.