Skip to Content
0
Former Member
Feb 16, 2016 at 09:36 AM

I am getting excel attachment from the proxy how to read that data into an internal table?

289 Views

hi experts,

i am getting excel attachment from proxy into ECC, i am not able to get that file into internal table please help on this,

please find the below code

l_server_context = cl_proxy_access=>get_server_context( ).

l_attachments ?=

l_server_context->get_protocol( if_wsprotocol=>attachments

).

CALL METHOD l_attachments->get_attachments

RECEIVING

attachments = li_attachments. inthis method i am getting the attachment into ECC


CALL METHOD wa_attachments->get_document_name

RECEIVING

p_name = l_excelfile.

CALL METHOD wa_attachments->get_kind

RECEIVING

p_kind = l_excelfile5 inthis i am getting kind of the document is 'B'.


CALL METHOD wa_attachments->get_binary_data " i am getting binary data inthis method into 'l_excelfl'

RECEIVING

p_data = l_excelfl

.

CALL FUNCTION 'LXE_COMMON_XSTRING_TO_STRING' when i pass to this method i am getting "#####'

EXPORTING

in_xstring = l_excelfl "p_file

IMPORTING

ex_string = l_text_data

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc NE 0.

sy-subrc = sy-subrc.

ENDIF.

so please help me on this.

thanks,

Mahesh