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

Can I make two differents selection screen in my program?

former_member384574
Active Participant
0 Likes
902

Hi experts!!

I don't know how to male this, the problem is that I need to make two differents selection screen in my program because I have two differents kinds of button,

BUTTON1 BUTTON2 BUTTON3

When I press button1 I received.

BUTTON4 BUTTON5 BUTTON6

Now If I press on button4, how can I pick up the event? the name or something associate to this button4?

Thanks a lot and regards

Rebeca

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
867

Hi,

try this concept.

BUTTON1

BUTTON2

BUTTON3

selection-screen begin of screen 900.

BUTTON4

BUTTON5

BUTTON6

selection-screen end of screen.

at selection-screen.

if sy-ucomm = 'FCODE1'.

call selection-screen 900.

elseif sy-ucomm = 'FCODE2'.

write your code for button2

elseif sy-ucomm = 'FCODE3'.

write your code for button3

elseif sy-ucomm = 'FCODE4'

write your code for button4.

elseif sy-ucomm = 'FCODE5'.

write your code for button5

elseif sy-ucomm = 'FCODE6'.

write your code for button6

endif.

Hi experts!!

I don't know how to male this, the problem is that I need to make two differents selection screen in my program because I have two differents kinds of button,

BUTTON1 BUTTON2 BUTTON3

When I press button1 I received.

BUTTON4 BUTTON5 BUTTON6

Now If I press on button4, how can I pick up the event? the name or something associate to this button4?

Thanks a lot and regards

Rebeca

5 REPLIES 5
Read only

Former Member
0 Likes
867

I think you may read this:

please forgive me if you caught yourself by your manager by laughing at desk

Cheers

Read only

Former Member
0 Likes
867

Hi

U need to assign the code for the USER-COMMAND to your button and check if the event AT SELECTION-SCREEN:

TABLES SSCRFIELDS.


SELECTION-SCREEN PUSHBUTTON 1(20) BUTT1 USER-COMMAND AAA.
SELECTION-SCREEN PUSHBUTTON /1(20) BUTT2 USER-COMMAND BBB.
SELECTION-SCREEN PUSHBUTTON /1(20) BUTT3 USER-COMMAND CCC.

INITIALIZATION.

  BUTT1 = '1'.
  BUTT2 = '2'.
  BUTT3 = '3'.

AT SELECTION-SCREEN.

  CASE SSCRFIELDS-UCOMM.
    WHEN 'AAA'. MESSAGE I208(00) WITH 'Button 1'.
    WHEN 'BBB'. MESSAGE I208(00) WITH 'Button 2'.
    WHEN 'CCC'. MESSAGE I208(00) WITH 'Button 3'.
  ENDCASE.

Max

Read only

Former Member
0 Likes
868

Hi,

try this concept.

BUTTON1

BUTTON2

BUTTON3

selection-screen begin of screen 900.

BUTTON4

BUTTON5

BUTTON6

selection-screen end of screen.

at selection-screen.

if sy-ucomm = 'FCODE1'.

call selection-screen 900.

elseif sy-ucomm = 'FCODE2'.

write your code for button2

elseif sy-ucomm = 'FCODE3'.

write your code for button3

elseif sy-ucomm = 'FCODE4'

write your code for button4.

elseif sy-ucomm = 'FCODE5'.

write your code for button5

elseif sy-ucomm = 'FCODE6'.

write your code for button6

endif.

Read only

0 Likes
867

Hi and thanks,

I've tried with your code, Velu Lakshmanan, and I only received another screen with the buttons... I need to put this button in the same screen, now I've this, but I can't receive the event associate to the second's buttons,

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON  1(79) DTP USER-COMMAND DTP
VISIBLE LENGTH 25.
SELECTION-SCREEN PUSHBUTTON 28(79) EMP USER-COMMAND EMP
VISIBLE LENGTH 25.
SELECTION-SCREEN PUSHBUTTON 55(79) ABS USER-COMMAND ABS
VISIBLE LENGTH 25.

PARAMETERS: PROC_TYP TYPE I DEFAULT 1 NO-DISPLAY.

SELECTION-SCREEN END OF LINE.



* Informes de datos de tiempo.

SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-FED USER-COMMAND FED MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-DCH USER-COMMAND DCH MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-ACH USER-COMMAND ACH MODIF ID DT1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-FII USER-COMMAND FII MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-PTB USER-COMMAND PTB MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-PTS USER-COMMAND PTS MODIF ID DT1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-ACI USER-COMMAND ACI MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-FIM USER-COMMAND FIM MODIF ID DT1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-LDH USER-COMMAND LDH MODIF ID DT1.
SELECTION-SCREEN END OF LINE.

