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

screen

Former Member
0 Likes
522

what is the difference between a standard selection screen and an user defined selection-screen.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
490

Hi,

As the name depicts, standard selection screen is attached to the standard program. If u want to customize it, need to copy it (transaction) and change it according to the requirements.

On the other hand, in user defined screens, we design it by declaring select-options and parameters.

Also check this link.

http://sap.mis.cmich.edu/sap-abap/abap05/sld005.htm

Reward if helpful.

regards,

Ramya

2 REPLIES 2
Read only

Former Member
0 Likes
491

Hi,

As the name depicts, standard selection screen is attached to the standard program. If u want to customize it, need to copy it (transaction) and change it according to the requirements.

On the other hand, in user defined screens, we design it by declaring select-options and parameters.

Also check this link.

http://sap.mis.cmich.edu/sap-abap/abap05/sld005.htm

Reward if helpful.

regards,

Ramya

Read only

Former Member
0 Likes
490

Calling Standard Selection Screens

The standard selection screen of an executable program consists of

· the selections of a logical database that may be linked to the program

· all selection screen elements from the declaration part of a program that are not assigned to a user-defined selection screen.

As long as at least one input field is defined for the standard selection screen, it is called fully automatically between the INITIALIZATION and START-OF-SELECTION events. During selection screen processing, the ABAP runtime environment generates special selection screen events. In the flow of an executable program, these events occur between the INTIALIZATION and the START-OF-SELECTION event. You can define event blocks for these events in the program.

If a standard selection screen is defined in an executable program, the system calls this same program again automatically after it has completely executed once and displayed the standard selection screen. If values have been initialized at the LOAD-OF-PROGRAM and INITIALIZATION events, they will be overwritten by the previous user entries. These user entries themselves can only be overwritten at the PBO of the selection screen.

REPORT DEMO.

NODES SPFLI.

SELECTION-SCREEN BEGIN OF BLOCK MYSEL WITH FRAME TITLE T01.

PARAMETERS: DEPTIME LIKE SPFLI-DEPTIME,

ARRTIME LIKE SPFLI-ARRTIME.

SELECTION-SCREEN END OF BLOCK MYSEL.

INITIALIZATION.

T01 = 'Times'.

...

If the executable program is linked to logical database F1S, the following selection screen is displayed automatically when the program is started:

Calling User-Defined Selection Screens

You can create user-defined selection screens in executable programs (reports), function modules and module pools. There are three ways how user-defined selection screens can be called.

Call From a Program

From any program in which selection screens are defined, you can call these screens at any point of the program flow using the following statement:

CALL SELECTION-SCREEN . The selection screen called must be defined in the calling program either as the standard selection screen (screen number 1000) or as a user-defined selection screen (any screen number). You must always use CALL SELECTION-SCREEN to call selection screens, and not CALL SCREEN. If you use CALL SCREEN, the system will not be able to process the selection screen.

You can display a user-defined selection screen as a modal dialog box using the STARTING AT and ENDING AT additions. This is possible even if you have not used the AS WINDOW addition in the definition of the selection screen. However, you are recommended to do so, since warnings and error messages that occur during selection screen processing will then also be displayed as modal dialog boxes (see example below).

When it returns from the selection screen to the program, the CALL SELECTION-SCREEN statement sets the return value SY-SUBRC as follows:

SY-SUBRC = 0 if the user has chosen Execute on the selection screen

SY-SUBRC = 4 if the user has chosen Cancel on the selection screen

Any time a selection screen is processed, the selection screen events are triggered. System field SY-DYNNR of the associated event blocks contains the number of the selection screen that is currently active.

REPORT SELSCREENDEF.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TIT1.

PARAMETERS: CITYFR LIKE SPFLI-CITYFROM,

CITYTO LIKE SPFLI-CITYTO.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.

SELECTION-SCREEN INCLUDE BLOCKS SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2

WITH FRAME TITLE TIT2.

PARAMETERS: AIRPFR LIKE SPFLI-AIRPFROM,

AIRPTO LIKE SPFLI-AIRPTO.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN END OF SCREEN 500.

INITIALIZATION.

TIT1 = 'Cities'.

AT SELECTION-SCREEN.

CASE SY-DYNNR.

WHEN '0500'.

MESSAGE W159(AT) WITH 'Screen 500'.

WHEN '1000'.

MESSAGE W159(AT) WITH 'Screen 1000'.

ENDCASE.

START-OF-SELECTION.

TIT1 = 'Cities for Airports'.

TIT2 = 'Airports'.

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

TIT1 = 'Cities again'.

CALL SELECTION-SCREEN 1000 STARTING AT 10 10.

This executable program contains definitions for the standard selection screen and the user-defined screen number 500. Selection screen 500 is defined to be displayed as a modal dialog box and contains the SEL1 block of the standard selection screen. Note the phase in which the titles of the screens are defined. For the purpose of demonstration, the program calls warning messages with message class AT during the AT SELECTION-SCREEN event.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba83d35c111d1829f0000e829fbfe/frameset.htm