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

Saving Attachments in DB Tables

Former Member
0 Likes
2,759

Hi All

I have an requirement where i have to Save DOCS file.And Fetch them whenever needed.

Solution that i am appying is:

-


i am saving Docs file in a folder on SAP APPLN SERVER, and then saving the PATH/LINK to that file in a DB table.

So that when i need that file i can simply get the PATH/LINK Stored in DB table and then Upload the file.

Is there any other alternative to that,like storing the DOC files straightaway in DB table and Fetch them back when Required.

ANY IDEAS?

Thanks in Advance

Vijay Raheja

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
1,833

Hi,

SAP could save the document into tables. Look the table DRAW & DRAD.

Rgd

Frédéric

Hi All

I have an requirement where i have to Save DOCS file.And Fetch them whenever needed.

Solution that i am appying is:

-


i am saving Docs file in a folder on SAP APPLN SERVER, and then saving the PATH/LINK to that file in a DB table.

So that when i need that file i can simply get the PATH/LINK Stored in DB table and then Upload the file.

Is there any other alternative to that,like storing the DOC files straightaway in DB table and Fetch them back when Required.

ANY IDEAS?

Thanks in Advance

Vijay Raheja

8 REPLIES 8
Read only

Former Member
0 Likes
1,833

Vijay,

I guess you can do that by activating the DMS (Document Management System) of SAP.

regards,

Ravi

Read only

FredericGirod
Active Contributor
0 Likes
1,834

Hi,

SAP could save the document into tables. Look the table DRAW & DRAD.

Rgd

Frédéric

Read only

0 Likes
1,833

you could use general object serivces (cl_gos_* classes) for this.

or you could simply store the whole content into a ztable.

Regards

Raja

Read only

0 Likes
1,833

if you want to store it in Ztable check out the following thread for complete code sample.

Regards

Raja

Read only

0 Likes
1,833

hi Durairaj Athavan Raja

Thanks for the code..It works Perfectly for XML or Say Binary format.

ISSUES NOW:

-


1) What about Unicode Conversion.?

AS i am working with DOC files, ANY IDEA?

2) Also the code that you have given,if the file/Record to

be inserted is of Bigger length,It stores all ZEROS in

DB Table.

And when i try to Decompress those DB Contents it

creates Dump.

Thanks in Advance

Vijay Raheja

Read only

0 Likes
1,833

which version of SAP you are working on.

if you are on WAS6.40 you can simply use string or xtring as field type.

as far the unicode, its based on your CODEPAGE parameter of gui_upload -

<i>For Reference the SAP internal Code page numbers are 4102 for utf-16be, 4103 for utf-16le, and 4110 for utf-8. These can be found in table TCP00A or by calling function module: SCP_CODEPAGE_BY_EXTERNAL_NAME.courtesy /people/thomas.jung3/blog/2004/08/09/bsp-download-to-excel-in-unicode-format - Thomas Jung</i>

or if you want to convert it within your program

app_type = 'APPLICATION/MSEXCEL; charset=utf-16le'.

call function 'SCMS_STRING_TO_XSTRING'

exporting

text = l_string

mimetype = app_type

importing

buffer = l_xstring.

Regards

Raja

Read only

0 Likes
1,833

Is your question answered? if so mark the thread as answered.

Thanks

Raja

Read only

0 Likes
1,833

Thanks RAJA for your replies.

Working on the same.

Will get back to you in new post,If i face more Problems.

Regards,

VIJAY RAHEJA