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

Push button in toolbar at selection screen?

Former Member
0 Likes
1,165

Hello peers,

I want to put a push button in the toolbar of a selection screen which should serve the purpose of modifying the current screen by displaying more parameter in selection screen block.

This is not working as the modifying screen statement can only be triggered in the event  ' AT SELECTION SCREEN OUTPUT'  where as the Function code for the user command at the push button in selection screen can be captured only at event  'AT SELECTION SCREEN'.

Help me on dis.

10 REPLIES 10
Read only

Former Member
0 Likes
1,122

Hi

The ok-code has to be managed in the event AT SELECTION-SCREEN, the screen modifications in the event AT SELECTION-SCREEN OUTPUT, but

AT SELECTION-SCREEN is triggered before AT SELECTION-SCREEN OUTPUT, so you can set a flag in order to decide which modifications have to be done:

AT SELECTION-SCREEN.

   

   CLEAR: FL_1, FL_2,.....

    CASE SSCRFIELDS-UCOMM.

       WHEN 'BOT1'. FL_1 = 'X'.

       WHEN 'BOT2'. FL_2 = 'X'.

       WHEN .............

     ENDCASE,

AT SELECTION-SCREEN OUTPUT.

  

    CASE 'X'.

       WHEN FL_1.

           LOOP AT SCREEN.

               ..............

          ENDLOOP.

       WHEN FL_2.

          LOOP AT SCREEN.

              ..............

          ENDLOOP.

      WHEN.................

     ENDCASE.

Max

Read only

0 Likes
1,122

Below is the coding..... cant find why is it working....help will be very much appreciated.

TABLES sscrfields.

data: flag(1) type c.

SELECTION-SCREEN begin of block b1 WITH FRAME TITLE t001.

   PARAMETERS: p_matnr type mara-matnr.

SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN END OF block b1.

SELECTION-SCREEN begin of block b2 WITH FRAME TITLE t002.

   PARAMETERS: pp_matnr type mara-matnr MODIF ID sc1.

SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN END OF block b2.

SELECTION-SCREEN FUNCTION KEY 1.

INITIALIZATION.

sscrfields-functxt_01 = 'SHOW'.

t001 = 'Title 1'.

t002 = 'Title 2'.

AT SELECTION-SCREEN.

case sscrfields-ucomm.

   when 'FC01'.

     flag = '1'.

     ENDCASE.

AT SELECTION-SCREEN OUTPUT.

   if flag <> '1' and screen-group1 = 'SC1'.

     loop AT SCREEN.

       screen-active = '0'.

       MODIFY SCREEN.

        ENDLOOP.

         endif.

Read only

0 Likes
1,122

Debug Please

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,122

You should have debugged after clicking the tool bar button.

Read only

Former Member
0 Likes
1,122

Hi,

This event is executed at PBO of the selection screen every time the user presses ENTER – in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values

Regards,

venkat.

Read only

Former Member
0 Likes
1,122

Hi all,

as THANDLAM VENKATESWARLU said I started this thread to know the feasibility of triggering a change in the current screen by capturing a user command from a push button at selection screen toolbar.

Kesavadas Thekkillath i hav done enuf debugging ...please look at the scenario before suggesting  for debugging.

and max bianchi AT SELECTION SCREEN OUTPUT is triggered before AT SELECTION SCREEN event. However, thanks for the prompt reply.

Read only

0 Likes
1,122

Until you put it like this, nothing is going to happen.

at selection-screen.

   case sscrfields-ucomm.

     when 'FC01'.

       if flag <> 1"<-----

         flag = '1'.

       else.

         flag = 0.

       endif.

   endcase.

at selection-screen output.

   loop at screen.

     if flag  = '1' and screen-group1 = 'SC1'.   "<--------

       screen-active = '0'.

       modify screen.

     endif.

   endloop.

This can be identified in a simple debugging.

Read only

0 Likes
1,122

Santhosh Yadav wrote:

..........

and max bianchi AT SELECTION SCREEN OUTPUT is triggered before AT SELECTION SCREEN event. However, thanks for the prompt reply.

uhm.....have you a new SAP release?

It's not possible:

AT SELECTION-SCREEN is like PAI

AT SELECTION-SCREEN OUTPUT is like PBO

That means:

- AT SELECTION-SCREEN OUTPUT is triggered just before displaying the selection-screen

- AT SELECTION-SCREEN is triggered just after pressing a push button.

So if you need to manage a new button in selection-screen,  your new button doesn't call START-OF-SELECTION, so your program will back to selection-screen, that means:

AT SELECTION-SCREEN will be triggered before AT SELECTION-SCREEN OUTPUT

Only the first time AT SELECTION-SCREEN OUTPUT will be called before AT SELECTION-SCREEN, but in this case AT SELECTION-SCREEN won't be called, but only INITIALIZATION (and then AT SELECTION-SCREEN OUTPUT)

Max

Read only

0 Likes
1,122

The same solution I wrote before....so I can't understand your affirmation if you've chosen it as good solution for you

Max

Read only

Former Member
0 Likes
1,122

Kesavadas thekkilath, pardon me.. thanks for your response.