2007 Feb 22 6:29 AM
wee needto refresh the alv table, here depending on the button we need to refresh the display.But here the program uses a function module and not a OOPS concept. We need to dynamically add or remove lines from the table. ne guidance on how this can be done. Ne little code will also be helpful.
Thanks.
wee needto refresh the alv table, here depending on the button we need to refresh the display.But here the program uses a function module and not a OOPS concept. We need to dynamically add or remove lines from the table. ne guidance on how this can be done. Ne little code will also be helpful.
Thanks.
2007 Feb 22 6:32 AM
say SAVE is ur UCOMM
when 'SAVE'.
*here write code to save data
SUBMIT <REORT NAME> " to refresh ALv
2007 Feb 22 6:35 AM
hi,
what u can do is, keep a button with some events declared in status.
like u set in set pf-status 'statusname'.
Then in that event capturing u can put ur refreshing of data and again refilling of data. And after refilling the data into dat table call display function again.
Keep display function module in some subroutine so dat u can call it ne time u need.
Hope it answers ur question.
bye.
Santosh.
2007 Feb 22 6:58 AM
Referr this link
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
case p_ucomm.
when 'SAVE'.
Data ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_dataNow your internal table will have the data that is seen in the editable alv.
2007 May 11 6:41 PM
Judith:
This is exactly what I was looking for - I only wish I found it sooner!!
Thank you!!
2007 Feb 22 11:56 AM
Hi Surya,
when using the function module "REUSE_ALV_GRID_DISPLAY", you have a exporting parameter called "I_CALLBACK_USER_COMMAND". This is the name of a form in your report to handle all the buttons clicked. To create your own buttons just create a GUI-Status and provide the exporting parameter "I_CALLBACK_PF_STATUS_SET" with a form in your report that sets the status.
Inside your user_command-Form you can update all the records of your internal table. To make ALV refresh the display just provide the field st_selfield-refresh with 'X'.
EXAMPLE:
=========
FORM USER_COMMAND USING RC_UCOMM LIKE SY-UCOMM
ST_SELFIELD TYPE SLIS_SELFIELD.
case rc_ucomm.
check which button has been pressed
Refresh internal table
select... into itab...
endcase.
Make sure, that the updated internal table itab is displayed
st_selfield-refresh = 'X'.
ENDFORM.
FORM PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ALV'. " EXCLUDING RT_EXTAB.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZPXYZ'
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
.....
...
Regards
CHRIS
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |