Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

?

Former Member
0 Likes
1,215

How can I provide 'file path' as a parameter on the selection screen when I'm uploading a flat file.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,128

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

How can I provide 'file path' as a parameter on the selection screen when I'm uploading a flat file.

9 REPLIES 9
Read only

Former Member
0 Likes
1,128

hi,

declare it as RLGRAP-FILENAME.

Read only

Former Member
0 Likes
1,128

put like this

P_FILE LIKE rlgrap-filename OBLIGATORY

regards

Peram

Read only

varma_narayana
Active Contributor
0 Likes
1,128

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>

Read only

Former Member
0 Likes
1,128

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

Read only

Former Member
0 Likes
1,128

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

Read only

Former Member
0 Likes
1,128

parameter:p_path like FILE_TABLE

thnkx

bhanu

Read only

Former Member
0 Likes
1,129

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

Read only

former_member196280
Active Contributor
0 Likes
1,128

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

Read only

Former Member
0 Likes
1,128

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