2007 Jul 12 12:23 PM
Hi Experts,
Can anyone help me in running an abap program to give an Excel file using OLE..
Regards,
Seshadri
2007 Jul 12 12:31 PM
Hi ashu,
thank u 4 ur fm.
Its ok,can u provide me the coding...
2007 Jul 12 12:25 PM
Hi,
All the fields which are to be passed to this FM <b>MS_EXCEL_OLE_STANDARD_DAT</b> are to be CHAR type
so the data will be downloaded as 25 only you can't get 25.00 using this fun module.
<b>
Reward points if useful</b>
Regards
Ashu
2007 Jul 12 12:28 PM
Hi Seshadri,
You can try using the function module "SAP_GUI_PROGRESS_INDICATOR".
You may cre3ate objects for the worksheets and then callthis function modules...
Regards,
Dhayanandh.S
2007 Jul 12 12:31 PM
Hi ashu,
thank u 4 ur fm.
Its ok,can u provide me the coding...
2007 Jul 12 12:33 PM
Hi Dhayanandh,
Can u provide the code.
I like ur function module and ur explanation,but if i could get the code then it will be helpful..
2007 Jul 12 12:36 PM
Hi Seshadri,
Here is ur expected coding...
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.
hope it helps..
2007 Jul 12 1:09 PM
Hi,
can anyone please provide some info that how to link 2D,3D,4D Graphics in this code..
2007 Jul 12 1:23 PM
Hi seshadri,
you can use the submit button and use the CPROG=> REKH0004 you can utilise the graphics in this..
hope it helps...