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

AT selection-screen : Processed 2 times!

Former Member
0 Likes
3,786

I do have a selection screen

and event at-selection-screen.

Some checkbox with usercommand

When box is uncheck something has to be done but it is done 2 times!

any idea +?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,254

I noticed that there are SUB SCREENS in your program.

The problem occurs because your program triggers the first event AT SELECTION-SCREEN for your main screen 1000 and the second event for your SUB SCREEN.

So check the current system variable, something like "CHECK SY-DYNNR = 1000." to trigger the event only for your main SCREEN.

This way you make sure the event AT SELECTION-SCREEN runs only once.

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:06 AM

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:08 AM

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:12 AM

13 REPLIES 13
Read only

hymavathi_oruganti
Active Contributor
0 Likes
2,254

can u send the code

Read only

Former Member
0 Likes
2,254

Hi Stephan,

it is <b>at selection-screen output</b> not <b>at selection-screen.</b>(are you sure)

it is some thing similar to PBO in module pool, it will trigger twice.

regards

vijay

Read only

0 Likes
2,254

My selection screens are generated by another program

Here is the generated code!

REPORT main_cock.
CALL SCREEN 0005.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN  .
SELECTION-SCREEN BEGIN OF BLOCK b_plan WITH FRAME TITLE box_plan.
SELECTION-SCREEN PUSHBUTTON /01(20) p_9360 USER-COMMAND pl_9360.
SELECTION-SCREEN PUSHBUTTON 26(20) p_0031 USER-COMMAND pl_0031.
SELECTION-SCREEN PUSHBUTTON 51(20) p_7320 USER-COMMAND pl_7320.
SELECTION-SCREEN PUSHBUTTON 76(20) p_7460 USER-COMMAND pl_7460.
SELECTION-SCREEN PUSHBUTTON /01(20) p_0030 USER-COMMAND pl_0030.
SELECTION-SCREEN PUSHBUTTON 26(20) p_3250 USER-COMMAND pl_3250.
SELECTION-SCREEN PUSHBUTTON 51(20) p_4350 USER-COMMAND pl_4350.
SELECTION-SCREEN PUSHBUTTON /01(20) p_6150 USER-COMMAND pl_6150.
SELECTION-SCREEN PUSHBUTTON 26(20) p_0035 USER-COMMAND pl_0035.
SELECTION-SCREEN PUSHBUTTON 51(20) p_4370 USER-COMMAND pl_4370.
SELECTION-SCREEN PUSHBUTTON /01(20) p_0007 USER-COMMAND pl_0007.
SELECTION-SCREEN PUSHBUTTON 26(20) p_7440 USER-COMMAND pl_7440.
SELECTION-SCREEN PUSHBUTTON 51(20) p_4360 USER-COMMAND pl_4360.
SELECTION-SCREEN END OF BLOCK b_plan .
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b_stat WITH FRAME TITLE box_stat.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(20) pstt_01
 FOR FIELD pst_01.
PARAMETERS pst_01 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_01.
SELECTION-SCREEN COMMENT 26(20) pstt_05
 FOR FIELD pst_05.
PARAMETERS pst_05 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_05.
SELECTION-SCREEN COMMENT 51(20) pstt_08
 FOR FIELD pst_08.
PARAMETERS pst_08 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_08.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(20) pstt_03
 FOR FIELD pst_03.
PARAMETERS pst_03 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_03.
SELECTION-SCREEN COMMENT 26(20) pstt_06
 FOR FIELD pst_06.
PARAMETERS pst_06 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_06.
SELECTION-SCREEN COMMENT 51(20) pstt_10
 FOR FIELD pst_10.
PARAMETERS pst_10 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_10.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(20) pstt_04
 FOR FIELD pst_04.
PARAMETERS pst_04 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_04.
SELECTION-SCREEN COMMENT 26(20) pstt_07
 FOR FIELD pst_07.
PARAMETERS pst_07 AS CHECKBOX DEFAULT 'X' USER-COMMAND pst_07.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b_stat .
SELECTION-SCREEN END OF SCREEN 200.
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b_licha WITH FRAME TITLE box_lich.
DATA : g_licha TYPE mch1-licha.
SELECT-OPTIONS : so_licha FOR g_licha.
SELECTION-SCREEN END OF BLOCK b_licha .
SELECTION-SCREEN END OF SCREEN 300.
SELECTION-SCREEN BEGIN OF SCREEN 333 AS SUBSCREEN.
SELECTION-SCREEN INCLUDE BLOCKS b_stat.
SELECTION-SCREEN INCLUDE BLOCKS b_licha.
SELECTION-SCREEN INCLUDE BLOCKS b_plan.
SELECTION-SCREEN END OF SCREEN 333.
SELECTION-SCREEN BEGIN OF SCREEN 666 AS SUBSCREEN.
SELECTION-SCREEN END OF SCREEN 666.
SELECTION-SCREEN BEGIN OF SCREEN 999 AS SUBSCREEN.
SELECTION-SCREEN END OF SCREEN 999.
SELECTION-SCREEN BEGIN OF SCREEN 0005.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR
17
LINES,
    TAB (20) button1 USER-COMMAND push1 DEFAULT SCREEN 333,
    TAB (20) button2 USER-COMMAND push2 DEFAULT SCREEN 666,
    TAB (20) button3 USER-COMMAND push3 DEFAULT SCREEN 999,
                  END OF BLOCK mytab.
SELECTION-SCREEN END OF SCREEN 0005.

