cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Modules to Read SAP Workflow Attachments

Former Member
0 Likes
6,011

We accidentally deleted 'links' to workflow attachments by running SAP Office program RSSODFRE (Delete Documents from Hidden Folder) because we checked the fields "Delete Documents from Hidden Folder" and "Delete unsent Documents". Now, from SWI1 we cannot read the attachments and get the message 'document does not exist'.

However, the workflow is intact with the attachments in a refreshed quality system and I was able to run a trace on selecting both the attached documents.

It gives me all the values for SOOD, SOFM, SOC3, SOFFCONT1 and based on this I was able to locate all the same documents on the tables in our production system - where we ran the RSSODFRE. Why are they still there is a mystery if they're supposed to have been deleted - but right now I'm not complaining!

I have tried a number of function modules to see if I can read the attachments but to no avail.

I tried SO_DOCUMENT_READ_API1, so_object_read, SWL_WI_ATTACHMENTS_READ, etc but to no avial - these were executed in the system where the workflow is still OK - I can't run SE37 in production.

Anybody have any ideas what function modules I can use to read these attachments?

I have SOOD values of FOL 26 000000000004 and EXT 37 000002711545.

SOFM: SELECT WHERE "MANDT"='028' AND "FOLTP"='FOL' AND "FOLYR"='26' AND "FOLNO"='000000000004 ' AND "DOCTP"='RAW' AND "DOCYR"='37'

SOC3: SELECT WHERE "MANDT"='028' AND "RELID"='DT' AND "SRTFD"='RAW37000004498126' AND "SRTF2">=0

SOFFCONT1: SELECT WHERE "RELID"='IR' AND "SRTF2"=0 AND "PHIO_ID"='4FEAB8B34CA447ACE1000000A3F1750B' AND "MANDT"='028'

It looks like the physical document is still in the database and my goal is to retrieve and download them to pc.

I can attach them back to the relevant SAP document or does anyone know how to re-build the link back to the workflow and therefore visible via SWI1.

Sorry for rambling but I'll really appreciate your help.

Thanks.

Soyab

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hello,

What happens when you try SO_DOCUMENT_READ_API1 in the system where you can run it, what error message does it give? What input are you giving it?

regards

Rick Bakker / hanabi technology

Former Member
0 Likes

Hi Rick,

Thanks for your reply.

In the client where I have NOT run WORITEM archiving or RSSODFRE then the function module SO_DOCUMENT_READ_API1 works fine.

However, in the client where I did run WORKITEM archiving for this one particular document the function module returns "DOCUMENT_ID_NOT_EXIST". On further investigation the SOFM entry for FOL26000000000004EXT37000002711545 no longer exists and has been archived - I can see that from the info structure.

So, the question remains what FM will display archived WF attachments!

Also, in the instances where we have errorneously run RSSODFRE (but NO WORKITEM archiving) the same SOFM entries are missing. I need to re-build the SOFM in those cases and from the SOOD record I can get the 2nd part of the key (EXT37000002711545) required for SOFM. I'm looking at ways to see if re-building the SOFM record will do the trick in test but I have no idea where to get the 1st part of the key for SOFM (FOL26000000000004).

I know this is getting complicated and thanks for your interest.

Soyab

Answers (4)

Answers (4)

Private_Member_46505
Active Participant

HI,

Got to SWO1 & enter SOFM & click on TEST

Click on instance & enter details which u have.

 

In the method list you have Displayattachment & If you execute that you will get the attachment.

Former Member
0 Likes

Hi Lohith,

Thanks for your suggestion and it works as long as the work item has not been archived.

If it has been archived this test with SWO1 returns 'document does not exist'.

Also, please see my reply to Rick above.

Appreciate your help.

Soyab

Pradeepgali
Explorer
0 Likes

Hi Soyab,

We are also facing the same issue. Any ideas what you end up doing to get these back.

Please let us know

Thanks

Former Member
0 Likes

All,

One other thing that I noticed.

If you go to the SAP document (in my case VA03) and looked at the workflow overview via the GOS menu it lists the WF activity including the attachments. However, when you click on the attachments it returns 'document does not exist'. This happens in all cases whether the workitem is still online (and attachments are visible via SWI1 and SWO1), archived or attachments are deleted via SAP Office.

I think this is a flaw and reported it to SAP via OSS.

Back to the original issue - It looks like the deletion is a soft delete.

My goal is to re-build the SOFM in the cases where it has been removed by RSSODFRE.

Looking forward to your insight.

Thanks.

Soyab

suresh_subramanian2
Active Contributor
0 Likes

Hello Soyab !

            Try with the following function modules which could be helpful : 

            SAP_WAPI_GET_ATTACHMENTS : Read Attachment for Work Item

            SO_ATTACHMENT_READ : Read an attachment

            SO_WIND_ATTACHMENT : SAPoffice: Display of Existing Attachments and Processing Possibilities

            SO_WIND_ATTACHMENT_DISP_API1 : Display an attachment to an object

            GOS_ATTACHMENT_LIST_POPUP : Display Attachment List                                              

            SWF_SWR_GET_ATTACHMENT : RFC-enabled module for reading attachments

            SWL_WI_ATTACHMENT_DISPLAY :  WLC: Get an attachment

                                               

            SAP_WAPI_GET_ATTACHMENTS : Workflow Interfaces: Read Attachment for Work Item

      

            SO_ATTACHMENT_READ_API1 : SAPoffice: Read attachment using RFC        

                                                

            SO_WIND_ATTACHMENT_LIST_API1 : SAPoffice: Attachment list for application objects

Regards,

S.Suresh.

Former Member
0 Likes

Hi Suresh,

Thanks - I'll try them out.

Soyab

Former Member
0 Likes

Hi Suresh,

I can use FM SO_DOCUMENT_READ_API1 to read the contents of the attachment (in table OBJECT_CONTENT).

I need to store a copy of these attachments to the archive server and need to know which function module to use. Any ideas please?

I know the details required to populate the TOA03 link table for these attachments.

Thanks.

Soyab