Limit Progress Indicator Updates

Fixed an issue with the progress indicator updates, where updates of the progress indicator would flush the message queue of SAP GUI and cause a GUI crash or hang.
The problem is described in SAP note #2084109 and seems to occur for large repositories (especially after installing SAP GUI 7.50 PL6)
This commit is contained in:
Michael Käsemann 2018-07-05 13:55:59 +02:00
parent ade1b4819c
commit 28a1554526
2 changed files with 40 additions and 6 deletions

View File

@ -21,7 +21,10 @@ CLASS zcl_abapgit_progress DEFINITION
!iv_current TYPE i !iv_current TYPE i
RETURNING RETURNING
VALUE(rv_pct) TYPE i . VALUE(rv_pct) TYPE i .
PRIVATE SECTION. private section.
data MV_CV_TIME_NEXT type SY-UZEIT .
data MV_CV_DATUM_NEXT type SY-DATUM .
ENDCLASS. ENDCLASS.
@ -53,13 +56,30 @@ CLASS ZCL_ABAPGIT_PROGRESS IMPLEMENTATION.
METHOD show. METHOD show.
DATA: lv_pct TYPE i. DATA: lv_pct TYPE i.
DATA: lv_time TYPE t.
CONSTANTS: c_wait_secs TYPE i VALUE 2.
lv_pct = calc_pct( iv_current ). lv_pct = calc_pct( iv_current ).
GET TIME.
lv_time = sy-uzeit.
IF mv_cv_time_next IS INITIAL AND mv_cv_datum_next IS INITIAL.
mv_cv_time_next = lv_time.
mv_cv_datum_next = sy-datum.
ENDIF.
"We only do a progress indication if enough time has passed
IF lv_time >= mv_cv_time_next AND sy-datum = mv_cv_datum_next OR
sy-datum > mv_cv_datum_next.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING EXPORTING
percentage = lv_pct percentage = lv_pct
text = iv_text. text = iv_text.
mv_cv_time_next = lv_time + c_wait_secs.
ENDIF.
ENDMETHOD. ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -14,6 +14,20 @@
<FIXPT>X</FIXPT> <FIXPT>X</FIXPT>
<UNICODE>X</UNICODE> <UNICODE>X</UNICODE>
</VSEOCLASS> </VSEOCLASS>
<DESCRIPTIONS>
<SEOCOMPOTX>
<CLSNAME>ZCL_ABAPGIT_PROGRESS</CLSNAME>
<CMPNAME>MV_CV_DATUM_NEXT</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>Date or Earliest, Next Progress Display</DESCRIPT>
</SEOCOMPOTX>
<SEOCOMPOTX>
<CLSNAME>ZCL_ABAPGIT_PROGRESS</CLSNAME>
<CMPNAME>MV_CV_TIME_NEXT</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>Time of Earliest, Next Progress Display</DESCRIPT>
</SEOCOMPOTX>
</DESCRIPTIONS>
</asx:values> </asx:values>
</asx:abap> </asx:abap>
</abapGit> </abapGit>