Application Development 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: 

Purpose of AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prct

Former Member
0 Kudos

Hi ,

what is the exact Purpose of AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prctrr. and what is the difference b/w on field & on value-request.

Kindly let me know.

Thanx in advance.

Akshitha.

1 ACCEPTED SOLUTION

Former Member

Hi,

If an input field declared in an executable program refers to a field in the ABAP Dictionary for which possible entries help is defined, the list of values from the Dictionary is automatically displayed when the user calls the F4 help for that field. To create possible values help for report input fields that have no Dictionary reference, or to override the Dictionary input help linked to the field, you can create an event block for the event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR field

The event is triggered when the user calls the F4 help for the field field. If no corresponding event block has been defined, no possible values help or values list from the Dictionary is displayed. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure in the event block that an appropriate list of values is displayed, and that the user can choose a value from it.

No event block AT SELECTION-SCREEN ON VALUE-REQUEST can be created for input fields on the selection screen that are declared within the logical database used. You cannot override the input help mechanism of the logical database within the executable program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONSstatements.

Regards

Sudheer

10 REPLIES 10

Former Member
0 Kudos

... ON VALUE-REQUEST FOR psel_low_high

Effect

In this addition, the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH, where sel is the name of a selection criterion. The effect of this is twofold:

The possible entries pushbutton for F4 appears beside the appropriate field.

When the user activates this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4, the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field psel_low_high at the end of this processing block are copied to the appropriate input/output field.

This addition is only allowed with report-specific parameters (PARAMETERS) or selection options (SELECT-OPTIONS). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the possible entries in the database program SAPDBxyz.

Regards

Prabhu

Former Member
0 Kudos

hi

akshintha

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <parm>|<selopt>.

The possible entries button automatically appears next to the input field for <parm>|<selopt> when it is selected on the selection screen. Executes a processing block which allows user to choice a value from a list when user presses the button or F4. Can be used only in report programs, not in a logical database program.

regds

praveen

Former Member
0 Kudos

Hi Akshitha,

Check this code.

1.

AT SELECTION-SCREEN ON HELP-REQUEST FOR <field>

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

REPORT SELECTION_SCREEN_F1_DEMO.

PARAMETERS: P_CARR_1 TYPE S_CARR_ID,

P_CARR_2 TYPE S_CARR_ID.

AT SELECTION-SCREEN ON HELP-REQUEST FOR P_CARR_2.

CALL SCREEN 100 STARTING AT 10 5

ENDING AT 60 10.

2.

If you have two parameters, you want to display values(f4) in parameter 2, depending on the values entered in parameter 1.

REPORT Z_SRI_HELP_VALUE_FOR_TABLES .

tables tcurt.

DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.

PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency

P_LTEXT LIKE TCURT-LTEXT, "Long Text

P_KTEXT LIKE TCURT-KTEXT. "Short Text

*----


*--- Example of updating value of another field on the screen -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.

CLEAR: DYFIELDS[], DYFIELDS.

*--- select currency

CALL FUNCTION 'HELP_VALUES_GET'

EXPORTING

fieldname = 'WAERS'

tabname = 'TCURT'

IMPORTING

SELECT_VALUE = P_WAERS.

*--- get long text for the selected currency

SELECT SINGLE LTEXT FROM TCURT

INTO DYFIELDS-FIELDVALUE

WHERE SPRAS = SY-LANGU

AND WAERS = P_WAERS.

IF SY-SUBRC <> 0.

CLEAR DYFIELDS-FIELDVALUE.

ENDIF.

*--- update another field

DYFIELDS-FIELDNAME = 'P_LTEXT'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

tables

dynpfields = DYFIELDS .

*----


*--- Example of reading value of another field -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.

*--- read another field

CLEAR: DYFIELDS[], DYFIELDS.

DYFIELDS-FIELDNAME = 'P_WAERS'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYFIELDS .

READ TABLE DYFIELDS INDEX 1.

*--- get short text and update current field

SELECT SINGLE KTEXT FROM TCURT

INTO P_KTEXT

WHERE SPRAS EQ SY-LANGU

AND WAERS EQ DYFIELDS-FIELDVALUE.

Hope this resolves your query.

Reward all the helpful answers.

Regards,

Jayant

Former Member
0 Kudos

Hi Akshitha,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prctrr is to get F4 help for the parameter which doesnthave any f4 help.

AT selection-screen on field : is used to validate the particular field in the selection screen.and only that particular field will be avaialble for input after an error message and all the remaining fields will be in display mode.

Revert back if any issues..

Reward points if helpful.

Regards ,

Naveen

former_member588853
Active Contributor
0 Kudos

HI,

If you need to get your own an F4 help for the selection parameter you need to write your code under the event "AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prct" for the paramete p_prct..

<b>on filed is to validate the field..</b>

