How to generate Excle file for a report runningin a Batch job

Advertisement

Hello All,
Can we generate Excle file for a report running in a Batch job.
Kindly send reply to     [email protected]
Thanks in Advance.
Cheers,
Sundeep

Advertisement

Dear Sundeep,
I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...
D A T A D E C L A R A T I O N *
TYPES: BEGIN OF TY_EXCEL,
CELL_01(80) TYPE C,
CELL_02(80) TYPE C,
CELL_03(80) TYPE C,
CELL_04(80) TYPE C,
CELL_05(80) TYPE C,
CELL_06(80) TYPE C,
CELL_07(80) TYPE C,
CELL_08(80) TYPE C,
CELL_09(80) TYPE C,
CELL_10(80) TYPE C,
END OF TY_EXCEL.
DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,
WA_EXCEL TYPE TY_EXCEL..
E V E N T : S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Here you populate the Internal Table.
Display - Top of the Page.
PERFORM DISPLAY_TOP_OF_PAGE.
E V E N T : E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
SET PF-STATUS 'GUI_STATUS'.
E V E N T : A T U S E R - C O M M AN D *
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXPORT'.
Exporting the report data to Excel.
PERFORM EXPORT_TO_EXCEL.
ENDCASE.
*& Form DISPLAY_TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM DISPLAY_TOP_OF_PAGE .
SKIP.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'O R I C A'
CENTERED COLOR 1,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'
CENTERED COLOR 4 INTENSIFIED OFF,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE.
E X C E L O P E R A T I O N
CLEAR: IT_EXCEL[],
WA_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
WA_EXCEL-cell_02 = ' XYZ Ltd. '.
APPEND WA_EXCEL TO IT_EXCEL.
CLEAR: WA_EXCEL.
WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.
APPEND WA_EXCEL TO IT_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
ENDFORM. " DISPLAY_TOP_OF_PAGE
*& Form APPEND_BLANK_LINE
text
-->P_1 text
FORM APPEND_BLANK_LINE USING P_LINE TYPE I.
DO P_LINE TIMES.
CLEAR: WA_EXCEL.
APPEND WA_EXCEL TO IT_EXCEL.
enddo.
ENDFORM.
*& Form EXPORT_TO_EXCEL
text
--> p1 text
<-- p2 text
FORM EXPORT_TO_EXCEL .
DATA: L_FILE_NAME(60) TYPE C.
Create a file name
CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)
'.' SY-DATUM+0(4) INTO L_FILE_NAME.
Pass the internal table (it_excel which is already populated )
to the function module for excel download.
CALL FUNCTION 'WS_EXCEL'
exporting
filename = L_FILE_NAME
tables
data = IT_EXCEL
exceptions
unknown_error = 1
others = 2.
if sy-subrc <> 0.
message e001(ymm) with 'Error in exporting to Excel.'.
endif.
ENDFORM. " EXPORT_TO_EXCEL
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......
Regards,
Abir
Don't forget to award points *

November 30, -0001

How to generate Excle file for a report runningin a Batch job

Hello All, Can we generate Excle file for a report running in a Batch job. Kindly send reply to     [email protected] Thanks in Advance. Cheers, SundeepDear Sundeep, I'm providing you with the following piece of code ... Its working fine for me ... h

How to generate XSD file for XML schema adobe form

Hi, I want to generate XSD file for XML schema interfaces adobe forms. How can I do it. Where I can do it..or who will provide this file.. Thanks Ram Edited by: Ramesh ram on Feb 23, 2010 6:33 PMAaaaah, my mistake, sorry for that. Of course you shoul

How to generate cacerts file for jar

how can i generate the cacerts for jar file to secure the applet? how can i do it myself? is it provided that function from Versign? can you all give my step by step guildanceEven though JDK1.4 is not officially shipping the Java Plugin 1.4 documents

How to generate Excel files in Oracle Reports

Hi, I've already built a JSP using oracle reports and Deploy on the report service. I also add a button to the left of the JSP.The next thing I want to do is:when user click on the button, the system will prompt a excel file contains the same content

