cancel
Showing results for 
Search instead for 
Did you mean: 

How to create open file dialog for choosing file in application server?

former_member220801
Participant
0 Kudos

I would like to have the same functionality as

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'NAVIGATION_FILENAME_HELP'

EXPORTING

DEFAULT_PATH = '.'

MODE = 'O'

IMPORTING

RETURNCODE = return_code

SELECTED_FILENAME = p_file.

But the above code, only allow me to choose files from local computer. How to do the same thing with the file location becomes the application server?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

DATA:

c_fnh_mask TYPE dxfields-filemask VALUE '*',

searched_dir TYPE dxfields-longpath,

file_path LIKE dxfields-longpath.

searched_dir = 'directory on application server'.

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.

Regards,

Maxim.

former_member220801
Participant
0 Kudos

Hi, Maxim Polonevich,

Thanks for your reply, your solution works fine.

P.S. Thanks all who have replied the thread and providing methods to solve my problem, you all are really nice guys!

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

i am also trying the same kind of stuff. but i too did not get succeed. i had used the following fm

'F4_FILENAME_SERVER'. i was able to see the files and select them but not able to retrieve the path...if you ur succed plz let me know and if i get succeed i will let u know...thanx

former_member220801
Participant
0 Kudos

Hi, Ateeq K,

I also used 'F4_FILENAME_SERVER' and experienced the same problem as you...can't return the path to selection screen.

Try the solution provided by Maxim Polonevich. It works fine.

Thanks!

Former Member
0 Kudos

Hi Gundam,

Hope you have checked out:

RZL_READ_DIR_LOCAL Read a directory on the Application Server.

F4IF_INT_TABLE_VALUE_REQUEST.

Best Regards,

Anjali

Former Member
0 Kudos

Hi,

Check the code for ur query.

PARAMETERS : A_APPL RADIOBUTTON GROUP RAD1 DEFAULT 'X' USER-COMMAND RAD.

"Appl Srvr

PARAMETERS: A_FILE LIKE RLGRAP-FILENAME,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR A_FILE.

  • F4 help for the flat file path

PERFORM F4_FILEPATH USING 'A_FILE' A_FILE.

FORM F4_FILEPATH USING P_APPLFILE P_PRESFILE.

IF A_APPL = 'X'.

  • F4 help for Application Server

CALL FUNCTION 'F4_DXFILENAME_4_DYNP'

EXPORTING

DYNPFIELD_FILENAME = P_APPLFILE

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

FILETYPE = 'P'

LOCATION = 'A'

SERVER = ''.

Former Member
0 Kudos

Try this it will give the full directory structure.

REPORT ZTEST3460 line-count 30(2) .

PARAMETERS: FILE LIKE RLGRAP-FILENAME.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

  • EXPORTING

  • DIRECTORY = ' '

  • FILEMASK = ' '

IMPORTING

SERVERFILE = FILE

  • EXCEPTIONS

  • CANCELED_BY_USER = 1

  • OTHERS = 2

.

Cheers

former_member220801
Participant
0 Kudos

Hi, Sanjay Sinha,

Thanks for your help first.

When I try your code provided, I get a short dump.

Error analysis

During "F4" processing, the program tried to send a " " message.

This is not allowed at this point in processing.

The program had to be terminated.

Thanks!

Former Member
0 Kudos

That may be due to the function not existing on your SAP version . Which version are you on. I am on 470 and it works wonders.

Cheers.

former_member220801
Participant
0 Kudos

Hi, Sanjay Sinha,

I am also using 470.

former_member220801
Participant
0 Kudos

Hi, Anandha Krishnan,

The codes you provided seems not completed. Thanks for your reply.

andreas_mann3
Active Contributor
0 Kudos

Hi,

i think there's no standard fm .

you can program your own f4-help with fm's

EPS_GET_DIRECTORY_LISTING and F4IF_INT_TABLE_VALUE_REQUEST

Andreas