2009 Apr 24 11:32 AM
Hi friends,
I have a selection screen as follows
PARAMETERS: p_frgco LIKE t16fc-frgco OBLIGATORY MEMORY ID fab.
SELECT-OPTIONS: s_frggr FOR ekko-frggr.
PARAMETERS: p_frgse LIKE rm06a-p_frgse DEFAULT 'X',
p_frgrs LIKE rm06a-p_frgrs,
p_frgvo LIKE rm06a-p_frgvo DEFAULT 'X',
p_mitpos LIKE rm06a-p_mitpos,
listu LIKE t160o-listu.
SELECT-OPTIONS: s_bstyp FOR ekko-bstyp,
s_ekorg FOR ekko-ekorg,
s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
MEMORY ID BES,
s_bsart FOR ekko-bsart NO-DISPLAY,
s_ekgrp FOR ekko-ekgrp no-DISPLAY,
s_lifnr FOR ekko-lifnr NO-DISPLAY MATCHCODE OBJECT kred,
s_reswk FOR ekko-reswk no-DISPLAY,
s_bedat FOR ekko-bedat no-DISPLAY,
s_procst FOR ekko-procstat NO-DISPLAY.
Now based on the User-id i have to hide some parameters as well as select-options as well as add
some more extra fields.
How do i do it..?
Thanks,
srinath.
2009 Apr 24 11:37 AM
At inititialisation check for the USER-NAMe (sy-uname) and accordingly you can hide parameters/select-options using
INITIALIZATION.
loop at screen.
if sy-uname = 'ZABC'. " For user ZABC
if screen-name = 'P_FRGCO'.
screen-invisible = '1'. " To hide
endif.
if screen-name = 'P_FRGSE'.
screen-active = '1'.
endif.
modify screen.
endloop.
endif.
In this fashion you can proceed for other.
Regards,
Mansi.
2009 Apr 24 11:41 AM
Hi,
try this:
PARAMETERS: P1 TYPE I MODIF ID AC1.
PARAMETERS: P2 TYPE I MODIF ID AC0.
*
AT SELECTION-SCREEN OUTPUT.
*
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'AC0' AND SY-UNAME = 'TEST'.
SCREEN-ACTIVE = '0'.
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
endloop.
*
Regards, Dieter
2009 Apr 24 11:41 AM
Hi Srinath,
You can try with this code and do the same with your requirement...This will work for sure :
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_dat AS CHECKBOX USER-COMMAND flag.
SELECTION-SCREEN COMMENT 3(79) text-112.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-109.
PARAMETER: p_year1 TYPE gjahr MODIF ID mo1,
p_perid1 TYPE perio MODIF ID mo1.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-110.
PARAMETER: p_year TYPE gjahr MODIF ID mo2,
p_period TYPE perio MODIF ID mo2.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_dat = 'X' AND screen-group1 = 'MO2'.
screen-active = '0'.
ELSEIF p_dat 'X' AND screen-group1 = 'MO1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Do the same as per your requirement, please execute this code so that you will be able to do the same as per your requirement.
Also go through the follow therads :
Regards,
Kittu
2009 Apr 24 11:56 AM
Hi,
In your code I have added a parameter user_id .
If the input in that parameter is X then the p_frgrs, s_ekorg will be disabled.
In initialization select-options are disabled by looping at screen.
In AT SELECTION-SCREEN OUTPUT event according to the user_id value disaling the p_frgco,
p_frgrs, s_ekorg .
TABLES : ekko.
PARAMETERS : user_id TYPE c . " Added
PARAMETERS: p_frgco LIKE t16fc-frgco MEMORY ID fab.
SELECT-OPTIONS: s_frggr FOR ekko-frggr.
PARAMETERS: p_frgse LIKE rm06a-p_frgse DEFAULT 'X',
p_frgrs LIKE rm06a-p_frgrs,
p_frgvo LIKE rm06a-p_frgvo DEFAULT 'X',
p_mitpos LIKE rm06a-p_mitpos,
listu LIKE t160o-listu.
SELECT-OPTIONS: s_bstyp FOR ekko-bstyp,
s_ekorg FOR ekko-ekorg,
s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
* MEMORY ID BES,
s_bsart FOR ekko-bsart NO-DISPLAY,
s_ekgrp FOR ekko-ekgrp NO-DISPLAY,
s_lifnr FOR ekko-lifnr NO-DISPLAY MATCHCODE OBJECT kred,
s_reswk FOR ekko-reswk NO-DISPLAY,
s_bedat FOR ekko-bedat NO-DISPLAY,
s_procst FOR ekko-procstat NO-DISPLAY.
INITIALIZATION. " Added
LOOP AT SCREEN.
IF screen-name CS 'S_'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN OUTPUT. " Added
IF user_id = 'X'.
LOOP AT SCREEN.
IF screen-name CS 'P_FRGRS' OR
screen-name CS 'P_FRGCO' OR
screen-name CS 'S_EKORG' .
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF. " Added
regards
pinaki
2009 Apr 24 12:30 PM
Hi,
look here:
/thread/1319493 [original link is broken]
Regards, Dieter
2009 Apr 24 12:48 PM
2009 Apr 24 12:55 PM
hi
sample code according to u r requirement change it
SELECTION-SCREEN BEGIN OF BLOCK b02 WITH FRAME TITLE text-t01.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_upload RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND show.
SELECTION-SCREEN COMMENT 4(30) text-t04 FOR FIELD p_upload.
SELECTION-SCREEN COMMENT 35(16) text-t05 FOR FIELD p_file.
PARAMETERS: p_file TYPE localfile MODIF ID fil.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_change RADIOBUTTON GROUP rad1.
SELECTION-SCREEN COMMENT 4(50) text-t06 FOR FIELD p_change.
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS: s_cust FOR ZCustomer MODIF ID chg,
s_item FOR zitem MODIF ID chg.
PARAMETERS: p_error TYPE c AS CHECKBOX MODIF ID chg.
SELECTION-SCREEN SKIP.
PARAMETERS: p_view RADIOBUTTON GROUP rad1.
SELECT-OPTIONS: s_custo FOR zcustomer MODIF ID see,
s_mat FOR ztem MODIF ID see.
SELECTION-SCREEN END OF BLOCK b02.
AT SELECTION-SCREEN OUTPUT.
PERFORM screen_edit.
FORM screen_edit .
LOOP AT SCREEN.
IF p_upload EQ 'X' AND screen-group1 EQ 'FIL'.
screen-input = '1'.
ELSEIF p_upload EQ space AND screen-group1 EQ 'FIL'.
screen-input = c_zero.
ENDIF.
IF p_change NE 'X' AND screen-group1 EQ 'CHG'.
screen-input = '0'.
ELSEIF p_change NE space AND screen-group1 EQ 'CHG'.
screen-input = '1'.
ENDIF.
IF p_view NE 'X' AND screen-group1 EQ 'SEE'.
screen-input = c_zero.
ELSEIF p_view NE space AND screen-group1 EQ 'SEE'.
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
end form.
~linganna
ENDLOOP.
2009 Apr 24 1:21 PM
Hi ,
I am giving you sample code for that
IF sy-uname ne 'EX_USR' ."OR sy-uname ne 'EDP' .
LOOP AT screen.
IF screen-name = 'BUTTON_MODIFY' or
screen-name = 'BOX_REPORTS' or
screen-name = 'BUTTON_REPORTS' .
screen-input = 0.
screen-active = 0.
MODIFY screen.
ENDIF.
ENDLOOP.
ENDIF.
Use the code in this way to hide selection screen or any field.
Hope above code will help you.
Regards,
Himanshu