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

Selection screen with no input fields

Former Member
0 Likes
1,868

Hi All,

i want to display a screen which should be having only comments that so and so user only should be executing this program. the req. is like the selection screen should be displayed and when the user executes only then a table is to be locked first and then the table is to be filled with records of other two tables. I have created a program like this.

selection screen 200.

declared the comments.

initialization.

called the selection screen 200.

start of selection.

locking the table and so on...

but in this program the problem is even if the user selects back button or any other button the program is getting executed i.e the control is going to start of selection.

please help me to solve teh problem. the req. is freezed, so, do not suggest to add a pop up or anything else.

awaiting your replies.

4 REPLIES 4
Read only

Former Member
0 Likes
1,054

Hi Ibrahim,

If this requirement is for report, Do you need custom selection screen?

Thanks,

Raj

Read only

Former Member
0 Likes
1,054

Hi,

Check this code..

selection screen 200.
declared the comments.

initialization.
* called the selection screen 200. " Comment the code

start of selection.
call the selection screen 200.
check sy-subrc eq 0.   " if press back/cancel/exit subrc will be 4 if execute subrc will be 0

locking the table and so on...

Read only

venkat_o
Active Contributor
0 Likes
1,054

Hi Ibrahim, You have to follow the sample program.

REPORT ztest_notepad.
SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECTION-SCREEN COMMENT 1(83) comm2. "83 chars is max comment length using comment statement
SELECTION-SCREEN   END OF SCREEN 1001.

INITIALIZATION.
  comm2 = 'Hi there. It shows text like this.'.

START-OF-SELECTION.
  "Call selection-screen
  CALL SELECTION-SCREEN 1001.
  IF sy-subrc = 0.
    "locking the table and so on...
    WRITE 'The user selected the function Execute or Execute + Print on the selection screen.'.
  ENDIF.
I hope that it helps you. Thanks Venkat.O

Read only

venkat_o
Active Contributor
0 Likes
1,054

Hi Ibrahim, I think It is good to write program the below way instead of doing the above way which i have posted just now.

REPORT ztest_notepad.

SELECTION-SCREEN COMMENT 1(83) comm2.
PARAMETERS p_dummy.

INITIALIZATION.
  comm2 = 'Hi there. It shows text like this.'.
  "Setting screen attributes
  LOOP AT SCREEN.
    IF screen-name = 'P_DUMMY' OR
       screen-name = '%_P_DUMMY_%_APP_%-TEXT'.
      screen-active = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

START-OF-SELECTION.

  WRITE 'The user selected the function Execute or Execute + Print on the selection screen.'.
I hope that it resolves. Thanks Venkat