How to Downlaod Data from Alv List to Excel File
Hi,
I have a Requirement like While download data from ALV to Excel File .After Download data into Excel we will not allow user to edit the Excel data..
Plz help me to complete this scenario.
Thanks & Regards,
Kumaran Duraiswamy.
hi,
try these following fm's
MS_EXCEL_OLE_STANDARD_DAT
EXCEL_OLE_STANDARD_DAT
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'Your Path' " enter your path to save the file.
CREATE_PIVOT = 0
* DATA_SHEET_NAME = ' '
* PIVOT_SHEET_NAME = ' '
* PASSWORD = ' '
* PASSWORD_OPTION = 0
VISIBLE = '0'
No_DIALOG = 'X'
TABLES
* PIVOT_FIELD_TAB =
DATA_TAB = t_deli_final
* FIELDNAMES =
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2nd fm
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = 'Your Path' "path to save your file
DATA_SHEET_NAME = V_SHEET_NAME
TABLES
DATA_TAB = TLX
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9.
IF SY-SUBRC NE 0.
WRITE:/ 'ERROR OPENING EXCEL'.
ENDIF.
ELSE.
WRITE:/ 'ERROR OR NO DATA'.
ENDIF.
Similar Messages
-
How to retrieve data from a read-only Excel file
Hi Developers,
I'm trying to retrieve data from a read-only Excel file. I used the same code that I used to retrieve data from a normal Excel file, but it can't work.
My code is as followed:
try
InputStream KpExcel = new FileInputStream("kp.xls");
HSSFWorkbook Kpwb = new HSSFWorkbook(KpExcel);
HSSFSheet Kpsheet = Kpwb.getSheetAt(0);
catch(Exception e)
e.printStackTrace();
System.out.println("Exception: "+e.getMessage());
The error I received is as followed:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
at photoproductionsystem.IncomingWIPPanel.getKp(IncomingWIPPanel.java:118)
at photoproductionsystem.IncomingWIPPanel.<init>(IncomingWIPPanel.java:76)
at photoproductionsystem.TabbedDisplay.<init>(TabbedDisplay.java:47)
at photoproductionsystem.Display.create(Display.java:73)
at photoproductionsystem.Display.init(Display.java:44)
at photoproductionsystem.Display.main(Display.java:229)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)
at org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:57)
at org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)
at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61)
... 15 more
Can someone please help me with my problem? Thanks a lot in advance!Madeline wrote:
how do I ask at Apache mailing list?I wonder why it seems to be a strange idea to some people to look at the software vendor's site for product support. :p
http://poi.apache.org/mailinglists.html -
How to download data from different sheet of excel file.
Hi Friends,
I have a Excel file with different sheet like sheet 1, sheet 2 and so on,
and i have to download each sheet data in to different internal tables.
Is there any FM or something else.
Pl. help
Thanks
Sunil.Hi,
You can create the function module for this.
The code sample is as below:
*Code Sample *
FUNCTION Z_UPLOADING_FROM_2SHEETS.
""Local interface:
*" IMPORTING
*" VALUE(FILE_NAME) LIKE RLGRAP-FILENAME
*" VALUE(START_ROW_SHEET1) TYPE I
*" VALUE(START_COLUMN_SHEET1) TYPE I
*" VALUE(START_ROW_SHEET2) TYPE I
*" VALUE(START_COLUMN_SHEET2) TYPE I
*" VALUE(END_ROW_SHEET1) TYPE I
*" VALUE(END_COLUMN_SHEET1) TYPE I
*" VALUE(END_ROW_SHEET2) TYPE I
*" VALUE(END_COLUMN_SHEET2) TYPE I
*" TABLES
*" IT_DATA1 STRUCTURE ALSMEX_TABLINE
*" IT_DATA2 STRUCTURE ALSMEX_TABLINE
*" EXCEPTIONS
*" INCONSISTENT_PARAMETERS
*" UPLOAD_OLE
DATA DECLARATION
DATA: excel_tab TYPE ty_t_sender,
excel_tab1 TYPE ty_t_sender.
DATA: ld_separator TYPE c.
DATA: application TYPE ole2_object,
workbook TYPE ole2_object,
SHEET TYPE OLE2_OBJECT,
range TYPE ole2_object,
worksheet TYPE ole2_object.
DATA: h_cell TYPE ole2_object,
h_cell1 TYPE ole2_object.
DATA: ld_rc TYPE i.
MESSAGE DEFINATION
DEFINE m_message.
case sy-subrc.
when 0.
when 1.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
when others. raise upload_ole.
endcase.
END-OF-DEFINITION.
PARAMETER CHECK
IF START_ROW_SHEET1 > END_ROW_SHEET1.
RAISE inconsistent_parameters.
ENDIF.
IF START_COLUMN_SHEET1 > END_COLUMN_SHEET1.
RAISE inconsistent_parameters.
ENDIF.
IF START_ROW_SHEET2 > END_ROW_SHEET2.
RAISE inconsistent_parameters.
ENDIF.
IF START_COLUMN_SHEET2 > END_COLUMN_SHEET2.
RAISE inconsistent_parameters.
ENDIF.
CLASS cl_abap_char_utilities DEFINITION LOAD.
ld_separator = cl_abap_char_utilities=>horizontal_tab.
OPENING EXCEL FILE
IF application-header = space OR application-handle = -1.
CREATE OBJECT application 'Excel.Application'.
m_message.
ENDIF.
CALL METHOD OF APPLICATION 'Workbooks' = WORKBOOK.
m_message.
CALL METHOD OF application 'Workbooks' = workbook.
m_message.
CALL METHOD OF workbook 'Open' EXPORTING #1 = FILE_NAME.
m_message.
CALL METHOD OF APPLICATION 'Worksheets' = SHEET EXPORTING #1 = 1.
m_message.
CALL METHOD OF APPLICATION 'Worksheets' = SHEET EXPORTING #1 = 1.
m_message.
CALL METHOD OF SHEET 'Activate'.
m_message.
GET PROPERTY OF application 'ACTIVESHEET' = sheet.
m_message.
MARKING OF WHOLE SPREADSHEET
CALL METHOD OF sheet 'Cells' = h_cell
EXPORTING #1 = START_ROW_SHEET1 #2 = START_COLUMN_SHEET1.
m_message.
CALL METHOD OF sheet 'Cells' = h_cell1
EXPORTING #1 = END_ROW_SHEET1 #2 = END_COLUMN_SHEET1.
m_message.
CALL METHOD OF sheet 'RANGE' = range
EXPORTING #1 = h_cell #2 = h_cell1.
m_message.
CALL METHOD OF range 'SELECT'.
m_message.
Copy marked area (SHEET1) into Clippboard
CALL METHOD OF range 'COPY'.
m_message.
Read clipboard into ABAP
CALL METHOD cl_gui_frontend_services=>clipboard_import
IMPORTING
data = excel_tab
EXCEPTIONS
cntl_error = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE a037(alsmex).
ENDIF.
PERFORM separated_to_intern_convert TABLES excel_tab IT_DATA1
USING ld_separator.
Clear the clipboard
REFRESH excel_tab.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = excel_tab
CHANGING
rc = ld_rc
EXCEPTIONS
cntl_error = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4
Working in Second Excel Work Sheet
CALL METHOD OF APPLICATION 'Worksheets' = SHEET EXPORTING #1 = 2.
m_message.
CALL METHOD OF SHEET 'Activate'.
m_message.
GET PROPERTY OF application 'ACTIVESHEET' = sheet.
m_message.
Mark Sheet2
CALL METHOD OF sheet 'Cells' = h_cell
EXPORTING #1 = START_ROW_SHEET2 #2 = START_COLUMN_SHEET2.
m_message.
CALL METHOD OF sheet 'Cells' = h_cell1
EXPORTING #1 = END_ROW_SHEET2 #2 = END_COLUMN_SHEET2.
m_message.
CALL METHOD OF sheet 'RANGE' = range
EXPORTING #1 = h_cell #2 = h_cell1.
m_message.
CALL METHOD OF range 'SELECT'.
m_message.
Copy Marked Area (Sheet2) into Clippboard
CALL METHOD OF range 'COPY'.
m_message.
Read Clipboard into ABAP
CALL METHOD cl_gui_frontend_services=>clipboard_import
IMPORTING
data = excel_tab1
EXCEPTIONS
cntl_error = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE a037(alsmex).
ENDIF.
PERFORM separated_to_intern_convert TABLES excel_tab1 IT_DATA2
USING ld_separator.
Clear Clipboard
REFRESH excel_tab.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = excel_tab1
CHANGING
rc = ld_rc
EXCEPTIONS
cntl_error = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4
Leaving Application .
CALL METHOD OF application 'QUIT'.
m_message.
FREE OBJECT application.
m_message.
ENDFUNCTION. -
How to download data from abap-ouput to excel sheet with logo
how to download data from abap-ouput to excel sheet with standard logo
Edited by: Harish Kasyap on Nov 18, 2008 8:19 AM
Edited by: Harish Kasyap on Nov 18, 2008 8:20 AMFor saving the report you can goto System -> List -> Save -> Local File -> Location where you want to save in your presentation server.
You can also give a option in your selection screen to save the file to Presentation server using FM GUI_DOWNLOAD.
Hope it helps.
Thanks,
Jayant. -
How to read data from a zipped MS Access file?
How to read data from a zipped MS Access file?
RPJ,
You do not need to use the Close Zip File.vi when you unzip a folder. This VI is used when you are creating a zip folder.
As for examples, I found a couple of ActiveX based MS Access examples. These programs look to be pretty basic. For more in depth example I would search Microsoft Developers Network
http://zone.ni.com/devzone/cda/epd/p/id/2188
http://zone.ni.com/devzone/cda/epd/p/id/1694
Regards,
Jon S.
National Instruments
LabVIEW R&D -
Facing a Problem while downloading the data from ALV Grid to Excel Sheet
Hi Friends,
Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
Can any one help me out in this case.hi...
if this problems happens dont display the same internal as u finally got.
just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
for eg.
ur final internal int table for disp,
data : begin of itab occur 0,
matnr like mara-matnr,
end of itab.
create new like this,
data : begin of itab occur 0,
matnr(12) type N,
end of itab. -
How to convert alv list into excel file?
Hi Experts,
i have created one report for Due Date Analysis.
Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
So i need the Function Module to Convert the Data into Excel File.
Thanks,
Neptune.MHi,
U can use function module gui_download.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'C:\Transportaionlane.XLS'
filetype = 'DAT'
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TABLES
ata_tab = t_trans_lane_dis[]
OTHERS = 22
if u want with header then pass the header.
regards
Ahasan -
I cannot dowload all fields from ALV list to Excel - urgent, please help me
I developed a report and displayed in ALV list using FM 'REUSE_ALV_GRID_DISPLAY'.The list contains 200 fields.But when i am trying to download in EXCEL file from ALV list, it is unable to download all the fields from ALV list into EXCEL.
Thanks in advance,
Katta.is your list having packed decimals or any fields which are of large length (around 128 char)?
It can happen so. -
How to extract data From Hyperion Essbase to Flat Files
Hi ,
Can anyone tell me how to extract data from Hyperion essbase to Flat file(e.g. .csv , .txt ,...) or Oracle Table using ODI.
Regards,
AvneetHi sutirtha,
I have make one column as key column now i am getting this error,
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 1, in ?
com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at com.hyperion.odi.essbase.ODIEssbaseDataReader.getAppData(Unknown Source)
at com.hyperion.odi.essbase.AbstractEssbaseReader.extract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyInstance.invoke(PyInstance.java)
at org.python.pycode._pyx7.f$0(<string>:1)
at org.python.pycode._pyx7.call_function(<string>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.k(e.java)
at com.sunopsis.dwg.cmd.g.A(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
Caused by: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.validateColumns(Unknown Source)
at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.init(Unknown Source)
... 33 more
com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.k(e.java)
at com.sunopsis.dwg.cmd.g.A(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source) -
Upload data from multiple worksheets of excel file into SAP by using MIME?
Hi all,
I'm trying to getting the data from a multiple worksheet excel file by usin the MIME Repository.
First of all i realizied it like [here|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in a normal ABAP Report.
By trying to transfer the code to a WebDynpro Component, i get problems.
With this part of code, because ActiveX is not allowed in our Webbrowser. So i have to find another solution to get the data from the excel file.
CALL METHOD c_oi_container_control_creator=>get_container_control
IMPORTING
control = iref_control
error = iref_error
I tried to rebuild this solution in webdynpro. But it dont works.
So my next step was trying to Read the Excel sheet directly from MIME by getting the Content (XString).
But there is no useful information Just a mix out of '######' and other symbols.
By converting it into String the same problem.
Maybe someone has an idea how to rebuild [this code|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in Webdynpro that it works correctly.
Currently Im Using the Fileupload UI Element. All Works fine. I can Upload the Excel file to MIME Repository and i can open it from there.
But i cant get the same clear informationen from the file, to write it later in a Database, like before without webdynpro.
i hope someone can help me.
Edited by: Sascha Baumann on Apr 20, 2009 4:28 PMYou can't read the native binary Excel Format in server side ABAP. The functions and classes that did this in Classic Dynpro used OLE Automation via the SAPGUI Control Framework to remotely control Excel to read the data. Because in the browser you have no connection to the SAPGUI or are sandboxed inside the browser; the same functionality is not possible.
I would suggest that you look into saving the Excel file as a open, text format. You might be able to use XML (although the Excel XML format can be complex) to support multiple sheets. You would have to build the logic yourself (using XSLT or the iXML parser) to process the XML format back into ABAP data. -
How to get data from subsites list of SharePoint 2010 in ssrs
Hi,
Can someone help me on this issue.
I want to create a report using ssrs, I have some of the data in SQL and some of the data in sharepoint list.
First I need to go to SQL and get the data from the table which contains URL for the subsite in sharepoint.
after that I need to go to all the subsites and go to perticulat list in the subsites and get data from that list.
for example, their is a top level site "abc"
it contains sub site "123", "456","567", etc.. All this sub sites contain a list by name "Sample List", Now I need to go to that sub site list(Sample List) and get list-item column say "created By" which
is created on particular date.
in my report, I need to print the sub site "url/Title" which comes from SQL database and list-item column "Created By" of that sub site list "Sample List".
I tried using subreport inside a report by using "Microsoft SharePoint List" as a datasource, but when it comes to real time we don't know how many subsites will be created, so we can't create a datasource for each subsite site.
I guess we need to be using XML as a datasource, but how can we go to particular subsite in query while using XML, since all subsites have list with the same name ?
I appreciate your help.
Thank you,
KishoreHi Kishore,
SQL Server Reporting Services(SSRS) supports expression-based connection strings. This will help us to achieve the goal you mentioned in this case:
Create a new report
Create a Data Source in the report with the connection string like this:
http://server/_vti_bin/lists.asmx (We use static connection string instead of expression-based connection string now, as it is not supported to get fields based on expression-based connection string in design time. We will change it to be expression-based
connection string later)
Create the data set(as you have done using XML query language). Please use list name instead of GUID in the listName parameter.
Design the report(e.g. Add controls to the report)
Now, let's change the connection string to be expression-based. First, please add a parameter to the report, move this parameter to top. This parameter is used to store the sub site name.
Open the Data Source editor, set the connection string to be: ="http://server/" & Parameters!parameterCreatedInStep5.value & "_vti_bin/lists.asmx"
In the main report, pass the sub site name to the report we created above via the parameter created in step5
That is all.
Anyway, this is actually a SQL Server Reporting Service(SSRS) question. You can get better support on this question from:
http://social.technet.microsoft.com/Forums/en/sqlreportingservices/threads
For more information about Expression-Based connection string, please see:
http://msdn.microsoft.com/en-us/library/ms156450.aspx#Expressions
If there is anything unclear, please feel free to ask.
Thanks,
Jinchun Chen
Jin Chen - MSFT -
How to extract data from legacy system to source file
Hi can anyone tell me the procedute to copy data from legacy system to source files....this data needs to be moved to base tables
can any one tell me the procedure and any sample code i,e any example
Thanks & Regards
KrishYou should post your thread to ...:
http://forums.oracle.com/forums/forum.jspa?forumID=183
providing all necessary info......!!!!
Greetings...
Sim -
How to Download colours of ALV outout into Excel file ?
Hi All,
I have a requirement, Download ALV output into Excel file
but the ALV output contains colors,
I need to download as it is ALV output into Excel,
Please guide me, how to do ?
If it is not possible, Pls provide any other solution for this ?
Appreciate your valuable answers,
Thanks.
Regards,
Prasad.Hi,
Instead of ALV, ucan directly write the output to EXCEL along with the required attributes. Find the below sample code. This might solve ur problem.
Venkat.
*& Report Y_ALV_OLE
REPORT YALV_OLE.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
include ole2incl.
handles for OLE objects
data: h_excel type ole2_object, " Excel object
h_mapl type ole2_object, " list of workbooks
h_map type ole2_object, " workbook
h_zl type ole2_object, " cell
h_f type ole2_object, " font
h_c type ole2_object. " color
DATA: FILENAME LIKE RLGRAP-FILENAME.
tables: spfli.
data h type i.
table of flights
data: it_t100 like T100 occurs 10 with header line.
*& Event START-OF-SELECTION
start-of-selection.
read flights
select *
from t100
up to 100 rows
into table it_t100
where SPRSL = sy-langu .
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-007
exceptions
others = 1.
start Excel
create object h_excel 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
set property of h_excel 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 =
*'c:\kis_excel.xls' .
PERFORM ERR_HDL.
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-008
exceptions
others = 1.
get list of workbooks, initially empty
call method of h_excel 'Workbooks' = h_mapl.
perform err_hdl.
add a new workbook
call method of h_mapl 'Add' = h_map.
perform err_hdl.
tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = text-009
exceptions
others = 1.
output column headings to active Excel sheet
perform fill_cell using 1 1 1 200 'Language Key'.
perform fill_cell using 1 2 1 200 'Application Area'.
perform fill_cell using 1 3 1 200 'Message number'.
perform fill_cell using 1 4 1 200 'Message text'.
perform fill_cell using 1 5 1 200 'Dep. Time'.
loop at it_t100.
copy flights to active EXCEL sheet
h = sy-tabix + 1.
perform fill_cell using h 1 0 000145000 it_t100-SPRSL.
perform fill_cell using h 2 0 246156138 it_t100-ARBGB.
perform fill_cell using h 3 0 111230222 it_t100-MSGNR.
perform fill_cell using h 4 0 130230230 it_t100-text.
perform fill_cell using h 5 0 115115105 it_spfli-deptime.
endloop.
EXCEL FILENAME
CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
free object h_excel.
perform err_hdl.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
form fill_cell using i j bold col val.
call method of h_excel 'Cells' = h_zl
exporting
#1 = i
#2 = j.
perform err_hdl.
set property of h_zl 'Value' = val .
perform err_hdl.
get property of h_zl 'Font' = h_f.
perform err_hdl.
set property of h_f 'Bold' = bold .
perform err_hdl.
set property of h_f 'Color' = col.
perform err_hdl.
endform. "FILL_CELL
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
form err_hdl.
if sy-subrc <> 0.
write: / 'OLE-Automation Error:'(010), sy-subrc.
stop.
endif.
endform. " ERR_HDL -
FM to get Data from Sheet of an excel file to Internal table??
Hello Champs!!!
I have a problem in Excel File's Data Getting.
There are diffrent Sheets in a single Excel file. I need data of a perticular sheet into an internal Table.
Like there are 2 Sheets in an Excel file EXCEL1, Sheet1 & Sheet2. Both Sheet have diffrent Data in it.
Now i only need Data of Sheet1 of this Excel FIle Excel1.
How can i get it?
Can you please help me in this?
Thanks in Advance!!!!
Girija ShankarWelcome to SCN
Please search before you post next time:BDC, upload data from multi excel sheets -
Writing data from a table to Excel file
Hello friends,
I am using Forms 5.0 on Windows NT. I need to write data from table A to Excel sheet from trigger 'when-botton-pressed'. Could you help me Any help will be appriciated.
Thanks
Charg
nullHERE IS THE CODE.
YOU CAN RUN IT USING THE DEPT TABLE.
PROCEDURE export_transaction_to_excel IS
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
fdes varchar2(250);
rowcounter number:=1;
local_cursor_record number:=:system.cursor_record;
old_cursor_style varchar2(100);
errors_occured boolean:=false;
ole_error exception;
pragma exception_init(ole_error, -305500);
my_alert_id alert;
alert_respnse number;
procedure place_value_in_cell(rownum_in in number,colnum_in in number,value_in in varchar2) is
args ole2.list_type;
begin
args:=ole2.create_arglist;
ole2.add_arg(args,rownum_in);
ole2.add_arg(args,colnum_in);
--cell:=ole2.invoke_obj(worksheet,'Cells',args);
cell:=ole2.get_obj_property(worksheet,'Cells',args);
ole2.destroy_arglist(args);
ole2.set_property(cell,'Value',value_in);
ole2.release_obj(cell);
end place_value_in_cell;
procedure savespreadsheet is
args ole2.list_type;
vDatestamp varchar2(20);
begin
fdes:='C:\TESTFORM.XLS';
vDatestamp:=to_char(sysdate,'mmddyyyyy')| |'-'| |to_char(sysdate,'hh24miss');
args:=ole2.create_arglist;
ole2.add_arg(args,fdes);
ole2.invoke(worksheet,'SaveAs',args);
ole2.destroy_arglist(args);
ole2.invoke(application,'Quit');
end savespreadsheet;
procedure open_excel_workbook is
begin
application:=ole2.create_obj('Excel.Application');
workbooks:=ole2.get_obj_property(application,'Workbooks');
workbook:=ole2.invoke_obj(workbooks,'Add');
worksheets:=ole2.get_obj_property(application,'Worksheets');
worksheet:=ole2.invoke_obj(worksheets,'Add');
end open_excel_workbook;
procedure write_column_header is
begin
place_value_in_cell(rowcounter,1,'Depart No');
place_value_in_cell(rowcounter,2,'Depart Name');
place_value_in_cell(rowcounter,3,'Loc');
rowcounter:=rowcounter+1;
end write_column_header;
procedure export_the_data is
original_receipt number;
original_date date;
original_transmital_number number;
begin
go_block('dept');
first_record;
loop
place_value_in_cell(rowcounter,1,to_char(:deptno));
place_value_in_cell(rowcounter,2,:dname);
place_value_in_cell(rowcounter,3,:loc);
exit when :system.last_record='TRUE';
next_record;
rowcounter:=rowcounter+1;
end loop;
end export_the_data;
BEGIN
begin
old_cursor_style:=get_application_property(cursor_style);
set_application_property(cursor_style,'BUSY');
open_excel_workbook;
write_column_header;
export_the_data;
exception
when form_trigger_failure then
raise;
when ole_error then
message('error sending data to excel');
message(' ');
errors_occured:=true;
end;
savespreadsheet;
ole2.release_obj(worksheet);
ole2.release_obj(worksheets);
ole2.release_obj(workbook);
ole2.release_obj(workbooks);
ole2.release_obj(application);
if not errors_occured then
go_record(local_cursor_record);
end if;
set_application_property(cursor_style,old_cursor_style);
END export_transaction_to_excel;
Maybe you are looking for
-
Xml file error in file adapter
Hi Experts. In my sceanrio i am Using File dapter. this adapter pick the Xml file. here my client provieded sample Xml file (this Xml file don't have the Url and Xml version). I am getting mapping error. nothing is wrong with mapping. Client provede
-
Process chain failing on particular day
Hi Experts, I am new to BW.I have an issue with one of the daily running process chain. It is a time based daily running process chain and usually completes in 10mins.It is running fine from monday to saturday but on every sunday this chain is gettin
-
Hyper-V Replica Broker resource not coming online
I was trying to create a cluster broker on a cluster using WMI. I am creating the required IPv4, IPv6 network resources and adding them as a dependency on the Hyper-V replica broker resource. When trying to bring the broker online, the Hyper-V Replic
-
Where clause requiring user input
I am a complete beginner at using SQL for Oracle. I am using a program called Toad for Oracle to try and help; See I am used to using the very simple Microsoft Query to build queries. I am using Excel to use these queries for a bunch of reports, grap
-
HELP please... iPhone won't start or turn off. Apple logo only
I try to reboot the phone w/by pressing the button on top and the button on the bottom of the face of the phone. The phone will go dark then come back w/just the apple logo... it goes no where else. HELP