‎2016 Sep 05 8:21 AM
Hi,
can anybody tell me how to change selection-screen parameter in runtime?
For example, I've this two parameters:
PARAMETERS: pidi LIKE t002-spras OBLIGATORY.
PARAMETERS: ppes TYPE int4.
and "pidi" should change of value depending "ppes" value.
Thanks in advance.
Regards.
‎2016 Sep 05 8:38 AM
Use AT SELECTION SCREEN. In the below example it will be called after pressing ENTER.
SELECTION-SCREEN BEGIN OF BLOCK b01.
PARAMETERS pa_one TYPE string.
PARAMETERS pa_two TYPE string.
SELECTION-SCREEN END OF BLOCK b01.
AT SELECTION-SCREEN.
IF pa_one = 'TEST'.
pa_two = 'asd'.
ENDIF.
‎2016 Sep 05 8:38 AM
Use AT SELECTION SCREEN. In the below example it will be called after pressing ENTER.
SELECTION-SCREEN BEGIN OF BLOCK b01.
PARAMETERS pa_one TYPE string.
PARAMETERS pa_two TYPE string.
SELECTION-SCREEN END OF BLOCK b01.
AT SELECTION-SCREEN.
IF pa_one = 'TEST'.
pa_two = 'asd'.
ENDIF.
‎2016 Sep 05 9:27 AM
If pa_one is equal to 'TEST' then pa_two is equal to 'asd' when I press intro but, what happens in case I wanted to change pa_two to 'XYZ', for example.
The value in pa_two keep on being 'asd' and I'd like that this would be only a propoposal but I should be able to change this value ultimately.
Is it possible?
Thanks again.
‎2016 Sep 05 9:46 AM
If I understand correctly you could set value of PA_TWO only in case it is initial - then it would be your proposal. In other cases you would not change it in order not to overwrite value provided by user.
If this does not answer your question please elaborate on your requirement.
SELECTION-SCREEN BEGIN OF BLOCK b01.
PARAMETERS pa_one TYPE string MODIF ID p01.
PARAMETERS pa_two TYPE string.
SELECTION-SCREEN END OF BLOCK b01.
AT SELECTION-SCREEN.
IF pa_one = 'TEST'.
IF pa_two IS INITIAL.
pa_two = 'value'.
ENDIF.
ELSEIF pa_one = 'TEST2'.
IF pa_two IS INITIAL.
pa_two = 'other value'.
ENDIF.
ENDIF.
‎2016 Sep 05 11:24 AM
I've a GUI with some parameters and two of them are PPES and PIDI. Once I've have all the parameters filled I run (F8) the program.
IF ppes=8. "KGS
pidi='EN'. "LANGUAGE ENGLISH
it means that if I put 8 KGS then the PIDI parameter is ENGLISH, until here it's correct.
But this is a proposed LANGUAGE and I would like to be able to change the LANGUAGE. In fact I can change this in the parameters and choose for example ZH (CHINESE) but when I push F8, PIDI keep on been EN and not ZH.
This is my problem.
Thanks.
‎2016 Sep 05 11:50 AM
I believe easy solution could be storing previous value of your parameter in a variable:
DATA gv_ppes TYPE string.
Then AT SELECTION-SCREEN you could try to determine if the change actually happened and if so change value of the other parameters.
IF gv_ppes <> ppes.
gv_ppes = ppes. "Store previous value
"change happend - do what you like
ENDIF.
Actually you can disable executing your logic when report is being executed - when you press F8 (or click Execute button) value of SY-UCOMM is changed to 'ONLI'. You can restrict your value substitution to SY-UCOMM <> 'ONLI'.
‎2016 Sep 05 4:06 PM
‎2016 Sep 05 9:06 AM
‎2016 Sep 05 11:53 AM
Hi Vichy,
I've two parameters
PPES and PIDI.
In case PPES has 8 then PIDI would be ES. But I need to have the option to change this value in PIDI despite PPES would be 8 and, for example, select ZH.
Thanks.
‎2016 Sep 05 12:01 PM
Hi,
Control the field properties based on the value of field under AT SELECTION-SCREEN Event.
thank you!!