Skip to Content
avatar image
Former Member

How to hide custom fields in Shopping cart depening on user role

Hi,

We have some custom fields in shopping cart for basic view. Every thing works fine. Now client is asking to hide all the custom fields based on user role.

I found some function module to fund roles. now my main problem is unable to find the cusotm filed screen field name.

When I tryed to find the screen field name using BBPSC02/03, its giving 'GT_DISPLAY_100-FIELD'. If I try to use this field, its not working.

Could you pls tell me how to find custom screen filed name to hide in shopping cart.

Thanks,

Ram

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 14, 2009 at 07:03 PM

    Hello Ram,

    Look at blog below:

    [How to create custom fields in SRM|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4711] [original link is broken] [original link is broken] [original link is broken];

    In paragraph 4, you will have informations on how manage Customer Fields settings

    Read following Wiki to get an ABAP code sample for implementation of method MODIFY_SCREEN:

    [BBP_CUF_BADI_2 - Customer Fields. Use of Standard Table Control|https://wiki.sdn.sap.com/wiki/display/SRM/BBP_CUF_BADI_2-CustomerFields.UseofStandardTableControl]

    Regards.

    Laurent.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ram,

      As Laurent suggested,to hide the custom fields based on the user role,you need to implement the logic in BADi "BBP_CUF_BADI_2".

      You have the importing parameter IV_USER in this BADI.

      Pass this parameter to tables AGR_USERS and AGR_USERT to get the user role

      OR

      Use FM: BAPI_USER_GET_DETAIL

      with USERNAME= user id and can retrieve Table: ACTIVITYGROUPS Field:AGR_NAME

      if you want the otherway around

      you can also use FM: RSRA_USERS_OF_AGR_GET

      with I_AGR_NAME= role and you can retieve Table: ACTIVITY_GROUPS_USERS Field: UNAME(usr Id)

      Then check the value for the User role as obtained using the above steps and accordingly set the property for the custom fields to hide them.

      BR,

      Deepti.