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: 

open Excel file file from abap report program

Former Member
0 Kudos

Hi Experts,

I want to show excel file from abap report program, but excel file exists in the following location.

'https://www.sdn.sap.com/test.xls'.

what are the steps to follow to display excel file from abap report program.

please help me out.

Thanks

Sridhar

7 REPLIES 7

Former Member
0 Kudos

Hi

U have to search some standd function module s there...U call FM and get the file.

Regarda:

Prabu

Former Member
0 Kudos

Generally we will use WS_EXECUTE function module using paramter PROGRAM = 'path of the file'.

But as this FM is OBSOLETE now we have to go for classes.

call method cl_gui_frontend_services=>execute

exporting

application = ls_file_path

parameter = lv_file

synchronous = 'X' "lv_modal

exceptions

cntl_error = 1

error_no_gui = 2

bad_parameter = 3

file_not_found = 4

path_not_found = 5

file_extension_unknown = 6

error_execute_failed = 7

others = 8.

if sy-subrc <> 0.

Former Member
0 Kudos

Hi,

try this:

CL_GUI_FRONTEND_SERVICES=>EXECUTE(

EXPORTING

DOCUMENT = 'https://www.sdn.sap.com/test.xls'

EXCEPTIONS

CNTL_ERROR = 1 ).

Regards, Dieter

Former Member
0 Kudos

DATA: d_string TYPE string.

CONCATENATE '\\Hrdoc\PRINTFILES\PRINT'w_printfileno'.doc' INTO text.

  d_string = text.

  CALL METHOD cl_gui_frontend_services=>execute

   EXPORTING

     document = d_string

   EXCEPTIONS

     OTHERS   = 1.

Former Member
0 Kudos

Hi,

use the below function module to upload the excel file.

WS_DOWNLOAD

to get the file name use the below function module in at selection screen.

call function 'KD_GET_FILENAME_ON_F4'

exporting

mask = ',Text files, *.txt'

static = 'X'

changing

file_name = p_pfile.

Regards,

sunil

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Check FM ALV_XXL_CALL. U can pass fieldcat and output table to this FM to display data in excel.

U can also check WS_EXECUTE. But All WS_ FMs are obsolete.

Thanks,

Vinod.

Former Member
0 Kudos

solved