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

open dialog box in application server.

Former Member
0 Likes
1,200

hai frnds,

i am using the following FM for open dialog box in application.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

i_location_flag = 'A'

i_server = '?'

i_path = f_app

filemask = c_fnh_mask

FILEOPERATION = 'R'

IMPORTING

  • O_LOCATION_FLAG = 'P'

  • O_SERVER = '?'

o_path = f_app

  • ABEND_FLAG =

EXCEPTIONS

rfc_error = 1

OTHERS = 2.

the path is been copied to the input box but when i am trying to open the file selected it is not retrieving the data and also the given path is changed to upper case. i had tried to change it in start of selection. but the same is hapenning. also my client requested some of the following...

1) the dialog should open at '//sapglobal_users'

2) the files should be sorted in desc group by date and time of creation.

3) the full path name should be visible in the dialog box which is not hapenning (i.e., if the path is > the visible length the invisible part is truncated. This shd not happen.)

Message was edited by: Ateeq K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,008

DO THIS..

parameters: file(128) obligatory lower case.

DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*',

searched_dir TYPE dxfields-longpath,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.

if loc1 = space.

message e307 with 'Enter Directory To Pick Up File'.

endif.

searched_dir = XXX. " WRITE THE DIRECTORY NAME--LIKE 'E:\usr\sap\put'.

TRANSLATE searched_dir TO LOWER CASE .

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

i_location_flag = 'A'

i_server = ' '

i_path = searched_dir

filemask = c_fnh_mask

  • FILEOPERATION = 'R'

IMPORTING

  • O_LOCATION_FLAG =

  • O_SERVER =

o_path = file_path

  • ABEND_FLAG =

EXCEPTIONS

rfc_error = 1

OTHERS = 2.

AND IT WORKS..REWARD POINTS IF IT HELPS YOU

7 REPLIES 7
Read only

Former Member
0 Likes
1,009

DO THIS..

parameters: file(128) obligatory lower case.

DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*',

searched_dir TYPE dxfields-longpath,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.

if loc1 = space.

message e307 with 'Enter Directory To Pick Up File'.

endif.

searched_dir = XXX. " WRITE THE DIRECTORY NAME--LIKE 'E:\usr\sap\put'.

TRANSLATE searched_dir TO LOWER CASE .

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

i_location_flag = 'A'

i_server = ' '

i_path = searched_dir

filemask = c_fnh_mask

  • FILEOPERATION = 'R'

IMPORTING

  • O_LOCATION_FLAG =

  • O_SERVER =

o_path = file_path

  • ABEND_FLAG =

EXCEPTIONS

rfc_error = 1

OTHERS = 2.

AND IT WORKS..REWARD POINTS IF IT HELPS YOU

Read only

Former Member
0 Likes
1,008

Hi,

Try this:

DATA: it_file TYPE filetable,

filerc TYPE i.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

call method cl_gui_frontend_services=>file_open_dialog

exporting

window_title = 'Select the File'

default_filename = '*.xls'

INITIAL_DIRECTORY = 'C:\'

multiselection = ' ' "No multiple selection

changing

file_table = it_file

rc = filerc

  • USER_ACTION =

exceptions

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

not_supported_by_gui = 4

others = 5

.

Hope this helps.

Pole

Read only

Former Member
0 Likes
1,008

data: file_path LIKE dxfields-longpath.

and after the call of the FM copy the value of file_pathto parameter file as

file = file_path.

Read only

0 Likes
1,008

can we sort externally the files basing on the date and time so that the latest file should appear first. i mean to say the FM is taking care of the same. is it possible..

and also the client requested that when selecting the folders, for every directory selection one window is opened. instead of that the output should be visible in the same window instead of multiple...

plzzz help me in this.

Read only

0 Likes
1,008

Hi,

just have look at this report

RO_F4_FILE_APPL_SERVER

i think it will help you,

and if our previos post has resolve your querry , pleas reward points for that

Read only

0 Likes
1,008

any other help plz...it's urgent

Read only

0 Likes
1,008

Check if you have FM "/SAPDMC/LSM_F4_SERVER_FILE" in your system. This will exactly meet your requirement.

Cheers.