cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading file content of a word document through BSP

former_member721730
Active Participant
0 Kudos

Hi,

When we try to upload a file using cl_htmlb_fileupload class, the file content results in xstring format. When the size of the file increases, the function module in which we try to modify a z-table with the file information is resulting into a short dump.

we have declared the field as a rawstring, also update as how to upload the word and ppt files, which are huge in size.

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

change the field type in the ztable to type XSTRING and if the problem still happens you can zip it and store the zipped content there.

Regards

Raja

Answers (1)

Answers (1)

former_member721730
Active Participant
0 Kudos

Hi Raja,

How to assign a field type as XSTRING in Z-table. There is not any XSTRING data type in dictionary.

In BSP we want to attach any type of document. That document should be saved in the Z-table and whenever the file link selected in the BSP screen, attached document should be fetched from the Z-table and displayed.

We find problem when upload normal document file. Then how to convert the any document to ZIP format and update in the Z-table.

Please guide and provide solution.

Thanks in advance.

Saravanan

athavanraja
Active Contributor
0 Kudos

for the field use data element HTTPBODY (its not xstring but its rawstring)

for compressing

try.

call method cl_abap_gzip=>compress_binary

exporting

raw_in = l_text

importing

gzip_out = wa_definitions-description.

catch cx_parameter_invalid_range .

catch cx_sy_buffer_overflow .

catch cx_sy_compression_error .

endtry.

for decompressing while reading it back

try.

call method cl_abap_gzip=>decompress_binary

exporting

gzip_in = wa_definitions-description

importing

raw_out = l_text.

catch cx_parameter_invalid_range .

catch cx_sy_buffer_overflow .

catch cx_sy_compression_error .

endtry.

Regards

Raja

Former Member
0 Kudos

Hi Durairaj,

i need to read the file and convert into rawstring in se38 program. Do you have any suggestion to do this?

See -

...Naddy