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

How do disable/enable a parameter? i have a code but not working.

Former Member
0 Likes
1,254

What's wrong with this?

PARAMETERS:

p_fname LIKE RLGRAP-FILENAME modif id bl1,

chkbox As Checkbox,

p_fpath(100) type c.

At Selection-Screen Output.

Loop at screen.

if chkbox = 'X'.

if screen-group1 = 'bl1'.

screen-active = 0.

else.

screen-active = 1.

endif.

MODIFY screen.

endif.

endloop.

Edited by: Christian Gajo on Nov 12, 2008 2:24 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,226

Hi,

if you want to disable the parameter, I think you should set screen-input = 0. This may help you.

Please try it.

The following code is for your reference:

PARAMETERS:
p_fname LIKE RLGRAP-FILENAME modif id bl1,
chkbox As Checkbox,
p_fpath(100) type c.

At Selection-Screen Output.

Loop at screen.
if chkbox = 'X'.
if screen-group1 = 'BL1'.
screen-input = 0.
else.
screen-input = 1.
endif.

MODIFY screen.
endif.
endloop.

Regards,

Chris Gu

Edited by: Gu Chris on Nov 12, 2008 4:46 AM

Edited by: Gu Chris on Nov 12, 2008 4:46 AM

Edited by: Gu Chris on Nov 12, 2008 4:47 AM

Edited by: Gu Chris on Nov 12, 2008 7:13 AM

12 REPLIES 12
Read only

Former Member
0 Likes
1,226

use caps for Group1 comparision..

Loop at screen.
if chkbox = 'X'.
if screen-group1 = 'BL1'. "here change the code and see,,
screen-active = 0.
else.
screen-active = 1.
endif.

MODIFY screen.
endif.
endloop.

Read only

0 Likes
1,226

It's the same..= (

Read only

Former Member
0 Likes
1,226

Hi,

bl1 in the single quotes should be capitalized as BL1.

Regards,

Chris Gu

Read only

Former Member
0 Likes
1,226

Check if below code can work as expected:

PARAMETERS: p_file TYPE filename MODIF ID bl1,
            p_chb AS CHECKBOX USER-COMMAND abc,
            p_fpath TYPE char100.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    CHECK screen-group1 = 'BL1'.
    CASE p_chb.
      WHEN 'X'.
        screen-active = 1.
      WHEN space.
        screen-active = 0.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.

~Eswar

Read only

Former Member
0 Likes
1,227

Hi,

if you want to disable the parameter, I think you should set screen-input = 0. This may help you.

Please try it.

The following code is for your reference:

PARAMETERS:
p_fname LIKE RLGRAP-FILENAME modif id bl1,
chkbox As Checkbox,
p_fpath(100) type c.

At Selection-Screen Output.

Loop at screen.
if chkbox = 'X'.
if screen-group1 = 'BL1'.
screen-input = 0.
else.
screen-input = 1.
endif.

MODIFY screen.
endif.
endloop.

Regards,

Chris Gu

Edited by: Gu Chris on Nov 12, 2008 4:46 AM

Edited by: Gu Chris on Nov 12, 2008 4:46 AM

Edited by: Gu Chris on Nov 12, 2008 4:47 AM

Edited by: Gu Chris on Nov 12, 2008 7:13 AM

Read only

Former Member
0 Likes
1,226

Hi ,

Try like this :

PARAMETERS: rd1 TYPE c RADIOBUTTON GROUP rd DEFAULT 'X' USER-COMMAND rd,

rd2 TYPE c RADIOBUTTON GROUP rd.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001 .

PARAMETERS: p_temp TYPE c MODIF ID 1.

SELECTION-SCREEN END OF BLOCK a1.

SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-001.

PARAMETERS: p_key TYPE c MODIF ID 2.

SELECTION-SCREEN END OF BLOCK a2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rd1 EQ 'X'.

IF screen-group1 = '1'.

screen-input = 1.

ELSEIF screen-group1 = '2'.

screen-input = 0.

ENDIF.

ENDIF.

IF rd2 EQ 'X'.

IF screen-group1 = '2'.

screen-input = 1.

ELSEIF screen-group1 = '1'.

screen-input = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Amresh.

Read only

Former Member
0 Likes
1,226

Hi,

Check this code...It is working...


PARAMETERS: p_fname LIKE rlgrap-filename MODIF ID bl1,
            chkbox AS CHECKBOX USER-COMMAND rd,               "<-------User-command
            p_fpath(100) TYPE c.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF chkbox = 'X'.
      IF screen-group1 = 'BL1'.                          "<-------Capitalize
        screen-active = 0.
      ELSE.
        screen-active = 1.
      ENDIF.

      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Read only

Former Member
0 Likes
1,226

hi,

Please give the checkbox a user-command and write BL1 in capitals.

thanks

Read only

Former Member
0 Likes
1,226

REPORT ZSRK_044 .

PARAMETERS:

P_FNAME LIKE RLGRAP-FILENAME MODIF ID BL1,

CHKBOX AS CHECKBOX,

P_FPATH(100) TYPE C.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF CHKBOX = 'X'.

IF SCREEN-GROUP1 = 'BL1'.

  • SCREEN-ACTIVE = 0.

SCREEN-INPUT = 0.

ELSE.

  • SCREEN-ACTIVE = 1.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,226

Hi,

Have you already solved the problem?

Your purpose is to disable/enable the parameter or display/ not display the parameter?

If you want to disable/ enable the parameter, then set screen-input = 0/1.

if you want to display/not display the parameter, then set screen-active = 1/0.

and all the values in the single quotas shoule be capital.

Hope it helps.

Regards,

Chris Gu

Edited by: Gu Chris on Nov 12, 2008 7:19 AM

Read only

0 Likes
1,226

thanks

Read only

Former Member
0 Likes
1,226

thanks