Skip to Content
0
Jul 03, 2011 at 07:28 AM

Position of Button changes slightly after a text field above it is made inv

20 Views

I have made a very simple screen with a TExT FIELD and a button below it. The idea is when you click on the button it makes the text field invisible/visible (toggle). The o/p is coming as expected but the only problem is when I click on the button and the text field above it is made invisible , the position of button is also shifted slightly upwards.

When i click on the button on the 2nd time , the TEXT field is made visible again and then the button is shifted back to its original position. Any ideas how to prevent the button from changing its position upon clicking it.

THANKS A LOT.

REPORT  ZSCREEN_MISC.
DATA: BTN(5) TYPE C,
      INV_FLAG TYPE I VALUE 1.
CALL SCREEN 0001.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0001 INPUT.

  CASE SY-UCOMM.
    WHEN 'CLICK'.
      BTN = 'CLICK'.
  ENDCASE.

ENDMODULE.                 " USER_COMMAND_0001  INPUT
*&---------------------------------------------------------------------*
*&      Module  STATUS_0001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0001 OUTPUT.

  IF BTN = 'CLICK'.
    LOOP AT SCREEN.
      if SCREEN-NAME = 'TXT1'.
        SCREEN-INPUT = 0.
        SCREEN-INVISIBLE = INV_FLAG.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    IF INV_FLAG = 0.
      INV_FLAG = 1.
    ELSE.
      INV_FLAG = 0.
    ENDIF.
  ENDIF.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'

ENDMODULE.