01-14-2009 4:03 PM
hi all
I have created a new report transaction which runs an existing custom program of ours, with a specific variant which greys out most of the fields in the transaction (this is for the sake of security as the program is normally only ever run by a day end batch job).
However, when running the transaction, the user can simply change the variant to an existing one where the fields are not greyed out!
Is there any way within the transaction definition of "locking" the start variant so it cannot be changed?
Thanks
Jon
01-14-2009 7:02 PM
Hi,
You could disable the function code for the variant selection. You can do this by identifying the transaction code, or any other logic you want. I'll give you an example when you disable it by transaction code.
DATA: lt_exclude TYPE STANDARD TABLE OF syucomm. " Global table of function codes to disable
AT SELECTION-SCREEN OUTPUT.
IF sy-tcode EQ 'ZZREPORT'. " Replace with your own transaction code
APPEND 'GET' TO i_exclude. " Get variants function code
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
p_program = sy-repid
TABLES
p_exclude = lt_exclude.
ENDIF.
Hope this helps,
Guy.
01-14-2009 4:11 PM
01-14-2009 4:14 PM
No it is not a transaction variant or a display variant.
The transaction calls a "Z" program and defaults in a specific start variant for the selection screen. I want it to be impossible for the user to change that selection variant.
Jon
01-14-2009 4:14 PM
> However, when running the transaction, the user can simply change the variant to an existing one where the fields are not greyed out!
You may need to create a protected variant, so that user can't change the values in variant
a®
01-14-2009 4:16 PM
Yes - I have already protected the variant. The problem is that they can simply select a different variant which is already set up.
Jon
01-14-2009 4:19 PM
One way could be to define a custom GUI status by copying the standard one. There you can deactivate the variant related function codes. The GUI status then must be set explicitely in your program code.
Thomas
01-14-2009 4:20 PM
01-14-2009 4:22 PM
Yes I thought of removing the PIDs for the user so they cannot select variants but they need to do so for other progs they run.
The GUI idea is one way of doing it but I didn't really want to go down that route. I may end up having to create a customised prog with a limited set of selection options.
Jon
01-14-2009 4:26 PM
>
> Yes I thought of removing the PIDs for the user so they cannot select variants but they need to do so for other progs they run.
>
> The GUI idea is one way of doing it but I didn't really want to go down that route. I may end up having to create a customised prog with a limited set of selection options.
>
> Jon
I meant, base on some criteria:
loop at screen.
* Your logic here
screen-input = '0'.
modify screen.
endif.
endloop.
Rob
01-14-2009 4:29 PM
I see. Yes that might work.
I could use auth group against the transaction in SE93 as well I guess.
01-14-2009 4:32 PM
01-14-2009 4:35 PM
May be try this way
Make check for field values by the following code
form f_get_variant.
data : v_field like dd03l-fieldname.
move SY-SLSET to v_variant. " <<<<<
call function 'RS_VARIANT_CONTENTS'
exporting
report = 'YATT3010'
variant = v_variant
tables
valutab = i_params
exceptions
variant_non_existent = 1
variant_obsolete = 2
others = 3.
if sy-subrc eq 0.
loop at i_params.
assign (i_params-selname) to <fs>.
<fs> = i_params-low. " Make a check here for fields you want user's cannot change the value
endloop.
endif.
endform. " F_get_variant
a®
01-14-2009 7:02 PM
Hi,
You could disable the function code for the variant selection. You can do this by identifying the transaction code, or any other logic you want. I'll give you an example when you disable it by transaction code.
DATA: lt_exclude TYPE STANDARD TABLE OF syucomm. " Global table of function codes to disable
AT SELECTION-SCREEN OUTPUT.
IF sy-tcode EQ 'ZZREPORT'. " Replace with your own transaction code
APPEND 'GET' TO i_exclude. " Get variants function code
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
p_program = sy-repid
TABLES
p_exclude = lt_exclude.
ENDIF.
Hope this helps,
Guy.