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

Non Editable Parameter

Former Member
0 Likes
2,395

Is there a simple way to not allow a user to change a parameter on the selection screen. I have the p_company parameter that is populated in the Intialization event.

I don't want the users to change this but to be able to see it.

Thanks

Richard

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,456

Hello Richard,

Use this code.

<b>INITIALIZATION.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_SPART'.

SCREEN-INPUT = '0'.

SCREEN-OUTPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.</b>

If useful reward.

Vasanth

12 REPLIES 12
Read only

Former Member
0 Likes
1,456

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_COMPANY'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,457

Hello Richard,

Use this code.

<b>INITIALIZATION.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_SPART'.

SCREEN-INPUT = '0'.

SCREEN-OUTPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.</b>

If useful reward.

Vasanth

Read only

0 Likes
1,456

Richard, I don't see how Vasanth's answer solved your problem. As he has suggested to put the LOOP at SCREEN in the INITIALIZATION event. The problem with this is that it will work the first time the screen is rendered, but if you press enter on the screen, you will notice that the field will become ready for input again. This LOOP at SCREEN should be done in the AT SELECTION-SCREEN OUTPUT event as many have suggested here.

Regards,

Rich Heilman

Read only

0 Likes
1,456

Rich,

Thanks for the heads up. I just jumped to the conclusion It was working.

Richard

Read only

Former Member
0 Likes
1,456

Hello,

Use the event AT-SELECTION SCREEN OUTPUT.

Inside this event,

LOOP AT SCREEN.

if screen-name EQ P_COMPANY.

screen-input = 0.

endif.

MODIFY SCREEN.

ENDLOOP.

Regs,

Venkat Ramanan N

Read only

Former Member
0 Likes
1,456

hi,


  data: p_matnr like mara-matnr.
  initialization.
      p_matnr = 'M-01'.
  at selection-screen output.

   loop at screen.
     if screen-name = 'P_MATNR'.
      screen-input = 0.
       modify screen.
     endif.
   endloop.

Regards,

Sailaja.

Read only

Former Member
0 Likes
1,456

Hi richard,

1. we cannot do it directly.

2. we have to use

a) MODIF ID

b) at selection-screen output event

c) SCREEN table.

3. just copy paste

4.

report abc.

parameters : a(10) type c MODIF ID ABC.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,456

You can do this.



report zrich_0001.

parameters: p_comp(4) type c.

initialization.

  p_comp = '0010'.

at selection-screen output.

  loop at screen.
    if screen-name = 'P_COMP'.
      screen-input = '0'.
      modify screen.
    endif.
  endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,456

Hi

you can say...

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if SCREEN-NAME = 'Parameter name'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

endif.

endloop.

Regards,

Raj

Read only

Former Member
0 Likes
1,456

Hi,

at selection-screen output

loop at screen.

if screen-name = 'P_COMAPNY'.

screen-input = 0.

modify screen.

endif.

endloop.

Regards

Amole

Read only

0 Likes
1,456

Vasanth

That worked perfect.

I'll reward as many points as possible.

Thanks for all the responses.

Read only

0 Likes
1,456

If you put it in the INITIALIZATION block and the user presses enter, it will be opened up for input again. That's why it should go in AT SELECTION-SCREEN OUTPUT.