‎2007 Jul 27 7:45 AM
Hi
I hav a ALv grid output. There i fixed one button using the function code &ZDL.
When user presses thst button the following FM to be called.
GUI_FILE_SAVE_DIALOG.
How can i code for this scenario.
‎2007 Jul 27 7:48 AM
hi Ramesh,
code it in this way ..
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN '&ZDL'.
CALL FM 'GUI_FILE_SAVE_DIALOG'.
ENDCASE.
‎2007 Jul 27 7:48 AM
Hi Ramesh,
You have to capture the event into for user_command which you can pass to alv grid function module. There you can call your function module to download the output.
Regards,
Ashutosh
Reward points if helpfull.
‎2007 Jul 27 7:52 AM
Refer this sample code.......
&----
*& Module USER_COMMAND_0100 INPUT
&----
PAI Event
----
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'name'. " Give the name of the button which has func code '&ZDL'.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
WITH_ENCODING =
FILE_FILTER =
INITIAL_DIRECTORY =
IMPORTING
FILENAME =
PATH =
FULLPATH =
USER_ACTION =
FILE_ENCODING =
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards,
Pavan
‎2007 Jul 27 7:53 AM
Hi ram,
Code like this:
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN '&ZDL'.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG
EXPORTING
WITH_ENCODING = 'X'
FILE_FILTER = filefilter
default_extension = 'txt'
IMPORTING
FILENAME = filename
PATH = path
FULLPATH = fullpath
USER_ACTION = user_action
FILE_ENCODING = file_encoding.
Hope this helps you. Reply for queries, shall post the updates.
Regards.
Kumar.
‎2007 Jul 27 7:59 AM
Hi,
In the FM 'REUSE_ALV_GRID_DISPLAY' you can use the parameter 'i_callback_user_command ' to pass the user command form name to be called for handling events.
Following is the code snippet :
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_bypassing_buffer = 'X'
i_buffer_active = ' '
i_callback_program = w_repid
i_callback_user_command = 'USER_COMMAND' "form name to be executed
Define the form 'User_command' in the program to handle the events and code the logic for * different events(for different push buttons).
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
The field "R_UCOMM" will contain the current value of "SY-UCOMM"
"RS_SELFIELD" will hold contents of the selected line
CASE r_ucomm.
WHEN '&ZDL'.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
.......
IMPORTING
..........
ENDCASE.
ENDFORM. "USER_COMMAND
Hope this information helps..
Regards,
Dilli
‎2007 Jul 27 8:53 AM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_bypassing_buffer = 'X'
i_buffer_active = ' '
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND' "form name to be executed
FORM user_command USING r_ucomm LIKE sy-ucomm
CASE r_ucomm.
WHEN '&ZDL'.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
ENDCASE.