Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Deactivate the attachments using SGOS for unauthorized users

gphadnis2000
Participant
0 Likes
3,081

Hi,

 

We have a requirement to restrict Some users from displaying and creating the attachments.

 

We have created 2 custom classes which inherit the below standard classes.

 

CL_GOS_SRV_ATTACHMENT_LIST

CL_GOS_SRV_ATTACHMENT_CREATE

Then the method "check_status" in both class is changed to deactivate the attachment.

 

Also the changes are done in transaction "SGOS"

PCATTA_CREA  Active  Z_GOS_SRV_ATTACHMENT_CREATE

VIEW_ATTA    Active     Z_GOS_SRV_ATTACHMENT_LIST

Sample source code of both class methods are attached for your reference.

The attachment is deactivated for unauthorized users as per requirement.

The authorized users can see and create the attachments in FB02, ME22N.

However for transaction FBL5N when user tries to add the attachment system gives message as attachment saved. but when the user saves the record and comes out of the transaction then in display mode the attachment is not visible.

Could you please guide us what changes are required for this ?

Thanks in advance.

Gaurav

5 REPLIES 5
Read only

arindam_m
Active Contributor
0 Likes
2,002

Hi,

Have you checked the various notes pertaining to the GOS related authorization objects. Might help you achieve it via them. Check the link below, the point 4 deals with authorization specific notes.

http://wiki.sdn.sap.com/wiki/display/SI/Frequently+asked+questions+about+Generic+Object+Services+%28...

Cheers,

Arindam

Read only

gphadnis2000
Participant
0 Likes
2,002

Hi,

Thanks for the information.We have checked the notes.

Also we can do this using below classes.

CL_GOS_SRV_ATTACHMENT_LIST

CL_GOS_SRV_ATTACHMENT_CREATE

Could you please refer my attachment source code and let me know if we need to make any correction in code ?

Thanks

Gaurav

Read only

FredericGirod
Active Contributor
0 Likes
2,002

Hi Gaurav,

go in transaction OAC3, try to find your FBL5n (must be a BKPF entry), in the column link you will find the table that store this link, maybe TOA01 (the default one).

Look inside the table TOA01 if you could find your document with object type, doc type and the key of the table

regards

Fred

Read only

gphadnis2000
Participant
0 Likes
2,002

Hi,

Table TOA01 does not contain entry for my document.

I removed my custom code and attached the file. Attachment was success but still there is no entry in this table and i can see the attachment.

I noticed that the class CL_GOS_SRV_ATTACHMENT_CREATE is creating the problem.

In SGOS i removed my custom class and placed the standard CL_GOS_SRV_ATTACHMENT_CREATE. In this case also the attachments are not created.

Could you please suggest ?

Thanks

Gaurav

Read only

0 Likes
2,002

There is a check box 'commit required' in Tcode SGOS. we had missed it. after checking it documents were getting saved.