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: 

ABAP Class to download a JPEG file

valter_oliveira
Active Contributor
0 Kudos

Hi experts,

I'm trying to use class cl_gui_frontend_services (method gui_download) to download a file in the pc.

The problem is that i have a XTRING field (binary string with thousands of characters) and this method, with filetype 'BIN', only accepts X fields (65000 characters aprox).

Is there any other class i can use?

Best regards.

Valter Oliveira.

1 REPLY 1

valter_oliveira
Active Contributor
0 Kudos

I filled the data table, spliting the XTRING into n X variables, USING THIS DO STATEMENT:

TYPES: BEGIN OF ty_file,

line(65000) TYPE x,

END OF ty_file.

DATA: out TYPE xstring,

wa TYPE ty_file,

lenght TYPE i,

data_tab TYPE STANDARD TABLE OF ty_file WITH DEFAULT KEY INITIAL SIZE 0.

DO.

lenght = STRLEN( out ).

IF lenght GT 65000.

wa-line = out(65000).

out = out+65000.

APPEND wa TO data_tab.

ELSE.

wa-line = out(lenght).

APPEND wa TO data_tab.

EXIT.

ENDIF.

ENDDO.

... CALL METHOD cl_gui_frontend_services=>gui_download

Best regards.

Valter Oliveira.