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

Hiding fields in a screen using BADI

Hi Experts

I want to invisible certain fields in the screen for certain users and it should be made visible for certain users,the requirement is to do with badi.Can anyone help me regarding this issue.

Thanks & Regards

Pravitha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on May 25, 2011 at 10:51 AM

    First you will have to [find a BAdI|http://www.sdn.sap.com/irj/scn/advancedsearch?query=findaBAdI] that is executed during the [PBO process before output|http://help.sap.com/abapdocu_70/en/DYNPPROCESS.htm#&ABAP_ALTERNATIVE_1@1@], in this BAdI you will be able to [LOOP AT SCREEN|http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_SCREEN.htm] on displayable fields and [MODIFY|http://help.sap.com/abapdocu_70/en/ABAPMODIFY_SCREEN.htm] their attributes.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2011 at 10:48 AM

    Hi,

    We generally use modify screen structure for enabling disabling screen fields.

    loop at screen

    if screen-name = field1

    screen-activ = 0.

    endif.

    modify screen

    endloop.

    But you need to make sure, if the badi is triggered at the right place.in the module pool of screen.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 25, 2011 at 11:19 AM

    Hi,

    You can create a Z table in this maintain all the user who will get authorisation to change the field.

    In the BADI compare the user with the Z table and modify the screen accordingly.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2011 at 12:15 PM

    Hi Pravithanambiar,

    Try to figure out the badi which has the structure SFAUSWTAB.

    In this structure there is one field KZINV, which is to make field invisible.

    Follow the below code then,

    IF sy-uname EQ 'Pravithanambiar'.

    IF ( fauswtab-fname = 'MARA-MEINS' ).

    fauswtab-kzinV = '0'.

    ENDIF.

    endif.

    U can add as many user names as u want by 'and' logical condition. This above written logic is to suppress the meins field for you

    and displayed for others.

    If u don't have any BADI with the structure SFAUSWTAB.

    Then try with this code.

    IF sy-uname EQ 'Pravithanambiar'.

    loop at screen.

    IF ( screen-name = 'MARA-MEINS' ).

    screen-invisible = 1'.

    ENDIF.

    endloop.

    endif.

    The above two can solve ur problem but the second method is trail and error one. Try with each and every method of all badi.

    Best wishes,

    Rudhir Bhaskar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2011 at 12:48 PM

    Thanks all..All the answers were very useful.

    Thanks & Regards

    Pravithanambiar

    Add a comment
    10|10000 characters needed characters exceeded

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.