‎2008 Aug 01 1:43 PM
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
‎2008 Aug 01 1:50 PM
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
‎2008 Aug 01 1:46 PM
‎2008 Aug 01 1:46 PM
‎2008 Aug 01 1:50 PM
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
‎2008 Aug 01 1:57 PM
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 !
‎2008 Aug 01 1:59 PM
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
‎2008 Aug 01 2:07 PM
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
‎2008 Aug 01 2:35 PM
Dude,
can you make sure us are you talking about report or module pool?
Amit.
‎2008 Aug 01 2:36 PM
‎2008 Aug 01 2:50 PM
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