Display progress bar in the sap gui Status Bar

Source: Internet
Author: User
Tags sap gui

The SAP standard progress indicator is implemented by calling the function module sapgui_progress_indicator. It is displayed as a running clock with instructions. However, some users think that the clock is not easy to read and want to use the traditional Windows progress bar. belowProgramIt is the progress bar simulated by characters. However, I think this progress bar is not as good as the clock:-P.

Note: Because the simulated characters belong to the Unicode Character Set, this program can only display the progress bar in the Unicode system. In non-Unicode systems, these characters are displayed as "#".

Programs that display progress are basically encapsulated in a sub-program. You can also encapsulate the program into a function module by yourself and add other user messages.

 

 Code 
*&---------------------------------------------------------------------*
*& Report zprogressbar
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

Report zprogressbar.

Do 100 Times.
Perform show_progressbar using SY - Index.
Wait up 1 Seconds.
Enddo.
Message ' Finished! ' (FIN) Type ' S ' .

*&---------------------------------------------------------------------*
*& Form show_progressbar
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
* --> PCT text
*----------------------------------------------------------------------*
Form show_progressbar using upct type I.

Data: fbar Type C Length 13 ,
Fmsg Type C Length 70 .

Constants: percent1 Type C value ' Bytes ' ,
Percent2 Type C value ' Bytes ' ,
Percent3 Type C value ' Bytes ' ,
Percent4 Type C value ' Bytes ' ,
Percent5 Type C value ' Bytes ' ,
Percent6 Type C value ' Bytes ' ,
Percent7 Type C value ' Bytes ' ,
Percent8 Type C value ' Bytes ' .

Data: fmod type N,
Ftim type I,
Ffield Type C Length 10 ,
Fidx Type C Length 3 .

Field - Symbols: < FS > Type C.

Ftim = Upct Div 8 .
Fmod = Upct mod 8 .
Clear: fbar.
Do ftim times.
Concatenate fbar percent8 into fbar.
Enddo.
If fmod ne 0 .
Concatenate ' Percent ' Fmod into Ffield.
Assign (Ffield) < FS > .
Concatenate fbar < FS > Into fbar.
Endif.
Fidx = Sy - Index.
Concatenate fbar fidx ' % ' Into fmsg.

Call Function ' Sapgui_progress_indicator '
Exporting
Percentage = Upct
Text = Fmsg.
.
Endform. " Show_progressbar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.