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

enable disable screen elements..

Former Member
0 Likes
1,726

hi,

at runtime, say for e.g. i want to enable or disable screen elements, like text boxes. also i want to check/uncheck the checkbox..what r the statements ?

where do i get the list of properties of the screen elements that i can set/reset ?

thks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,194

hiiii

use following code with screen elements name

AT SELECTION-SCREEN OUTPUT .

  IF p_rad2 IS INITIAL .
    LOOP AT SCREEN.
      IF screen-name CS 'p_docno'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.

  ELSE.
    LOOP AT SCREEN .
      IF screen-name CS 'p_docno'.
         screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  ENDIF.                               " IF p_rad2 IS INITIAL .

regards

twinkal

9 REPLIES 9
Read only

Former Member
0 Likes
1,194

Hi!

Check out this thread.

Regards

Tamá

Read only

Former Member
0 Likes
1,194

sdnuser1 sdnsurname,

refer:

Read only

Former Member
0 Likes
1,195

hiiii

use following code with screen elements name

AT SELECTION-SCREEN OUTPUT .

  IF p_rad2 IS INITIAL .
    LOOP AT SCREEN.
      IF screen-name CS 'p_docno'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.

  ELSE.
    LOOP AT SCREEN .
      IF screen-name CS 'p_docno'.
         screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  ENDIF.                               " IF p_rad2 IS INITIAL .

regards

twinkal

Read only

0 Likes
1,194

sorry, twinkal, i am not able to follow u.

my requirement is to control the individual screen elements based on my choice !!

say for e.g.

if user is in "create" screen then particular set of text boxes must be in diasabled state, he should not enter any values.

if user is in "modify" screen, then those text boxes should be enabled !

Read only

0 Likes
1,194

Use than:

Case sy-ucomm.
when 'CREATE'.
screen-input = 0.

when 'MODIFY'.
screen-input = 1.

endcase.

It should code in PAI

Edited by: Amit Gujargoud on Aug 1, 2008 3:11 PM

Read only

0 Likes
1,194

hii

here p_docno is individual screen element in above thread there you need to give your screen element name and there is a condition like

if p_rad1 is not initial..at this place use your codition like in below code for create and for modify radiobutton is there and see the code..like this you can use while you press button for CREATE and MODIFY.

just you need to use button at that place like

when 'CREATE'..or when 'MODIFY'.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_rad1 TYPE c RADIOBUTTON GROUP gr  DEFAULT 'X'
USER-COMMAND
usr .
SELECTION-SCREEN COMMENT 3(16) text-005.
SELECTION-SCREEN END OF LINE.


SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_rad2 TYPE c RADIOBUTTON GROUP gr.
SELECTION-SCREEN COMMENT 3(16) text-006.
SELECTION-SCREEN END OF LINE.

PARAMETERS:
  p_num1 TYPE i MODIF ID num,
  p_num2 TYPE i MODIF ID num,
  p_char1 TYPE c MODIF ID chr,
  p_char2 TYPE c MODIF ID chr.

AT SELECTION-SCREEN output..




 if p_rad1 is not initial.
    LOOP AT SCREEN.
       IF screen-group1 = 'NUM'.

        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
      IF screen-group1 = 'CHR'.

        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.
  ELSE.
    LOOP AT SCREEN .
       IF screen-group1 = 'NUM'.

        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
      IF screen-group1 = 'CHR'.

        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  ENDIF.                               " IF p_rad2 IS INITIAL .

i hope it helps you.

regards

twinkal

Read only

Former Member
0 Likes
1,194

Dude,

can you make sure us are you talking about report or module pool?

Amit.

Read only

0 Likes
1,194

Hey amit, it is module pool and not report !!!

Read only

0 Likes
1,194

than what problem in:

Case sy-ucomm.
when 'CREATE'."it is function code of create button
screen-input = 0.
 
when 'MODIFY'.it is function code of modify button
screen-input = 1.
 
endcase.

It should code in PAI