Excel API in WD ABAP
Hello All,
I want to create a excel file with formatting options like color or writing some values in a particular cell inside a web dynpro application. Is there any API available like we have JExcel API for WD JAVA. I tried doing that with OLE calls but it does not create a excel from a web dynpro application ??
Hi Nirav,
Please use ALV ( ABAP List Viewer ) component to replicate excel like functionality. There are no API is available for excel in WDA.
Regards
Rohit Chowdhary
Similar Messages
-
How to read excel binary file in ABAP application server
Hi Gurus,
I have to read business partner data from the binary format of an excel file in application server. I searched in forums but only found solutions about using ole2 objects, but in ABAP application server there is no excel APIs, so I have to read binary directly. You know it is rather difficult, do you have any clues or sample function modules? Thanks!
Best regards,
HaoHi Deng,
I think there are two possible solutions:
1. Get the file created as tab-delimited or CSV as recommended earlier
2. Excel files are BIFF (Binary Interchange File Format). The Microsoft office 97 developer kit has tools for analysis and access. You may search for existing interface software or create your own ABAP code. Publish it on SDN and win great merits.
Regards,
Clemens -
How to use excel api in java?
I need to use excel api in Java to generate data in excel format. Can any one tell any of the use ful Excel api that we can down load from net? i have read about Apache's POi-hssf-Java api. But the jar i downloaaded from Apache site is not working ? Can anybody please send me the jar for taht Api ?
Hi,
In fact i was not clear about whcih jar file to download from the apache site. i found one folder structure like this
-parent
-bin
-src
All these folders contained some zip files. i took the zip files and extracted them. And i set teh class path also . But when i tried to import in java programs ,these jar files are giving compilation errors -
Problem in uploading an excel file in wd abap
I am trying to upload an excel file in wd abap but on uploading it shows me the data in the form of some codes but when i try to do the same thing using text file it works well.Plese refer the code .
METHOD onactionon_upload .
TYPES : BEGIN OF itab_str1,
name(10) TYPE c,
age(10) TYPE c,
END OF itab_str1.
DATA : t_table1 TYPE STANDARD TABLE OF itab_str1,
i_data TYPE STANDARD TABLE OF string,
lo_nd_sflight TYPE REF TO if_wd_context_node,
lo_el_sflight TYPE REF TO if_wd_context_element,
l_string TYPE string,
fs_table TYPE itab_str1,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string.
DATA : t_table TYPE if_main=>elements_data_tab,
data_table TYPE if_main=>elements_data_tab.
wd_context->get_attribute(
EXPORTING
name = 'DATASOURCE'
IMPORTING
value = l_xstring
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field index 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field index 2.
fs_table-age = lv_field.
APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB').
lo_nd_sflight->bind_table( t_table1 ).
ENDMETHOD.Problem is not with the file format nor Upload element.
problem is with conversion function module, still now for conversion of xcel data to string format we dont have perfect function module.
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
That's a bug with xcel conversion As of now I dont find any fm which converts xcel data to string without any problem.
Regards
Srinvivas
Edited by: sanasrinivas on Dec 23, 2011 7:02 AM -
Hi Colleages,
Is it possible to upload an excel file through WD ABAP?
The file upload control gives the data in XSTRING format and probably would not be of much help. What I need is the excel data uploaded to my internal table.
Also I tried using the CL_GUI_FRONTEND_SERVICES inside my action but it does not work.
Suggest any way for this.Hi Sagar,
Yesterday I tried the same with GUI_UPLOAD. Here i am putting the code will help you about my logic.
Logic:
I create 2 internal table IT_OIR0DTFKGOILAMEX & IT_OIR0DTFKGOILAMEX1.
---> Population information into internal table IT_OIR0DTFKGOILAMEX and download to file C:\TEST4.XLS.
---> Upload the same file into another internal table IT_OIR0DTFKGOILAMEX1.
---> you can check in the debug mode how the data is transferring
Here I am putting the code as follows:
DATA: IT_OIR0DTFKGOILAMEX TYPE TABLE OF alv_t_t2, " OIR0DTFKGOILAMEX,
IT_OIR0DTFKGOILAMEX1 TYPE TABLE OF alv_t_t2. " OIR0DTFKGOILAMEX." OCCURS 0.
SELECT * FROM sflight INTO corresponding fields of table IT_OIR0DTFKGOILAMEX.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:TEST4.xls'
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = IT_OIR0DTFKGOILAMEX
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh IT_OIR0DTFKGOILAMEX1[].
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:TEST4.xls'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
READ_BY_LINE = 'X'
TABLES
DATA_TAB = IT_OIR0DTFKGOILAMEX1
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Warm Regards,
Vijay -
Access data in Excel placed in OFFICE_CONTROL ABAP WB
We are using the Excel Office Control in ABAP WD. The Excel displays and I can get the excel binary data in a XString thru context binding.
However, is there a chance to access single cells of the Excel. I do not really want to deal with all the technical details but simply get some cells of the filled in Excel.
Any hints?Hi Frank,
Thanks for the pointer. I managed to find this link by myself. I was wondering if there is any other sample application that demonstrates the features of this Office Control in WDA(Like the package SWDP_TEST has all sample applications).
Anyways, thanks for the reply.
Regards
<i><b>Raja Sekhar</b></i> -
Do you know a Excel API?
Hi everybody !!!!
Do you know a good Excel API ? In fact I have some figures in my program Java. And I would like to transfer these figures in the Excel file, because I want to display some graphs with these data.
Thanks !!!Try the tool at
http://simtel.net/product.php[id]60701[sekid]0[SiteID]simtel.net
With it you can use Axcel as a regular COM object. -
How to read the excel file using webdynpro abap?
Hi,
how to read and modify excel file using webdynpro abap?
Regards,
PavaniFor reading excel file follow the steps :
1. Use a File upload UI element and bind it with xstring.
2. Now your excel will be uploaded and stored in Xstring.
3. Convert Xstring to String data using FM 'HR_KR_XSTRING_TO_STRING'.
4. Now split the string at new line so as to make an internal table .
Ex . SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE it_table.
here it_table is type table of string.
5.now loop at the internal table and separate the content of this table separated by tab.
Ex. SPLIT wa_table AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_new.
it_new type string_table.
6. For more info , refer this thread :
Re: How to upload excel file in Webdynpro application using ABAP -
Can I link excel apis to build a 64-bit applicatio​n?
Hi,
I need to use excel api's to build a 64-bit application which works for 64-bit o/s.
But, when i use these excel api's to build my 64-bit application from command line, i am getting linking errors whereas i am using the same libraries to build 32-bit application and this is being built.
So, here my doubt is that will the labwindows excel apis support for 64-bit o/s?
Please do help.
Thanks in advance.
SaferHey menchar -
You can use the new 64 bit intel template to create a 64 bit app. The documentation is incorrect. I have already filed a bug report for this.
NickB
National Instruments -
Warning while downloading an Excel file from WD ABAP
Hi folks,
In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
We achieved this with Simple Transformations.
Now the question is while downloading the excel file, the framework/other is throwing an Warning like
" The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
Note: All the users of my client are using MS Office 2002 / 2003.
I am using the following code........!
*------ Call Transformation for Excel OUTPUT
CALL TRANSFORMATION ZEXCEL_OUTPUT
SOURCE
t_dates = t_dates
t_info = t_info
RESULT XML l_xml_string.
REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>' l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
**-- Call Function Module for converting string data to XSTRING
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = l_xml_string
mimetype = 'application/xml'
IMPORTING
buffer = l_xml_xstring
EXCEPTIONS
failed = 1
OTHERS = 2.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'info.xml'
i_content = l_xml_xstring
i_mime_type = 'application/vnd.ms-excel'.
With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
Can any one help me on this -
> How to avoid this warning?
Thanks and Regards,
Aneel Danda
Edited by: danda aneel on Jul 13, 2010 1:43 PMFirstly, Thanks for Your quick Response, Thomas.
Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
Kindly provide me an alternative on this XML doesn't seem like it would match the 'application/vnd.ms-excel'.
what is the supported format.?
Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
Edited by: danda aneel on Jul 14, 2010 7:52 AM -
Create a check box in excel cell using sap abap
Dear Sap Master's,
Please give me some idea on how to create a check box in excel cell using abap program..
(OLE concept).
Thanks
Moderator message: please search for available information first.
Edited by: Thomas Zloch on Jan 12, 2012select the cell then open the cell formatter:
process should be similar in the iOS version. I do not have any iOS devices with Numbers so I cannot check. I did find this link that may help:
http://support.apple.com/kb/PH3374?viewlocale=en_US -
Reading & writing from MS Excel files in Webdynpro ABAP
Dear experts,
We have a requirement to read and write from an MS excel file in a Webdynpro ABAP based application. The application would be deployed on WAS (Web Application Server) which is running as part of SAP ECC on UNIX platform.
What is not clear is
1) If we store the MS Excel template on the server which has UNIX, will the file be recognised for reading/writing programmatically in Webdynpro ABAP? If this works, we have a requirement where the end users will download the excel template and upload the same after filling data into the excel file. The data filled into the excel has to be read and updated in the SAP backend (ECC).
2) There is an article on "Modifying Excel using WD ABAP" at the following link
https://wiki.sdn.sap.com/wiki/display/WDABAP/ModifyingexistingexcelsheetusingWDABAP
But again it is not clear whether this approach will work on Unix based SAP server (ECC WAS).
Thanks
SureshI don't know if there is an application in Unix that can read Excel files - if that is what you are asking. However that has nothing to do with this forum. If you are uploading the file to ABAP using Web Dynpro ABAP, then it doesn't matter what Operating System the server is running on. Unix, Linux, Windows - all the processing is done in ABAP and is OS independent. The actual reading of the file in ABAP involves reading either an XML or Text Tab Delimited version of the Excel file however - if you read through the links on manipulating Excel in ABAP.
-
Read large Excel cell content using ABAP class i_oi_spreadsheet
Hello,
I am trying to read an excel file using ABAP methods of interface i_oi_spreadsheet.
Unfortunetly some of my cells contain data that exceeds the 256 characters size.
To retrieve the content of the excel speadsheet, I am using method get_ranges_data.
Unfortunetly as the returned structure is of type soi_generic_table, the content of the cell is truncated to the maximum limit of 256.
Is there a way to read cells with large content ??
Thanks
Regards
Jean-PierreSame problem for me on ECC 6.0. Hope for a solution.
-
Creating Excel Using OLE through ABAP
Hi Experts,
Can anyone help me in running an abap program to give an Excel file using OLE..
Regards,
SeshadriHi 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.. -
Call front-end API from WD ABAP
Hi experts,
I'm trying to call font-end API (Destination: SAP_SSFATGUI) from webdynpro. It giving me communication_error but if i call it from ABAP its working. Pls help.Hi,
I try to call API namely ssfrfc which is provided by SAP and located in SAPGUI dir in my desktop. You also will have this API program if you installed SAPGUI. When calling this API using call function....destination 'SAP_SSFATGUI' via WebDynpro ABAP it giving me communication_error . However no problem when using normal ABAP. Below are the coding.
METHOD onactionact_exe .
DATA: ostr_output_data TYPE ssfparms-outtext,
ostr_output_data_l TYPE ssfparms-outtextlen,
crc TYPE ssfparms-ssfcrc,
lv_sysubrc type sysubrc.
call C function 'SSFVERSION'
CALL FUNCTION 'SSFVERSION' DESTINATION 'SAP_SSFATGUI'
IMPORTING
ostroutputdata = ostr_output_data
ostroutputdatal = ostr_output_data_l
crc = crc
EXCEPTIONS
communication_failure = 1
system_failure = 2.
lv_sysubrc = sy-subrc.
write:/ OSTR_OUTPUT_DATA,
/ OSTR_OUTPUT_DATA_L,
/ CRC.
Maybe you are looking for
-
How to create a jar file which is in the remote system?
Hi, I have a set of files that resides in a remote system,which have to be "jar"red. I have a firewall in between. I want to create a jar file out of the files situated in the remote system.How do i go about this process.?
-
Black screen on MacBook Pro Retina Display after installing Moutain Lion. Need Help!
My macbook pro (retina) screen went black after I installed Mountain Lion. I got a HDMI cable to another monitor and the image worked nicely there. But i cant get it back on my MacBook Pro! I tried taking out the HDMI cable, restarting, searching on
-
Please tell me how to edit my iTunes account info. The we're charges from iTunes on my husband's company credit card. I can't tell by the amount if they were mine that were supposed to go on my card. There's just a total charge and not a detailed
-
Hi all, I am trying to create a DC webservice, while creating the stateless session bean in package, I am getting the error "Not able to create session bean". How can I solve this issue? Basically the problem is with the ejb-jar.xml. Thanks Vivek
-
Account balance £0.38 ! Unable to change stores !
I left England last month . I want to change my store back to Singapore . But my account balance was £0.38 . It doesn't allowed me to. Change unless I finish it . How am I able to spend £0.38? This is ridiculous