Need to generate a Index xml file for corresponding Report PDF file.

Need to generate a Index xml file for corresponding Report PDF file. Currently in fusion we are generating a pdf file using given Rtf template and dataModal source through Ess BIPJobType.xml . This is generating pdf successfully. As per requirement f

How to create .csv file from ABAP report

Hi We have a requirement to generate .csv file from abap report. Currently user saves data from abap report to spreadsheet(.xls format) in desktop.  Then opens excel file and save as .csv format.  Need option to save directly in .csv format instead o

How to make a CheckBox for a report parameter?

Hi, How to make a CheckBox for a report parameter? thanxdesign ur parameters forms using forms and call ur report form thereRead other 2 answers

Error : generate war file for iplanet server 6.5

I use war file that generate from WSAD V.4 and deploy this war file to iPlanet sun one app server V6.5. before deploy to iplanet I must use command to generate war file for iplanet server (convert J2EE Archive to IAS Archive) but i found problem afte

How to build ear files for ADF application using Ant task

How to build ear files for ADF applications using Ant. The ojdeploy ant task can not find application-level deployment profiles. I am trying to automated build and release for ADF application. Any help is highly appreciated. Thanks ShivaHi Timo Thank

How to import WMV file for use in adobe programs, especially After Effects and/or Premier?

How to import WMV file for use in adobe programs, especially After Effects and/or Premier?I have the latest adobe creative cloud and i'm using Mac 10.8.2 My client gave me a wmv file that she wants some people blurred out in the background but when I

How to generate BP number for the employee (ECC to CRM) ...

Hi all, can any one give solution for ,how to generate BP number for the employee from ECC to CRM other than active status,as i downloaded employee data from ECC to CRM through ALE/IDOC,as only active employment status employees are got BP number gen

How to generate output file of a certain report in a specified directory

Hello everyone, I wanna know how to generate the output file of a certain report in a specified directory. Now, the output file directory = /produits/OA/OAS/production/prodcomn/admin/out/PROD_us15k1bp/ I wanna to generate the output file of a report

How to dpwnload one XML file for each report row

Hi all, i have a report on the products table with about 1000 rows desc of table products product_id varchar (10) product_desc varchar2 (2000) I would like to download on the file system an xml file for each row of the report the nane of each xml fil

Error while generating XML file from rdf report.

Hi All, we are having a rdf report that displays images retrieved from data base. I need to convert this report to xml report(using rtf template). when i tried to run the report after changing the output of the concurrent program to "XML", i am

Generate .DAT file for CG33

Hi Experts, Can you please explain in details how can we generate .DAT file to use for importing specification through CG33. Thanks in Advance. Regards KapilHello Kapil, You can create a *-DAT file by Exporting a Specification from TR CG02 see http:/

DiagTool- how to generate the file

Hi can some one tell me how to use the diagtool i read the note , its says Dowload the attached tool (diagtool.zip) and execute it according to the root instructions: go.bat <config_file> <path_to_configtool>  (Windows and IBM iSeries) whre ca

How to generate Income Statement from Crystal Report

Hi, Experts, I have: SAP BUSINESS ONE 2007A CRYSTAL REPORT 2008 I have a problem with generating Income Statement related reports from CRYSTAL. For example, My revenue accounts are: '411000-00-00' and '412000-00-00', my expense accounts are: '510000-

SEPA file – how to create one file for multiple company codes

Dear experts, My company has multiple company codes and they process automatic payments (F110) for multiple company codes in the same run. The company wants to generate one SEPA file for all company codes. In OBPM1  for SEPA format in the section ``P

How to Import Js file inside Webi report ?

hello People, i have one question regarding webi report. As per web documentation i can directly inscribe javascript logic inside the webi report and can read it as html content . But what if i have javascript file which i want to simply import insid

How to generate mmx file in 10g or 9i?

I am in the process of migrating Forms from version 6 to 10g. I compliled mmb files without any error, but how do I generate mmx file in 9i or 10g? I used to be able to generate mmx file in Form version 6 through: File -> Administration -> Compile F