Reputation: 13
I have a problem while using a loop on function module pt_arq_reqlist_get
and parameter IM_Command = 'show_reqlist'
to get all requests for all employees, it's about 3000 employees and I'm looping , problem is that the delay in response if I loop 100 employees it takes about 5 minutes, and when it's 1000 there's no response with time out after 15 minutes. My question is how to handle this bad performance? Or any way else?
Code:
REPORT YEH_TEST_LEAVE.
TYPE-POOLS: SLIS.
TABLES: PA0006,PERNR,
YEH_TEMP_LEAVES.
DATA: MESSAGES TYPE PTARQ_UIA_MESSAGES_TAB,
IM_TEAM TYPE HROBJECT,
IM_DEBUG TYPE BOOLEAN,
EX_AS_OF_DATE TYPE SY-DATUM,
EX_COMMANDS TYPE PTARQ_UIA_COMMAND_TAB,
REQ_LIST TYPE PTARQ_UIA_REQLIST_TAB,
REQ_WA TYPE PTARQ_UIA_REQLIST_STRUC.
DATA: track type YEH_TEMP_LEAVES.
SELECT-OPTIONS: XCode1 FOR PERNR-PERNR.
START-OF-SELECTION.
loop at XCode1.
CALL FUNCTION 'PT_ARQ_REQLIST_GET'
EXPORTING
IM_PERNR = XCode1-LOW
IM_TEAM = IM_TEAM
IM_COMMAND = 'SHOW_REQLIST'
IM_MODUS = 'A'
IMPORTING
EX_REQUEST_LIST = REQ_LIST
EX_AS_OF_DATE = EX_AS_OF_DATE
TABLES
EX_MESSAGES = MESSAGES
EX_COMMANDS = EX_COMMANDS.
WRITE: / XCode1-SIGN,
XCode1-option,
XCode1-low,
XCode1-high.
endloop.
Upvotes: 1
Views: 67
Reputation: 10621
Try to use parallel processing technique.
Schematic structure of your program would be:
On step 2 you must split your 3000 employees into appropriate slices and play with the size of the slize to achieve smooth and fast execution.
Upvotes: 0