2006 Jun 05 9:08 AM
Hi all,
I am running a report with selection screens. I created a 'REFRESH' button. If i press that button, the report shud be refreshed for the same selection screen but without going back to selection screen. How to do?
Also if I want to refresh automatically after 30 seconds, what shud i do?
What is meant by 'LOCAL UPDATE' in BDC?
Thanks in advance.
Vijayakumar.G
Hi all,
I am running a report with selection screens. I created a 'REFRESH' button. If i press that button, the report shud be refreshed for the same selection screen but without going back to selection screen. How to do?
Also if I want to refresh automatically after 30 seconds, what shud i do?
What is meant by 'LOCAL UPDATE' in BDC?
Thanks in advance.
Vijayakumar.G
2006 Jun 05 9:14 AM
Hi Vijay,
Are u using ALV report for display..
In that case, you case use the following function
gr_alvgrid->refresh_table_display
where gr_alvgrid is object of class cl_gui_alv_grid,
for referehing the contents of the table.
For periodical refereshing,
U can use the EVENT Finished of class CL_GUI_TIMER.
N handle this event in ur code...
Hope that helps
Regards,
Tanveer.
<b>Please mark helpful answers.</b>
2006 Jun 05 9:14 AM
HI vijaykumar,
1. This ALV list will refresh automatically
every 5 seconds.
(without going back to selection screen)
2. Just copy paste in new program.
3. REPORT abc.
*----
NECESSARY / MUST
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
DATA : howmany TYPE i.
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : END OF itab.
DATA : ctr TYPE i,
nummax TYPE i.
*----
DEFN
CLASS my DEFINITION.
PUBLIC SECTION.
METHODS : run_handler FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "my DEFINITION
DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.
----
CLASS my IMPLEMENTATION
----
*
----
CLASS my IMPLEMENTATION.
METHOD run_handler.
ctr = ctr + 1.
IF ctr >= 6.
EXIT.
ENDIF.
CALL METHOD timer->run.
PERFORM mylist.
ENDMETHOD. "run_handler
ENDCLASS. "my IMPLEMENTATION
*----
Init
INITIALIZATION.
nummax = 5.
CREATE OBJECT timer.
CREATE OBJECT myh.
SET HANDLER myh->run_handler FOR ALL INSTANCES.
*----
selection screen (just)
PARAMETERS : a TYPE c.
*----
START-OF-SELECTION
*----
START-OF-SELECTION.
timer->interval = '0.5'.
CALL METHOD timer->run.
PERFORM displaylist.
*----
FORM
*----
FORM mylist.
howmany = howmany + 1.
SET USER-COMMAND 'REFR'.
ENDFORM. "MYLIST
*----
FORM
*----
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
whatrow-refresh = 'X'.
ENDFORM. "itab_user_command
*----
FORM
*----
FORM displaylist.
SELECT * FROM t001 INTO TABLE itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid
is_layout = alvly
i_callback_user_command = 'ITAB_USER_COMMAND'
i_save = 'A'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "DISPLAYLIST
regards,
amit m.
2006 Jun 05 9:17 AM
Hii vijay ,
use this func module <b>ENQUE_SLEEP</b>
you can also use
<b>wait up to 10 seconds</b>
After writing your list
set the system variables
<b>sy-lsind = 0 or
sy-lsind = sy-lsind - 1</b>
depending upon your functionality .
So ALV list is always display the same screen .
<b>SY-LSIND denotes the index of the list currently created</b>
Update types by which database table is updated.
<b>S</b> is for <b>Synchronous update</b> in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
<b>A</b> is for <b>Asynchronous update</b>. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
we can put Update Mode As <b>L</b> Local.
It is similar to saving reports as local objects
Regards
Naresh
2006 Jun 05 9:24 AM
Hi Vijay,
<b>1</b>.
U better to create Module pool program for this .It does not go previous screen .Some what difficulty with S-Screen for ur requirement.
<b>2</b>.
In a local update, the update program is run by the same work process that processed the request. The dialog user has to wait for the update to finish before entering further data. This kind of update is useful when you want to reduce the amount of access to the database. The disadvantage of local updates is their parallel nature. The updates can be processed by many different work processes, unlike asynchronous or synchronous update, where the update is serialized due to the fact that there are fewer update work processes (and maybe only one).
For LOCAL UPDATE documentation go thru these paths
<b>a</b>.
http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097133543b11d1898e0000e8322d00/frameset.htm
<b>b</b>.
http://help.sap.com/saphelp_erp2005/helpdata/en/41/7af4d7a79e11d1950f0000e82de14a/frameset.htm
<b>
Thanks,
Venkat.O</b>
2006 Jun 05 10:13 AM
Hi Vijay,
There is another option. You can call the same program again with the same parameter set.
The screen will be refreshed.
Just check this out!
report zpost11.
Data declaration.
DATA : SELTAB LIKE TABLE OF RSPARAMS.
Selection Screen.
SELECT-OPTIONS:
p_bukrs FOR vbkpf-bukrs,
p_belnr FOR vbkpf-belnr,
p_gjahr FOR vbkpf-gjahr,
START-OF-SELECTION.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = 'ZPOST11'
tables
selection_table = seltab
Now in the PAI of the screen, when you click on the refresh button(Suppose function code is 'REF'.
MODULE pai_100 INPUT.
CASE ok_code.
WHEN 'REF'.
SUBMIT ZPOST11 WITH SELECTION-TABLE seltab.
ENDCASE.
The screen refreshing will work.
2. The main update technique for bundling database changes in a single database LUW is to use CALL FUNCTION... IN UPDATE TASK.
A program can send an update request using COMMIT WORK
a. To the update work process, where it is processed asynchronously. The program does not wait for the work process to finish the update
b. For asynchronous processing in two steps
c. To the update work process, where it is processed synchronously. The program waits for the work process to finish the update
d. To its own work process locally (Local Update). In this case, of course, the program has to wait until the update is finished.
Local update is used when you want to limit the database access. Updation is done by the same workprocess processing the update request. It resembles synchrounous updates in that the dialog user has to wait for the update to finish before entering further data. However multiple updates can occur, since one update is independent of other updates. This is the main reason why local updates are not prefferred.
ABAP statement SET UPDATE TASK LOCAL sets a "local update switch". When it is set, the system interprets CALL FUNCTION IN UPDATE TASK as a request for local update. The update is processed in the same work process as the dialog step containing the COMMIT WORK. The transaction waits for the update to finish before continuing.
Regards,
Susmitha
Please mark useful answers.
Message was edited by: Susmitha Thomas
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |