cancel
Showing results for 
Search instead for 
Did you mean: 

Excel with contents in web dynpro for ABAP application

Former Member
0 Kudos

Hi Experts,

I have excel file (example "http://xxxx/test.xls") with contents in remote system. 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

I wrote code the following code in WDDOMODIFYVIEW method.

data : content TYPE xstring,

url TYPE string VALUE 'http://xxx/test.xls'.

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = url

IMPORTING

BUFFER = content .

wd_context->set_attribute( name = 'DATAS' value = content ).

while running my application, I getting excel without contents and with one message "SAP IOS". Please suggest how to display excel with contents in view of my application.

Can any one help me.....

Thanks & Regards

Sridhar

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Experts,

>

>

> CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

> EXPORTING

> text = url

> IMPORTING

> BUFFER = content .

>

>

> Thanks & Regards

> Sridhar

I think you are overestimating the power of the SCM_STRING_TO_XSTRING function module. By supplying a URL as the value of the input text, it isn't going to magically go read the content from the remote location and convert that to a binary string. It is going to take whatever value you supply in th importing TEXT parameter convert that to binary. In other words it is literally converting the string http://xxx/test.xls to binary. You will need some other mechanism to read the content from the remote location into ABAP memory before you can process it. You will need to use the CL_HTTP_CLIENT class or call some sort of web service to retrive the content.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You have to open a document

see web dynpro component IOS_TEST_HELLOWORLD_MS for detail

data:

office type ref to cl_wd_view_element,

factory type ref to IF_IOS_FACTORY,

document type ref to IF_IOS_DOCUMENT.

office ?= view->get_element( 'GENERIC_OFFICE' ).

factory ?= office->_method_handler.

factory->get_document_proxy( IMPORTING proxy = document ).

document->opendocument( ).

Abhi