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: 

Launch Excel via Transaction Code

Former Member
0 Kudos

I am looking to create a transaction code by which a use can open a new excel workbook. I have seen the function module called RSAH_LAUNCH_EXCEL but i must pass it the workbook name. In my situtation i would like to open a brand new session of Excel. Any suggestions?

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

you can use Transaction <b>OLE</b>, and from there you can click on EXCEL.

Regards

vijay

4 REPLIES 4

suresh_datti
Active Contributor
0 Kudos

Hi,

You can use the function module 'FTBU_START_EXCEL'.

Regards,

Suresh Datti

ferry_lianto
Active Contributor
0 Kudos

Hi Jeff,

Welcome to SDN.

You can go to transaction code <b>OLE</b> and click on Start (Excel) or execute program <b>RSOLETT1</b>.

Also please check this link for sample code.

http://www.guidancetech.com/people/holland/sap/abap/zzbgs700.htm

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi Paolone,

Use the below program to create the Excel sheet from ABAP, this is possible through OLE

REPORT ZCREATEEXCEL.

TYPE-POOLS OLE2.

DATA: EXCEL TYPE OLE2_OBJECT,

WORKBOOKS TYPE OLE2_OBJECT,

WORKBOOK TYPE OLE2_OBJECT.

DATA: FILENAME LIKE RLGRAP-FILENAME.

  • START THE EXCEL APPLICATION

CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.

PERFORM ERR_HDL.

  • PUT EXCEL IN FRONT

SET PROPERTY OF EXCEL 'VISIBLE' = 1.

PERFORM ERR_HDL.

  • INFORM USER OF THE CURRENT STATUS

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = 0

TEXT = TEXT-I08

EXCEPTIONS

OTHERS = 1.

  • CREATE AN EXCEL WORKBOOK OBJECT

CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOKS.

PERFORM ERR_HDL.

CALL METHOD OF WORKBOOKS 'ADD' = WORKBOOK.

PERFORM ERR_HDL.

  • EXCEL FILENAME

CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'

SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.

CALL METHOD OF WORKBOOK 'SAVEAS' EXPORTING #1 = FILENAME.

FORM ERR_HDL.

IF SY-SUBRC <> 0.

WRITE: / 'OLE ERROR: RETURN CODE ='(I10), SY-SUBRC.

STOP.

ENDIF.

ENDFORM.

*-- End of Program

Thanks

Sudheer

former_member188685
Active Contributor
0 Kudos

Hi,

you can use Transaction <b>OLE</b>, and from there you can click on EXCEL.

Regards

vijay