Skip to Content
author's profile photo Former Member
Former Member

making inputoutput field invisible

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 05: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


    1.png (22.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 02, 2014 at 04: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 02, 2014 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 04:55 AM

    Hi Rajendra,

    Check this program DEMO_DYNPRO_MODIFY_SCREEN, you will understand the functionality of

    Rg, Kiran


    pastedImage_0.png (20.7 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

      Untitled.jpg (4.5 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.