Application Development 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: 

making inputoutput field invisible

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

sivaganesh_krishnan
Contributor
0 Kudos

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

11 REPLIES 11

arivazhagan_sivasamy
Active Contributor
0 Kudos

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

atul_mohanty
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Rajendra,

Check this program DEMO_DYNPRO_MODIFY_SCREEN, you will understand the functionality of

Rg, Kiran

0 Kudos

Hi Kiran,

Can i have all examples related to modulepool.i.e from se80 which program will give all examples

Regards,

Reddy

0 Kudos

Hi,

Yes, go to se30- enter DEMO_DYNPRO*( f4)

Will have many examples with clear steps

sivaganesh_krishnan
Contributor
0 Kudos

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

Former Member
0 Kudos

Thakyou all for ur reply's but even though i do like this it make the Textfield contol invisible but not I/O field

0 Kudos

hi ,

have you grouped both the text and I/O field together .

and done the coding..????

0 Kudos

hi krishhnan i grouped both text and I/O field togther and make them invisible alo but its not working

0 Kudos

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

0 Kudos

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