on 10-01-2009 10:51 AM
Hi All
I am doing a scenario where my requirement is that some excel file is coming in mail as an attachment and PI need to pick that file in attachment and than data into excel need to be inserted into ECC through Proxy.
can anybody suggest me how to proceed with this requirement?
Thanks in advance
Regards
sandeep sharma
Hi,
In the Sender mail adapter, use Message protocol = XIPAYLOAD and check "Keep attachments" checkbox. This will transfer the Excel as additional payload as a HEX stream.
Then in your proxy you can read the attachment you the standard methods available.
Please refer to http://help.sap.com/saphelp_nwpi71/helpdata/EN/a7/3b2a2d45a34a23b75e3b18745c63bc/content.htm.
I have not tried this so I don't have code for this but this should definitely work. Please try and post the outcome.
Regards,
Vikas
Edited by: Vikas Aggarwal on Oct 1, 2009 3:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
1. You need to import the ximail_xsd from service marketplace and use it as your data type , fo reading the data from mail into your XI.
2. As suggested above check the keep attachements option in ID configuration.
3. Now when this data comes into your abap proxy, using some standard methods you need to read this data.
Check this blog for refrence on how to read attachements in proxy.
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
Hope this helps.
Regards,
Siddhesh S.Tawate
Edited by: siddhesh tawate on Oct 1, 2009 12:57 PM
Hi experts
please provde more inputs in this regards....
Regards
sandeep sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please follow below steps:
1. Download ximail30_xsd.xml from service market place. Import this as external definition in IR. This will act as sender data type
2. Create Data type for receiver side (proxy).
3. Do all the necessary configs as usual.
4. Create proxy in ECC.
5. In ID configs for mail sender channel check the keep attachements option.
Now inside proxy take refrence of the example code below and the above blog link.
Data: lr_attachments TYPE REF TO if_wsprotocol_attachments,
lr_server_context TYPE REF TO if_ws_server_context,
lt_attach TYPE prx_attach,
l_xstring type xstring,
l_type type string,
l1_string type string,
file_type(3) type c,
file_name type string,
l_name type string,
l_attachment TYPE REF TO if_ai_attachment.
lr_server_context = cl_proxy_access=>get_server_context( ).
lr_attachments ?=
lr_server_context->get_protocol( if_wsprotocol=>attachments ).
lt_attach = lr_attachments->get_attachments( ).
loop at lt_attach into l_attachment.
l_type = l_attachment->GET_CONTENT_TYPE( ).
split l_type at '"' into l_type
file_name
l_name.
l_name = file_name.
split file_name at '.' into file_name
file_type.
l_xstring = l_attachment->GET_BINARY_DATA( ).
endloop.
Hope this helps.
Regards,
Siddhesh S.Tawate
Before proceedings ,please note that there is no content handler will be available for Excel by default i.e attachment data read cannot be converted into XML for processing ,May be you need to look for CSV file instead of EXCEL if possible
other wise need to proceed with developing new module for handling the excel ...
and need to configure the same at mail sender channel module
HTH
Rajesh
User | Count |
---|---|
94 | |
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.