on 04-16-2007 2:54 PM
Hello,
I need to add an attachement (file) to a complaint, just like You normally do in transaction CRMD_ORDER.
But I want to do it programmatically (through a call to a function module or method).
Which function(method can I use for that ?
How to do it having only complaint number ? (Which tables to search for necessary data)
Code snippets would be appreciated !
The best answer will be rewarded.
DATA: ls_bor type sibflporb,
lv_bor TYPE SWO_OBJTYP,
lv_loio TYPE skwf_io,
lv_phio TYPE skwf_io,
lv_error TYPE skwf_error.
DATA: wa_result_tab TYPE string,
result_tab TYPE STANDARD TABLE OF string,
lin TYPE i,
long_nombre TYPE i,
long_total TYPE i,
desplazamiento TYPE i,
filename_aux TYPE skwf_descr.
CALL FUNCTION 'CRM_ORDERADM_H_READ_OW'
EXPORTING
iv_orderadm_h_guid = guid
IMPORTING
EV_OBJECT_TYPE = lv_bor
EXCEPTIONS
ADMIN_HEADER_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE:lv_bor TO ls_bor-typeid,
'BO' TO ls_bor-catid,
guid TO ls_bor-instid.
CALL METHOD cl_crm_documents=>create_with_file
EXPORTING
file_name = filename
directory = path
business_object = ls_bor
IMPORTING
loio = lv_loio
phio = lv_phio
error = lv_error.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDFUNCTION.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use class CL_CRM_DOCUMENTS to create attachement.
Thanks,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.