Application Development 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: 

Loading external documents ( .DOC; .PDF... ) into SAP

Former Member
0 Kudos

Hi, I should load into SAP external documents

(curricula) attached to applicant data. Via web interface,

applicants can only attach files created with Word, Adobe

Acrobat, Notepad. The web server will send the applicant

data + the attachment (via an XML message) to an integration server (TIBCO), which in turn will send the data to SAP HR. I presume TIBCO can extract the attachment

from the XML envelope and send it to the SAP server. Is

there anyone that can tell me how can I load these files into SAP (without corrupting their contents)? Once loaded

the attachment, the SAP system has to be able to invoke

(via OLE automation) the exact application used to create

it (transaction: PB20). A function exists that can import

whatever type of attachment: SO_OBJECT_INSERT; this

function, however, needs to be filled with the file

contents (TABLE parameter); this implies that the ABAP

program has to read the file contents in such a way that

guarantees its integrity (binary mode, I presume). Is

there a function that loads the attachment by reading

its local path? This way the read operation would be

transparent. Or maybe there exist an RFC function module

that can be invoked directly from TIBCO.. (I don't know).

Thanks in advance.

Adriano.

9 REPLIES 9

Former Member
0 Kudos

When TIBCO loads this files to SAP server, i believe there will be a separate directory created for your application which will contain all these attachments. You can upload these files using OPEN DATASET / READ DATASET. This should help you to get the details correctly. You can see contents of application server file using transaction AL11.

To answer your second question, you can use GUI_DOWNLOAD, provided you have saved attachment on a presentation server. If you use this function, you will not be ableto run your program in background.

Also pls check once using ABAP program if it reads contents of acrobat file correctly.

0 Kudos

Hi Ashish, thank you very much for your reply. Yes, the

quicker solution to my problem will be reading the external documents by: OPEN/READ DATASET ... IN BINARY

MODE, then passing the records to the function:

SO_OBJECT_INSERT. Do you think the target structure has to

respect a specific length?

Your last consideration forces me to do another

question: have you ever had difficulty in handling a

document in .PDF format within SAP environment? I've no

experience about it. I presume (but I'm not sure) that

loading the file as it is (using binary mode) should be

sufficient to guarantee that Acrobat will open the

document correctly. I know there are functions specialized

in handling .PDF format, but I don't know whether they may

be useful in this context.

With regard to this topic (.PDF handling) I noticed

that table: TSOPE (external formats accepted) doesn't

include .PDF on my system. I presume this table has to be

updated for SAP to be able to invoke Acrobat front-end

side. Do you know if there is a special transaction to do

it, and if other steps are required in order to make

possible that invocation?

Thanks again.

Adriano.

Former Member
0 Kudos

Hi Adriano,

I am not logged on to SAP right now. I loaded the different kinds of documents9 PDF, JPEG, DOC) to SAP CRM recently. I had found one method for BDS (business document services) object. It was 'Create_with_file' method.

I am not sure that if BDS is available at R3 side but DMS(document management services)is. You can create an documentin DMS and assign it to one or more business object. Then that document becomes available through General Object Sevices. Check the methods of DMS. The tables are DRAW and DRED.

I hope it helps. If it does, please award points.

0 Kudos

As Sharad said, you can upload acrobat documents in SAP. Regarding the structure length as per function SO_OBJECT_INSERT, it limits to 255 characters per line. I have not used Methods for this but surely there should be ABAP classes / methods available. You can explore that area too. I will also check and let you know if i come across anything.

0 Kudos

If you are looking for loading data from Application server, record size should be less that 1096 characters. You can try this - get your attachment on application server and then load it to SAP by reading this file and see if this satisfies your requirement.

0 Kudos

Hi Sharad, first of all I want to thank you for your

help. BDS is a very interesting option. I've no experience

with it but I'm studying the relevant documentation and

I'd like to use it to implement my solution. I've read the

BDS is part of the SAP System, so there should be no

problem in using it. The ABAP OO class:

cl_bds_document_set provides, as you told me, a method

named: CREATE_WITH_FILES, through which it's possible to

load a certain file from a certain directory. The question

is: do you know where this method stores the file contents? The module involved by the development is:

HR-Selection; debugging the standard code during the

storing/retrieval phase, I found out the standard (see

function: SO_OBJECT_INSERT) stores the file contents in

SOC3 table (cluster table of type: INDX). Transactions:

PB20/PB30 access that table to retrieve the attachment.

Regarding DMS, can you recommend some URL where I can

find complete documentation?

Thanks again.

Adriano.

0 Kudos

Hi Ashish, first I'll try using the BDS class, as

suggested by Sharad. As an alternative, I'll try using the

'traditional' approach (OPEN/READ DATASET in custom

program). It's true: the table parameter of

SO_OBJECT_INSERT has a length limited to 255 characters.

I think there should be no problem in reading the file

contents (in binary mode) 255 characters each time. The

problem is that I'm making analysis and I've no

authorization for creating programs.. So I must be sure

that the solution will function before passing the

document to the developers.

Thanks again.

Adriano.

0 Kudos

You can read the online help at

http://help.sap.com/saphelp_erp2005/helpdata/en/dd/f5253715dfb808e10000009b38f889/frameset.htm

you can use generic object services to attach documents to objects (master data, transactions, etc).

(transaction OAOR)

http://help.sap.com/saphelp_erp2005/helpdata/en/be/3fe63659241157e10000009b38f889/frameset.htm

alternate approach - SAP Easy Document Management

http://help.sap.com/saphelp_erp2004/helpdata/en/db/003353fca05c47bfc8f391cf296fc8/frameset.htm

Regards

Raja

Former Member
0 Kudos

Hi,

What is the difference between direct input and BDC.

What is the main advantage of using direct input method.

rgds

p.kp