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

Disable a button in Module pool

Former Member
0 Likes
2,552

Hi experts,

I have 2 buttons(create and change)in my screen painter.If i click 'CHANGE' then the 'create' button should be disable.Anyone let me know the answer.

Kind Regards,

Ranjith C.

3 REPLIES 3
Read only

Former Member
0 Likes
710

Hi,

Use this....


LOOP AT SCREEN.
  CASE SCREEN-NAME.
    WHEN 'BUTT_CREATE'.
      IF mode = 'CHANGE'.
        screen-active = 0.
      ELSEIF mode = 'CREATE'.
        screen-active = 1.
      ENDIF.
    WHEN 'BUTT_CHANGE'.
      IF mode = 'CHANGE'.
        screen-active = 1.
      ELSEIF mode = 'CREATE'.
        screen-active = 0.
      ENDIF.
  ENDCASE.
ENDLOOP.

Edited by: Sukriti Saha on Nov 22, 2008 12:32 PM

Read only

Former Member
0 Likes
710

u make two PF-STATUS then write logic PBO IN STATUS

SET PF-STATUS '9001'.

FOR EXAMPLE:-

module STATUS_9001 output.

SET PF-STATUS '9001'.

IF sy-ucomm = 'CHANGE' OR sy-ucomm = 'DISP' OR sy-ucomm = 'DEL' OR sy-ucomm = 'ENTER'.

SET PF-STATUS 'Z9002'.

ENDIF.

endmodule. " STATUS_9001 OUTPUT

Read only

Former Member
0 Likes
710

Hi

Define a global varible in the code to check if you press change button. For example name it 'check'.

In screen PBO

  Module change_screen.

  In screen PAI

  Module user_command.

In abap editor.

DATA  check type string value 'Initial'.

  Module change_screen OUTPUT.
      if check = 'change.'
         loop at screen.
             if screen-name = 'BUTTON_CREATE_NAME'.
                  screen-invisible = '1'.
                  modify screen.
             endif.
         endloop.
      endif.
  Endmodule.

  Module user_command INPUT.
      case okcode.
           when 'CHANGE'.
               clear okcode.
               check = 'change'.
               leave to screen XX. "this screen
      endcase.
  Endmodule.