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

parameter in selection-screen

Former Member
0 Likes
847

Hi,

Please how to return a parameter grayed (disabled) in selection-screen.

Thanks a lot.

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
813
parameters: p_check type c.


at selection-screen.

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

start-of-selection

....

Regards,

Rich Heilman

Read only

Former Member
0 Likes
813

Hi there. If you want to grey out a parameter in your selection screen so that the user cannot change or enter data, here's what you need to do. First use a modif ID with the field. Then before your start of selection you will change the screen input value. Here is some sample code:

PARAMETERS: p_field LIKE rlgrap-filename MODIF ID fpn.

AT SELECTION-SCREEN OUTPUT.

  • make any parameter in group FPN display only

  • (gray out areas we don't want user to change)

LOOP AT SCREEN.

CHECK screen-group1 = 'FPN'.

screen-input = 0. "Output (Display) only

MODIFY SCREEN.

ENDLOOP.

I hope this helps.

- April King

Read only

0 Likes
813

I have 2 parameters in my selection-screen and i went if the first is valide and exist, the second became grayed (not in default).

Thanks

Read only

0 Likes
813

hi,

In ABAP, we will not have any events like lost_cursor similar to VB.

At selection-screen gets triggered once we press Enter after giving input to First parameter. So, that validation can be done for first parameter and make the second parameter grayedout.

Regards,

Sailaja.

Read only

0 Likes
813

Okay. Then try this (assuming that you have MODIF ID fpn assigned to p_field2):

AT SELECTION-SCREEN.

IF p_field1 > space. "change this to whatever you need to check for field1 to be valid

LOOP AT SCREEN.

CHECK screen-group1 = 'FPN'.

screen-input = 0. "Output (Display) only

MODIFY SCREEN.

ENDLOOP.

ENDIF.

- April

Read only

0 Likes
813

Hi Hraichi,

PARAMETERS: P_MARA TYPE MARA-MATNR.

PARAMETERS: P_MATKL TYPE MARA-MATKL.

AT SELECTION-SCREEN.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_MARA' AND P_MATKL IS NOT INTIAL.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'P_MATKL' AND P_MARA IS NOT INTIAL.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

Vinay

Read only

Former Member
0 Likes
813

Hi,

You can disable the parameter by setting SCREEN-INPUT as 0 to grayed out in the AT SELECTION-SCREEN event.

PARAMETERS: P_MARA TYPE MARA-MATNR.

AT SELECTION-SCREEN.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_MARA'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

Vinay

Read only

Former Member
0 Likes
813

How about using radio-buttons to select the active field. Something lie this:

  SELECTION-SCREEN BEGIN OF LINE .
  PARAMETERS : r_p1 RADIOBUTTON GROUP fred DEFAULT 'X' USER-COMMAND bob ,
               p_p1 TYPE char20 MODIF ID pa1 .
  SELECTION-SCREEN END OF LINE .
  SELECTION-SCREEN BEGIN OF LINE .
  PARAMETERS : r_p2 RADIOBUTTON GROUP fred ,
               p_p2 TYPE char20 MODIF ID pa2 .
  SELECTION-SCREEN END OF LINE .

  AT SELECTION-SCREEN OUTPUT .
    LOOP AT SCREEN .
      IF screen-name EQ 'P_P1' .
        IF r_p1 EQ 'X' .
          MOVE '1' TO screen-input .
        ELSE .
          MOVE '0' TO screen-input .
        ENDIF .
        MODIFY SCREEN .
      ENDIF .
      IF screen-name EQ 'P_P2' .
        IF r_p2 EQ 'X' .
          MOVE '1' TO screen-input .
        ELSE .
          MOVE '0' TO screen-input .
        ENDIF .
        MODIFY SCREEN .
      ENDIF .
    ENDLOOP .

Have a good weekend!

Lyal

Read only

Former Member
0 Likes
813

This message was moderated.