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

dynamic parameter

Former Member
0 Likes
593

Hello,

I have a program with a parameter declared as no-display. I would like that, only for a specific user, the parameter to be visible. How can I do that?

I tried in this way:

SELECTION-SCREEN BEGIN OF BLOCK b1.

if lconfig_flag = 'X'.

PARAMETERS: p1 TYPE I .

else.

PARAMETERS: p1 TYPE I

NO-DISPLAY.

endif.

SELECTION-SCREEN END OF BLOCK b1.

But I have an error because I am declaring the parameter twice.

How can I do it?

3 REPLIES 3
Read only

Former Member
0 Likes
563

Hi,

U can do like this:

PARAMETERS : P1 type I.

AT SELECTION-SCREEN-OUTPUT.

IF SY-UNAME = 'User Name'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P1'.

SCREEN-INVISIBLE = 0.

SCREEN-INPUT = 1.

SCREEN-OUTPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P1'.

SCREEN-INVISIBLE = 1.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Himanshu

Read only

Former Member
0 Likes
563

Hi....

Try this...

PARAMETERS: P1 TYPE I,

P2 TYPE I.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SY-UNAME EQ 'USER1'.

IF SCREEN-NAME EQ 'P1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Here the parameter P1 will not be visible for the user 'USER1'.

Regards,

Suresh.........

Read only

0 Likes
563

It works, but P1 parameter is the only parameter on the selection screen, so I don't want to display the selection screen at all. With your solution the p1 parameter appears as read-only. How can I do that?

Thank you