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: 

Sample Class Program

Former Member
0 Kudos

Hi,

Can any body post me an sample report based on the class CL_GUI_FRONTEND_SERVICES and method GUI_upload or GUI_Download.

Thanks

Manju

1 ACCEPTED SOLUTION

former_member150733
Contributor
0 Kudos

For Class CL_GUI_FRONTEND_SERVICES

================================

DATA : URL TYPE STRING.

URL = 'http://sdn.sap.com/'.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

DOCUMENT = URL

EXCEPTIONS

OTHERS = 1.

For GUI Download

=============

data : i_tline type table of tline with header line.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

max_linewidth = 132

importing

bin_filesize = v_len_in

tables

otf = st_jobout-otfdata[]

lines = i_tline

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

others = 5.

call method cl_gui_frontend_services=>file_save_dialog

changing

filename = file

path = path

fullpath = file_path

user_action = user_dec.

clear flag.

if user_dec ne '0'.

leave program.

endif.

check not file_path is initial.

*Download PDF File to Presentation Server

call function 'GUI_DOWNLOAD'

exporting

filename = file

filetype = 'BIN'

importing

filelength = file_len

tables

data_tab = i_tline

exceptions

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

others = 22.

Regards,

Anish Thomas

3 REPLIES 3

Former Member
0 Kudos

Hi,

Go through the programs,

LSCR2U05 --> UPLOAD

LSCR2U06 --> DOWNLOAD

Regards,

Azaz Ali.

former_member150733
Contributor
0 Kudos

For Class CL_GUI_FRONTEND_SERVICES

================================

DATA : URL TYPE STRING.

URL = 'http://sdn.sap.com/'.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

DOCUMENT = URL

EXCEPTIONS

OTHERS = 1.

For GUI Download

=============

data : i_tline type table of tline with header line.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

max_linewidth = 132

importing

bin_filesize = v_len_in

tables

otf = st_jobout-otfdata[]

lines = i_tline

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

others = 5.

call method cl_gui_frontend_services=>file_save_dialog

changing

filename = file

path = path

fullpath = file_path

user_action = user_dec.

clear flag.

if user_dec ne '0'.

leave program.

endif.

check not file_path is initial.

*Download PDF File to Presentation Server

call function 'GUI_DOWNLOAD'

exporting

filename = file

filetype = 'BIN'

importing

filelength = file_len

tables

data_tab = i_tline

exceptions

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

others = 22.

Regards,

Anish Thomas

amit_khare
Active Contributor
0 Kudos

Hi,

CL_GUI_FRONTEND_SERVICES -

RHVERI_EXCEL_DOWNLOAD

RSTXPDFT

GUI_DOWNLOAD -

RFFM_TEST_ELKO

RCOPOC_TEST_XML_GENERATOR

GUI_UPLOAD -

FT_PULL_FILES

UPLOAD_FILES

Regards,

Amit

reward al helpful replies.