Skip to Content

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

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 04, 2011 at 04:30 AM

    Hi.,

    If you made the field invisible it wont occupy any space. so it is shifting up. If you want to make the button stable take one more text field above the button with just one dot as text (if you keep space again it will ignore ) and initially make it invisible.

    On Click of button make the required text as invisible and the text above button which you created as visible.. so that the button position will be at same place..

    hope this helps u.,

    Thanks & Regards,

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi.,

      As far I know there is no such attribute or property. May I know why you want to keep button fixed..! Every One Wants to hide Extra space..

      Ok If you want to keep button fixed., use Sub Screen and Place your Text Inside Subscreen and keep button out side the Subscreen. So that when You make the Text Invisible The Subscreen Wont shrink I think.. and the button will be in its place..

      hope this helps u.,

      Thanks & Regards,

      Kiran

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.