* Informes de empleados


SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-LDP USER-COMMAND LDP MODIF ID EM1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-PDF USER-COMMAND PDF MODIF ID EM1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-LDT USER-COMMAND LDT MODIF ID EM1.
SELECTION-SCREEN END OF LINE.

* Informes de bajas


SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-BAJ USER-COMMAND BAJ MODIF ID AB1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-VMA USER-COMMAND VMA MODIF ID AB1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-SDE USER-COMMAND SDE MODIF ID AB1.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(25)  TEXT-LDB USER-COMMAND LDB MODIF ID AB1.
SELECTION-SCREEN PUSHBUTTON 28(25) TEXT-LDA USER-COMMAND LDA MODIF ID AB1.
SELECTION-SCREEN PUSHBUTTON 55(25) TEXT-DHT USER-COMMAND DHT MODIF ID AB1.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B1.


* Pintamos los botones que necesitemos mostrar según la opción seleccionada

AT SELECTION-SCREEN.
  CASE SSCRFIELDS-UCOMM.

    WHEN 'DTP'. PROC_TYP = 1.
    WHEN 'EMP'. PROC_TYP = 2.
    WHEN 'ABS'. PROC_TYP = 3.
  ENDCASE.


AT SELECTION-SCREEN OUTPUT.

  CASE PROC_TYP.


* Cuando el botón que ha seleccionado es "Datos de tiempo"

    WHEN 1.

      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          NAME   = ICON_OKAY
          TEXT   = TEXT-DTP
          INFO   = TEXT-AUS
        IMPORTING
          RESULT = DTP.

      EMP = TEXT-EMP.
      ABS = TEXT-ABS.

      LOOP AT SCREEN.
        IF SCREEN-GROUP1 EQ 'DT1'.
          SCREEN-INPUT = '1'. SCREEN-INVISIBLE = '0'. MODIFY SCREEN.
        ENDIF.
        IF SCREEN-GROUP1 EQ 'EM1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.

        IF SCREEN-GROUP1 EQ 'AB1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.

      ENDLOOP.





    WHEN 2.

      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          NAME   = ICON_OKAY
          TEXT   = TEXT-EMP
          INFO   = TEXT-AUS
        IMPORTING
          RESULT = EMP.

      DTP = TEXT-DTP.
      ABS = TEXT-ABS.

      LOOP AT SCREEN.
        IF SCREEN-GROUP1 EQ 'DT1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.
        IF SCREEN-GROUP1 EQ 'EM1'.
          SCREEN-INPUT = '1'. SCREEN-INVISIBLE = '0'. MODIFY SCREEN.
        ENDIF.

        IF SCREEN-GROUP1 EQ 'AB1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.

      ENDLOOP.

    WHEN 3.

      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          NAME   = ICON_OKAY
          TEXT   = TEXT-ABS
          INFO   = TEXT-AUS
        IMPORTING
          RESULT = ABS.

      DTP = TEXT-DTP.
      EMP = TEXT-EMP.

      LOOP AT SCREEN.
        IF SCREEN-GROUP1 EQ 'DT1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.
        IF SCREEN-GROUP1 EQ 'EM1'.
          SCREEN-INPUT = '0'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN.
        ENDIF.

        IF SCREEN-GROUP1 EQ 'AB1'.
          SCREEN-INPUT = '1'. SCREEN-INVISIBLE = '0'. MODIFY SCREEN.
        ENDIF.

      ENDLOOP.



  ENDCASE.

Help please... I don't know how can I make this.....

If I use screen...how can I put this screen in the correct place?

Thanks a lot

Regards,

Rebeca

Read only

0 Likes
867

Hi

But where is the problem? Every button has an own code so u need to check it in AT SELECTION-SCREEN just as you do for the first buttons:

AT SELECTION-SCREEN.
  CASE SSCRFIELDS-UCOMM.
* First buttons
    WHEN 'DTP'. PROC_TYP = 1.
    WHEN 'EMP'. PROC_TYP = 2.
    WHEN 'ABS'. PROC_TYP = 3.
* Second buttons
    WHEN 'FED'.
    WHEN 'DCH'.
    WHEN 'ACH'.
* and so....
  ENDCASE.

Max