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

looks simple

Former Member
0 Likes
738

Hi,

I have 2 parameter options and 2 buttons - activate and deactivate. When user clicks on activate, it gets activated. If the user clicks on deactivate immediately, nothing happens. But if he clicks on the execute button and clicks on deactivate, it gets deactivated.

How to make it both activate and deactivate without clicking the execute button?

thanks and regards,

bindazme

Hi,

I have 2 parameter options and 2 buttons - activate and deactivate. When user clicks on activate, it gets activated. If the user clicks on deactivate immediately, nothing happens. But if he clicks on the execute button and clicks on deactivate, it gets deactivated.

How to make it both activate and deactivate without clicking the execute button?

thanks and regards,

bindazme

5 REPLIES 5
Read only

gopi_narendra
Active Contributor
0 Likes
712

give the addition user-command to the radio button

PARAMETERS : w_par1  RADIOBUTTON GROUP aa USER-COMMAND aa.
PARAMETERS : w_par2  RADIOBUTTON GROUP aa.

And do the activation deactivation in the event

AT SELECTION-SCREEN OUTPUT. " At selection screen output event

Regards

Gopi

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
712

Hi,

Give the addition user-command to those PARAMTERS.

And add AT USER-COMMAND event block to your code.

There check sy-ucomm for the user command.

Regards,

Sesh

Read only

Former Member
0 Likes
712

Hi,

Where does these parameters and buttons present?. on selection-screen or any custom screen?

If they are present in selection screen by adding user command to the buttons u can handle this.

Regards,

Sankar

Read only

former_member189059
Active Contributor
0 Likes
712

try this

REPORT  Z_DYNAMIC_SEL_SCREEN.

tables: eban.

SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',
          rad2 RADIOBUTTON GROUP rad .
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.

PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,
           p_matnr TYPE eban-matnr MODIF ID g1,
           sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2.


SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.


SELECTION-SCREEN END OF SCREEN 100.



name = 'FETCH'.
title = 'Test Report'.
CALL SELECTION-SCREEN '100'.


TYPE-POOLS slis.

AT SELECTION-SCREEN OUTPUT.



  IF rad1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1' OR screen-group1 = 'G4'.
        screen-active = '1'.
        screen-input = 0.
      ELSEIF screen-group1 = 'G2'.
        screen-active = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

  ELSEIF rad2 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'  OR screen-group1 = 'G4' OR screen-group1 = 'G3' OR screen-group1 = 'G5'.
        screen-active = '0'.
      ELSEIF screen-group1 = 'G2'.
        screen-active = '1'.

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

  IF mtr = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
        screen-input = 1 .

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

  IF sloc = ' '.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
        screen-input = 0 .
      ENDIF.


      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

clear sy-ucomm.
*  iflag = 1.

Read only

Former Member
0 Likes
712

Hi

When I added USER-COMMAND to the parameters i get the error user-command ended unexpectedly. The parameters code uses listbox..

parameter : s_matnr like qmat-matnr as listbox visible length 20.

parameter : s_werks like qmat-werks as listbox visible length 20.

parameters: p_insty like qmat-art.

The activation and deactivation takes place using call transaction. Now i am getting the message 'No changes made' when i click on activate and deactivate continously.

regards,

bindazme