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

ole excel application from abap

Former Member
0 Likes
484

Hi all ,

I an calling one excel application from abap . I don't want to make excel file visible , but insted want to save and close the file , by using method

saveas for excel application and later i want to see the file . file name i want to store in a variable .

eg :

CALL METHOD OF H_EXCEL 'FILESAVEAS' = RC

EXPORTING #1 = filename .

Can it be possible ?

regards,

SA

1 ACCEPTED SOLUTION
Read only

sourabhshah
Product and Topic Expert
Product and Topic Expert

Hi all ,

I an calling one excel application from abap . I don't want to make excel file visible , but insted want to save and close the file , by using method

saveas for excel application and later i want to see the file . file name i want to store in a variable .

eg :

CALL METHOD OF H_EXCEL 'FILESAVEAS' = RC

EXPORTING #1 = filename .

Can it be possible ?

regards,

SA

2 REPLIES 2
Read only

Former Member
0 Likes
414

hi

i simpler method will be to use the function modules for this purpose.

CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • PROGRAM_NAME = SYST-CPROG

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

file_name = file_name .

lc_filename = file_name.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = lc_filename

filetype = 'DAT'

TABLES

data_tab = gt_itab.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Fn module F4_filename will prompt for the name of the file to be saved and GUI_DOWNLOAD will save the file.

gt_itab is the internal table containing the data to be stored in excel.

Read only

sourabhshah
Product and Topic Expert
Product and Topic Expert