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: 

Trigger AT SELECTION-SCREEN OUTPUT after START-OF-SELECTION.

h_senden2
Active Contributor
0 Kudos

Hi,

is it possible to trigger the event AT SELECTION-SCREEN OUTPUT after the START-OF-SELECTION event ?

PARAMETERS: p_tel TYPE i.

AT SELECTION-SCREEN OUTPUT.

  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.

START-OF-SELECTION.

* trigger AT SELECTION-SCREEN OUTPUT ?

  WRITE:/ 'P_TEL = ', p_tel.

If user fills 6 and press enters, the input field value is set to 5.

But if the value is 6 and the user press Execute, the field value will stay 6.

regards,

Hans

16 REPLIES 16

Former Member
0 Kudos

Hi,

WHy do you want at selection screen output to trigger after start of selection?

What is your exact requirment.

Former Member
0 Kudos

Hi Hans,

If you want the user entry of '6' to change as '5' when the user presses 'ENTER' or 'EXECUTE' , then instead of 'SELECTION SCREEN OUTPUT' use the event 'AT SELECTION SCREEN'.

Regards,

Santhosh

h_senden2
Active Contributor
0 Kudos

Hi,

the reason for this question is that the user want to see the parameters on the screen with the values used for processing.

The code shown is just an simple example to indicate the issue.

If the user fills 6, the system should add 5 to the screen and process with the 5 (and not the 6).

If the execution takes some time to produce output on the screen, it shows the incorrect values on the screen.

To use the correct parameters for processing i've used the code below, but the screen is still showing the old value (6).

PARAMETERS: p_tel TYPE i.
 
AT SELECTION-SCREEN OUTPUT.
 
  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.
 
START-OF-SELECTION.
 
* trigger AT SELECTION-SCREEN OUTPUT ?
  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.
 
  WRITE:/ 'P_TEL = ', p_tel.

Former Member
0 Kudos

Hi,

Then you just need to use The event "AT selection screen.

As shown below:

At selection screen.

IF p_tel > 10.

p_tel = 10.

ELSEIF p_tel > 5.

p_tel = 5.

ENDIF.

Now when the user presses enter, after putting 6.. the value would get validated and replaced to 5.

Put a break point and test the same.Should work.

0 Kudos

HI Senden,

Use the Event AT SELECTION-SCREEN to validate the Screen input

AT SELECTION-SCREEN.  "  This is like PAI and used for Field Validation purpose
 
  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.

Cheerz

Ramchander Rao.K

h_senden2
Active Contributor
0 Kudos

No, it still is not working as requested.

See my answer to Santhost (sakasa).

0 Kudos

Hi Senden,

We can not change the triggering order of external events. It will be always same as below:

1. INITIALIZATION

2. AT SELECTION-SCREEN ON OUTPUT

3. AT SELECTION-SCREEN ON VALUE REQUEST FOR <FIELD>

4. AT SELECTION-SCREEN ON <FIELD>

5. AT SELECTION-SCREEN

6. START-OF-SELECTION

7. TOP-OF-PAGE(If There is write statement in START-OF-SELECTION)

8. END-OF-PAGE

9. END-OF-SELECTION

Coming to your issue- Try following code..

parameters: p_num type i.

at selection-screen.
 if p_num > 10.
   p_num = 10.
 elseif p_num > 5.
   p_num = 5.
 endif.

start-of-selection.
 write: p_num.

Regards,

Naveen Inuganti

h_senden2
Active Contributor
0 Kudos

Hi Naveen,

that solution will not do the job.

See my answer to Santhost (sakasa).

During the 10 seconds of processing you will see the old value (6) and not the new (5).

h_senden2
Active Contributor
0 Kudos

Personally i don't think my request is not possible.

But the customer wants me to investigate, and the SDN forum is my last try

regards,

Hans

0 Kudos

Senden,

What you are looking for is not possible Senden!

We should think about following alternates.

parameters: p_tel type i.

at selection-screen output.
  if p_tel > 10.
    p_tel = 10.
  elseif p_tel > 5.
    p_tel = 5.
  endif.


