‎2009 Jan 21 12:35 PM
Hi ABAP workers,
I have a block of selection parameters, and I created the event AT SELECTION SCREEN ON BLOCK bl1 with a subroutine. I want that subroutine to be executed only when a parameter in the selection block is changed by the user. But the behaviour right now is that it executes every time I press Enter, even if no parameter changes.
Is there any way to chieve this (like in the module pool case, with the extension "ON REQUEST")?
Thank you very much
Ivson
Code involved:
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE csks-bukrs MEMORY ID buk OBLIGATORY,
p_ryear LIKE glpct-ryear OBLIGATORY.
SELECT-OPTIONS: s_poper FOR glpct-rpmax,
s_racct FOR glpct-racct,
s_kunnr FOR glpca-kunnr,
s_lifnr FOR glpca-lifnr,
s_sprctr FOR glpct-sprctr.
SELECTION-SCREEN END OF BLOCK bl1.
AT SELECTION-SCREEN ON BLOCK bl1.
PERFORM preselect.
‎2009 Jan 21 12:46 PM
Hi,
U can use
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_meth1(Screen field).
it'll solve ur problm
‎2009 Jan 21 12:45 PM
Hi,
Pressing Enter is triggering the PAI which is executing AT SELECTION-SCREEN regardless of any condition.
Please include another perform like CHECK_VALUES_ENTERED and if values are not initial, call the PERFORM preselect in AT SELECTION-SCREEN.
Regards,
Prosenjit.
‎2009 Jan 21 12:46 PM
Hi,
U can use
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_meth1(Screen field).
it'll solve ur problm
‎2009 Jan 21 12:55 PM
Hi,
i think you should use an additional variable like this:
data : curr_value like <your_parameter_type>.
..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <your_parameter>.
if <your_parameter> ne curr_value.
curr_value = <your_parameter>.
perform <your_form> using .....
endif.
This should works
Bye
Andrea
‎2009 Jan 21 12:52 PM
Hi,
You could try this.
Use the FM "DYNP_VALUES_READ" to get the contents of that screen parameter and then check for the parameter value inside the subroutine using a IF statement.
PNAME is a paramter name here.
a dynpfields-fieldname = 'PNAME'.
append dynpfields.
repid = sy-repid.
call function 'DYNP_VALUES_READ'
exporting
dyname = repid
dynumb = sy-dynnr
tables
dynpfields = dynpfields
exceptions
others.
read table dynpfields index 1.
pname = dynpfields-fieldvalue.
Process the subroutine if needed based on the check condition.
Hope this helps you.
Regards,
Subbu