Skip to Content
avatar image
Former Member

Launch Excel via Transaction Code

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Apr 03, 2006 at 03:53 PM

    Hi,

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

    Regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 03, 2006 at 03:33 PM

    Hi,

    You can use the function module 'FTBU_START_EXCEL'.

    Regards,

    Suresh Datti

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 03, 2006 at 03:37 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 03, 2006 at 03:38 PM

    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

    Add comment
    10|10000 characters needed characters exceeded