07-31-2009 7:22 AM
Hi,
How do I detect when cancel button is clicked in FM TEXT_CONVERT_XLS_TO_SAP?
07-31-2009 7:34 AM
Hi,
you can't check Cancel button in this FM.
you will be having an open dialod call, right? there you can..
try the below code for open dialod :
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = l_str
default_extension = '*.xls'
file_filter = 'Excel (.xls)|.xls|'
CHANGING
file_table = i_filetab
rc = w_rc
user_action = w_user_act
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF w_user_act EQ cl_gui_frontend_services=>action_ok.
READ TABLE i_filetab INTO wa_filetab INDEX 1.
IF sy-subrc EQ 0.
po_ufil = wa_filetab-filename.
ENDIF.
ENDIF.
ENDIF.
Thanks,
Renjith.
07-31-2009 7:34 AM
Hi,
you can't check Cancel button in this FM.
you will be having an open dialod call, right? there you can..
try the below code for open dialod :
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = l_str
default_extension = '*.xls'
file_filter = 'Excel (.xls)|.xls|'
CHANGING
file_table = i_filetab
rc = w_rc
user_action = w_user_act
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF w_user_act EQ cl_gui_frontend_services=>action_ok.
READ TABLE i_filetab INTO wa_filetab INDEX 1.
IF sy-subrc EQ 0.
po_ufil = wa_filetab-filename.
ENDIF.
ENDIF.
ENDIF.
Thanks,
Renjith.
07-31-2009 8:41 AM
hi Renjith,
Thank you so much, yeah, I have looked at the wrong FM. It works now with the sample code you gave.