2007 Jul 18 8:06 AM
How can I provide 'file path' as a parameter on the selection screen when I'm uploading a flat file.
2007 Jul 18 8:12 AM
hi
try including the follwing code
parameters: p_infile like ibipparms-path default 'C:\'.
Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME' "allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
<b>reward points for helpful ans</b>
Regards
Aarti
hi
try including the follwing code
parameters: p_infile like ibipparms-path default 'C:\'.
Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME' "allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
<b>reward points for helpful ans</b>
Regards
Aarti
2007 Jul 18 8:08 AM
2007 Jul 18 8:09 AM
put like this
P_FILE LIKE rlgrap-filename OBLIGATORY
regards
Peram
2007 Jul 18 8:09 AM
Hi.
Check this code
<b>Parameters : p_file type RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-HELP FOR P_FILE.
CALL Function 'F4_FILENAME'</b>
This function module allows the user to Select the file path from Presentation server thru F4 help.
<b>Reward if it helps.</b>
2007 Jul 18 8:10 AM
hi
i think u cannot upload aflat file thro' select-option or parameter..
if u upload using bdc then it will ask for the file name ..
reward if useful
2007 Jul 18 8:10 AM
just create a parameter in the selection screen and use the method FILE_OPEN_DIALOG of the CL_GUI_FRONTEND_SERVICES class to select the file....
or alternatively use the F4_filename function module
null
2007 Jul 18 8:12 AM
2007 Jul 18 8:12 AM
hi
try including the follwing code
parameters: p_infile like ibipparms-path default 'C:\'.
Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME' "allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
<b>reward points for helpful ans</b>
Regards
Aarti
2007 Jul 18 8:12 AM
Parameters : <b>p_file</b> type RLGRAP-FILENAME OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-HELP FOR <b>P_FILE.</b>
Use FM 'F4_FILENAME'
Regards,
SaiRam
2007 Jul 18 8:12 AM
Hi Khan,
Try this out.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME
OBLIGATORY
LOWER CASE
DEFAULT 'C:\'.
Get the Input File Data
V_FILENAME = P_FILE.
PERFORM UPLOAD_FLATFILE_DATA TABLES I_RECORD
USING V_FILENAME.
FORM GET_FILE_NAME USING L_FILE LIKE RLGRAP-FILENAME.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',.TXT,.txt.'
MODE = 'O'
TITLE = TEXT-011
IMPORTING
FILENAME = L_FILE
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
CASE SY-SUBRC.
WHEN 1.
MESSAGE I000 WITH TEXT-084.
STOP.
WHEN 2.
MESSAGE I000 WITH TEXT-085.
STOP.
WHEN 3.
MESSAGE I000 WITH TEXT-086.
STOP.
WHEN 4.
MESSAGE I000 WITH TEXT-087.
STOP.
ENDCASE.
*
ENDFORM.
<b>Reward points if this helps,</b>
Kiran
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |