Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Home arrow Sample Code arrow ABAP Reports arrow Percentage Complete progress indicator
Percentage Complete progress indicator PDF Print E-mail
User Rating: / 0
PoorBest 
Written by anon.   
Saturday, 05 July 2008
REPORT  zprogind.

TYPES: BEGIN OF t_mara,
matnr LIKE mara-matnr,
END OF t_mara.
DATA: it_mara TYPE STANDARD TABLE OF t_mara INITIAL SIZE 0,
wa_mara TYPE t_mara.
DATA: mara_lines TYPE i,
gd_percent TYPE i.
 START-OF-SELECTION.

SELECT matnr
INTO TABLE it_mara
FROM mara.

CHECK sy-subrc EQ 0.
mara_lines = sy-dbcnt.
clear: gd_percent.

LOOP AT it_mara INTO wa_mara.
PERFORM progress_bar USING 'Retrieving data...'(001)
sy-tabix
mara_lines.
* WAIT UP TO 2 SECONDS.
ENDLOOP.
 
FORM progress_bar USING    p_value
p_tabix
p_nlines.

DATA: w_text(40),
w_percentage TYPE p,
w_percent_char(3).

w_percentage = ( p_tabix / p_nlines ) * 100.
w_percent_char = w_percentage.
SHIFT w_percent_char LEFT DELETING LEADING ' '.
CONCATENATE p_value w_percent_char '% Complete'(002) INTO w_text.

* This check needs to be in otherwise when looping around big tables
* SAP will re-display indicator too many times causing report to run
* very slow. (No need to re-display same percentage anyway)

if w_percentage gt gd_percent or p_tabix eq 1.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = w_percentage
text = w_text.
gd_percent = w_percentage.
endif.
endform. " PROGRESS_BAR


WRITE: /20 'Report is "Complete" OK'.
 

 
Next >

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor