‎2005 Dec 15 12:38 PM
Hi my dear experts,
I have a little pgm with a simple selection-screen page...
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
PARAMETERS p_filsip LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 2.
SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
PARAMETERS p_filbw LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 3.
SELECTION-SCREEN END OF BLOCK 1.
SELECTION-SCREEN BEGIN OF BLOCK 4 WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF BLOCK 5 WITH FRAME TITLE text-005.
PARAMETERS p_filout LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 5.
SELECTION-SCREEN END OF BLOCK 4.
Matchcode to choose the files
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filsip.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_filsip.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filbw.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_filbw.
My problem is that with the above-mentioned code, after having choosen the files, the pgm runs automatically without an additional F8/execute command (as I need!).
How can I obtain this behaviour (choose the files, but running the pgm after an additional F8, after the first one that leads me to this selection screen)?
Thanks in advance !
Bye,
Roberto
‎2005 Dec 15 12:45 PM
try giving 'Start-of-selection' after the selection screen.
Please acknowledge if it works.
Regards,
Bikash
‎2005 Dec 15 12:45 PM
try giving 'Start-of-selection' after the selection screen.
Please acknowledge if it works.
Regards,
Bikash
‎2005 Dec 15 12:45 PM
Hi Roberto
Try to use this method: file_open_dialog
at selection-screen on value-request for p_file.
data wa_file like file_table.
refresh filetable.
call method cl_gui_frontend_services=>file_open_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INITIAL_DIRECTORY =
MULTISELECTION =
WITH_ENCODING =
changing
file_table = filetable
rc = rc
USER_ACTION =
FILE_ENCODING =
exceptions
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5.
if sy-subrc = 0.
if rc = 1.
read table filetable into wa_file index 1.
move wa_file-filename to p_file1.
endif.
endif.
Max
‎2005 Dec 15 12:54 PM
Hi
excuse me I haven't raed all your post.
I don't think you can run your program from POV event, try to use statament as SUPPRESS DIALOG but I don't think it'll work.
Max
‎2005 Dec 15 12:58 PM
Hi Roberto,
It will not run automatically...
If the code given in post is your complete code, apart from getting the files, you are not performing anything.(no process being done.)
All your processing happens in START-OF-SELECTION section.
Keep a break-point at this SOS, and try again..without pressing F8 or Execute, control will not come to this SOS.
Regards,
Raj
‎2005 Dec 15 1:17 PM
try It
PARAMETERS: p_cami TYPE rlgrap-filename OBLIGATORY .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cami.
PERFORM f_query_filename USING 'c:\' 'S'.
----
FORM QUERY_FILENAME *
----
........ *
----
FORM f_query_filename USING def_path LIKE rlgrap-filename
mode TYPE c.
DATA: global_filemask_mask(20),
global_filemask_text(20).
DATA: global_filemask_all(80).
DATA: fieldln TYPE i .
DATA: tmp_filename LIKE rlgrap-filename.
DATA: tmp_mask LIKE global_filemask_all.
FIELD-SYMBOLS: <tmp_sym>.
Build Filter for Fileselektor
IF global_filemask_mask IS INITIAL.
tmp_mask = ',.,..'.
ELSE.
tmp_mask = ','.
WRITE global_filemask_text TO tmp_mask+1.
WRITE ',' TO tmp_mask+21.
WRITE global_filemask_mask TO tmp_mask+22.
WRITE '.' TO tmp_mask+42.
CONDENSE tmp_mask NO-GAPS.
ENDIF.
IF NOT global_filemask_all IS INITIAL.
tmp_mask = global_filemask_all.
ENDIF.
fieldln = STRLEN( def_path ) - 1.
ASSIGN def_path+fieldln(1) TO <tmp_sym>.
IF <tmp_sym> = '/' OR <tmp_sym> = '\'.
CLEAR <tmp_sym>.
ENDIF.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = rlgrap-filename
def_path = def_path
MASK = ',.,..'
mask = tmp_mask
mode = mode
TITLE = ' '
IMPORTING
filename = tmp_filename
RC =
EXCEPTIONS
inv_winsys = 01
no_batch = 02
selection_cancel = 03
selection_error = 04.
IF sy-subrc = 0.
rlgrap-filename = tmp_filename.
p_cami = tmp_filename .
ELSE.
IF SY-SUBRC = 01. "// Does not work, why ???
MESSAGELINE = 'Not supported'.
ENDIF.
ENDIF.
ENDFORM. "f_query_filename
Alexandre Nogueira.
‎2005 Dec 15 1:43 PM
check with ur code that u have written only this code under at selection screen or the remaining also.
because u need to handle the events separately.
start-of-selection.
perform load_file.
top-of-page.
end-of-page. etc.,
plz check with ur code.
only write the FM in the at selection screen. remaining thing u handle in other events.
Cheers.
‎2005 Dec 15 1:47 PM
Roberto, Make sure that the program logic is separate from the selection screen code. Meaning you need to add the START-OF-SELECTION EVENT.
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
PARAMETERS p_filsip LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 2.
SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
PARAMETERS p_filbw LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 3.
SELECTION-SCREEN END OF BLOCK 1.
SELECTION-SCREEN BEGIN OF BLOCK 4 WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF BLOCK 5 WITH FRAME TITLE text-005.
PARAMETERS p_filout LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 5.
SELECTION-SCREEN END OF BLOCK 4.
*Matchcode to choose the files*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filsip.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_filsip.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filbw.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_filbw.
START-OF-SELECTION.
* Code to be executed when user preses F8.
REgards
Rich Heilman
‎2005 Dec 15 2:57 PM
I regret for my ABAP ignorance, but I missed START-OF-SELECTION event !
Please forgive me, but ABAP is not exactly my job !
Anyway, thanks to all!
See you next time !
Bye,
Roberto