Application Development 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: 

F4 Help for Selecting a File in WD ABAP

Former Member
0 Kudos

HI,

What is the method, or FM that is available for selecting a file in WD ABAP.

method FILE_OPEN_DIALOG is not working as it required GUI.

Thanks

Mahesh

9 REPLIES 9

Former Member
0 Kudos

hi Mahesh,

Try using /SAPDMC/LSM_F4_FRONTEND_FILE and F4_dxfilename_toprecursion FM's....

Regards,

Santosh

0 Kudos

Hi,

Thanks.. But these are still GUI FM's.. They Are not working in WD ABAP..

Thanks

Mahesh

former_member194669
Active Contributor
0 Kudos

Hi,

Please check the class CL_WD_FILE_UPLOAD and it have UI element FILE_UPLOAD may be this will help you.

0 Kudos

Hi ,

THIS SHOULD UR PROBELM

data: ifiletable type filetable.

data: xfiletable like line of ifiletable.

data: rc type i.

selection-screen: begin of block blk with frame title text-001.

selection-screen : skip 1.

parameters : u_file like rlgrap-filename.

selection-screen : skip 1.

selection-screen : end of block blk.

initialization.

h_repid = sy-repid.

at selection-screen on value-request for u_file.

call method cl_gui_frontend_services=>file_open_dialog

  • EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

  • DEFAULT_FILENAME =

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • MULTISELECTION =

changing

file_table = ifiletable

rc = rc

  • USER_ACTION =

  • EXCEPTIONS

  • FILE_OPEN_DIALOG_FAILED = 1

  • CNTL_ERROR = 2

  • ERROR_NO_GUI = 3

  • others = 4

.

if sy-subrc eq 0.

read table ifiletable into xfiletable index 1.

if sy-subrc = 0.

u_file = xfiletable-filename.

endif.

else.

endif.

start-of-selection.

clear : file ,count.

move u_file to file.

call method cl_gui_frontend_services=>gui_upload

exporting

filename = file

filetype = 'ASC'

  • HAS_FIELD_SEPARATOR = SPACE

  • HEADER_LENGTH = 0

  • IMPORTING

  • FILELENGTH =

  • HEADER =

changing

data_tab = i_text_file[]

exceptions

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

others = 17

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

loop at i_text_file ..

Thanks

Venki

0 Kudos

HI,

Thanks for the reply...

I have gone through the example that you have sent. But none of it speaks about F4 Help for File(File Dialog). i Want File Dialog when i click on a push button on the WD ABAP Application (Similar to CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG).. for this i need a method which could pop me up with the file dialog.

Thanks

Mahesh

0 Kudos

Mahesh,

Please check this link, i used in the same way as mentioned in this link i am able to get the dialog box.

http://help.sap.com/saphelp_nw04s/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm

0 Kudos

HI,

I Am already using this FileUpload UI and it has some problem in showing the Name of the file selected. That is the reason why i am trying to do it by writing the code..

I dont want to Use this FileUpload UI...

Thanks

Mahehs

0 Kudos

Closing the Thread

0 Kudos

Hi Mahesh,

Can you share the code for upload file using the class CL_WD_FILE_UPLOAD

Thanks

Edited by: SinhNG on Jan 7, 2012 8:43 AM