Skip to Content
0
Former Member
Oct 29, 2007 at 03:54 PM

Case attachments not displayed using PCUI CRMD_CASE

22 Views

Hi all,

We´ve developped an WDA in order to create cases in case management, using BAPI

BAPI_CASE_CREATE, developped as follows:

__________________________________________________________

call function 'BAPI_CASE_CREATE'

exporting

case_type = gc_zcas

importing

guid = lv_guid

tables

return = lt_return

case_attributes = lt_attributes

case_notes = lt_casenotes

case_note_ids = lt_casenotesid

element_identification = lt_identifi

element_insertion = lt_insertion

element_relations = lt_relations.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'.

__________________________________________________________

On this web dynpro we´ve also created a file upload field in order to attach a document to the case created previously, using method "m_insertar_adjunto".

Method call uses the following parameters:

__________________________________________________________

wd_this->m_insertar_adjunto(

guid = lv_guid

content = ls_adjunto-filecontent

filename = ls_adjunto-filename

).

method m_insertar_adjunto .

data: l_folid type soodk,

l_folderid type soobjinfi1-object_id,

l_size type i,

lt_content type table of solisti1.

data ls_content like line of lt_content.

data: ls_document_data type sodocchgi1.

data: l_doctype type soodk-objtp.

data: l_docinfo type sofolenti1.

data: lt_words type table of string,

l_token type string.

data: l_att_key type swotobjid-objkey.

check content is not initial.

call function 'SO_FOLDER_ROOT_ID_GET'

exporting

region = 'B'

importing

folder_id = l_folid

exceptions

communication_failure = 1

owner_not_exist = 2

system_failure = 3

x_error = 4

others = 5

.

l_folderid = l_folid.

call function 'SCMS_XSTRING_TO_BINARY'

exporting

buffer = content

append_to_table = 'X'

importing

output_length = l_size

tables

binary_tab = lt_content.

data: lc_word(100).

l_token = filename.

while l_token ca ''.

split l_token at '' into lc_word l_token.

endwhile.

split l_token at '.' into lc_word l_doctype.

ls_document_data-obj_name = l_token.

ls_document_data-obj_descr = 'Adjunto Caso'.

ls_document_data-obj_langu = sy-langu.

ls_document_data-doc_size = l_size.

ls_document_data-no_change = 'X'.

call function 'SO_DOCUMENT_INSERT_API1'

exporting

folder_id = l_folderid

document_data = ls_document_data

document_type = l_doctype

importing

document_info = l_docinfo

tables

object_content = lt_content

exceptions

folder_not_exist = 1

document_type_not_exist = 2

operation_no_authorization = 3

parameter_error = 4

x_error = 5

enqueue_error = 6

others = 7.

l_att_key = l_docinfo-doc_id.

data: object_a type sibflporb,

object_b type sibflporb.

object_a-instid = guid.

object_a-typeid = 'BUS20900'.

object_a-catid = 'BO'.

object_b-instid = l_att_key.

object_b-typeid = 'MESSAGE'.

object_b-catid = 'BO'.

try.

call method cl_binary_relation=>create_link

exporting

is_object_a = object_a

is_object_b = object_b

ip_reltype = 'ATTA'.

endtry.

if sy-subrc eq 0.

commit work and wait.

endif.

endmethod.

__________________________________________________________

Our problem is the following: when we ONLY use PCUI CRMD_CASE (case management) something goes wrong, because case is displayed but its attachments do not appear.

The behaviour is not the same if you display case in GUI or in PCUI; even if you enter firstly in CRM GUI and afterwards in PCUI, the behaviour changes; the possibilities are the following:

1 --> Using CRM GUI (only) case and attachments are displayed right.

2 --> Using PCUI CRMD_CASE (only) and not entering previously on CRM GUI, case is displayed right but its attachments are lost.

3 --> If you enter CRM GUI firstly to see case and attachments and entering PCUI CRMD_CASE afterwards, everything (case and attach) is displayed right.

It seems that something is refreshed in database when you enter in CRM GUI and this is exactly what allows system to show rightly in PCUI.

We don´t know how to solve the problem.

Could anybody help us to solve this issue?

Thanks in advance.

Carmen Rodriguez