01-02-2014 4:35 AM
Hi experts,
Happy new year to u all .i have requirement such that one field will be invisible and visible based on userid we login
ex
1. if sy-uname = 'A' screen field should be visible(i.e both textbox and lable) so that user can enter some value
2.if sy-uname <> 'A' screen field should be invisible(i.e both textbox and lable)
3. when we press insert button if sy-uname = 'A' the user enterd value will be stored other wise some number generated automatically that is displayed on screen with disable mode and the same value should be inserted to database.can we make the input output field invisible
01-02-2014 5:24 AM
hi rajendra,
just group the screen fileds (label and text box ) together. In PBO write the modification code like
if sy-uname EQ 'A'.
loop at screen.
if screen-group1 EQ 'Value'.
screen-invisible = 0.
modify screen.
endif.
endloop.
endif.
if sy-uname NE 'A'.
loop at screen.
if screen-group1 EQ 'Value'.
screen-invisible = 1.
modify screen.
endif.
endloop.
endif.
In PAI, if the user is A , then write the code which does the insertion. For other user , write the code in PBO that.
if sy-uname NE 'A' AND ok_code EQ 'INSERT'.
use number range to get number generated automatically . and then disable the field by the following code.
loop at screen.
if screen-group1 EQ 'Value'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
Regards,
sivaganesh
01-02-2014 4:41 AM
Hui Rajendra,
data: tex1 as checkbox modifid A1.
Please write a code as below in AT Selection-screen output event.
if Sy-uname = '''.
Loop at screen.
if screen-group1 = 'A1'.
screen-input = 0.
endif.
modify screen.
endloop.
endif.
Arivazhagan S
01-02-2014 4:49 AM
Hi Rajendra -
It seems you are working on some module pool program.
In PBO event, write a Module in which you need to work on properties of SCREEN for those screen properties of those screen elements.
Example -
LOOP AT SCREEN.
if sy-uname = < User NAME>.
if screen-name = < screen field>
screen-invisible = '1'.
screen-active = '0'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
01-02-2014 4:55 AM
Hi Rajendra,
Check this program DEMO_DYNPRO_MODIFY_SCREEN, you will understand the functionality of
Rg, Kiran
01-02-2014 6:56 AM
Hi Kiran,
Can i have all examples related to modulepool.i.e from se80 which program will give all examples
Regards,
Reddy
01-02-2014 6:59 AM
Hi,
Yes, go to se30- enter DEMO_DYNPRO*( f4)
Will have many examples with clear steps
01-02-2014 5:24 AM
hi rajendra,
just group the screen fileds (label and text box ) together. In PBO write the modification code like
if sy-uname EQ 'A'.
loop at screen.
if screen-group1 EQ 'Value'.
screen-invisible = 0.
modify screen.
endif.
endloop.
endif.
if sy-uname NE 'A'.
loop at screen.
if screen-group1 EQ 'Value'.
screen-invisible = 1.
modify screen.
endif.
endloop.
endif.
In PAI, if the user is A , then write the code which does the insertion. For other user , write the code in PBO that.
if sy-uname NE 'A' AND ok_code EQ 'INSERT'.
use number range to get number generated automatically . and then disable the field by the following code.
loop at screen.
if screen-group1 EQ 'Value'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
Regards,
sivaganesh
01-02-2014 5:29 AM
Thakyou all for ur reply's but even though i do like this it make the Textfield contol invisible but not I/O field
01-02-2014 5:31 AM
hi ,
have you grouped both the text and I/O field together .
and done the coding..????
01-02-2014 5:39 AM
hi krishhnan i grouped both text and I/O field togther and make them invisible alo but its not working
01-02-2014 6:28 AM
make sure the name of the fields are capital in PBO.
Also If you have written the group name in first box. write the condition as
if screen-group1 EQ 'G1'. only if you wrote the group in layout as like this.
if you have written in second box , you should code it like screen-group2 ... likewise
regards,
Sivaganesh
01-02-2014 5:48 AM
Hi Rajendra,
i think you need to check with correct name for Input field.
Here I/o field name is 'FIELD1'.
so,
loop at screen.
if sy-uname <> 'A'.
if screen-name = 'FIELD1'.
screen-invisible = '1'.
screen-active = '0'.
modify screen.
endif.
endif.
endloop.
I hope it works for u...
Thanks,
Raghu