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: 

storing PDF and JPEG docs in SAP

Former Member
0 Kudos

Hi Friends,

I need to store PDF and JPEG docs into SAP system from either Application server or external server.

This storing will be done in background.

How do i store them and retrieve to show them in say in a report.

Any help in this regard is highly appreciated.

SAP Version: 4.7EE on AIX DB2

Regards,

Simha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

Just have a look at DMS

Regards

prabhu

22 REPLIES 22

Former Member
0 Kudos

Hi Simha.

I would like to suggest,

It is not possible to do directly from presentation server.

If you have your file in Presentation server and want to download using background mode,

I would like to suggest you a reference,

[SDN - Standard Reference PDF for Communication to presentation server in Background mode|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2]

Use transaction CG3Z to download from presentation to application server.

Then you can use OPEN DATA SET and READ DATASET AND CLOSE DATASET operations on application server.

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

0 Kudos

Hi Harsh Dave,

No its not from presentation to Application,

its basically into SAP (some table which can store pdf and jpeg) from App server and in background.

they are not datasets to do open dataset operations, they are documents which have to be retrieved as and when needed.

Regards,

Simha

Edited by: Simha on Jul 28, 2008 5:08 AM

Former Member
0 Kudos

Hi,

Try the following link,

[http://www.sap-img.com/fu002.htm]

0 Kudos

Hi Avinash,

Its not for the purpose of Logo, this is to store documents related to Invoices.

Kind of content management but with out content server.

Regards,

Simha

Edited by: Simha on Jul 25, 2008 2:57 AM

Former Member
0 Kudos

Hi ,

Just have a look at DMS

Regards

prabhu

0 Kudos

Hi prabhu,

We don't have a DMS in our landscape.

can you pls be more specific on the link that you provided.

It is pointing me to forums page only.

Regards,

Simha

0 Kudos

Hi ,

just i searched on SDN forums ,

Please check this link

http://www.sap-img.com/sap-dms.htm

SAP DMS are for storing documents such as CAD drawings, Materials pictures etc.

With the document management system, users will be able to view the documents with ease within their SAP systems.

SAP DMS enables the capture and management of electronic documents, CAD models and drawings, MS-Office

files, scanned images, multi-media files, and any other electronic files that should be stored and controlled in a

secure environment. SAP DMS provides version and revision control, integrated workflow capabilities, full text

retrieval and search functionality, and linkage with SAP business objects such as Bill of Materials, material masters

(parts), process plans, engineering change masters, and production orders. SAP DMS supports archiving and SAP

classification schemes as well as third-party archiving repositories. SAP DMS provides integrated viewing and

redlining capabilities.

DMS provides various user interfaces including an easy-to-use, intuitive, Web-based portal and MS-Windows

Explorer simplified access, called Easy DMS. The Easy DMS and Web Browser user interfaces require minimum

training for occasional users.

DMS is a service that gives you ability of information managment and is associated with Knowledge Provider (KPro).

Check this links for detailed info:

About DMS

http://help.sap.com/saphelp_nw70/helpdata/EN/30/08a037b9e62417e10000009b38f889/frameset.htm

About DMS programing interface

http://help.sap.com/saphelp_nw70/helpdata/EN/3c/4d26696ab411d3aece0000e82deb58/frameset.htm

Regards.

Valter Oliveira.

0 Kudos

Hi Prabhu,

Thanks for a quick response, let me reiterate that we don't have a DMS in our installation and client is not interested to invest in this.

My problem: is there any way that i can store PDF/JPEG documents in SAP(either Database tables/app server)?

regards,

Simha

0 Kudos

custom option:

you can create a ztable with say

docid type xxxx

doctype type xxx

doccontent type xstring.

fields.

in the doc content field you can store the document. alternatively, you could also store them in the MIME repository (se80)

Raja

0 Kudos

Hi Raja,

Thanks for your inputs.

Yes i have a similar approach in mind but don't know how to read the documents and make them in to XSTRING to store in document content field( of the custom Ztable)

Any inputs on realizing such thing will be of great help.

These are basically for an interface for Invoicing, where these PDF, JPEG and JPG documents(which are supporting documents for the invoice data) are FTPed into SAP server which i need to store them and display in various reports.

I thought of storing these documents in a separte server with Webserver installed in it and once i have the absolute path of the documents, thought of giving link in my report which opens the documents by using CL_GUI_Frontendservices=>Execute, but the client is having a security problem in storing these attachments in a separate server and insisting on storing in SAP DB only.

But i am really confused if this is feasible and a best practise?

Your valuable help in this regard is highly appreciated.

Regards,

Simha

0 Kudos

questions:

1. whats the source of the documents - on the user machine or in some other locations?

2. should this uploaded into SAP through batch processing, or user will attach few docs. at a time?

0 Kudos

if the upload will be performed by users.

the code for uploading and converting to xstring will be like below


 constants: line_size type i value 255.
  data: begin of xml_tab occurs 0,
           raw(line_size) type x,
        end   of xml_tab  ,
     xmldata type xstring .

call function 'GUI_UPLOAD'
    exporting
      filename            = filename
      filetype            = 'BIN'
      has_field_separator = ' '
      header_length       = 0
    importing
      filelength          = size
    tables
      data_tab            = xml_tab
    exceptions
      others              = 1.

call function 'SCMS_BINARY_TO_XSTRING'
  exporting
    input_length       = size
*   FIRST_LINE         = 0
*   LAST_LINE          = 0
 importing
   buffer             = xmldata
  tables
    binary_tab         = xml_tab
 exceptions
   failed             = 1
   others             = 2

0 Kudos

Hi Raja,

Please find the answers for the questions posed.

1.whats the source of the documents - on the user machine or in some other locations?

Ans: Documents are FTPed into a staging server and from there they will be copied into SAP APP Server into a designated drive.

2.should this uploaded into SAP through batch processing, or user will attach few docs. at a time?

Ans: Should be uploaded into SAP thru Batch Process no user interaction.

Regards,

Simha

0 Kudos

so an ABAP batch program should periodically check the "staging server" to read the docs and update the abap tables?

what communication mechanisms this staging server can support

http? webservice? we need more info about the "staging server"

Raja

0 Kudos

Basically staging server acts as SFTP client first to get all the data from external server. A java Program is written for this purpose.

Once the documents and Invoice data(a flat file) is in staging server, these documents will be once again FTPed into SAP App server into some designated Directory.

Putting files till the SAP directory is taken care by non sap programs written in Java and Unix.

All i want is to take these documents and upload into SAP Database tables as discussed earlier and flat file i will be reading and storing by read dataset commands...

Hope i gave you clarity..let me know..Thanks

Regards,

Simha

0 Kudos

then use

open dataset for <file> for output in binary mode.

to read the content and update your table.

Raja

0 Kudos

Will Open dataset statement be able to convert a PDF/JPEG document into XSTRING format and help me in storing in DB table?

I thought open dataset will work only for flat files.

If i can read and store documents, how do i display them when i query from table and render on UI?

Regards,

Simha

0 Kudos

Hi Raja,

Thanks for the help.

I am able to read the required documents from app server in binary format and able to display.

But how can i store the binary text into DB table.

I am wokring on 4.7EE and no XSTRING datatype available for a field data element.

Thanks,

Simha

0 Kudos

alternatively you can use LRAW data type

0 Kudos

but how would i know the length of the LRAW data which i am supposed to store in a field of type INT4 as per the usage of LRAW data type?

Do i have to do any conversions before inserting data into LRAW field?

What should be the length of the data type of LRAW?

Regards,

Simha

0 Kudos

but how would i know the length of the LRAW data which i am supposed to store in a field of type INT4 as per the usage of LRAW data type?

when you use read dataset use the addition length to get the length for each read line

Do i have to do any conversions before inserting data into LRAW field?

no

What should be the length of the data type of LRAW?

you can use LRAW7000 data element.

(just do a where used list for DE LRAW7000 and see how its used)

Raja

0 Kudos

Thanks a lot for your inputs.

I will definitely try this way.

Thanks for your patient help.

regards,

Simha

I am closig this thread...Thanks