on 08-25-2008 11:50 AM
Hi Experts,
I have excel file (example "http://xxxx/test.xls") with contents. I want to incorporate this excel file into my web dynpro application. For this I used Officecontrol UI element and set the following properties for Officecontrol
1. datasource : binding with context attribute DATAS(xstring)
2. document type : ms_excel
Please suggest how to display excel with contents in view of my application.
Can any one help me.....
Thanks & Regards
Sridhar
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
go through this link it will solve your query.
http://www.saptechnical.com/Tutorials/WebDynproABAP/Export/toexcel.htm
Edited by: anand prakash rai on Oct 23, 2008 10:58 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use the web dynpro component IOS_TEST_HELLOWORLD_MS as example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
I have a file 'https://sap.com/.../test.xls', this file is opening through web browser. I need to convert the excel contents to binary format. Please tell me the step to do.
required the following values from excel:
Input length , file line, last line, binary format
Please help me...
Thanks
Sridhar
>
> Hi Thomas,
>
> I have a file 'https://sap.com/.../test.xls', this file is opening through web browser. I need to convert the excel contents to binary format. Please tell me the step to do.
>
> required the following values from excel:
> Input length , file line, last line, binary format
>
> Please help me...
>
> Thanks
> Sridhar
I fail to see how this is connected and I believe that the question has strayed pretty far from the Web Dynpro ABAP topic.
>I need to convert the excel contents to binary format
Excel already is binary format. What exactly are you trying to do here?
>> Input length , file line, last line, binary format
Not sure what you mean by this. Once you have the content in a binary string you can just do a xstrlen command on it to get the input length. Why do you you need the file line and last line? What do you even mean by binary format?
Hi Thomas,
Thanks for your time. Here my requirement is ..
I have an excel file "http://sdn.sap.com/test.xls" , I can open this file through web browser without any authorizations ( i.e open to all).
I need to show this excel file in web dynpro application, for this I used officecontrol UI element. Please suggest the right way...
I saw few web dynpro applications like "IOS_TEST_SPREADSHEET_MS", but here excel file is available in MIME repository. so the following code is used
mime_repository = cl_mime_repository_api=>get_api( ).
CALL METHOD mime_repository->get
EXPORTING
i_url = url
IMPORTING
e_content = content.
Instead of this code what I have to do...
Please help me.....
Thanks
Sridhar
I have already given a suggestion for a solution to this exact problem that you described. Instead of using mime_repository->get to read the binary content from the MIME repository you would use the CL_HTTP_CLIENT class to read the content from the remote URL. Once you have read the content all the remaining processing is the same.
>
> Hi Thomas,
>
> Even I used the method...cl_http_client=>create_by_url and I'm getting content value is null.
>
> Thanks
> Sridhar
I'm not sure what you want. This class does work and when used correctly will retrive the file content from the Remote URL if the URL truely requires no authentication. I would have to assume that you are doing something wrong.
Hi Thomas,
Please correct me, If I did wrong coding
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = url
IMPORTING
client = client.
here client value is getting
client->request->set_header_field( name = '~request_uri'
value = url ).
client->request->set_header_field( name = '~request_method'
value = 'GET' ).
here content is null getting
content = client->response->get_data( ).
Thanks
Sridhar
The coding looks like you are missing the client->send( ). command. You have to issue this before you can call the response->get_data. You are never actually performing the HTTP GET.
If problems persist after this correction you can trace the HTTP connection and see if you are getting an error. Make sure that proxy settings (which would already be maintained in your browser, but generally aren't set in transaction SICF in most ABAP systems) aren't needed to access the URL. Also you may find that some authentication is actually needed.
Hi Thomas,
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = url
IMPORTING
client = client.
*here client value is getting
client->request->set_header_field( name = '~request_uri'
value = url ).
client->request->set_header_field( name = '~request_method'
value = 'GET' ).
ALL METHOD CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
CALL METHOD CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3.
content = client->response->get_data( ).
After execution of client->receive method .. raising http_communication_failure exception.
Please help me out..
Thanks
Sridhar
As I said in my previous post, check the HTTP trace logs for more details. An HTTP communication failure would seem to indicate either your URL is incorrect, authentication is needed, or proxy settings are needed. You will have to look at the logs to see more details as to the cause of the exception.
>
> Hi Thomas,
>
> i need great help from u, that is i have an excel sheet containing data (suppose 2 fields) and i need to upload it to an internal table using webdynpro abap.can u help me by giving an example.
>
> Have a nice day.
> waiting for your reply
> thanks.
> raja reddy
First of all it is against the SCN Forum rules of engagment to post new unrelated questions into an existing thread. Your question is for uploading a Excel sheet and this forum post was for displaying an Excel sheet within WDA - two very different things. You should post your question as a new thread. However before you do that, you should search SCN and this forum for solutions, as this question has been asked and answered several times already.
Thanks for the reply, Thomas. Soooo, can you throw me a bone? I want to upload the file from a local drive or intranet folder and display it in the office_control. (I'm new to ABAP Web Dynpro...guess you can tell). I could not find an example for doing this combination. Most examples seem to deal with the MIME repository.
Thanks.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.