‎2009 Sep 18 6:32 PM
I have alv output with some values, now I need to put a push button on application tool bar if I change any values in the out put and then press that push button then the new values should be updated with out re execution of the alv program . how to do it.
‎2009 Sep 19 1:12 AM
Hi Kiran,
<li> The below code is more than enough. It works for your requirement.
<li>Define events
<li>Fill events like below.
DATA: it_events TYPE slis_t_event,
wa_event like line of it_events.
<li>Set pf status like below.
wa_events-name = 'PF_STATUS_SET'.
wa_events-form = 'PF_STATUS_SET'.
append wa_events to it_events.
clear wa_events.
wa_events-name = 'USER_COMMAND'.
wa_events-form = 'USER_COMMAND'.
append wa_events to it_events.
clear wa_events.
<li>Use USER_COMMAND event like below
FORM PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STATUS' EXCLUDING rt_extab.
"When you set pf-status using above statement, you dont see ALV toolbar. To get back all the tools copy status of the any "program status which is using ALV in SE41 transaction code to your program with status you mentioned here.
"Program :SAPLKKBL
"status :STANDARD_FULLSCREEN
ENDFORM.
<li>Call function module like below
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
IF R_UCOMM = 'REFRESH'."Create one button on ALV toolbar with function code REFRESH
RS_SELFIELD-REFRESH = 'X'. "Set this one. It refreshes internal table data with new values
ENDIF.
ENDFORM. "USER_COMMAND
Let me know if you have any problem.
Thanks
Venkat.O
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = program
it_fieldcat = it_fieldcat
it_events = it_events
TABLES
t_outtab = i_mard.
‎2009 Sep 18 6:37 PM
‎2009 Sep 18 6:41 PM
there is event called DATA_CHANGED
search SDN, there are a lot of post related to this.
but DATA_CHANGED is triggered only byF8(refresh) button.
you can also call the data changed event from USER_COMMAND event.
‎2009 Sep 19 12:56 AM
Hi Kiran,
Please check below link:
[http://www.sapalv.net/2009/08/sap-alv-tutorial-8-handling-data-change/]
Regards,
Andy
[www.sapgeek.net]
‎2009 Sep 19 1:12 AM
Hi Kiran,
<li> The below code is more than enough. It works for your requirement.
<li>Define events
<li>Fill events like below.
DATA: it_events TYPE slis_t_event,
wa_event like line of it_events.
<li>Set pf status like below.
wa_events-name = 'PF_STATUS_SET'.
wa_events-form = 'PF_STATUS_SET'.
append wa_events to it_events.
clear wa_events.
wa_events-name = 'USER_COMMAND'.
wa_events-form = 'USER_COMMAND'.
append wa_events to it_events.
clear wa_events.
<li>Use USER_COMMAND event like below
FORM PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STATUS' EXCLUDING rt_extab.
"When you set pf-status using above statement, you dont see ALV toolbar. To get back all the tools copy status of the any "program status which is using ALV in SE41 transaction code to your program with status you mentioned here.
"Program :SAPLKKBL
"status :STANDARD_FULLSCREEN
ENDFORM.
<li>Call function module like below
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
IF R_UCOMM = 'REFRESH'."Create one button on ALV toolbar with function code REFRESH
RS_SELFIELD-REFRESH = 'X'. "Set this one. It refreshes internal table data with new values
ENDIF.
ENDFORM. "USER_COMMAND
Let me know if you have any problem.
Thanks
Venkat.O
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = program
it_fieldcat = it_fieldcat
it_events = it_events
TABLES
t_outtab = i_mard.
‎2009 Sep 19 4:37 AM
thank u very much it was very sweet and simple solution , i was worried about classes and all that u have made it simple
thank u very much venkat