cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

laurent_burtaire
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.