‎2008 May 28 1:05 PM
hi..
i have some doubts in at selection-screen .
what is diff between at selection-screen , at selection-screen output and at selection-screen on value request..
can anyone explain this...
Regards,
Varadarajan.R
‎2008 May 28 1:07 PM
Hi,
at selection screen------when user enters the values in the feilds of the selection screen and clicks on execution button,this event gets triggered.this event is basically for checking the value entered by the user for the feild of the selection screen i.e data validity checking.this event is for entire selection screen.
at selection screen output-----
This event is executed at PBO of the selection screen every time the user presses
ENTER - in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values.
Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used)
and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters
or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Example
Output all fields of the SELECT-OPTION NAME highlighted:
SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
....
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.
The addition MODIF ID XYZ to the key word SELECT-OPTIONS
assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1 .
At PBO of the selection screen, all these fields are then set to highlighted.
For at selection-screen on value request.
refer this:
Regards,
Shiva Kumar
‎2008 May 28 1:07 PM
Hi,
at selection screen------when user enters the values in the feilds of the selection screen and clicks on execution button,this event gets triggered.this event is basically for checking the value entered by the user for the feild of the selection screen i.e data validity checking.this event is for entire selection screen.
at selection screen output-----
This event is executed at PBO of the selection screen every time the user presses
ENTER - in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values.
Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used)
and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters
or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Example
Output all fields of the SELECT-OPTION NAME highlighted:
SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
....
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.
The addition MODIF ID XYZ to the key word SELECT-OPTIONS
assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1 .
At PBO of the selection screen, all these fields are then set to highlighted.
For at selection-screen on value request.
refer this:
Regards,
Shiva Kumar
‎2008 May 28 1:07 PM
Hi,
AT SELECTION-SCREEN
Syntax
AT SELECTION-SCREEN selscreen_event.
Effect
This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
Note
The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.
AT SELECTION-SCREEN OUTPUT
The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
AT SELECTION-SCREEN ON VALUE-REQUEST
This event is fired when the user hits F4 on the field. This is used to provide F4 Help for the field. Here is a sample program.
code
report zrich_0001 .
tables: t001.
data: begin of it001 occurs 0,
bukrs type t001-bukrs,
butxt type t001-butxt,
ort01 type t001-ort01,
land1 type t001-land1,
end of it001.
select-options s_bukrs for t001-bukrs.
initialization.
select bukrs butxt ort01 land1 into table it001 from t001.
at selection-screen on value-request for s_bukrs-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BUKRS'
dynprofield = 'S_BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = it001.
start-of-selection.
[/code]
Reward for useful answers.
Regarsd,
Raj.
‎2008 May 28 1:07 PM
hi,
Selection screen is the screen where you give your inputs i.e the values for which you want to get the report.
AT-SELECTION SCREEN OUTPUT
This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION. Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.
Example
Output all fields of the SELECT-OPTION NAME highlighted:
SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.
The addition MODIF ID XYZ to the key word SELECT-OPTIONS assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1. At PBO of the selection screen, all these fields are then set to highlighted.
AT-SELECTION SCREEN ON FIELD
This event is for validating a particular field in the selection-screen.
AT SELECTION-SCREEN.
is the basic form for events on selection screen and used for validating all the selection-screen fields.
‎2008 May 28 1:08 PM
At-selection screen
:If you want to give a normal inout to the fields and then the control passes to the next event say start-of-selection.
At selection screen output
:if you do any modifications on the selection screen
say :you want that a field shld be Invisble on your selection screen then
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
*screen-invisible = 1.
screen-intensified = 1.
screen-color = 1.
MODIFY SCREEN.
ENDLOOP.
Hope it helps
‎2008 May 28 1:08 PM
When you are using this event you have to code depending on input parameter.
If it is parameter then use that code mentioned in ur question directly.
If its select-options then use separately for low and high options by providing
At selection-screen on value request for S_MATNR-LOW.
"Code.
At selection-screen on value request for S_MATNR-HIGH.
"Code.
<b>Please reward points if it is useful.</b>
‎2008 May 28 1:30 PM
hi,
AT SELECTION-SCREEN OUTPUT.
it gets called everytime before that selection screen appears to us.
AT SELECTION-SCREEN.
gets executed whenever u do smthing on the selection screen for eg. if u enter a value in parameters or select options and then press enter then it gets called
AT SELECTION-SCREEN ON HELP-REQUEST FOR <parameter name>.
it gets called when u do F4 on the <parameter >
reward points if useful ....
‎2008 May 28 1:38 PM
Hi
At Selection-screen OUTPUT is trigerred in PBO of selection-screen.
- This allows you to modify the Selection-screen, before it is displayed.
At Selection-screen On value request.
- This event is trigerred for F4 help.
at selection-screen on value-request for p_fpath.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
importing
file_name = p_fpath.
AT SELECTION-SCREEN.
IF p_radio1 = 'X'.
CLEAR p_radio4.
p_radio3 = 'X'.
ELSE.
IF p_radio2 = 'X'.
CLEAR p_radio3.
p_radio4 = 'X'.
ENDIF.
ENDIF.