At selection screen on s_vkorg

*Local variables

DATA l_v_vkorg TYPE vkorg.

SELECT vkorg "Sales organization

UP TO 1 ROWS

FROM tvko "Organizational Unit: Sales Org

INTO l_v_vkorg

WHERE vkorg IN s_vkorg.

ENDSELECT.

IF sy-subrc <> 0 AND l_v_vkorg IS INITIAL.

MESSAGE e032. "Error msg for invalid Sales Org

ENDIF.

<b>On value request you are request ing for the values top appear..</b>

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ort01.

CONSTANTS : l_c_fieldname TYPE dfies-fieldname VALUE 'ORT01',

l_c_dynprofld TYPE help_info-dynprofld VALUE 'S_ORT01'.

CLEAR : it_city.

REFRESH : it_city.

SELECT city1 "#EC CI_NOWHERE

APPENDING TABLE it_city

FROM adrc.

SORT it_city BY ort01.

DELETE ADJACENT DUPLICATES FROM it_city COMPARING ort01.

SORT it_city BY ort01 ASCENDING.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = l_c_fieldname

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = l_c_dynprofld

window_title = text-078

value_org = 'S'

callback_program = sy-cprog

TABLES

value_tab = it_city

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

you get F4 help for the filld s_ort01.

reward if useful

regards,

nazeer

Former Member

Hi,

If an input field declared in an executable program refers to a field in the ABAP Dictionary for which possible entries help is defined, the list of values from the Dictionary is automatically displayed when the user calls the F4 help for that field. To create possible values help for report input fields that have no Dictionary reference, or to override the Dictionary input help linked to the field, you can create an event block for the event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR field

The event is triggered when the user calls the F4 help for the field field. If no corresponding event block has been defined, no possible values help or values list from the Dictionary is displayed. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure in the event block that an appropriate list of values is displayed, and that the user can choose a value from it.

No event block AT SELECTION-SCREEN ON VALUE-REQUEST can be created for input fields on the selection screen that are declared within the logical database used. You cannot override the input help mechanism of the logical database within the executable program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONSstatements.

Regards

Sudheer

Former Member
0 Kudos

Hi Akshitha,

The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.

Refer this code :

AT SELECTION-SCREEN ON VALUE-REQUEST FOR L_FILE.

PERFORM F4_SEARCH.

form F4_SEARCH .

CALL FUNCTION 'F4_FILENAME'

EXPORTING

FIELD_NAME = V_FILE

IMPORTING

FILE_NAME = L_FILE.

endform. " F4_SEARCH

Reward points if helpful.

Regards,

Hemant

ashok_kumar24
Contributor
0 Kudos

Hi Akshitha,

<b>Good ...Check out the program DEMO_SELECTION_SCREEN_EVENTS.</b>

At selection-screen output(it is like A PBO) is used to modify the selection screen fields.

AT-SELECTION SCREEN ON FIELD

is to validate a particular selection screen field.

if any error comes it will open only this field and other fields will be disabled.

AT-SELECTION SCREEN

you can validate all the selection screen fields.

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.

Example:

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

At selection-screen on field

AT SELECTION-SCREEN ON <field>

is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.

The program below is connected to the logical database F1S:

REPORT EVENT_DEMO.

NODES SPFLI.

AT SELECTION-SCREEN ON CITY_FR.

IF CARRID-LOW EQ 'AA' AND CITY_FR NE 'NEW YORK'.

MESSAGE E010(HB).

ENDIF.

Good Luck and thanks

AK

Former Member
0 Kudos

<b>AT SELECTION-SCREEN on psel.</b>

Effect

This event is assigned to the selection screen fields corresponding to the report parameter or selection criterion psel.

If the report starts an error dialog at this point, precisely these fields become ready for input.

<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR psel_low_high</b>

Effect

In this addition, the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH, where sel is the name of a selection criterion. The effect of this is twofold:

1. The possible entries pushbutton for F4 appears beside the appropriate field.

2. When the user activates this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4, the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field psel_low_high at the end of this processing block are copied to the appropriate input/output field.

This addition is only allowed with report-specific parameters (PARAMETERS) or selection options (SELECT-OPTIONS). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the possible entries in the database program SAPDBxyz.

abhishek_shukla3
Explorer
0 Kudos

Taken from ABAP help:

In this case the field p_prct is either the name of a report parameter or of the form sel-LOW or sel-HIGH, where sel is the name of a selection criterion. The effect of this is twofold:

1. The possible entries pushbutton for F4 appears beside the appropriate field.

2. When the user activates this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4, the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field p_prct at the end of this processing block are copied to the appropriate input/output field.

This addition is only allowed with report-specific parameters ( PARAMETERS ) or selection options (SELECT-OPTIONS). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the possible entries in the database program SAPDBxyz.