on 04-08-2010 2:22 PM
Hi Experts!
I have a problem with the attach documents in opportunities.
I need to get the XLS attached in a opportunity and put it in a server directory for be consumed by a legacy system. But when i try to get it with the method cl_crm_documents=>get_whit_table i get a binary table
CALL METHOD cl_crm_documents=>get_with_table
EXPORTING
* loio = ls_loios
phio = ls_phios
text_as_stream = 'X'
IMPORTING
file_access_info = lt_file_inf
file_content_ascii = lt_file_ascii
file_content_binary = lt_file_bin
* error =
* bad_ios =
.
but i can't reconstruct the XLS file in the server. i try with this ( among thousand other things ) but is not working =(
open DATASET 'data.xls' for output in TEXT MODE ENCODING *?* .
LOOP AT lt_file_bin into ls_file_bin.
lv_string = ls_file_bin-line .
TRANSFER lv_string to 'data.xls' .
CLEAR ls_file_bin.
ENDLOOP.
CLOSE DATASET 'data.xls'.
Can you help me?
Thanks!
Don't you have to now the mime type before you read the files?
Can you not use FM CRM_PPM_GET_ATTACHMENT_IL ? - This is to retrieve attachments from opportunities.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This FM only give me the info and the URL for the document, not the document itself. My requirement is put the file into the server. even the path for the file can help me, so if you know how to get it please tell me about it. The method get_with_table returns in the info file_type = B, i think this is the problem but i don't know how change it .
Best regards
Hi Martin,
Convert the binary data to a XSTRING and then do file transfer to application server in BINARY mode.
Refer to my article below, which has solution for your problem-
Get the files attached to CRM Transactions (Activity, Opportunity, Lead etc.,) and upload them to application server
http://divulgesap.com/blog.php?p=MTI2
Hope it helps.
Regards,
Ravikiran
Edited by: Ravikiran C on Apr 17, 2010 4:14 AM
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.