11-07-2007 4:21 PM
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
11-07-2007 4:24 PM
hi Mahesh,
Try using /SAPDMC/LSM_F4_FRONTEND_FILE and F4_dxfilename_toprecursion FM's....
Regards,
Santosh
11-07-2007 4:37 PM
Hi,
Thanks.. But these are still GUI FM's.. They Are not working in WD ABAP..
Thanks
Mahesh
11-07-2007 4:43 PM
Hi,
Please check the class CL_WD_FILE_UPLOAD and it have UI element FILE_UPLOAD may be this will help you.
a®
11-07-2007 4:49 PM
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
11-07-2007 4:51 PM
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
11-07-2007 4:57 PM
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
a®
11-07-2007 5:53 PM
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
11-12-2007 6:43 PM
01-07-2012 7:42 AM
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