‎2006 Feb 07 4:10 PM
Hi everyone:
I have a abap program, where a loop returns this dump:
Nach einer bestimmten Zeit wird das Programm abgebrochen, um den
Arbeitsbereich für einen anderen wartenden Benutzer zu räumen.
Damit soll verhindert werden, daß ein Arbeitsbereich z.B. durch
- Endlosschleifen (DO, WHILE, ...),
- Datenbankzugriffe mit großer Ergebnismenge,
- Datenbankzugriffe ohne geeigneten Index (full table scan)
unnötig lang blockiert wird.
Die maximale Laufzeit eines Programms wird vom Systemprofilparameter
"rdisp/max_wprun_time" begrenzt. Die aktuelle Einstellung ist
600 Sekunden. Nach Überschreiten dieser Zeitgrenze wird versucht,
ein evtl. laufendes SQL-Statement abzubrechen bzw. dem ABAP-Prozessor
signalisiert, das laufende Programm abzubrechen. Danach wird nochmals
max. 60 Sekunden gewartet. Falls danach das Programm immer noch aktiv
ist, wird der Work-Prozeß durchgestartet.
erfolgreicher Bearbeitung nicht sofort abgebrochen wird, steht dem
Programm nochmal die Zeit von 600 Sekunden zur Verfügung.
Die maximale Laufzeit eines Programms beträgt dadurch mindestens den
doppelten Wert des Systemprofilparameters "rdisp/max_wprun_time".
Any idea about this?
Thanks.
Eduardo Campos.
‎2006 Feb 07 4:15 PM
It seems that the time limit for the dialog process has expired. This is a system wide setting. You can either choose to run your program in background process, or we can see if there is anyway to speed it up. Can you please post the code of the program? Also, point out where you think it is spending most of the time.
Regards,
Rich Heilman
‎2006 Feb 07 4:14 PM
hi,
as per settings the maximum time allowed for the program to run in foreground is 10 Minutes(600 seconds)..as the loop is taking longer time than that..schedule the job in the background and after it is completed check the result
regards
Sai easwar
‎2006 Feb 07 4:25 PM
‎2006 Feb 07 4:27 PM
‎2006 Feb 07 4:15 PM
It seems that the time limit for the dialog process has expired. This is a system wide setting. You can either choose to run your program in background process, or we can see if there is anyway to speed it up. Can you please post the code of the program? Also, point out where you think it is spending most of the time.
Regards,
Rich Heilman
‎2006 Feb 07 4:19 PM
Hi
If you're loopin an internal table you can try to change the type, for example try to use a SORTED TABLE instead of STANDARD TABLE.
Max
‎2006 Feb 07 4:29 PM
Hi Rich:
This is the code, i think that in this perform PERFORM f_obtener_plan_vigente USING lv_progc_var
lv_objid_st
CHANGING
lv_objid_sc.
spending most time sorry by the Spanish words.
FORM f_llenar_tabla_faltas .
DATA: lv_faltas_just TYPE zcm_cab_ina-faltas,
lv_progc_var TYPE hrp1738-progc_var,
lv_objid_sc TYPE piqscobjid,
lv_objid_st TYPE piqstudent,
lv_materia TYPE hrp1001-sobid,
lv_mess(100),
lv_plan_short TYPE hrp1000-short,
v_tabix LIKE sy-tabix,
v_lin TYPE i,
v_cont TYPE i.
v_lin = 3000.
v_cont = 1.
Buscar, el plan de estudio, id del alumno y las faltas justificadas *
para hacer el update o insert en la tabla zcm_cab_ina
LOOP AT gt_total_faltas INTO ga_total_faltas.
v_tabix = sy-tabix.
loop vacio cada 5000 mi registros para evitar el timeout.
IF v_tabix > v_lin.
v_cont = v_cont + 1.
v_lin = v_lin * v_cont.
LOOP AT i_vacia.
ENDLOOP.
ENDIF.
Buscar si tiene faltas justificadas.
READ TABLE gt_faltas_just
WITH KEY matricula = ga_total_faltas-matricula
plan_estudio = ga_total_faltas-plan_estudio
anio = ga_total_faltas-anio
periodo = ga_total_faltas-periodo
materia_id = ga_total_faltas-materia_id
INTO ga_faltas_just.
IF sy-subrc = 0.
lv_faltas_just = ga_faltas_just-faltas.
ELSE.
lv_faltas_just = 0.
ENDIF.
Obtener la clase de programa de la materia.
SELECT SINGLE progc_var
INTO lv_progc_var
FROM hrp1738
WHERE plvar = gc_plvar AND
otype = gc_sm AND
objid = ga_total_faltas-materia_id AND
endda >= sy-datum.
IF sy-subrc = 0.
Obtener el id del estudiante
PERFORM f_obtener_id_estudiante USING ga_total_faltas-matricula
CHANGING lv_objid_st.
CHECK lv_objid_st NE 0.
Obtener el plan de estudios vigente para la clase de programa
de la materia.
PERFORM f_obtener_plan_vigente USING lv_progc_var
lv_objid_st
CHANGING lv_objid_sc.
IF lv_objid_sc NE 0.
Obtener el short del plan de estudios.
SELECT SINGLE short
INTO lv_plan_short
FROM hrp1000
WHERE plvar = gc_plvar AND
otype = gc_sc AND
objid = lv_objid_sc AND
endda >= sy-datum.
Validar si la materia si pertence al plan de estudios
regresado.
SELECT SINGLE sobid
INTO lv_materia
FROM hrp1001
WHERE otype = gc_sc AND
objid = lv_objid_sc AND
plvar = gc_plvar AND
rsign = gc_rsign AND " A
relat = gc_relat AND " 500
sclas = gc_sm.
IF sy-subrc = 0.
PERFORM f_actualizar USING ga_total_faltas
lv_plan_short
lv_objid_st
lv_objid_sc
lv_faltas_just.
ELSE.
lv_mess = 'La materia no pertences al plan vigente'.
PERFORM f_genera_log
USING ga_total_faltas-matricula
ga_total_faltas-materia_id
ga_total_faltas-anio
ga_total_faltas-periodo
lv_mess.
ENDIF.
ELSE.
lv_mess = 'El estudiante no tiene un plan vigente'.
PERFORM f_genera_log
USING ga_total_faltas-matricula
ga_total_faltas-materia_id
ga_total_faltas-anio
ga_total_faltas-periodo
lv_mess.
ENDIF.
ELSE.
lv_mess = 'No existe clase de plan para la materia'.
PERFORM f_genera_log
USING ga_total_faltas-matricula
ga_total_faltas-materia_id
ga_total_faltas-anio
ga_total_faltas-periodo
lv_mess.
ENDIF.
ENDLOOP.
Regards.
‎2006 Feb 07 4:32 PM
‎2006 Feb 07 4:43 PM
This is the code:
FORM f_obtener_plan_vigente USING p_lv_progc_var
p_lv_objid_st
CHANGING p_lv_objid_sc.
DATA: lv_is_student TYPE hrobject,
lt_et_program_info TYPE STANDARD TABLE OF piqmrproginfo,
lt_et_segment TYPE STANDARD TABLE OF piqstudysegment,
la_et_program_info TYPE piqmrproginfo,
la_et_segment TYPE piqstudysegment,
lv_vigente(1),
lv_contador TYPE i,
lv_objid_sc TYPE piqscobjid.
CLEAR: lt_et_program_info, lt_et_segment.
REFRESH: lt_et_program_info, lt_et_segment.
Ejecutar la funcion HRIQ_STUDENT_MODREG_PROGS_GET para obtener los
planes de estudio del estudiante.
lv_is_student-plvar = gc_plvar.
lv_is_student-otype = gc_st.
lv_is_student-objid = p_lv_objid_st.
CALL FUNCTION 'HRIQ_STUDENT_MODREG_PROGS_GET'
EXPORTING
is_student = lv_is_student
IV_KEYDATE =
IV_PERYR =
IV_PERID =
IMPORTING
EV_LEADING_PROGRAM =
TABLES
et_program_info = lt_et_program_info
et_segment = lt_et_segment
ET_ADMISSION =
ET_REGISTRATION =
ET_STUDIES =
EXCEPTIONS
MISSING_OBJECT = 1
NO_DATA_FOUND = 2
PLVAR_NOT_FOUND = 3
OTHERS = 4
.
IF sy-subrc = 0.
lv_contador = 0.
LOOP AT lt_et_program_info INTO la_et_program_info
WHERE progc_var = p_lv_progc_var.
Validar vigencia del plan.
LOOP AT lt_et_segment INTO la_et_segment
WHERE plvar = gc_plvar AND
st_objid = p_lv_objid_st AND
cs_objid = la_et_program_info-cs_objid AND
sc_objid = la_et_program_info-sc_objid AND
endda >= sy-datum.
IF la_et_segment-endda >= sy-datum.
lv_vigente = 'X'.
lv_objid_sc = la_et_segment-sc_objid.
CONTINUE.
ENDIF.
ENDLOOP.
Si el plan es vigente incrementar en uno el contador.
IF lv_vigente = 'X'.
lv_contador = lv_contador + 1.
lv_vigente = ' '.
ENDIF.
ENDLOOP.
Validar que solo haya salido un plan vigente.
IF lv_contador = 1.
p_lv_objid_sc = lv_objid_sc.
ELSE.
lv_objid_sc = 0.
ENDIF.
ELSE.
"Mensaje de error.
ENDIF.
‎2006 Feb 07 4:49 PM
Yuou might try:
sort gt_faltas_just by matricula plan_estudio anio periodo materia_id.
LOOP AT gt_total_faltas INTO ga_total_faltas.
...
READ TABLE gt_faltas_just
WITH KEY matricula = ga_total_faltas-matricula
plan_estudio = ga_total_faltas-plan_estudio
anio = ga_total_faltas-anio
periodo = ga_total_faltas-periodo
materia_id = ga_total_faltas-materia_id
BINARY SEARCH
INTO ga_faltas_just.
...
ENDLOOP.
‎2006 Feb 07 4:50 PM
So do you think that it is spending most of its time in the function module call, or the nested loop below.
About how many records are present in each interal table after the function call.
LOOP AT lt_et_program_info INTO la_et_program_info
WHERE progc_var = p_lv_progc_var.
* Validar vigencia del plan.
LOOP AT lt_et_segment INTO la_et_segment
WHERE plvar = gc_plvar AND
st_objid = p_lv_objid_st AND
cs_objid = la_et_program_info-cs_objid AND
sc_objid = la_et_program_info-sc_objid AND
endda >= sy-datum.
IF la_et_segment-endda >= sy-datum.
lv_vigente = 'X'.
lv_objid_sc = la_et_segment-sc_objid.
CONTINUE.
ENDIF.
ENDLOOP.
* Si el plan es vigente incrementar en uno el contador.
IF lv_vigente = 'X'.
lv_contador = lv_contador + 1.
lv_vigente = ' '.
ENDIF.
ENDLOOP.
Regards,
Rich Heilman
‎2006 Feb 07 4:55 PM
‎2006 Feb 07 5:02 PM
I think that function CALL FUNCTION 'HRIQ_STUDENT_MODREG_PROGS_GET'
is the cause.
‎2006 Feb 07 5:04 PM
‎2006 Feb 07 5:11 PM
‎2006 Feb 07 5:17 PM
Hi Rich:
The program have writes how can I see this message, when i run this like a job? is there a way or i need to change the program?
‎2006 Feb 07 5:22 PM
‎2006 Feb 07 7:25 PM
OK - that's probably not it then. Have you done a runtime analysis (SE30) to pinpoint the bottleneck?
Rob
‎2006 Feb 07 9:33 PM
Hi Rob:
I run the program in background, in this way it doesn't return a error, I make some change to the code with your suggestions, I put some points to you by this.
Thanks & regards.
Eduardo
‎2006 Feb 07 9:39 PM
It'd probably still be a good idea to do the runtime analysis. Even if it's run in the background, if it runs a long time and uses a lot of resources, it can slow down other processes.
Rob