Application Development 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: 

hiding screen fields at an event

Former Member
0 Kudos

hi,

assume that i am having 3 fields in a screen.

after antering the values on the first field and if i place the cursor on the second or third fields then these fields (second and third ) should be disabled.

can anyone help me out in this. For me it works only by pressing the enter key. I want that to work if the cursor has been placed on other fields.is there any event available for that.

or pls tell me how to do this.

regards,

Phyrose.

4 REPLIES 4

Former Member
0 Kudos

Hi,

check the below.

&----


*& Report ZHAR_DYN_SELSCR.

&----


*& This program demonstrates how easy it is to set selection screen

*& element properties dynamically

*&

*& The program uses 3 radio buttons to set the display and input

*& properties of selection screen fields dynamically

&----


*& URL: http://allaboutsap.blogspot.com

&----


REPORT ZHAR_DYN_SELSCR.

----


  • DATABASE TABLES

----


tables : mara.

----


  • SELECTION SCREEN

----


selection-screen begin of block b1 with frame.

*--- Radio buttons to set properties

PARAMETERS:

rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,

rad2 RADIOBUTTON GROUP rad,

rad3 RADIOBUTTON GROUP rad.

*--- Selection Screen fields

SELECT-OPTIONS:

s_matnr FOR mara-matnr MODIF ID MI1,

s_mtart FOR mara-mtart MODIF ID MI1,

s_mbrsh FOR mara-mbrsh MODIF ID MI2,

s_matkl FOR mara-matkl MODIF ID MI2.

selection-screen end of block b1.

----


  • AT SELECTION SCREEN

----


at selection-screen output.

loop at screen.

*--- If Radio Button 1 is checked

IF rad1 = 'X'.

IF screen-group1 = 'MI2'.

*--- Fields with MODIF ID MI2 disappear from the screen

screen-input = 0.

screen-invisible = 1.

ENDIF.

*--- If Radio Button 2 is checked

ELSEIF rad2 = 'X'.

IF screen-group1 = 'MI1'.

*--- Fields with MODIF ID MI1 are input-disabled

screen-input = 0.

ENDIF.

*--- If Radio Button 3 is checked

ELSEIF rad3 = 'X'.

IF screen-group1 = 'MI1' or screen-group1 = 'MI2'.

*--- All fields will appear input-enabled

screen-input = 1.

ENDIF.

ENDIF.

*--- MODIFY SCREEN mandatory addition to apply changes to the screen

Modify screen.

endloop.

Reward if helpful.

Regards,

Harini.S

Former Member
0 Kudos

Hi

The event is the PBO, only here you can change the attribute of input/output field:

PROCESS PBO.

  MODULE CHANGE_SCREEN.

PROCESS PAI.
  
  MODULE GET_CURSOR.


MODULE GET_CURSOR.
  GET CURSOR FIELD FIELD_NAME.
ENDMODULE.

MODULE CHANGE_SCREEN.
  
  IF FIELD_NAME = <FIELD2 NAME > OR
      FIELD_NAME = <FIELD3 NAME >.
   
    LOOP AT SCREEN.
       IF SCREEN-NAME = <FIELD2 NAME > OR
          SCREEN-NAME = <FIELD3 NAME>.
         SCREEN-INPUT = 0.
         MODIFY SCREEN.
       ENDIF.
     ENDIF. 
    ENDLOOP.

  ENDIF.

ENDMODULE.

Max

Former Member
0 Kudos

Hi,

Add USER COMMAND option to your screen field and modify the screen parameters in event At selection-screen output.

Former Member
0 Kudos

Hi

PARAMETERS: par1 like par1 MODIF ID s1.

PARAMETERS: par1 like par1 MODIF ID s2.

PARAMETERS: par1 like par1 MODIF ID s3.

AT SELECTION-SCREEN OUTOUT.

LOOP AT SCREEN .

IF SCREEN-GROUP1 = 'S2' AND SCREEN-GROUP1 = 'S3'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AFTER ENTERING THE VALUES IN THE 1ST FIELD PRESS ENTER BUTTON THEN REMAING 2 FIELDS WILL AUTOMATICALLY CHANGE IN DISPLAY MODE

REWARD IF USEFULL