‎2010 Mar 19 6:57 AM
Hello Expert,
I have the following requirement:
My selection screen has an input field which is used to keep the directory for user to download data in the report.
I want to add a command button in the selection screen after the field. By clicking the button, the user can specify the download folder. After the user confirms the selection, the directory should be displayed in the field.
How to write such statement?
Thanks in advance,
Best Regards, Yongbo
‎2010 Mar 19 7:00 AM
Hi,
Why not use a F4 help to browse through the directory on that field !!?
‎2010 Mar 19 7:01 AM
try using this
SELECTION-SCREEN INCLUDE PUSHBUTTON [/][pos](len) button_text
[USER-COMMAND fcode]
[MODIF ID modid]
[ID id].
‎2010 Mar 19 7:05 AM
PUSHBUTTON 3(5) but USER-COMMAND btn,
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'btn'.
ENDCASE.
START-OF-SELECTION.
title = 'Bbutton'.
but = 'Button '.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_information
text = 'Button'
info = 'Button on screen'
IMPORTING
RESULT = but2
EXCEPTIONS
OTHERS = 0.
‎2010 Mar 19 7:08 AM
Hi,
Check this program : demo_sel_screen_pushbutton
Regards,
Srini.
‎2010 Mar 19 7:42 AM
Hi,
<li>Try this way.
Thanks
Venkat.O
REPORT ztest_notepad.
DATA: file_table TYPE filetable.
DATA: file_table_line LIKE LINE OF file_table.
DATA: rc TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:p_file TYPE char50.
SELECTION-SCREEN PUSHBUTTON 53(10) but1 USER-COMMAND but1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
but1 = 'Click here'.
AT SELECTION-SCREEN.
IF sy-ucomm EQ 'BUT1'.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select file'
default_extension = '*.*'
CHANGING
file_table = file_table
rc = rc.
READ TABLE file_table INTO file_table_line INDEX 1.
p_file = file_table_line-filename.
ENDIF.