ALV Grid Refresh Issue
Hello!
I am using the FM 'REUSE_ALV_GRID_DISPLAY' to display a report we have written. The report displays sales orders and when the user double-clicks on a line they are taken in VA02. I put in a change to have the report refresh after the user came back from VA02. I put in the code p_selfield-refresh = 'X' in the user_command section. This was working before and now it is not refreshing. I'm wondering if this has to do with a default layout we added after these changes were put in. I've done some google searches and I can find object-oriented code but my report is not setup that way so hopefully there is a solution for me!
Thanks,
Wendy
If you set refresh subfield (and row/col_stable subfields if sort fields are not changed), then you should update the internal table record in your user_command form. You need to reload the data from database, but there may be a delay between leaving VA02 and actual update of database, you may try to lock the sales order to insure update task release the lock. (DO/ENQUEUE_EVVBAKE with WAIT/ENDDO and when/if successful DEQUEUE_EVVBAKE, if not successful after some tries, put a warning/status message)
* init data
CLEAR: lv_error,
refresh lt_bdcmsg.
* Read record
READ TABLE gt_data INTO old_data
INDEX rs_selfield-tabindex.
CHECK sy-subrc EQ 0.
* Call VA02
SET PARAMETER ID 'AUN' FIELD old_data-vbeln.
CALL transaction 'VA02' AND SKIP FIRST SCREEN
MESSAGES into lt_bdcmsg.
* Call successful ?
LOOP AT lt_bdcmsgcoll INTO ls_bdcmsg WHERE msgtyp = 'E' OR msgtyp = 'S'.
MESSAGE message ID ls_bdcmsg-msgid TYPE ls_bdcmsg-msgtyp
NUMBER ls_bdcmsg-msgnr WITH ls_bdcmsg-msgv1. " 2 3 4
IF ls_bdcmsg-msgtyp EQ 'E'.
lv_error = 'X'.
EXIT.
ENDIF.
ENDLOOP.
CHECK lv_error IS INITIAL.
* Is update ended
DO 10 TIMES.
CALL FUNCTION 'ENQUEUE_EVVBAKE'
EXPORTING
vbeln = old_data-vbeln
_wait = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 1
OTHERS = 1.
IF sy-subrc EQ 0.
CALL FUNCTION 'DEQUEUE_EVVBAKE'
EXPORTING
vbeln = old_data-vbeln
EXCEPTIONS
OTHERS = 0.
EXIT.
ENDIF.
ENDDO.
* Reload
new_data = old_data.
SELECT SINGLE * FROM vbak INTO CORRESPONDING FIELDS OF new_data
WHERE vbeln = l_sdata-vbeln. " more coding for other fields
* Update internal table
IF new_data NE old_data.
MODIFY gt_data FROM new_data.
rs_selfield-refresh = 'X'.
ENDIF.
Regards,
Raymond
Similar Messages
-
hi,
I have 2 views, input and output these two included in a MAIN views.
when user key in their input values in INPUT view and the search results will be displayed in OUTPUT view using ALV grid.
the problem i'm facing here is, when user changes search criteria once after search results displayed.. it is not displaying with new search results. every time i have to give F5(Refresh) it is certainly not comfortable to deliver it as it is.
i have tried same scenario with simple query in our local server.. where it is working very well.
i really clueless what would be the cause.. is there any with SAP patch issues.
i have tried with refresh method of ALV component.
please help me out of this, i cannot use TABLE control every time to avoid this.
thanks,
gupta.Hi Gupta,
Could you please let us know how you are filling the context node which is mapped to ALV table?
After the search criteria is changed, if you are doing it inside handler of the button or something like that, it should work.
Refer to the tutorial in the following link which shows an example similar to your scenario:
SAP List Viewer in Web Dynpro - Simple Example for Using ALV
please post the code also which you are using to fill the node in case if you still face the issue after referring to the above tutorial.
Hope this helps!
Regards.
Srilatha
Edited by: Srilatha M on Jul 19, 2010 7:57 AM -
ALV Grid: refresh in sub screens
Hello All,
I have some issues with internal table display in ALV grid.
The following is the scenario.
I am in a wizard which has 2 sub screens (SScreen 1 and sscreen 2).
1)On sscreen 1, i have a input field,where i provide a value and on clicking the next button i get a list of values which i display on sub screen 2 using ALV grid.
2)Now i go back to sscreen1 and change the value in the input field,since i use on-request module, i know the value in the field has changed and now i need to display new set of values on sscreen 2.
In this case i clear the internal table, get new values for internal table and then call set_values_for_first_display().However i still get the old values displayed on SScreen 2!!!!.
Any suggestions on what i might be doing wrong?
Cheers
DevHi Vijay,
Thanks for the info.
I will try refresh_table_display option after getting to work in a couple of hours.
I am initializing the grid and control everytime i change a value on Subscreen 1 in the PBO of Subscreen 2(the screen where the ALV list is displayed).
That is the reason why i call set_table_first_display, whenever there are new values in the internal table and avoid refresh_table_display.
Cheers
Dev -
Reg : ALV Grid Refresh - Output not appearing
Hi All ,
Am calling a screen 100 at 3 different places.
Though i use refresh_table_display , The value in the output table, say i_final changes, but while displaying the output , the whole screen is blank , even the container is not appearing in the output .
Can you please help me with your inputs .
Regards,
Chitrayes it is good ...see the example...for your requirement..
REPORT yztest .
TYPE-POOLS: slis.
Tables
TABLES: mara.
TYPES: BEGIN OF ty_name,
name TYPE char10,
age TYPE i,
END OF ty_name.
TYPES: BEGIN OF ty_marks,
sub1 TYPE i,
sub2 TYPE i,
total TYPE i,
END OF ty_marks.
TYPES: BEGIN OF ty_phone,
phnum TYPE char10,
END OF ty_phone.
TYPES: BEGIN OF ty_addr,
address TYPE char20,
END OF ty_addr .
Output internal table
DATA: itab TYPE TABLE OF ty_name,
wa TYPE ty_name,
itab1 TYPE TABLE OF ty_marks,
wa1 TYPE ty_marks,
itab2 TYPE TABLE OF ty_phone,
wa2 TYPE ty_phone,
itab3 TYPE TABLE OF ty_addr,
wa3 TYPE ty_addr.
ALV Grid
DATA: r_grid TYPE REF TO cl_gui_alv_grid,
r_grid1 TYPE REF TO cl_gui_alv_grid,
r_grid2 TYPE REF TO cl_gui_alv_grid,
r_grid3 TYPE REF TO cl_gui_alv_grid,
g_dock TYPE REF TO cl_gui_docking_container,
g_dock1 TYPE REF TO cl_gui_docking_container,
g_dock2 TYPE REF TO cl_gui_docking_container,
g_dock3 TYPE REF TO cl_gui_docking_container,
g_dock4 TYPE REF TO cl_gui_docking_container,
it_fieldcat TYPE lvc_t_fcat,
it_fieldcat1 TYPE lvc_t_fcat,
it_fieldcat2 TYPE lvc_t_fcat,
it_fieldcat3 TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
DATA picture TYPE REF TO cl_gui_picture.
DATA url(255).
CLEAR url.
DATA init.
START-OF-SELECTION.
wa-name = 'test01'.
wa-age = '1'.
APPEND wa TO itab.
wa-name = 'test02'.
wa-age = '2'.
APPEND wa TO itab.
wa-name = 'test03'.
wa-age = '3'.
APPEND wa TO itab.
wa1-sub1 = '11'.
wa1-sub2 = '22'.
wa1-total = wa1-sub1 + wa1-sub2.
APPEND wa1 TO itab1.
wa1-sub1 = '22'.
wa1-sub2 = '33'.
wa1-total = wa1-sub1 + wa1-sub2.
APPEND wa1 TO itab1.
wa2-phnum = '99999999999'.
APPEND wa2 TO itab2.
wa2-phnum = '888888888888'.
APPEND wa2 TO itab2.
wa2-phnum = '777777777777'.
APPEND wa2 TO itab2.
wa3-address = 'HItech City'.
APPEND wa3 TO itab3.
wa3-address = 'Secunderabad'.
APPEND wa3 TO itab3.
wa3-address = 'Hyderabad'.
APPEND wa3 TO itab3.
PERFORM display_image.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'LISTOUT1'.
SET TITLEBAR 'LIST1'.
wa_fieldcat-fieldname = 'NAME'.
wa_fieldcat-seltext = 'NAME OF THE STUDENT'.
wa_fieldcat-coltext = 'NAME OF THE STUDENT'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AGE'.
wa_fieldcat-seltext = 'AGE OF THE STUDENT'.
wa_fieldcat-coltext = 'AGE OF THE STUDENT'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'SUB1'.
wa_fieldcat-seltext = 'SUBJECT1'.
wa_fieldcat-coltext = 'SUBJECT1'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'SUB2'.
wa_fieldcat-seltext = 'SUBJECT2'.
wa_fieldcat-coltext = 'SUBJECT2'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-seltext = 'TOTAL'.
wa_fieldcat-coltext = 'TOTAL'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'PHNUM'.
wa_fieldcat-seltext = 'PHONE NO'.
wa_fieldcat-coltext = 'PHONE NO'.
APPEND wa_fieldcat TO it_fieldcat2.
wa_fieldcat-fieldname = 'ADDRESS'.
wa_fieldcat-seltext = 'ADDRESS'.
wa_fieldcat-coltext = 'ADDRESS'.
APPEND wa_fieldcat TO it_fieldcat3.
IF g_dock IS INITIAL.
CREATE OBJECT g_dock
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock->dock_at_left
extension = 300.
CREATE OBJECT r_grid
EXPORTING
i_parent = g_dock.
ENDIF.
IF g_dock1 IS INITIAL.
CREATE OBJECT g_dock1
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock1->dock_at_right
extension = 300.
CREATE OBJECT r_grid1
EXPORTING
i_parent = g_dock1.
ENDIF.
IF g_dock2 IS INITIAL.
CREATE OBJECT g_dock2
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock2->dock_at_top
extension = 100.
CREATE OBJECT r_grid2
EXPORTING
i_parent = g_dock2.
IF g_dock3 IS INITIAL.
CREATE OBJECT g_dock3
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock3->dock_at_top
extension = 100.
CREATE OBJECT r_grid3
EXPORTING
i_parent = g_dock3.
ENDIF.
IF NOT itab[] IS INITIAL.
CALL METHOD r_grid->set_table_for_first_display
CHANGING
it_outtab = itab
it_fieldcatalog = it_fieldcat.
ENDIF.
IF NOT itab1[] IS INITIAL.
CALL METHOD r_grid1->set_table_for_first_display
CHANGING
it_outtab = itab1
it_fieldcatalog = it_fieldcat1.
ENDIF.
IF NOT itab2[] IS INITIAL.
CALL METHOD r_grid2->set_table_for_first_display
CHANGING
it_outtab = itab2
it_fieldcatalog = it_fieldcat2.
ENDIF.
IF NOT itab3[] IS INITIAL.
CALL METHOD r_grid3->set_table_for_first_display
CHANGING
it_outtab = itab3
it_fieldcatalog = it_fieldcat3.
ENDIF.
if g_dock4 is initial.
CREATE OBJECT g_dock4
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock4->dock_at_bottom
extension = 100.
CREATE OBJECT picture
EXPORTING parent = g_dock4.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = url.
init = 'X'.
endif.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form display_image
FORM display_image .
DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.
DATA html_table LIKE w3html OCCURS 1.
DATA return_code LIKE w3param-ret_code.
DATA content_type LIKE w3param-cont_type.
DATA content_length LIKE w3param-cont_len.
DATA pic_data LIKE w3mime OCCURS 0.
DATA pic_size TYPE i.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'ENJOYSAP_LOGO'.
APPEND query_table.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
query_string = query_table
html = html_table
mime = pic_data
CHANGING
return_code = return_code
content_type = content_type
content_length = content_length
EXCEPTIONS
object_not_found = 1
parameter_not_found = 2
OTHERS = 3.
IF sy-subrc = 0.
pic_size = content_length.
ENDIF.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
OTHERS = 1.
ENDFORM. " display_image
*& Module EXIT INPUT
text
MODULE exit INPUT.
CALL METHOD g_dock->free.
CALL METHOD g_dock1->free.
CALL METHOD g_dock2->free.
CALL METHOD g_dock3->free.
ENDMODULE. " EXIT INPUT -
Problems with ALV grid refresh
Hello,
I am writing a relatively simple wd application, I enter a few values in the select-options and display the data in an ALV grid. My problem seems to be that the grid values do not refresh if I change the selection conditions.
On going through the forum I saw a few posts which ask me to call the Node->Invalidate( ) method, but on using that my grid refreshes completely and data does not appear again, even on changing the input values.
I have pasted the ALV portion of the code from my onAction method - could you suggest what I could do to correct this? I realise this is a relatively stupid question, but I am very new to this technology and am trying to learn. Thanks in advance.
***Database selection (this works fine, tested in debug)
Bind the data to the context
dyn_node = wd_context->get_child_node( name = 'TIME_ENTRY' ).
dyn_node->bind_table( icatsdb ).
Connect to the component Usage of the ALV
l_ref_cmp_usage = wd_this->wd_cpuse_display_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
Through the interface controller of the ALV Component set the DATA node dynamically
l_ref_interfacecontroller = wd_this->wd_cpifc_display_alv( ).
l_ref_interfacecontroller->set_data( r_node_data = dyn_node ).
SudhaHi,
Did you change the statement <b>SET PF-STATUS 'ZIMP'</b> to <b>SET PF-STATUS 'ZLIQ'</b> ? If not, please do that, and run the program after activation.
Reward points if the asnwer is helpful.
Regards,
Mukul -
ALV grid refresh problem when I return from list-processing
hi,
I have made alv grid with f4 help features and i'm using row select feature.
When i click on a button in Application toolbar, the program leaves to list processing and then return to alv gridscreen.
Now the problem arises.
(1)Even if i select rows and press F8, the program does not identify the rows selected and does not give me desired output.
(2)Also, when i press F4, the selected value does not appear in the text field.
Both the cases are working fine, if i dont press button and go to list processing.
Please help!!You can use the function module as stated below -
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
ET_EXCLUDING =
E_FLG_NO_HTML =
E_CALLBACK_PROGRAM =
E_REPID =
e_grid = ref1
ES_LAYOUT_KKBLO =
ES_SEL_HIDE =
CALL METHOD ref1->check_changed_data.
This helps to get the data in the internal table refreshed as well as that on the screen so that both are in sync.
this is generally used on some event, you can also use it otherwise.
<b>
Reward if useful.</b>
Regards,
Pritha -
ALV grid Refresh problem for one user
Have an ALV with editable columns. Validation and save works for all columns for one user but not for the other. The user with the issue is able to modify the values and save to the database fine.The problem is it doesn't display in the ALV once refreshed. Please suggest any ideas of how to look into this issue as it works for one and not other user.
Strange work for one user not for other.
Once you save the data, rebind the data to table. so that new data will display. ( that use set_initial_elements as true, so that old values not display ).
Regards
Srinivas -
ALV grid refresh while fcat and internal table change
Hi,
I am displaying an ALV output using OOPS ALV grid. It is displaying data from internal table t1.
Later I am changing fieldcat table content and I want to display with internal table t2. how can I do this.
It is not refreshing the fieldcat values in the ALV.
Which method I should call to refresh the ALV.
Thanks and regards,
Venkat.hi,
to refresh the alv display.
you can use the method refresh_table_display
of the class cl_gui_alv_grid.
regards. -
ALV Grid - Alignment Issues in TOP OF PAGE.
Hi,
We have a requirement to right align text in the report header.
We are using REUSE ALV GRID DISPLAY, but using TOP-OF-PAGE event - the whole text is left aligned.
I tried using Class CL_DD_DOCUMENT which solved the alignment issue, but I am not able to see the header while printing/downloading to excel.
I want the header to be available while downloading/printing the list. Any suggestions?
Thanks in advance,
Harveen.Hi
The ALV download only the grid into the file, so not the data you're writing in TOP_OF_PAGE event.
If you need to do that, you should create an your own buttom to download the file.
Max -
ALV grid refresh problem - Icons briefly flashed on screen
Hi ,
I have an editable OO ALV grid which has a "New Entries" option. When the user clicks on that button a new blank row is appended at the bottom. The problem is on some monitors /screens when the user clicks on the button the ALV grid flashes for a brief moment and every cell has an image icon.
You can see this problem by going to Tcode SE16N choose a large table like VBAP and display 500 records or more. On the next screen press the page down button, you would see those icons.(the problem is as described above, except that the se16n ALV is not editable ).
Is this a buffering problem of ALV ? Or is there a way to avoid / fix this ?
Thanksyou will find a beginning of explanation here in [sap library - Using the ALV Grid Control in WANs|http://help.sap.com/saphelp_nw2004s/helpdata/en/32/d3e962f7fb11d2b48c006094192fe3/frameset.htm]
-
ALV grid display issue from radio buttons
Hello,
I have a radio button group in a selection screen. On select of the first radio button, I display an ALV grid below the radio button group.
On selecting the next one, I want the grid to disappear which isn't happening currently.
Please help.
Thanks and Regards,
AbhijnanPlease check if this is what you needed or something else
DATA: obj TYPE REF TO cl_gui_alv_grid,
repid TYPE sy-repid,
entered TYPE c,
lv_structure TYPE tabname,
dock TYPE REF TO cl_gui_docking_container,
i_mara TYPE TABLE OF mara,
i_marc TYPE TABLE OF marc.
FIELD-SYMBOLS:<fs_tab> TYPE table.
PARAMETERS: p_matnr TYPE matnr.
PARAMETERS: p_mara RADIOBUTTON GROUP a USER-COMMAND abc.
PARAMETERS: p_marc RADIOBUTTON GROUP a.
AT SELECTION-SCREEN OUTPUT.
CHECK NOT p_matnr IS INITIAL.
IMPORT entered from memory id 'E'.
CHECK NOT entered IS INITIAL.
CHECK dock IS INITIAL.
repid = sy-repid.
CREATE OBJECT dock
EXPORTING
repid = repid
dynnr = sy-dynnr
ratio = 80
side = cl_gui_docking_container=>dock_at_bottom
name = 'DOCK_CONT'.
CHECK obj IS INITIAL.
CREATE OBJECT obj
EXPORTING
i_parent = dock.
IF p_mara = 'X'.
IMPORT i_mara FROM MEMORY ID 'IMARA'.
FREE MEMORY ID 'IMARA'.
lv_structure = 'MARA'.
ASSIGN i_mara TO <fs_tab>.
ELSE.
IMPORT i_marc FROM MEMORY ID 'IMARC'.
FREE MEMORY ID 'IMARC'.
lv_structure = 'MARC'.
ASSIGN i_marc TO <fs_tab>.
ENDIF.
CALL METHOD obj->set_table_for_first_display
EXPORTING
i_structure_name = lv_structure
CHANGING
it_outtab = <fs_tab>.
START-OF-SELECTION.
entered = 'X'.
EXPORT entered TO memory ID 'E'.
IF p_mara = 'X'.
SELECT * FROM mara UP TO 100 ROWS INTO TABLE i_mara
WHERE matnr = p_matnr.
EXPORT i_mara TO MEMORY ID 'IMARA'.
ELSE.
SELECT * FROM marc UP TO 100 ROWS INTO TABLE i_marc
WHERE matnr = p_matnr.
EXPORT i_marc TO MEMORY ID 'IMARC'.
ENDIF. -
ALV Grid - Resource Issue?
Morning All
I have a situation where I have a standard selection screen displaying an ALV grid. The user can then double click a line to see a drill down ALV. My error occurs if the user executes the program multiple times i.e. displaying the grid time and time again. Eventually the session does not display the grid and on a subsequent attempt the session either crashes or locks.
I am currently destroying the 2 containers used every time the user exits the relevant screens using call method gr_alvgrid-> free but to no avail.
Has anyone else had similar problems? I am on a 46B machine running on NT4 (yes I know I'm in the dark ages!)
Cheers
IanHi,
Have you did something like that before creating event receiver?
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
* Create the event reciever
IF o_eventreceiver IS INITIAL.
CREATE OBJECT o_eventreceiver.
ENDIF.
ENDIF.
In PAI of the screen,just try this.
module USER_COMMAND_9001 input.
CASE sy-ucomm.
WHEN 'EXIT' or 'CANC'.
perform f9600_free_objects:
using o_Alvgrid 'ALV' text-E02,
using o_Dockingcontainer 'DOCKING'
TEXT-E01.
* leave program.
LEAVE PROGRAM.
when 'BACK'.
perform f9600_free_objects:
using o_Alvgrid 'ALV' text-E02,
using o_Dockingcontainer 'DOCKING'
TEXT-E01.
set screen '0'.
leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen
when others.
ENDCASE.
endmodule. " USER_COMMAND_9001 INPUT
FORM f9600_free_objects USING pobject
value(ptype)
value(ptext).
DATA: l_objectalv TYPE REF TO cl_gui_alv_grid.
* Need to type the field symbol or it does not work
CASE ptype.
WHEN 'ALV'.
l_objectalv = pobject.
IF NOT ( l_objectalv IS INITIAL ).
CALL METHOD l_objectalv->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, l_objectalv.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN 'DOCKING'.
DATA: lobjectdock TYPE REF TO cl_gui_docking_container.
lobjectdock = pobject.
IF NOT ( lobjectdock IS INITIAL ).
CALL METHOD lobjectdock->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, lobjectdock.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN 'CONTAINER'.
DATA: lobjectcontainer TYPE REF TO cl_gui_container.
lobjectcontainer = pobject.
IF NOT ( lobjectcontainer IS INITIAL ).
CALL METHOD lobjectcontainer->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, lobjectcontainer.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN OTHERS.
sy-subrc = 1.
PERFORM f9700_error_handle USING
text-e04.
ENDCASE.
ENDFORM. " f9600_free_objects
FORM f9700_error_handle USING value(ptext).
IF sy-subrc NE 0.
* add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-e03
txt2 = sy-subrc
txt1 = ptext.
ENDIF.
ENDFORM. " f9700_error_handle
Message was edited by: Jayanthi Jayaraman -
ALV Grid refresh to exact row position
Hi All
After implementing DATA_CHANGED CL_GUI_ALV_GRID event
1. As I enter the event, I set CALL METHOD GRID->GET_CURRENT_CELL
2. validate and apply changes to grid
3. CALL METHOD GRID->REFRESH_TABLE_DISPLAY
4. CALL METHOD CL_GUI_CONTROL=>SET_FOCUS " to custom control
5. CALL METHOD CL_GUI_CFW=>FLUSH
6. CALL METHOD GRID->SET_CURRENT_CELL_VIA_ID
However, the grid refreshes by putting my current row right at the bottom.
I'd like the top row to remain the top row, but the methods that look usable are 'protected'
If you know how to avoid this repositioning of the grid, please assist.
Thank you and best regards,
Adrian*& Form FM_REFRESH_TABLE_DISPLAY
FORM FM_REFRESH_TABLE_DISPLAY USING GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA LS_STABLE TYPE LVC_S_STBL.
LS_STABLE-COL = 'X'.
LS_STABLE-ROW = 'X'.
CALL METHOD GRID->REFRESH_TABLE_DISPLAY
EXPORTING
IS_STABLE = LS_STABLE
EXCEPTIONS
FINISHED = 1
OTHERS = 2.
ENDFORM. " FM_REFRESH_TABLE_DISPLAY
Edited by: Adrian Bruwer on Apr 14, 2011 9:07 AM -
Hi,
Scenario:
I have implemented the ALV display using the methods of class CL_SALV_TABLE. I have a layout parameter and depending on the layout selected the result is displayed. Also there is a Refresh button on the grid for displaying the new data set.
For this I have used the refresh method of the CL_SALV_TABLE class.
gr_grid->refresh( ).
Issue:
When the data is displayed for the first time, it is as per the Layout selected. When I press the refresh button, the ordering of the rows is lost. I tried to debug but I am not able to figure out where the problem lies.
Kindly suggest.
Please do let me know in case the problem is not clear.
Regards
s@kDear Rich,
Adding to the question, I have 3 ALVs which I am displaying on the same screen(by splitting the container ). I have provided Refresh button on each of the screen and for handling the events I have created a class.
CLASS cl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
on_user_command FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function sender.
ENDCLASS. "cl_handle_events DEFINITION
The ALVs are created by calling
TRY.
cl_salv_table=>factory(
EXPORTING
r_container = gr_container1
IMPORTING
r_salv_table = gr_grid_1
CHANGING
t_table = gt_table1
CATCH cx_salv_msg INTO gr_error1.
ENDTRY.
In the same fashion i instantiate the other 2 ALVs.
The requirement is that If the user presses the Refresh button on the First screen(split container), the other two ALVs should also be refreshed. So, on pressing the 'Refresh' button on the first screen, I do some modification to the three tables and then call the refresh() method for each instance.
gr_grid_1->refresh( ).
gr_grid_2->refresh( ).
gr_grid_3->refresh( ).
Kindly suggest..
Please let me know if I am anyway unclear about the question...:)
Regards
s@k -
Hi all,
In custom infotype we had a requirement to have a alv. So we created a container and we are displaying alv.
The alv is working fine. But, when we go in display mode, it shows the same alv for all the records, say if there are 3 records in infotype and if we select 'Next' button, the alv is not refreshing the contents.
We tried all the possiblities like refresh_table_display, free the container, clearing the table, freeing the grid etc. But nothing is working.
Please let us know.
Thanks,Thanks for the reply. So it means that the below coding should be executed only once.
So, it should be somewhere in the declaration or something?
Now this is in PBO and whenever the user clicks the Next button this will get executed. But at the end of PBO this container and ref_grid has been freed.
CREATE OBJECT container
EXPORTING
container_name = 'CONTAINER'. "name of container in module pool
CREATE OBJECT ref_grid
EXPORTING
i_parent = container.
Maybe you are looking for
-
Hi All, While transferring materials form ECC to GTS (Sandbox), i am receiving the above mentioned error. Conversion error in module API6850_HDR_PROD_MAP, field API6850_HDR-WEIGHTUNIT_ISO, value LBR. As per standard , In the ISO code for US pound its
-
How to avoid components in a JDialog to collapse
When resizing the dialog making it smaller than it should be all the fields inside it collapse. I've tried setting the minimum size but nothing happened. Thanks in advance.
-
I have been using CS5 for the last two years to create a .indb file. I always export the book as a PDF and then send it to my printer. I recently had to change laptops and decided to give CC a try on the trial version. I used all the same content and
-
Which character encoding do Adobe ExportPDF use when converting to word document?
Which character encoding do Adobe ExportPDF use when converting to word document?
-
Hi I want to define change Eventlistener for all elements in a mxml component dynamically ( myUI.mxml). I tried this inside a class that extends canvas: _ui = new myUI() this.addChild(_ui); for(var i in _ui){ _ui .addEventListener(Event.CHANGE, value