Application Development and Automation 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: 
Read only

Change selection-screen parameter in runtime

former_member254358
Participant
0 Likes
7,784

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.

1 ACCEPTED SOLUTION
Read only

ziolkowskib
Active Contributor
0 Likes
4,440

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.

9 REPLIES 9
Read only

ziolkowskib
Active Contributor
0 Likes
4,441

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.

Read only

0 Likes
4,440

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.

Read only

0 Likes
4,440

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.

Read only

0 Likes
4,440

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.

Read only

0 Likes
4,440

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'.

Read only

0 Likes
4,440

Thanks a lot, using SY-UCOMM fix the problem.

Regards.

Read only

vicky_upadhyay
Explorer
0 Likes
4,440

Hi David,

use .

Read only

0 Likes
4,440

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.

Read only

Chintu6august
Contributor
0 Likes
4,440

Hi,

Control the field properties based on the value of field under AT SELECTION-SCREEN Event.

thank you!!