cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create an entity for a particular user

SandeshK
Participant
0 Kudos

Hi,

We have Z-component and in DO_PREPARE_OUTPUT method of a custom view we have this following piece of code:

lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_first( ).

entity ?= lr_entity->get_related_entity( 'BTItemOrdPrpExt' ).

lr_entity ?= entity->create_related_entity( iv_relation_name = 'BTOrdPrpIProdList' ) .

Say there are two business roles A and B . The issue is for business role A, the method entity->create_related_entity() in the third line is returning no entity , i.e a NULL BOUND but whereas for business role B, the method successfully returns the newly created entity.

Is this because of the authorization objects of A or could there be any other reason.

I have tried to debug this issue by debugging create_related_entity() method, and found that inside CL_CRM_BOL_CORE->CREATE_RELATED_ENTITY(), the following line is returning FALSE instead of TRUE.

check GET_LOCK( IV_ENTITY ) = TRUE.

Please let me know why this is happening only with the user with business role A and not with the user with business role B.

Thanks,

San

Accepted Solutions (0)

Answers (3)

Answers (3)

praveen_kumar194
Active Contributor
0 Kudos

if get lock is returning false, then it could not be authorization issue. log off all users from web ui or gui, and try again.

SandeshK
Participant
0 Kudos

Hi Praveen,

I have checked that but it is not due to that. It is happening only for the users with the business role A

Thanks,

San

Former Member
0 Kudos

Hi San,

When we are entering WEB Browser it will ask for USER NAME

May be the problem is that...

Business Roles can be assigned to multiple users , User can also have multiple Business Role ... but att a time he can access only one business role

May be in the above when you are entering webui Business role B is attached to the particular user (who is entering)

Thatz the reason only Business role B is getting data

Hope it works

Regards,

Dinesh Gurram

Former Member
0 Kudos

You should do an authorization trace using the transaction STAUTHTRACE (display errors only) for each of the users and see if there is an authorization missing for user B.

SandeshK
Participant
0 Kudos

Hi Euan,

I have checked this transaction STAUTHTRACE but the system says it does not exist. Probably because of my SAP_BASIS component version. We are using SAP_BASIS 7.0 .

Is there any other work around to do an authorization trace?

Thanks,

San

former_member182421
Active Contributor
0 Kudos

Maybe SU53?

Former Member
0 Kudos

you can also access the trace via ST01 and then select authorization check

SandeshK
Participant
0 Kudos

I was able to compare the authorization objects , but there are many differences between the two business roles. There is one authorization object COM_PRD(Product Master: General Authorization). I am guessing this must be the corresponding object for product line item and causing the issue.

Business role A is having only display/change activity access but business role B is having even CREATE or GENERATE access.

Any idea if this would be the corresponding object for the product line item?

former_member182421
Active Contributor
0 Kudos

hmmmmm looks like but unfurtonally I'm not an authorization guy, I found this link maybe give you some clue

http://help.sap.com/saphelp_nw70ehp3/helpdata/en/87/19d4e61db34ed7abcaeda1daa6fb18/content.htm?frame...