cancel
Showing results for 
Search instead for 
Did you mean: 

Get documents using SO_DOCUMENTS_MANAGER

Former Member
0 Kudos

Hi

In a similar vein to a recent post about BAPI_DOCUMENT_CHECKOUTVIEW2 I now can't get SO_DOCUMENTS_MANAGER to work either. I'm passing "DISP" to ACTIVITY, and the docId in bits to FOLTP, FOLYR, FOLNO, OBJTP, OBJYR, and OBJNO. I can get it to work fine in SE37.

Has anyone had any success with this function?

Thanks

Nick

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Nick,

I've not used this particular BAPI/RFC before but what is the ResponseXML that you are getting back? What's the error message? If every field in the XML structure is null then it's probably a permissions issue.

Sam

Former Member
0 Kudos

Thanks for replying, sorry I should have provided these details.

Error message I get back is

[ERROR]: RFC Execution Error: Access via 'NULL' object reference not possible.

The documents I'm trying to view are attachments added to a Production Order in CO03.

The docId (INSTID_B) is a 34 character string I get from table SRGBTBREL (choose something with RELTYPE=ATTA). This is then split and fed into SO_DOCUMENTS_MANAGER/TABLES/DOCUMENTS/Item in the following manner

FOLTP = chars 1-3

FOLYR = 4-5

FOLNO = 6-17

OBJTP = 18-20

OBJYR = 21-22

OBJNO = 23-34

If you need any further details let me know.

Nick

0 Kudos

Nick,

After a quick search through the SDN I found this thread:

[|]

Which mentions using this one instead: BDS_BUSINESSDOCUMENT_GET_TAB

Also there's a link to this document which describes "How to" use it:

[How to retrieve a Generic Object Services (GOS) or SAPOffice document & display it in a BSP / WebDynpro(JAVA) Application|/people/siddhartha.jain/blog/2007/01/16/how-to-retrieve-a-generic-object-services-gos-or-sapoffice-document-display-it-in-a-bsp-webdynprojava-application]

Hope this helps.

Sam

Former Member
0 Kudos

Sam

I tried BDS_BUSINESSDOCUMENT_GET_TAB in se37 and xmii and couldn't get anything back (Error message = RFC Execution Error: NOTHING_FOUND.) so I don't see any point pursuing that one.

The second link suggests using SO_DOCUMENT_READ_API1 (which I was already using to read NOTEs) and this again works fine in SE37 (giving binary output), but will not work in XMII. The error message received is

RFC Execution Error: An invalid XML character (Unicode: 0x0) was found in the element content of the document.

I tried stepping through the ABAP debugger to find what was causing this, but it all seemed OK. Can you help?

Thanks again

Nick

0 Kudos

Nick,

Update the BAPI/RFC to return Base64 encoded values, they are xMII friendly. Then you can use the Image Saver action to store the Base64 encoded content as binary.

Hope this helps.

Sam