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

regarding push button for parameters

Former Member
0 Likes
1,126

initially there are two push buttons and the parameters should not be displayed.

when any one push button is clicked on one parameter should be displayed.

i had written the following code but is not working

please help me

with regards

bob

TABLES : SSCRFIELDS.

PARAMETERS : P LIKE MARA-MATNR MODIF ID ABC.

PARAMETERS : P1 LIKE MARC-WERKS MODIF ID ABC.

SELECTION-SCREEN : begin of line,

PUSHBUTTON 2(10) PB1 USER-COMMAND A,

PUSHBUTTON 20(10) PB2 USER-COMMAND B,

end of line.

AT SELECTION-SCREEN ." OUTPUT.

CASE SSCRFIELDS-UCOMM.

WHEN 'A'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endcase.

4 REPLIES 4
Read only

dani_mn
Active Contributor
0 Likes
811

HI,

check this program it is doing the same you required.

<b>REPORT zwa_test2.

TABLES : SSCRFIELDS.

DATA: comm(1).

PARAMETERS : P LIKE MARA-MATNR MODIF ID P.
PARAMETERS : P1 LIKE MARC-WERKS MODIF ID p1.

SELECTION-SCREEN : begin of line,
PUSHBUTTON 2(10) PB1 USER-COMMAND A,
PUSHBUTTON 20(10) PB2 USER-COMMAND B,
end of line.

INITIALIZATION.
  LOOP AT SCREEN.
    IF SCREEN-group1 = 'P' OR
       SCREEN-group1 = 'P1'.
      SCREEN-active = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN.

  IF sy-ucomm  = 'A'.
    comm = 'A'.
  elseif sy-ucomm = 'B'.
    comm = 'B'.
  ENDIF.

AT SELECTION-SCREEN output.



  LOOP AT SCREEN.
    IF SCREEN-group1 = 'P'.

      if comm = 'A'.
        SCREEN-active = '1'.
      else.
        SCREEN-active = '0'.
      endif.
      MODIFY SCREEN.

    ENDIF.

    IF SCREEN-group1 = 'P1'.

      if comm = 'B'.
        SCREEN-active = '1'.
      else.
        SCREEN-active = '0'.
      endif.
      MODIFY SCREEN.



    ENDIF.

  ENDLOOP.
  clear: comm.</b>

REgards,

HRA

Read only

ibrahim_u
Active Participant
0 Likes
811

you must do in "at selection-screen output" statement.

and you must use a copy of SY-UCOMM like this.


data : ucom like sy-ucomm.

at selection-screen.
  ucom = sy-ucomm.

at selection-screen output.
  case ucomm.
    when 'A'.
      loop at screen.
        if screen-name eq 'P'.
          screen-active = 0.
        endif.
      endloop.
  endcase.

ibrahim

Read only

Former Member
0 Likes
811

Hi Gangadhar,

Try the following code. Its working on my side.

TABLES : SSCRFIELDS.

PARAMETERS : P LIKE MARA-MATNR MODIF ID ABC.

PARAMETERS : P1 LIKE MARC-WERKS MODIF ID ABC.

SELECTION-SCREEN : begin of line,

PUSHBUTTON 2(10) PB1 USER-COMMAND A,

PUSHBUTTON 20(10) PB2 USER-COMMAND B,

end of line.

DATA : FLAG TYPE C.

AT SELECTION-SCREEN OUTPUT.

IF FLAG IS INITIAL..

LOOP AT SCREEN.

IF SCREEN-NAME = 'P'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '0'.

SCREEN-OUTPUT = '1'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN .

CASE SSCRFIELDS-UCOMM.

WHEN 'A'.

FLAG = '1'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

SCREEN-OUTPUT = '1'.

SCREEN-INVISIBLE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Endcase.

Hope this helps,

Pragya

Read only

0 Likes
811
SELECTION-SCREEN PUSHBUTTON 15(15) KIS1 USER-COMMAND ID1.
SELECTION-SCREEN PUSHBUTTON 35(15) KIS2 USER-COMMAND ID2.

parameters: KISHAN1(15) MODIF ID ID1.


parameters: KISHAN2(15)  MODIF ID ID2.

TABLES: sscrfields.

data l_button like sy-ucomm.

INITIALIZATION.
 KIS1 =  'Pushbutton1'.
 KIS2 =  'Pushbutton2'.
l_button = 'ID1'.


AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ID1'
OR sscrfields-ucomm = 'ID2'.
l_button = sscrfields-ucomm.
ENDIF.

AT SELECTION-SCREEN OUTPUT.

loop at screen.
IF SCREEN-GROUP1 = 'ID1'.
IF SCREEN-GROUP1 <> L_BUTTON.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.

loop at screen.
IF SCREEN-GROUP1 = 'ID2'.
IF SCREEN-GROUP1 <> L_BUTTON.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.