INITIALIZATION.

  SET  PF-STATUS 'STAT'.
  sy-title = '-= [ MDi Cockpit ] =-'.
  TABLES zvmdi16. RANGES : r_status FOR zvmdi16-zzmdistat.
  r_status-sign = 'I'. r_status-option = 'EQ'.
  MOVE 'ACB' TO p_9360.
  MOVE 'Avilés' TO p_0030.
  MOVE 'Cockerill Sambre' TO p_6150.
  MOVE 'EKO Stahl GmbH' TO p_0007.
  MOVE 'Etxebarri' TO p_0031.
  MOVE 'Galvalange' TO p_3250.
  MOVE 'Gijón' TO p_0035.
  MOVE 'Sagunto' TO p_7440.
  MOVE 'Sidmar' TO p_7320.
  MOVE 'Sollac Atlantique' TO p_4350.
  MOVE 'Sollac Lorraine' TO p_4370.
  MOVE 'Sollac Méditerranée' TO p_4360.
  MOVE 'Stahlwerke Bremen' TO p_7460.
  MOVE '01-Initialized' TO pstt_01.
  MOVE '01' TO r_status-low. APPEND r_status.
  MOVE '03-Send to Plant' TO pstt_03.
  MOVE '03' TO r_status-low. APPEND r_status.
  MOVE '04-Analysis by Plant' TO pstt_04.
  MOVE '04' TO r_status-low. APPEND r_status.
  MOVE '05-Pending at Plant' TO pstt_05.
  MOVE '05' TO r_status-low. APPEND r_status.
  MOVE '06-Updated for Leverage' TO pstt_06.
  MOVE '06' TO r_status-low. APPEND r_status.
  MOVE '07-Wait for new MDI Message' TO pstt_07.
  MOVE '07' TO r_status-low. APPEND r_status.
  MOVE '08-Returned to Leverage' TO pstt_08.
  MOVE '08' TO r_status-low. APPEND r_status.
  MOVE '10-Ignore MDI Message' TO pstt_10.
  MOVE '10' TO r_status-low. APPEND r_status.

AT SELECTION-SCREEN OUTPUT.
  MOVE 'Vendor Batch' TO %_so_licha_%_app_%-text.
  MOVE 'Plant' TO box_plan.
  MOVE 'MDi Status' TO box_stat.
  MOVE ' Main Selection ' TO button1 .
  MOVE ' Status Information ' TO button2 .
  MOVE ' Error Information ' TO button3 .

AT SELECTION-SCREEN.
  IF sy-ucomm CS 'PL_'.
    IF r_status[] IS INITIAL.
      MESSAGE e398(00) WITH 'No Status have been selected!'.
    ELSE.
      SUBMIT zvl_mdi_errorwf_plant
            WITH s_licha IN so_licha
            WITH s_plant = sy-ucomm+3
            WITH s_status IN r_status
      AND RETURN.
    ENDIF.
  ELSEIF sy-ucomm CS 'PST_'.
    DELETE r_status WHERE low = sy-ucomm+4.
    IF sy-subrc NE 0.
      MOVE  sy-ucomm+4(2) TO r_status-low. APPEND r_status.
    ENDIF.
    CLEAR sy-ucomm.
  ENDIF.

Read only

Former Member
0 Likes
2,254

Hi

Generally at selection-screen output is a PBO event. so when you display a screen it automatically triggers the

at selection-screen output. so it get triggers when you excute.

when you press the selection button it triggers at selection-screen and if it returns to the same screen once again the at selection-screen output will be triggered.

that's why at selection-screen output is triggering twice

regards

Read only

0 Likes
2,254

> Hi

>

> Generally at selection-screen output is a PBO event.

> so when you display a screen it automatically

> triggers the

> at selection-screen output. so it get triggers when

> you excute.

>

> when you press the selection button it triggers at

> selection-screen and if it returns to the same screen

> once again the at selection-screen output will be

> triggered.

>

>that's why at selection-screen output is triggering

> twice

>

> regards

<b>Subject is AT SELECTION SCREEN ! Not AT SELECTION-SCREEN output</b>

Read only

0 Likes
2,254

what ever code now u r witing in AT SELECTION-SCREEN,

y cant u try in AT USER-COMMAND?

Read only

0 Likes
2,254

Yep !

But then the checkbox are not processed there!

Read only

Former Member
0 Likes
2,254

Hi

link uesr commend to the you check box its simple.

Read only

Former Member
0 Likes
2,254

hi ,

i am sorry i did't given code here is your code.

PARAMETERS: p_chek as CHECKBOX USER-COMMAND flag.

flag is just flag no scpoe of that .

we are making our selection of check box as a event.

[Removed by the moderator.]

Read only

0 Likes
2,254

If you take a look at my code above you see it is done!

And I do not reach at user-command

Read only

0 Likes
2,254

Selection screen events occur immediately before sending a selection screen and after certain user actions on a AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.

Read only

0 Likes
2,254

Hi,

can you please provide more details like what you do what times tiggering . at-selection-screen tigger twice here in your code.

Read only

Former Member
0 Likes
2,255

I noticed that there are SUB SCREENS in your program.

The problem occurs because your program triggers the first event AT SELECTION-SCREEN for your main screen 1000 and the second event for your SUB SCREEN.

So check the current system variable, something like "CHECK SY-DYNNR = 1000." to trigger the event only for your main SCREEN.

This way you make sure the event AT SELECTION-SCREEN runs only once.

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:06 AM

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:08 AM

Edited by: Eduardo Luiz Nunes Ribeiro on Jul 6, 2009 10:12 AM