‎2012 Jul 12 9:25 AM
Hi experts, i'm new in ABAP development and I have a problem.
I looked for solution in this forum but i didn't find anything to help me.
In the CRM COMMPR01 transaction, for a specific product, i uploaded an attachment (a jpg image); now i have to develop a FM to get this file in any way (such as providing me a URL to download it or giving me the binary code of my file).
Using debug and stuff like this, i found that my image is stored (clustered) in the SOFFCONT1 table and I found the correct procedure to identify all the rows of this table which contain my image... the problem is that i can't read this image because of the rappresentation format of field CLUSTD wich contains the image code.
I've read that i may use the instruction IMPORT ... FROM DATABASE but i didn't understand how to use it, so:
- in general, is there any way to get access at the attachment (FM, class or something to get URL or binary code)?
- if not, how can i get binary code of my image starting from the sum of all CLUSTD field of all the rows of SOFFCONT1 associated to my image?
Thank you so much
‎2012 Jul 16 9:28 AM
Hello you both and thank you for your answer...
FM BDS_BUSINESSDOCUMENT_GET_C_URL is not so easy to use because you have to search many parameters, even if it makes the whole process simplier. Anyway, i found a way to get simply the attached documents using the FM SO_DOCUMENT_READ_API1 as explained in the 3d http://scn.sap.com/thread/1450845.
so...
exporting
DOCUMENT_ID = lt_SRGBTBREL-INSTID_B
tables
CONTENTS_HEX = lt_CONTENTS_HEX.
lt_CONTENTS_HEX is a table which contains the binary code of the attachment divided in rows.
Thank you, see you soon.
‎2012 Jul 12 9:53 AM
Hi,
Please check the thread.
<< Link Farming Removed & points unassigned >>
Cheers
~Niranjan
Message was edited by: Kesavadas Thekkillath
‎2012 Jul 12 9:59 AM
Hi,
Have a look at function modules starting with BDS_BUSINESSDOCUMENT*
I have used fm BDS_BUSINESSDOCUMENT_CREATEF to add an attachment to a purchase requisition and it works fine.
Maybe FM BDS_BUSINESSDOCUMENT_GET_C_URL will do the trick ?
Regards,
Dirk.
‎2012 Jul 16 9:28 AM
Hello you both and thank you for your answer...
FM BDS_BUSINESSDOCUMENT_GET_C_URL is not so easy to use because you have to search many parameters, even if it makes the whole process simplier. Anyway, i found a way to get simply the attached documents using the FM SO_DOCUMENT_READ_API1 as explained in the 3d http://scn.sap.com/thread/1450845.
so...
exporting
DOCUMENT_ID = lt_SRGBTBREL-INSTID_B
tables
CONTENTS_HEX = lt_CONTENTS_HEX.
lt_CONTENTS_HEX is a table which contains the binary code of the attachment divided in rows.
Thank you, see you soon.