Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Performance Tuning Tips for the below fetch code

SELECT bname FROM usr02 INTO TABLE lt_user where bname between '101930' and '106953'.

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

  • LANGUAGE = SY-LANGU

  • TRANSLATE_WI_TEXT = ' '

  • IM_TASK_FILTER =

  • IM_STATUS_FILTER =

  • IM_ITEM_TYPE_FILTER =

IMPORTING

  • RETURN_CODE =

worklist = lt_worklist

  • DEADLINE_ITEMS =

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.

clear employee_rec.

n = n + 1.

endloop.

ENDLOOP.

output-MT_EP001_ACTION_ITEM-SUMMARY_EMAIL_ACTION_ITEM = employee.

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.

WRITE: / 'no of records', n.

Edited by: SAMEER CHOPRA on May 18, 2009 7:37 AM

Edited by: SAMEER CHOPRA on May 18, 2009 7:40 AM

Edited by: SAMEER CHOPRA on May 18, 2009 7:41 AM

Edited by: SAMEER CHOPRA on May 18, 2009 7:52 AM

Former Member
Not what you were looking for? View more on this topic or Ask a question