11-03-2007 7:47 AM
Dear All,
I need to add some extra functionality into standard user commands of the ALV Dispaly.
For eg. if I need to give a confirmation message popup before downloading the data into an excel file using the standard fuction, and after download wish to update a database table.
Can this be done? If yes, How?
Regards
Vijai
11-03-2007 8:11 AM
You can use following function module
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'SAVE'
TEXT_QUESTION = 'You want to Update ? '
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = ' '
IMPORTING
ANSWER = answer.
11-03-2007 8:11 AM
You can use following function module
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'SAVE'
TEXT_QUESTION = 'You want to Update ? '
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = ' '
IMPORTING
ANSWER = answer.
11-03-2007 8:26 AM
Thanks Balaji for the answer.
My question is a little different. If I need to do this under a standard user command which also has its own standard functionality. then where to add my code.
Regards
Vijai
11-03-2007 9:24 AM
copy the standard GUI- STATUS to zguistatus
write form as below
FORM zguistatus USING p_extab TYPE slis_t_extab.
SET PF-STATUS 'zguistatus'.
ENDFORM.
call zguistatus to ALV FM as below
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_pf_status_set = 'ZGUISTATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_PAGE'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
TABLES
t_outtab = final_tab[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
in user command form as below handle SY-UCOMM for download
FORM user_command USING pv_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE sy-ucomm.
WHEN 'DOWNLOAD'.
since ur req is diff
add a diff icon to the gui status
and when that icon is clicked
call GUI_DOWNLOAD.
and then UODATE TABLE Logic
tc
saji
.
10-01-2008 7:13 AM
Hi
Solved myself. Created my own code for standard user command.
Regards
Vijai