start-of-selection.
  if p_tel = 10 or p_tel le 5.
   write:/ 'P_TEL = ', p_tel.
  else.
   message 'Value reset' type 'S'.
  endif.

Or

For first execution - open pop window with one output field which will have modified value and one button for secondary execution.

Or

Your own GUI screen, Where you need to have your own execution button which can act as your wish.

All the best!

Thanks,

Naveen.I

0 Kudos

I think the issue lies that you want to avoid user running the report before pressing ENTER (which would trigger dialog step and change your parameter on screen, so the user would see what the report is running with). I think then that playing with GUI status can do the job.

You simply don't allow to run the report before any action followed by ENTER is triggered. You can achieve this with this


PARAMETERS: p_tel TYPE i.

AT SELECTION-SCREEN OUTPUT.
  IF p_tel IS NOT INITIAL.
    PERFORM set_sel_status USING space.
  ELSE.
    PERFORM set_sel_status USING 'E'.
  ENDIF.


AT SELECTION-SCREEN.
  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.


*&---------------------------------------------------------------------*
*&      Form  set_sel_status
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->I_MODE     text
*----------------------------------------------------------------------*
FORM set_sel_status USING i_mode TYPE c.
  DATA lt_exc_fcodes TYPE TABLE OF sy-ucomm.

  IF i_mode = 'E'.
    APPEND 'ONLI' TO lt_exc_fcodes.
  ELSE.
    REFRESH lt_exc_fcodes.
  ENDIF.

  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = space
    TABLES
      p_exclude = lt_exc_fcodes.

ENDFORM.                    "set_sel_status


START-OF-SELECTION.

  WRITE:/ 'P_TEL = ', p_tel.

One downside, this will only work for the first time. You could however make this field read only once the value has been altered. If the user want to change it again he would have to select i.e. pencil button (you could add this to GUI status) which would trigger pai again and you could remove RUN button again making the field ready for input again. So the process would loop.

Regards

Marcin

Former Member
0 Kudos

Hi,

try this :

PARAMETERS: p_tel TYPE i.

AT SELECTION-SCREEN on p_tel.

IF p_tel > 10.

p_tel = 10.

ELSEIF p_tel > 5.

p_tel = 5.

ENDIF.

START-OF-SELECTION.

WRITE:/ 'P_TEL = ', p_tel.

Regards,,

santhosh

0 Kudos

Hi Santhosh,

during processing (i've build in a wait for 10 seconds) the selection screen still shows me the old value (6). I want the program to show the value that is used for the processing (5).

PARAMETERS: p_tel TYPE i.

AT SELECTION-SCREEN ON p_tel.

  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.


AT SELECTION-SCREEN OUTPUT.

  IF p_tel > 10.
    p_tel = 10.
  ELSEIF p_tel > 5.
    p_tel = 5.
  ENDIF.

START-OF-SELECTION.

* trigger AT SELECTION-SCREEN OUTPUT ?

* do same actions as for AT SELECTION-SCREEN OUTPUT

  WAIT UP TO 10 SECONDS.

  WRITE:/ 'P_TEL = ', p_tel.

raymond_giuseppi
Active Contributor
0 Kudos

Ok, you want that the report correct the input of the user and in this case, the program should redisplay the selection-screen, yes ?

Try

TABLES: sscrfields.

PARAMETERS: p_tel TYPE i.

AT SELECTION-SCREEN ON p_tel.
  IF p_tel > 10.
    p_tel = 10.
    CLEAR sscrfields-ucomm.
  ELSEIF p_tel > 5.
    p_tel = 5.
    CLEAR sscrfields-ucomm.
  ENDIF.

So if user input a number out of range, the program will correct the value and redisplay the selection-screen even if user has pressed execute or print icon. (so triggering the output of the selection-screen)

You cannot redisplay the screen without triggering a complete PBO/PAI, even if you stored the ucomm value and SUPPRESS DIALOG in the PBO the screen would not be redisplayed.

Regards,

Raymond

h_senden2
Active Contributor
0 Kudos

Thanks for all suggetions, but this is not possible.

I will close the subject.

Thanks,

Hans

0 Kudos

Re-opened. Please assign stars to helpful replies, although the outcome is not what you expected, then close the thread again.

Thomas