‎2010 Jan 20 9:22 AM
Hi there dear ABAP'ers,
I've got a report, something like this:
SELECT ... INTO itab .
LOOP AT itab INTO item .
... [processing item] ..
WRITE item-sometext .
ENDLOOP .
* > cumulated LOG displayed *
The effect is that I receive a program log after program is finished.
Is it possible to display part of log each time item is processed? Something like this:
SELECT ... INTO itab .
LOOP AT itab INTO item .
... [processing item] ..
WRITE item-sometext .
* > line of the LOG appended and cumulated LOG displayed *
ENDLOOP .
Maybe instead of WRITE I could use an GRID object, and each time item is processed I append a line to GRID and refresh it display. But it would be blikning probably each refresh occurs ...
Is such solution worthy of efforts? Uset wants to see which step is currently program processing. I thought about using a Process Indicator in status bar (CLOCK), bot some of steps would change quickly and user would not be able to read the text.
I will be thankful for tips. Regards. P.
‎2010 Jan 20 9:27 AM
I hope Write Statement with some messages would be better approach.
Using Process Indiactor each time will slow down the performance.
ManasM.
‎2010 Jan 20 9:27 AM
just a possibility
You can use the 'wait' statement and show the GUI progress indicator.
‎2010 Jan 20 9:30 AM
The statement WAIT causes a switch in the work process, which is linked to the rollout and rollin of all loaded programs. For this reason, the time given in sec must not be less than one second, to avoid burdening the system with too many work process switches.
‎2010 Jan 20 9:27 AM
I hope Write Statement with some messages would be better approach.
Using Process Indiactor each time will slow down the performance.
ManasM.
‎2010 Jan 20 9:55 AM
Kumar Manas Mishra
But haw could I achieve this effect?
DATA: BEGIN OF itab OCCURS 0,
item_1(50) ,
END OF itab .
DATA: line LIKE LINE OF itab .
DATA: ctr_i TYPE i .
DATA: ctr_c(3) .
ctr_i = 1 .
DO 5 TIMES .
ctr_c = ctr_i .
CLEAR line .
CONCATENATE 'This is a' ctr_c 'line of log.'
INTO line SEPARATED BY SPACE .
ctr_i = ctr_i + 1 .
APPEND line TO itab .
ENDDO .
LOOP AT itab INTO line .
WAIT UP TO 1 SECONDS.
WRITE / line-item_1 .
ENDLOOP .
In example program above I have to wait 5 seconds to see the log. And the log is cumulated. Like this:
This is a 1 line of log.
This is a 2 line of log.
This is a 3 line of log.
This is a 4 line of log.
This is a 5 line of log.
whils I would like to see each line of log immediately when item is processed, so something like that:
<after 1st second> output:
This is a 1 line of log.
<after 2nd second> output:
This is a 1 line of log.
This is a 2 line of log.
<after 3rd second> output:
This is a 1 line of log.
This is a 2 line of log.
This is a 3 line of log.
... ... ...
‎2010 Jan 20 10:12 AM
Yeah true.
But im not sure whether the user can read the log within one second.
@piotr - if there is lot of records to be processed
then time taken should be considered.
‎2010 Jan 20 10:15 AM
Try This:-
DATA: BEGIN OF itab OCCURS 0,
item_1(50) ,
END OF itab .
DATA: line LIKE LINE OF itab .
DATA: ctr_i TYPE i .
DATA: ctr_c(3) .
ctr_i = 1 .
DO 5 TIMES .
ctr_c = ctr_i .
CLEAR line .
CONCATENATE 'This is a' ctr_c 'line of log.'
INTO line SEPARATED BY SPACE .
ctr_i = ctr_i + 1 .
APPEND line TO itab .
LOOP AT itab INTO line .
WAIT UP TO 1 SECONDS.
WRITE / line-item_1 .
ENDLOOP .
ENDDO .
‎2010 Jan 20 10:26 AM
Kumar Manas Mishra
The result is that first I'm waiting few seconds and then such a log appears in one moment:
This is a 1 line of log.
This is a 1 line of log.
This is a 2 line of log.
This is a 1 line of log.
This is a 2 line of log.
This is a 3 line of log.
This is a 1 line of log.
This is a 2 line of log.
This is a 3 line of log.
This is a 4 line of log.
This is a 1 line of log.
This is a 2 line of log.
This is a 3 line of log.
This is a 4 line of log.
This is a 5 line of log.
‎2010 Jan 20 10:34 AM
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = v_percent
text = 'Processing, please wait.'.
Can we go this way?
Increase the wait time so that user can see all the logs.
‎2010 Jan 20 11:08 AM
Unfortunatelly,
client seems to want the log to be presented as a cumulated list.
‎2010 Jan 28 2:42 PM
‎2010 Jan 28 3:01 PM