2008 Jul 19 6:56 PM
hi gurus....
could u plz explain me the following events with a simple example
At Selection-screen.
AT SELECTION-SCREEN-ON FIELD.
AT SELECTION-SCREEN-ON OUTPUT.
AT SELECTION-SCREEN-ON HELP REQUEST( F1).
AT SELECTION-SCREEN-ON VALUE REQUEST(F4).
2008 Jul 21 4:19 AM
hi gurus....
could u plz explain me the following events with a simple example
At Selection-screen.
AT SELECTION-SCREEN-ON FIELD.
AT SELECTION-SCREEN-ON OUTPUT.
AT SELECTION-SCREEN-ON HELP REQUEST( F1).
AT SELECTION-SCREEN-ON VALUE REQUEST(F4).
2008 Jul 21 4:19 AM
2008 Jul 21 4:32 AM
Hi Diana,
I think you should have searched for these events in the SDN Forum, where you have good number of examples.
Check this link:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9a1435c111d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Chandra Sekhar
2008 Jul 21 4:32 AM
Hi,
AT SELECTION-SCREEN-ON FIELD:
This event is used for validating the parameters or select-
option paramter and this is mainly for validating the feild
on the selection screen.
AT SELECTION-SCREEN-ON OUTPUT:
We can change field before going to display like hide.this
will process before at-selection screen and after
intialization events
AT SELECTION-SCREEN-ON HELP REQUEST( F1) OR (F2):
The event is triggered when the user calls the F1 help for the field <field>. If no corresponding event block has been defined, the help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default help mechanism. It is then up to the programmer to ensure that appropriate help is displayed.
You cannot declare the event block AT SELECTION-SCREEN ON HELP-REQUEST for input fields on the selection screen that are declared within a logical database. You cannot override the help mechanism of a logical database within the program. You can define separate help within the logical database program using the HELP-REQUEST option in the PARAMETERS and SELECT-OPTIONS statements.
http://help.sap.com/saphelp_nw04/helpdata/en/79/34a243d9b511d1950e0000e8353423/content.htm
http://abapcode.wordpress.com/2007/12/07/how-to-create-f1-or-f4-help-on-selection-screen/
2008 Jul 21 4:34 AM
Hi
Check out here.
http://sap.niraj.tripod.com/id33.html
Create F1 help for custom ABAP programs at field level. This method can help companies to eliminate the off-line documentation for custom programs. On top of that, users are not required to search for help documentation for a custom program.
Logo is: u201CPress F1 for help anywhere in SAPu201D.
This is done by using u201Chelp-requestu201D events.
Sample code:
at selection-screen on help-request for
message xxxx (ZZ)
You can maintain messages with varied degree of details here. You can also specify examples in messages long text to clarify the contents of program to your valued users.
Example 2: F4 Help
To control F4 help in a selection screen use the
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
event.
Note that for ranges both the low and high value of the field
must have there own ON VALUE-REQUEST
Example:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM f4_help_prctr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-high.
PERFORM f4_help_prctr.
REPORT f4help.
PARAMETERS:
p_auart LIKE vbak-auart.
START-OF-SELECTION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_auart.
PERFORM f4_help_aaurt.
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
FORM f4_help_auart *
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
u2026u2026.. *
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
FORM f4_help_auart.
CALL FUNCTION u2018F4IF_FIELD_VALUE_REQUESTu2019
EXPORTING
tabname = u2018VBAKu2019
fieldname = u2018AUARTu2019
SEARCHHELP = u2018 u2018
SHLPPARAM = u2018 u2018
DYNPPROG = u2018 u2018
DYNPNR = u2018 u2018
DYNPROFIELD = u2018 u2018
STEPL = 0
VALUE = u2018 u2018
MULTIPLE_CHOICE = u2018 u2018
DISPLAY = u2018 u2018
SUPPRESS_RECORDLIST = u2018 u2018
CALLBACK_PROGRAM = u2018 u2018
CALLBACK_FORM = u2018 u2018
TABLES
RETURN_TAB =
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Regards
Divya
2008 Jul 21 4:38 AM
Hi,
suppose there is one parameter/select-options in your program.
parameters p_matnr like mara-matnr.
AT SELECTION-SCREEN.
select * from mara where matnr = p_matnr.
if sy-subrc <> 0.
error message.
endif.
AT SELECTION-SCREEN only for single field validation.
but there are two or more parameters/select-options.
you can go at selection-screen on field.
parameters: p_kunnr like kna1-kunnr,
p_matnr like mara-matnr.
select-options: s_vbeln for vbak-vbeln.
AT SELECTION-SCREEN ON p_kunnr.
select* from kna1 where kunnr = p_kunnr.
if sy-subrc <> 0.
error message.
endif.
AT SELECTION-SCREEN ON p_matnr.
select * from mara where matnr = p_matnr.
if sy-subrc <> 0.
error message.
endif.
AT SELECTION ON s_vbeln.
select * from vbak where vbeln in s_vbeln.
if sy-subrc <> 0.
error message.
endif.
by using at selection-screen on field you can validate two or more fields.
AT SELECTION-SCREEN OUTPUT.
we can use this syntax to modify the screen at runtime in output.
AT SELECTION-SCREEN OUTPUT.
loop at screen.
screen-input = 'variable'.
screen-active = '0'.
screen-invisible = '0'.
modify screen.
endif.
HELP-REQUEST is for f1 help means documentaion for your selection.
VALUE-REQUEST is for search help means place the cursor on input field and press f4 it will display all the values exist in database for that particular field.
sriram.
2008 Jul 21 4:42 AM
At Selection-Screen : This event is triggered after giving input in the selection screen fields. This event is used to validate all the fields present in the selection-screen. This is also used to handle the user access on the screen.
At Selection-Screen on <field>: This event is used to validate a particular field present on Selection-Screen.
At Selection-Screen Output : This event is used to change selection-screen properties dynamically.
At Selection-Screen on Value-Request for <field> : It is used to give 'F4 Help ' to selection-screen Fields.
Thanks
Vijay.
2008 Jul 21 5:11 AM
Hi,
[http://www.abapguide.com/notes/events-in-report/]
Regards,
Sravanthi
2008 Jul 21 5:19 AM
hi,
Plz refer to this thread.
http://www.sapbrainsonline.com/ARTICLES/TECHNICAL/ABAP/AT%20SELECTION-SCREEN%20Command.html
Regards
Sumit Agarwal
2008 Jul 21 5:31 AM
Hi,
AT SELECTION-SCREEN-ON <FIELD.>
This event is basically used for the validation of a field.Suppose at selection screen you specify a wrong value for this field. then only this field will be active, so that you can re enter the the correct value.
AT SELECTION-SCREEN OUTPUT
This event is used for selection screen modifications. suppose you have a set of two radiobuttons. On Clicking of one radiobutton you want some fields to be displayed, and on clicking other radiobutton, you want another set of fields to be displayed in this case, this event is used.
AT SELECTION-SCREEN-ON HELP REQUEST
This event is used to attach F1 help to a field.
AT SELECTION-SCREEN-ON VALUE REQUEST
This event is used to attach input or F4 help to a field.
Just have a look at this sample code. This is an example for above event.
REPORT z_test11 .
PARAMETERS:
p_carrid(2).
DATA: table1 LIKE
ddshretval
OCCURS 0 WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'scarr'
fieldname = 'carrid'
* SEARCHHELP = ' '
* SHLPPARAM = ' '
* DYNPPROG = 'YH1146_TEST11'
* DYNPNR = ' '
* DYNPROFIELD = 'p_carrid'
* STEPL = 0
* VALUE = ' '
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* SELECTION_SCREEN = ' '
TABLES
RETURN_TAB = table1
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
p_carrid = table1-fieldval.
START-OF-SELECTION.
write: p_carrid.
Regards
Abhijeet
2008 Jul 21 6:24 AM
HI,
At Selection-screen: it is used to validate selection screen one or all fields
AT SELECTION-SCREEN-ON FIELD: it is used to validate specific selection screen field
AT SELECTION-SCREEN-ON OUTPUT: it is used to modify the selection screen
AT SELECTION-SCREEN-ON HELP REQUEST( F1): it is used to validate the help request
AT SELECTION-SCREEN-ON VALUE REQUEST(F4): to validate the f4 help
Regards,
venkat n
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |