Hi all, we are in the middle of an EhP 6 upgrade and ran into a MODIFY statment that is acting strange with workflow items. When the MODIFY statement runs, it updates the desired row/columns correctly but also overwrites the first few columns of the very next row in the table with the TRANSPORTING fields. Any help would be appreciated.
Here is the type for the internal table:
TYPES: BEGIN OF t_list.
INCLUDE TYPE swr_wihdr.
TYPES: key TYPE sweinstcou-objkey,
classification TYPE swlwp1-dyncol_c2,
imagepriority TYPE zfapr024_alv-imagepriority,
barcode TYPE ztwfapinvcimage-barcode,
documenttype TYPE toav0-ar_object,
documentclass TYPE toadd-doc_type,
changed(1) TYPE c,
END OF t_list.
DATA: wa_list TYPE t_list,
it_list TYPE STANDARD TABLE OF t_list
This is the function that loads the internal table:
CALL FUNCTION 'SAP_WAPI_CREATE_WORKLIST'
EXPORTING
translate_wi_text = 'X'
read_task_text = 'X'
im_task_filter = it_task
im_status_filter = it_status
IMPORTING
return_code = l_return_code
TABLES
worklist = it_list.
Then the code loads some additional information from the container and updates the work area with those fields.
LOOP AT it_list INTO wa_list .
l_tabix = sy-tabix.
CLEAR: it_container, it_all_objects.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
EXPORTING
workitem_id = wa_list-wi_id
IMPORTING
return_code = w_rc
TABLES
simple_container = it_container
subcontainer_all_objects = it_all_objects.
CHECK w_rc = 0.
CLEAR wa_all_objects.
READ TABLE it_all_objects
INTO wa_all_objects
WITH KEY element = g_c_wi_object_id.
IF sy-subrc = 0.
wa_list-key = wa_all_objects-value(42)."42 key length of ZIMAGE
ENDIF.
CLEAR: wa_container.
READ TABLE it_container
INTO wa_container
WITH KEY element = g_c_classification.
IF sy-subrc = 0.
wa_list-classification = wa_container-value.
ENDIF.
CLEAR: wa_container.
READ TABLE it_container
INTO wa_container
WITH KEY element = g_c_imagepriority.
IF sy-subrc = 0.
wa_list-imagepriority = wa_container-value.
ENDIF.
CLEAR: wa_container.
READ TABLE it_container
INTO wa_container
WITH KEY element = g_c_barcode.
IF sy-subrc = 0.
wa_list-barcode = wa_container-value.
ENDIF.
CLEAR: wa_container.
READ TABLE it_container
INTO wa_container
WITH KEY element = g_c_documenttype.
IF sy-subrc = 0.
wa_list-documenttype = wa_container-value.
ENDIF.
CLEAR: wa_container.
READ TABLE it_container
INTO wa_container
WITH KEY element = g_c_documentclass.
IF sy-subrc = 0.
wa_list-documentclass = wa_container-value.
ENDIF.
Here is the statement that causes the problem.
MODIFY it_list
INDEX l_tabix
FROM wa_list
TRANSPORTING
key
classification
imagepriority
barcode
documenttype
documentclass.