on 04-07-2011 6:53 AM
Hi,
I am trying to create attachment in a transaction type using cl_crm_documents->create_with_file. But it is not creating the same, instead gives error "Error loading file &".
I am uploading a file with fields object_id, text, file name, description and category.
I have passed the parameters as follows:
data: gref_obj type ref to cl_crm_documents.
create object gref_obj.
gw_prop_attr-name = 'BDS_KEYWORD'.
gw_prop_attr-value = gw_attach-category.
append gw_prop_attr to gt_prop_attr.
gs_business_object-instid = gw_guid-guid.(object guid)
gs_business_object-typeid = gv_object_type.(object type)
gs_business_object-catid = 'BO'.
call method gref_obj->create_with_file
exporting
file_name = gw_attach-f_name (name as provided in my uploaded file, in my case it is test)
directory = p_floder (C:\Attachment\)
properties = gt_prop_attr
business_object = gs_business_object
importing
phio = gs_phio_id
loio = gs_loio_id
error = ls_error.
Please help me on this. I doubt the directory that I am giving is wrong.
Thanks.
You marked your question as closed but unanswered. It seems to me that the primary inquiry was answered. The class and method you are trying to use is for SAPGUI usage only. Remember that you are in a web browser and don't have direct access to the client machine. You can't just specify c:\filename. Uploads must be done via the FileUpload UI element or the ACFUpDownload (7.01 and higher) UI Element.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.