Hello,
I have a report program where I am sending worklists for a user to mysql database using PI interface.
Now, my report program is getting timed out with error.
I am basically using one fetch operation
SELECT bname FROM usr02 INTO TABLE lt_user.
Now bname table is corrupted and having spaces after number say "112233".
can u plz tell me why I am getting error. do i need to fetch data in chunks i.e SELECT bname FROM usr02 INTO TABLE lt_user. should be used fetch data in chunks
or error can come becuase of corrupt data.
TABLES ZIT_ERROR_TAB.
DATA WA_ZIT_ERROR_TAB TYPE ZIT_ERROR_TAB.
DATA: lt_user TYPE zuser_tt,
ls_user TYPE zuser_sty.
DATA: lt_worklist TYPE uwlitemlist,
lt_messages TYPE TABLE OF swr_messag,
lt_mess_struct TYPE TABLE OF swr_mstruc.
DATA: CREATED_TIME(22) type c,
wa_lt_worklist like line of lt_worklist,
go_sys_exception TYPE REF TO cx_ai_system_fault,
employee_data TYPE REF TO ZPI_CO_SI_EP003_ACTION_ITEM_MA,
output type ZPI_MT_EP003_ACTION_ITEM,
employee_rec type ZPI_DT_EP003_ACTION_ITEM_SUMMA,
employee type ZPI_DT_EP003_ACTION_ITEM_S_TAB,
n type i.
n = 1.
SELECT bname FROM usr02 INTO TABLE lt_user.
SORT lt_user.
DELETE ADJACENT DUPLICATES FROM lt_user.
LOOP AT lt_user INTO ls_user.
CLEAR lt_worklist.
CLEAR lt_messages.
CLEAR lt_mess_struct.
CALL FUNCTION 'SWN_UWL_GET_WORKLIST'
EXPORTING
user = ls_user-bname
IMPORTING
worklist = lt_worklist
TABLES
message_lines = lt_messages
message_struct = lt_mess_struct.
loop at lt_worklist into wa_lt_worklist.
employee_rec-USER_ID = wa_lt_worklist-USER_ID.
employee_rec-SUBJECT = wa_lt_worklist-SUBJECT.
CREATED_TIME = wa_lt_worklist-CREATED_TIME.
employee_rec-CREATED_TIME = CREATED_TIME+0(14).
employee_rec-FORWARDED_BY = wa_lt_worklist-FORWARDED_BY.
employee_rec-IDENTITY_NUMBER = n.
append employee_rec to employee.
output-MT_EP003_ACTION_ITEM-SUMMARY_EMAIL_ACTION_ITEM = employee.
clear employee_rec.
n = n + 1.
endloop.
ENDLOOP.
TRY.
CREATE OBJECT employee_data.
call method employee_data->UPLOAD_ACTION_ITEM
EXPORTING
OUTPUT = output.
commit work.
CATCH cx_ai_system_fault INTO go_sys_exception.
WA_ZIT_ERROR_TAB-message = go_sys_exception->errortext.
WA_ZIT_ERROR_TAB-code = go_sys_exception->code.
WA_ZIT_ERROR_TAB-errordate = sy-datum.
insert into ZIT_ERROR_TAB values wa_ZIT_ERROR_TAB.
ENDTRY.