Académique Documents
Professionnel Documents
Culture Documents
by António César
Software Developer, SAP Senior With SAP File Explorer I tried to mimic the Windows Explorer
Consultant in the SAP environment.
It’s main purpose is to access the server system files using the
I started as an IBM AS400 software SAP GUI, much in the way transaction AL11 does but with a
developer in COBOL and RPG, having friendlier user interface
changed later for SAP. My main focus lies
in software development for IS-U, I’ve This is a testing tool and not much effort was put in the
worked as a software developer for different authority issues, so you may want to consider some changes in
companies. You can reach me at my e-mail this if you plan to use it otherwise.
ajcesar7@gmail.com.
Note: This document is structured in two parts, the fist one is a brief
manual on how to work with the tool, the second one is where you can
find the coding and instructions on how to implement it.
SAP File Explorer Release.620
PART 1 – Using SAP File Explorer The default path will always be the root and the
desired displayed path will be shown as a child of
the root dir in the respective sequence.
Introducing SAP File Explorer GUI
Initiating the test for example in the Function
The tool consists of a function module that can be Modules test environment, passing the path
called with no parameters passed or by passing a “/tmp/ADM/” as parameter as shown below.
defined path like for example “/tmp/” for an
UNIX or AIX system or “c:\temp\” for a
Windows system.
Figure 1 – Function Modules test environment, note that the UNIX and AIX systems are case sensitive so in case a wrong path is
passed the default root path is displayed
The SAP File Explorer will open in the desired path as shown below.
Figure 2 – SAP File Explorer screen, the folder displayed is ADM in “/tmp/”, note that “/” is the root folder
Tool Details
Address, Tree Panel, User Options and Folder
The SAP File Explorer consists of a single screen, Panel.
with a layout similar to the Windows Explorer These elements comprise themselves other
and contain the fallowing elements: sub elements discussed later on.
Element Depiction
The Tree Panel is the main interaction element of
the SAP File Explorer tool and is composed of
Address two other elements.
- Tree Header
Figure 4 – Address display
Shows the operation system your SAP server is
running on, in this case an AIX server. It also
serves to change to the Search screen when
Much in the way of Windows Explorer, it shows
clicked which will be discussed later on.
the folder complete path of the folder displayed
on the right Folder Panel, and will change
according to the one being displayed at any - Tree Panel
specific moment.
This panel as said before in combination with the
Folder Panel will be your main interaction
Tree Panel elements in the tool and works much like the one
in Windows Explorer.
It was build using class cl_gui_alv_tree, to which
I removed the columns displayed.
Folder Panel
Figure 11 shows the detail of the Folder Panel, Similar to Windows Explorer these column
this is the second most important element of the headers also serve another purpose, they can be
tool and is where the content of the folder is used to sort ascending and descending the content
displayed. of the folder when clicked.
It’s a simplified ALV Grid build using class
cl_gui_alv_grid, so it retains some of the
restrictions of the normal grids like for example
the single cell selection.
- Type The Folder Panel will also serve to open the items
Shows the type of the item displayed, if it is a displayed.
folder for example it will display “File Folder”, if If you double click the folder “doc” for example,
it is a PDF file it will display “Adobe Acrobat as seen in figure 13 the folder content will be
Document” and so on.(This is also done in the displayed as seen in figure 8.
“prepare_display_layout” form)
In this case as this is an ALV Grid, it’s irrelevant
where you double click in that line, you can
- Date Modified double click the icon, the name “doc” the size
“4.096 B” and so on, the result will always be the
This is a time stamp type of field and shows the same.
date and time the item was last modified.
If in the other hand you intend to enhance the
Folder Panel functionalities, you can always
As you can see by figure 10 this column headers assign different operations depending on where
change according to the screen you are in, on the you double click by using the parameter
search screen the columns are slightly different, “fuw_e_column” in the form
and will be discussed later. “double_click_handler”.
Figure 13 – Folder Panel, folder double click Figure 14 - Folder Panel, item double click
Some considerations regarding this functionality. installed in you front-end computer, the document
will not be displayed.
The same will happen if the file does not have an
The file will be displayed or the application will
application associated.
be executed using the method “EXECUTE” of the
class “CL_GUI_FRONTEND_SERVICES” which
basically means that it will only work if your front
end is prepared to deal with the respective item.
Search Screen
As seen back in figure 9, if you click the Tree back in the Folder Pane as the search folder but
Header, the screen changes to the Search Screen, you can always change it directly in the Search
which as the name states serves to search and will Screen.
be blank when first accessed as seen in figure 10.
It’s always assumed that the search will be
performed in the folder and all sub folders, so be
careful on where you perform your search as it
This screen contains the fallowing elements.
may take a considerable amount of time if done in
the root folder for example.
- Back Button
Takes you back to the Tree Panel. The displayed - Search Pattern
folder in the Tree Panel and in the Folder panel
It’s where you specify what you want to search. If
may change depending on the one selected in the
your SAP server is running on a UNIX or AIX
Search Screen.
system the uppercase or lowercase are relevant.
You can use wildcards but not especial characters
- Search Folder like “\, /, @, #, §” and so on.
- Search Button
Performs the search, the same happens if you Note: To keep the program as simple as possible, as to
press return. dynamic SAP Dynpro programming concerns anyway,
the Search Screen left panel was created using SAP
HTML functionalities in the forms “html_prepare” and
- Search Result Display “html_show”.
Drad & Drop - Copy or Move Some considerations regarding Drag & Drop:
As stated before, you can use Drag & Drop The fist consideration you need to take regarding
functionalities to move or copy your files from drag & drop in SAP File Explorer is the focus,
folder to folder. meaning, as there is two different objects in the
main screen, the Tree and the ALV Grid (Tree
Panel and Folder Panel) you need to set the focus
on the item you want to drag by clicking on it.
So, to Drag & Drop an item you need to do it in That can be changed by passing “X” to the
two steps, first you select the item you want to “dragsrc” parameter for the ADD method in form
move or copy by clicking on it and then you click it “start_drad_drop”.
again and drag it. If you try to do it in one click
like in the windows environment for instance it
wont work unless the item was already selected. Drag & Drop wont work when moving or coping
items to the same folder, this is self imposed in the
code and you can change it in the fallowing forms
To move you just need to drag the item to the “handle_tree_on_drop” and
desired folder however to copy it, you have to “handle_ltree_on_drop” and
press the keyboard key (Ctrl) while dragging. “handle_grid_on_drop”, for the copy that is, be
careful though to correctly manage the different
versions of the item when doing so.
As a security precaution I only programmed the
Drag & Drop for files or applications, not for
folders, but that can be easily changed in the forms
“handle_tree_on_drop” and
“handle_ltree_on_drop”.
Figure 19 – Mouse Pointer on Move
User Options This second tree functions exactly the same way
as the server tree and is exactly what you see if
you use Windows Explorer for example.
This may seam redundant as you can manage your
files in a much more practical way by using the
Figure 21 – User Options Windows Explorer in the first place, the problem
is when you need to manage files across the two
different platforms as there is no way yet to Drag
From left to right the user options are: & Drop from SAP to external systems. None that
I’m aware of anyway, (correct me if I’m wrong
please!...)
As you can see in figure 23, once the button Local - Expand and collapse of the folder by clicking
PC is pressed the second tree is displayed the arrow to the left of the folder.
showing your local PC.
- Display of the folder content on the Folder
By default the root folder will always be the Panel by double clicking it.
system drive “C:\” but all other accessible drives
- Drag & Drop.
are displayed as well and can be browsed.
- Change to the Search Screen to search your
As for the Folder Panel it now displays the C
local pc by clicking the Tree Header as seen
drive content but you can freely navigate between
in figure 24.
the two systems by double clicking the desired
folder in any of the trees and the Folder Panel will
always display the contend of the selected folder. The Folder Panel itself also keeps all
Notice as well that the Address has now changed functionalities, like the Drag & Drop, the double
to display the local pc path. It will also change click to open files or folders, the sort and when
accordingly to the selected folder regardless of searching your local pc it will display the search
which tree folder you double clicked. result as well, as you can see in figure 24.
Note: The Folder Panel and the Address are refreshed As for the search screen it also retains all
only when you double click one folder, either in the functionalities as the first one in figure 17 like
Tree Panels or in the Folder Panel, they won’t change Drag & Drop double click to open files or folders
however if you just select the folder with one click. and the sort
The Back Button, the Search Folder Field, the
The Tree Header now displays your PC name, in Search Pattern Field and the Search Button all
this example XP051401 work in the same way as for the first screen but
this time for your local pc.
SAP File Explorer consist of a function group The sizes where calculated to the best fit within
with a single function module that calls a single the screen with the docking container, and are the
screen. same for the screen and the control.
Structures
You’ll need to create the fallowing two structures, the first is the internal table for folders and the second is
for the ALV Grid, so it’s advisable that you create the Data Elements for the fields because it’s there that the
columns in the ALV get the names from, that is also the reason way the icon field doesn’t need one.
ZXIS_0X_FILE
Short description: SAP File Explorer List
Field structure
Number of fields: 18
Sum of the field lengths: 1042
Field structure
Number of fields: 11
Sum of the field lengths: 1043
Function Group
- ZXIS_X_00_FILE_SERVICES
*******************************************************************
* System-defined Include-files. *
*******************************************************************
include lzxis_x_00_file_servicestop. " Global Data
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
include lzxis_x_00_file_servicesf01. " Subprograms
Import Parameters
Parameter Name Type Associated Type Optional Short Text
FIW_PATH TYPE C X Remote Server Path
Export Parameters
Parameter Name Type Associated Type Short Text
FEW_NAME TYPE C File Name
FEW_PATH TYPE C Path
FEW_PATH_NAME TYPE C File and Path
Exceptions
Exception Short text
NOT_FOUND Not Found
Source Code
function z_x_is_get_file_tree_xxxx.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(FIW_PATH) TYPE C OPTIONAL
*" EXPORTING
*" REFERENCE(FEW_NAME) TYPE C
*" REFERENCE(FEW_PATH) TYPE C
*" REFERENCE(FEW_PATH_NAME) TYPE C
*" EXCEPTIONS
*" NOT_FOUND
*"----------------------------------------------------------------------
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
data:
lw_file_name type localfile.
* Initialization Output
perform initialization.
w_server_path = fiw_path.
lw_file_name = c_wlchar.
if w_server_path is initial.
if sy-opsys = 'Windows NT'(009).
w_server_path = c_win_root.
elseif sy-opsys = c_aix.
w_server_path = c_slash.
elseif sy-opsys = c_unix.
w_server_path = c_slash.
endif.
endif.
else.
* The following characters are not allowed
message id c_msgig_fsev type c_msgty_w number c_msgno_001
with c_excp_chr
raising not_found.
endif.
endfunction.
Screen
- 100
Elements
CCONT01
OK_CODE
Flow Logic
* Process Before Output
process before output.
module status_0100.
module output_prepare.
As stated before the screen consists of a single custom control with 24/110
Figure 28 – Screen 100
Gui Status
- ST_0100
The “&’s” in the Address are replaced in run time with the path.
Top Include
- LZXIS_X_00_FILE_SERVICESTOP
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
data:
o_dataobj type ref to cl_dragdropobj,
* Grid Drag/Drop Control
o_dd_grid type ref to cl_dragdrop,
* Tree Drag/Drop Control
o_dd_tree type ref to cl_dragdrop,
* Event Handler
o_eventh type ref to cl_event_handler,
* Local Event Handler
o_eventhl type ref to cl_local_event_handler,
* File container
o_file_cont type ref to cl_gui_custom_container,
* ALV Grid
o_grid type ref to cl_gui_alv_grid,
* Frontend Services
o_gui_serv type ref to cl_gui_frontend_services,
* HTML Control
o_html_control type ref to cl_gui_html_viewer,
* Tree Control
o_tree type ref to cl_gui_alv_tree,
* Local PC Tree Control
o_treel type ref to cl_gui_alv_tree,
* Docking Container
o_tree_cont type ref to cl_gui_docking_container,
* Local PC Docking Container
o_tree_contl type ref to cl_gui_docking_container.
begin of t_file,
dirname type char600,
name type char300,
type_id type char1,
type type char10,
len(16) type p,
owner type char8,
mtime(6) type p,
mode type char9,
useable type char1,
subrc type char4,
errno type char3,
errmsg type char40,
mod_date type d,
mod_time type char8,
seen type char1,
changed type char1,
end of t_file,
begin of t_node,
node_key type tv_nodekey,
dirname type char600,
name type char300,
drive type char300,
end of t_node,
begin of t_drv,
drive type char300,
type type char20,
desc type char300,
end of t_drv.
data:
begin of i_server_data occurs 0,
line type char300,
end of i_server_data.
Classes Include
- LZXIS_X_00_FILE_SERVICESCL0
This should be included at the end of TOP Include as seen above, the easier way is to create it in the object
navigator (SE80), in the function group tree right click in the includes node and select create and give the
include name.
*----------------------------------------------------------------------*
***INCLUDE LZXIS_X_00_FILE_SERVICESCL0 .
*----------------------------------------------------------------------*
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
* CLASS cl_event_handler DEFINITION
*-----------------------------------------------------------------------
class cl_event_handler definition.
public section.
methods:
* Handle Node Double Click
handle_node_double_click
for event node_double_click of cl_gui_alv_tree
importing node_key,
*-----------------------------------------------------------------------
* CLASS cl_local_event_handler DEFINITION
*-----------------------------------------------------------------------
class cl_local_event_handler definition.
public section.
methods:
* Handle Node Double Click
handle_node_double_click
for event node_double_click of cl_gui_alv_tree
importing node_key,
*-----------------------------------------------------------------------
* CLASS cl_dragdropobj DEFINITION
*-----------------------------------------------------------------------
class cl_dragdropobj definition.
public section.
data:
l_file_list_d type zxis_0x_file_d,
w_index type i.
*-----------------------------------------------------------------------
* CLASS cl_event_handler IMPLEMENTATION
*-----------------------------------------------------------------------
class cl_event_handler implementation.
* Display Files
perform node_double_click using w_node_key.
endmethod. "handle_node_double_click
* Search Pattern
perform set_search_pattern.
endmethod. "handle_header_click
endmethod. "handle_expand_no_children
endmethod. "handle_on_drop
endmethod . "handle_double_click
endmethod . "handle_ondrag
endmethod . "handle_ondropcomplete
w_action = action.
i_query_table = query_table.
case w_action.
when c_back.
* Back to Folder Tree
perform back_to_tree.
when c_search.
* Search
perform folder_search.
endcase.
endmethod. "handle_on_sapevent
*-----------------------------------------------------------------------
* CLASS cl_local_event_handler IMPLEMENTATION
*-----------------------------------------------------------------------
class cl_local_event_handler implementation.
* Display Files
perform lnode_double_click using w_lnode_key.
endmethod. "handle_node_double_click
* Search Pattern
perform set_lsearch_pattern.
endmethod. "handle_header_click
endmethod. "handle_expand_no_children
endmethod. "handle_on_drop
w_action = action.
i_lquery_table = query_table.
case w_action.
when c_back.
* Back to Folder Tree
perform back_to_loc_tree.
when c_search.
* Search Local PC
perform loc_folder_search.
endcase.
endmethod. "handle_on_sapevent
Forms Include
- LZXIS_X_00_FILE_SERVICESF01
*-----------------------------------------------------------------------
***INCLUDE LZXIS_X_00_FILE_SERVICESF01 .
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
* Form initialization
*-----------------------------------------------------------------------
form initialization .
* Initialize Data
perform clear_data.
*-----------------------------------------------------------------------
* Form clear_data
*-----------------------------------------------------------------------
form clear_data .
clear:
o_dataobj, o_dd_grid, o_dd_tree, o_eventh, o_eventhl, o_file_cont,
o_grid, o_gui_serv, o_html_control, o_tree, o_treel, o_tree_cont,
o_tree_contl.
clear:
i_buftab_t, i_drv, i_file_list, i_file_list_d, i_html, i_kpath,
i_log_list, i_log_listl, i_node, i_nodel, i_query_table,
i_lquery_table, i_sort.
clear:
ok_code, w_act, w_action, w_dct, w_dd_target_name, w_dest,
w_dest_path, w_drive, w_dropeffect, w_dysp_path, w_file_dest,
w_file_name, w_file_path, w_file_path_name, w_find_path,
w_handle_grid, w_handle_tree, w_html_line, w_lnode_key, w_loc,
w_lpath_name, w_nnode_key, w_node_key, w_path_name, w_pcname,
w_perf, w_platform, w_return, w_returns, w_search_name,
w_search_path, w_server_path, w_src, w_srcd, w_srcl, w_strlen,
w_type, w_unixcomm.
*-----------------------------------------------------------------------
* Form initiate_gui
*-----------------------------------------------------------------------
form initiate_gui .
if w_file_path is initial.
w_file_path = w_server_path.
endif.
*-----------------------------------------------------------------------
* Form grid_prepare
*-----------------------------------------------------------------------
form grid_prepare .
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form output_prepare
*-----------------------------------------------------------------------
form output_prepare .
data:
li_events type standard table of cntl_simple_event.
data:
ll_event type cntl_simple_event.
data:
lw_repid type sy-repid,
lw_dynnr type sy-dynnr,
lw_flag type as4flag,
lw_ext type i value '300'.
lw_repid = sy-repid.
lw_dynnr = sy-dynnr.
w_act = c_x.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
lw_flag = c_x.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if w_src is initial.
* Initiate Drag & Drop
perform start_drad_drop.
* Header click
ll_event-eventid = cl_gui_column_tree=>eventid_header_click.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Expand no Children
ll_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Set Events
call method o_tree->set_registered_events
exporting
events = li_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form set_tree_layout
*-----------------------------------------------------------------------
form set_tree_layout .
data:
li_fieldcat type standard table of lvc_s_fcat.
data:
ll_header type treev_hhdr.
field-symbols:
<lf_fieldcat> type lvc_s_fcat.
*-----------------------------------------------------------------------
* Form set_local_tree_layout
*-----------------------------------------------------------------------
form set_local_tree_layout .
data:
li_fieldcat type standard table of lvc_s_fcat.
data:
ll_header type treev_hhdr.
field-symbols:
<lf_fieldcat> type lvc_s_fcat.
clear: w_pcname.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form set_grid_layout
*-----------------------------------------------------------------------
form set_grid_layout .
data:
li_fieldcat type standard table of lvc_s_fcat,
li_fieldcatalog type standard table of lvc_s_fcat.
data:
ll_layout type lvc_s_layo.
data:
lw_structure_name type tabname.
field-symbols:
<lf_fieldcat> type lvc_s_fcat.
clear: ll_layout.
lw_structure_name = c_file_disp.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if w_srcd is initial.
* Name - Output column 2
if <lf_fieldcat>-fieldname = c_name.
clear: <lf_fieldcat>-no_out.
<lf_fieldcat>-col_pos = c_2.
<lf_fieldcat>-outputlen = c_45.
<lf_fieldcat>-lowercase = c_x.
endif.
else.
* Name - Output column 2
if <lf_fieldcat>-fieldname = c_name.
clear: <lf_fieldcat>-no_out.
<lf_fieldcat>-col_pos = c_2.
<lf_fieldcat>-outputlen = c_30.
<lf_fieldcat>-lowercase = c_x.
endif.
clear: w_srcd.
* Prepare layout
perform prepare_display_layout.
** Get active
* CALL METHOD o_grid->get_frontend_fieldcatalog
* IMPORTING
* et_fieldcatalog = li_fieldcatalog.
if li_fieldcatalog[] is initial.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
else.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
*-----------------------------------------------------------------------
* Form start_drad_drop
*-----------------------------------------------------------------------
form start_drad_drop .
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form prepare_display_layout
*-----------------------------------------------------------------------
form prepare_display_layout .
data:
ll_file_list type zxis_0x_file,
ll_file_list_d type zxis_0x_file_d.
data:
lw_extenc type char5,
lw_lenght type i.
ll_file_list_d-type_f = c_bin.
case ll_file_list_d-type_id.
when 'D'.
ll_file_list_d-icon = '@IH@'.
ll_file_list_d-type = 'File Folder'(108).
when 'F'.
if lw_extenc cs '.txt'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'TXT'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'Text Document'(100).
elseif lw_extenc cs '.ini'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'INI'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'Configuration Settings'(101).
elseif lw_extenc cs '.sap'.
ll_file_list_d-icon = '@E3@'.
ll_file_list_d-file_id = 'SAP'.
ll_file_list_d-type = 'SAP GUI Shortcut'(102).
elseif lw_extenc cs '.api'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'API'.
ll_file_list_d-type = 'API File'(103).
elseif lw_extenc cs '.tp0'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'TP0'.
ll_file_list_d-type = 'TP0 File'(104).
elseif lw_extenc cs '.par'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'PAR'.
ll_file_list_d-type = 'PAR File'(105).
elseif lw_extenc cs '.tql'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'TQL'.
ll_file_list_d-type = 'TQL File'(106).
elseif lw_extenc cs '.bck'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'BCK'.
ll_file_list_d-type = 'BCK File'(107).
elseif lw_extenc cs '.cfg'.
ll_file_list_d-icon = '@EQ@'.
ll_file_list_d-file_id = 'CFG'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'CFG File'(109).
elseif lw_extenc cs '.log'.
ll_file_list_d-icon = '@DR@'.
ll_file_list_d-file_id = 'LOG'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'Log File'(110).
elseif lw_extenc cs '.eco'.
ll_file_list_d-icon = '@9P@'.
ll_file_list_d-file_id = 'ECO'.
ll_file_list_d-type = 'ECO File'(111).
elseif lw_extenc cs '.tpp'.
ll_file_list_d-icon = '@9P@'.
ll_file_list_d-file_id = 'TPP'.
ll_file_list_d-type = 'TPP File'(112).
elseif lw_extenc cs '.doc'.
ll_file_list_d-icon = '@J7@'.
ll_file_list_d-file_id = 'DOC'.
ll_file_list_d-type = 'Microsoft Office Word Document'(113).
elseif lw_extenc cs '.its'.
ll_file_list_d-icon = '@IZ@'.
ll_file_list_d-file_id = 'ITS'.
ll_file_list_d-type = 'Internet Document Set'(114).
elseif lw_extenc cs '.inf'.
ll_file_list_d-icon = '@9E@'.
ll_file_list_d-file_id = 'INF'.
ll_file_list_d-type = 'Setup Information'(115).
elseif lw_extenc cs '.rec'.
ll_file_list_d-icon = '@I5@'.
ll_file_list_d-file_id = 'REC'.
ll_file_list_d-type = 'REC File'(116).
elseif lw_extenc cs '.trc'.
ll_file_list_d-icon = '@96@'.
ll_file_list_d-file_id = 'TRC'.
ll_file_list_d-type = 'TRC File'(117).
elseif lw_extenc cs '.lst'.
ll_file_list_d-icon = '@DH@'.
ll_file_list_d-file_id = 'LST'.
ll_file_list_d-type = 'LST File'(118).
elseif lw_extenc cs '.sav'.
ll_file_list_d-icon = '@96@'.
ll_file_list_d-file_id = 'SAV'.
ll_file_list_d-type = 'SAV File'(119).
elseif lw_extenc cs '.tmp'.
ll_file_list_d-icon = '@9D@'.
ll_file_list_d-file_id = 'TMP'.
ll_file_list_d-type = 'TMP File'(120).
elseif lw_extenc cs '.elg'.
ll_file_list_d-icon = '@KK@'.
ll_file_list_d-file_id = 'ELG'.
ll_file_list_d-type = 'ELG File'(121).
elseif lw_extenc cs '.wlg'.
ll_file_list_d-icon = '@9O@'.
ll_file_list_d-file_id = 'WLG'.
ll_file_list_d-type = 'WLG File'(122).
elseif lw_extenc cs '.htm'.
ll_file_list_d-icon = '@J4@'.
ll_file_list_d-file_id = 'HTM'.
ll_file_list_d-type = 'HTML Document'(123).
elseif lw_extenc cs '.htt'.
ll_file_list_d-icon = '@IY@'.
ll_file_list_d-file_id = 'HTT'.
ll_file_list_d-type = 'HyperText Template'(124).
elseif lw_extenc cs '.url'.
ll_file_list_d-icon = '@8S@'.
ll_file_list_d-file_id = 'URL'.
ll_file_list_d-type = 'Internet Shortcut'(125).
elseif lw_extenc cs '.xml'.
ll_file_list_d-icon = '@IZ@'.
ll_file_list_d-file_id = 'XML'.
ll_file_list_d-type = 'XML Document'(126).
elseif lw_extenc cs '.hlp'.
ll_file_list_d-icon = '@5E@'.
ll_file_list_d-file_id = 'HLP'.
ll_file_list_d-type = 'Help File'(127).
elseif lw_extenc cs '.sys'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'SYS'.
ll_file_list_d-type = 'System file'(128).
elseif lw_extenc cs '.cmd'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'CMD'.
ll_file_list_d-type = 'Windows Command Script'(129).
elseif lw_extenc cs '.pid'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'PID'.
ll_file_list_d-type = 'PID File'(130).
elseif lw_extenc cs '.tag'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'TAG'.
ll_file_list_d-type = 'TAG File'(131).
elseif lw_extenc cs '.dev'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'DEV'.
ll_file_list_d-type = 'DEV File'(132).
elseif lw_extenc cs '.pci'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'PCI'.
ll_file_list_d-type = 'PCI File'(133).
elseif lw_extenc cs '.cat'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'CAT'.
ll_file_list_d-type = 'Security Catalog'(134).
elseif lw_extenc cs '.smp'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'SMP'.
ll_file_list_d-type = 'SMP File'(135).
elseif lw_extenc cs '.opt'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'OPT'.
ll_file_list_d-type = 'OPT File'(136).
elseif lw_extenc cs '.aix'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'AIX'.
ll_file_list_d-type = 'AIX File'(137).
elseif lw_extenc cs '.dll'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'DLL'.
ll_file_list_d-type = 'Application Extension'(138).
elseif lw_extenc cs '.drv'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'DRV'.
ll_file_list_d-type = 'Device driver'(139).
elseif lw_extenc cs '.ttf'.
ll_file_list_d-icon = '@AI@'.
ll_file_list_d-file_id = 'TTF'.
ll_file_list_d-type = 'TrueType Font file'(140).
elseif lw_extenc cs '.old'.
ll_file_list_d-icon = '@DH@'.
ll_file_list_d-file_id = 'OLD'.
ll_file_list_d-type = 'OLD File'(141).
elseif lw_extenc cs '.dmp'.
ll_file_list_d-icon = '@DH@'.
ll_file_list_d-file_id = 'DMP'.
ll_file_list_d-type = 'DMP File'(142).
elseif lw_extenc cs '.ica'.
ll_file_list_d-icon = '@GA@'.
ll_file_list_d-file_id = 'ICA'.
ll_file_list_d-type = 'ICA File'(143).
elseif lw_extenc cs '.pks'.
ll_file_list_d-icon = '@DH@'.
ll_file_list_d-file_id = 'PKS'.
ll_file_list_d-type = 'PKS File'(144).
elseif lw_extenc cs '.buf'.
ll_file_list_d-icon = '@NB@'.
ll_file_list_d-file_id = 'BUF'.
ll_file_list_d-type = 'BUF File'(145).
elseif lw_extenc cs '.pcf'.
ll_file_list_d-icon = '@AI@'.
ll_file_list_d-file_id = 'PCF'.
ll_file_list_d-type = 'PCF File'(146).
elseif lw_extenc cs '.out'.
ll_file_list_d-icon = '@AI@'.
ll_file_list_d-file_id = 'OUT'.
ll_file_list_d-type = 'OUT File'(147).
elseif lw_extenc cs '.hot'.
ll_file_list_d-icon = '@9N@'.
ll_file_list_d-file_id = 'HOT'.
ll_file_list_d-type = 'HOT File'(148).
elseif lw_extenc cs '.spc'.
ll_file_list_d-icon = '@9P@'.
ll_file_list_d-file_id = 'SPC'.
ll_file_list_d-type = 'PKCS Certificates'(149).
elseif lw_extenc cs '.exe'.
ll_file_list_d-icon = '@9X@'.
ll_file_list_d-file_id = 'EXE'.
ll_file_list_d-type = 'Application'(150).
elseif lw_extenc cs '.sar'.
ll_file_list_d-icon = '@9Y@'.
ll_file_list_d-file_id = 'SAR'.
ll_file_list_d-type = 'SAR File'(151).
elseif lw_extenc cs '.bat'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'BAT'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'MS-DOS Batch File'(152).
elseif lw_extenc cs '.tar'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'TAR'.
ll_file_list_d-type = 'TAR File'(153).
elseif lw_extenc cs '.ora'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'ORA'.
ll_file_list_d-type = 'ORA File'(154).
elseif lw_extenc cs '.dba'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'DBA'.
ll_file_list_d-type = 'DBA File'(155).
elseif lw_extenc cs '.sh'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'SH'.
ll_file_list_d-type = 'SH File'(156).
elseif lw_extenc cs '.bak'.
ll_file_list_d-icon = '@9V@'.
ll_file_list_d-file_id = 'BAK'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'BAK File'(157).
elseif lw_extenc cs '.pfb'.
ll_file_list_d-icon = '@AI@'.
ll_file_list_d-file_id = 'PFB'.
ll_file_list_d-type = 'PFB File'(158).
elseif lw_extenc cs '.ppt'.
ll_file_list_d-icon = '@J5@'.
ll_file_list_d-file_id = 'PPT'.
ll_file_list_d-type = 'Microsoft Office PowerPoint Presentation'(159).
elseif lw_extenc cs '.dot'.
ll_file_list_d-icon = '@J6@'.
ll_file_list_d-file_id = 'DOT'.
ll_file_list_d-type = 'Microsoft Office Word Template'(160).
elseif lw_extenc cs '.tpl'.
ll_file_list_d-icon = '@A7@'.
ll_file_list_d-file_id = 'TPL'.
ll_file_list_d-type = 'TPL File'(161).
elseif lw_extenc cs '.eml'.
ll_file_list_d-icon = '@J8@'.
ll_file_list_d-file_id = 'EML'.
ll_file_list_d-type = 'Outlook Express Mail Message'(162).
elseif lw_extenc cs '.rtf'.
ll_file_list_d-icon = '@J9@'.
ll_file_list_d-file_id = 'RTF'.
ll_file_list_d-type = 'Rich Text Format'(163).
elseif lw_extenc cs '.pdf'.
ll_file_list_d-icon = '@IT@'.
ll_file_list_d-file_id = 'PDF'.
ll_file_list_d-type = 'Adobe Acrobat Document'(164).
elseif lw_extenc cs '.ps'.
ll_file_list_d-icon = '@IT@'.
ll_file_list_d-file_id = 'PS'.
ll_file_list_d-type = 'TPS File'(165).
elseif lw_extenc cs '.otf'.
ll_file_list_d-icon = '@OA@'.
ll_file_list_d-file_id = 'OTF'.
ll_file_list_d-type = 'OTF Document'(166).
elseif lw_extenc cs '.tif'.
ll_file_list_d-icon = '@JA@'.
ll_file_list_d-file_id = 'TIF'.
ll_file_list_d-type = 'TIF Image Document'(167).
elseif lw_extenc cs '.ico'.
ll_file_list_d-icon = '@GZ@'.
ll_file_list_d-file_id = 'ICO'.
ll_file_list_d-type = 'Icon'(168).
elseif lw_extenc cs '.gif'.
ll_file_list_d-icon = '@IW@'.
ll_file_list_d-file_id = 'GIF'.
ll_file_list_d-type = 'GIF Image'(169).
elseif lw_extenc cs '.wri'.
ll_file_list_d-icon = '@JB@'.
ll_file_list_d-file_id = 'WRI'.
ll_file_list_d-type = 'Write Document'(170).
elseif lw_extenc cs '.prd'.
ll_file_list_d-icon = '@EW@'.
ll_file_list_d-file_id = 'PRD'.
ll_file_list_d-type = 'PRD File'(171).
elseif lw_extenc cs '.prn'.
ll_file_list_d-icon = '@0X@'.
ll_file_list_d-file_id = 'PRN'.
ll_file_list_d-type = 'PRN File'(172).
elseif lw_extenc cs '.xpm'.
ll_file_list_d-icon = '@EU@'.
ll_file_list_d-file_id = 'XPM'.
ll_file_list_d-type = 'XPM File'(173).
elseif lw_extenc cs '.vsd'.
ll_file_list_d-icon = '@JE@'.
ll_file_list_d-file_id = 'VSD'.
ll_file_list_d-type = 'Microsoft Visio Document'(174).
elseif lw_extenc cs '.bmp'.
ll_file_list_d-icon = '@IU@'.
ll_file_list_d-file_id = 'BMP'.
ll_file_list_d-type = 'Bitmap Image'(175).
elseif lw_extenc cs '.png'.
ll_file_list_d-icon = '@IU@'.
ll_file_list_d-file_id = 'PNG'.
ll_file_list_d-type = 'PNG Image'(176).
elseif lw_extenc cs '.xls'.
ll_file_list_d-icon = '@J2@'.
ll_file_list_d-file_id = 'XLS'.
ll_file_list_d-type = 'Microsoft Office Excel Worksheet'(177).
elseif lw_extenc cs '.csv'.
ll_file_list_d-icon = '@J2@'.
ll_file_list_d-file_id = 'CSV'.
ll_file_list_d-type = 'Microsoft Office Excel Comma Separated Values
File'(201).
elseif lw_extenc cs '.jpg'.
ll_file_list_d-icon = '@J0@'.
ll_file_list_d-file_id = 'JPG'.
ll_file_list_d-type = 'JPEG Image'(178).
elseif lw_extenc cs '.xwd'.
ll_file_list_d-icon = '@J0@'.
ll_file_list_d-file_id = 'XWD'.
ll_file_list_d-type = 'XWD File'(179).
elseif lw_extenc cs '.xbm'.
ll_file_list_d-icon = '@NI@'.
ll_file_list_d-file_id = 'XBM'.
ll_file_list_d-type = 'XBM File'(180).
elseif lw_extenc cs '.zip'.
ll_file_list_d-icon = '@12@'.
ll_file_list_d-file_id = 'ZIP'.
ll_file_list_d-type = 'Compressed (zipped) Folder'(181).
elseif lw_extenc cs '.dat'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'DAT'.
ll_file_list_d-type = 'DAT File'(182).
elseif lw_extenc cs '.mon'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'MON'.
ll_file_list_d-type = 'MON File'(183).
elseif lw_extenc cs '.inp'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'INP'.
ll_file_list_d-type = 'INP File'(184).
elseif lw_extenc cs '.pfl'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'PFL'.
ll_file_list_d-type = 'PFL File'(185).
elseif lw_extenc cs '.car'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'CAR'.
ll_file_list_d-type = 'CAR File'(186).
elseif lw_extenc cs '.mss'.
ll_file_list_d-icon = '@IF@'.
ll_file_list_d-file_id = 'MSS'.
ll_file_list_d-type = 'MSS File'(187).
elseif lw_extenc cs '.asp'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'ASP'.
ll_file_list_d-type = 'ASP File'(188).
elseif lw_extenc cs '.ccs'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'CCS'.
ll_file_list_d-type = 'CCS File'(189).
elseif lw_extenc cs '.sc1'.
ll_file_list_d-icon = '@9U@'.
ll_file_list_d-file_id = 'SC1'.
ll_file_list_d-type = 'SC1 File'(190).
elseif lw_extenc cs '.ext'.
ll_file_list_d-icon = '@O8@'.
ll_file_list_d-file_id = 'EXT'.
ll_file_list_d-type = 'EXT File'(191).
elseif lw_extenc cs '.lib'.
ll_file_list_d-icon = '@DH@'.
ll_file_list_d-file_id = 'LIB'.
ll_file_list_d-type = 'LIB File'(192).
elseif lw_extenc cs '.http'.
ll_file_list_d-icon = '@IX@'.
ll_file_list_d-file_id = 'HTP'.
ll_file_list_d-type = 'HTTP File'(193).
elseif lw_extenc cs '.avi'.
ll_file_list_d-icon = '@5L@'.
ll_file_list_d-file_id = 'AVI'.
ll_file_list_d-type = 'Video Clip'(194).
elseif lw_extenc cs '.wav'.
ll_file_list_d-icon = '@5L@'.
ll_file_list_d-file_id = 'WAV'.
ll_file_list_d-type = 'Wave Sound'(195).
elseif lw_extenc cs '.snd'.
ll_file_list_d-icon = '@5L@'.
ll_file_list_d-file_id = 'SND'.
ll_file_list_d-type = 'AU Format Sound'(196).
elseif lw_extenc cs '.mp3'.
ll_file_list_d-icon = '@5L@'.
ll_file_list_d-file_id = 'MP3'.
ll_file_list_d-type = 'MP3 Format Sound'(197).
elseif lw_extenc cs '.sql'.
ll_file_list_d-icon = '@PO@'.
ll_file_list_d-file_id = 'SQL'.
ll_file_list_d-type = 'SQL File'(198).
elseif lw_extenc cs '.jar'.
ll_file_list_d-icon = '@N5@'.
ll_file_list_d-file_id = 'JAR'.
ll_file_list_d-type = 'Executable Jar File'(200).
else.
ll_file_list_d-icon = '@O9@'.
shift lw_extenc right deleting trailing space.
if sy-subrc is initial.
ll_file_list_d-file_id = lw_extenc+2(3).
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'File'(199).
else.
ll_file_list_d-file_id = 'ANY'.
ll_file_list_d-type_f = c_asc.
ll_file_list_d-type = 'File'(199).
endif.
endif.
when others.
ll_file_list_d-icon = '@IH@'.
endcase.
endloop.
clear: lw_lenght.
describe table i_file_list_d lines lw_lenght.
if lw_lenght is initial.
clear: ll_file_list_d.
ll_file_list_d-type_id = 'Z'.
ll_file_list_d-file_id = 'ZZZ'.
while lw_lenght < c_25.
append ll_file_list_d to i_file_list_d.
lw_lenght = lw_lenght + 1.
endwhile.
endif.
*-----------------------------------------------------------------------
* Form free_control
*-----------------------------------------------------------------------
form free_control .
* Free containers
call method o_tree_cont->free.
call method o_file_cont->free.
* Clear Data
perform clear_data.
*-----------------------------------------------------------------------
* Form get_file_list
*-----------------------------------------------------------------------
form get_file_list using fuw_path type any
fuw_file type any.
data:
ll_file type t_file,
ll_file_list type zxis_0x_file.
data:
lw_path_name type localfile,
lw_file_name type localfile,
lw_errcnt type p,
lw_date type char8,
lw_length3(16) type p.
w_path_name = fuw_path.
lw_path_name = fuw_path.
lw_file_name = fuw_file.
clear: ll_file, i_file_list, ll_file_list.
refresh: i_file_list.
if sy-subrc <> 0.
* Access Error
message id c_msgig_fsev type c_msgty_s number c_msgno_003
with ll_file-errmsg.
else.
do.
clear ll_file.
call 'C_DIR_READ_NEXT'
id c_type field ll_file-type
id c_name field ll_file-name
id c_len field ll_file-len
id c_owner field ll_file-owner
id c_mtime field ll_file-mtime
id c_mode field ll_file-mode
id c_errno field ll_file-errno
id c_errmsg field ll_file-errmsg.
ll_file-dirname = lw_path_name.
case sy-subrc.
when 0.
clear: ll_file-errno, ll_file-errmsg.
case ll_file-type(1).
endcase.
if ll_file-len = 0.
move c_sap_no to ll_file-useable.
endif.
when 1.
exit.
if sy-subrc = 5.
move: c_qstmrk to ll_file-type,
c_qstmrk to ll_file-owner,
c_qstmrk to ll_file-mode.
endif.
move c_sap_no to ll_file-useable.
endcase.
if ll_file-subrc = 0.
if ll_file-type = 'directory'(005).
ll_file-type = 'Directory'(006).
ll_file-type_id = c_d.
if ll_file-name = c_dot.
ll_file_list-file_id = c_dira.
elseif ll_file-name(2) = c_ddot.
ll_file_list-file_id = c_dirb.
else.
ll_file_list-file_id = c_dirc.
endif.
lw_length3 = ll_file-len.
lw_date = ll_file-mod_date.
ll_file_list-date = lw_date.
if ll_file-name(1) = c_dot
or ll_file-name(2) = c_ddot.
clear: ll_file.
else.
ll_file_list-seen = c_r.
append ll_file_list to i_file_list.
endif.
endif.
enddo.
endif.
*-----------------------------------------------------------------------
* Form get_loc_file_list
*-----------------------------------------------------------------------
form get_loc_file_list using fuw_path type any
fuw_file type any.
data:
li_file_tab type standard table of file_info.
data:
ll_file_list type zxis_0x_file,
ll_file_tab type file_info.
data:
lw_count type i,
lw_path_name type string,
lw_file_name type string,
lw_date type char8,
lw_list type abap_bool value c_x.
w_lpath_name = fuw_path.
lw_path_name = fuw_path.
lw_file_name = fuw_file.
if lw_path_name is initial.
lw_path_name = c_win_root.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ll_file_list-dirname = lw_path_name.
ll_file_list-name = ll_file_tab-filename.
ll_file_list-type_id = c_d.
ll_file_list-file_id = c_dirc.
ll_file_list-type = 'Directory'(006).
ll_file_list-len = ll_file_tab-filelength.
ll_file_list-mtime = ll_file_tab-createtime.
ll_file_list-date = ll_file_tab-createdate.
ll_file_list-mod_time = ll_file_tab-createtime.
ll_file_list-seen = c_f.
lw_date = ll_file_tab-createdate.
write lw_date to ll_file_list-mod_date
using edit mask c_editm_dt.
ll_file_list-dirname = lw_path_name.
ll_file_list-name = ll_file_tab-filename.
ll_file_list-type_id = c_f.
ll_file_list-file_id = c_firc.
ll_file_list-type = 'File'(001).
ll_file_list-len = ll_file_tab-filelength.
ll_file_list-mtime = ll_file_tab-createtime.
ll_file_list-date = ll_file_tab-createdate.
ll_file_list-mod_time = ll_file_tab-createtime.
ll_file_list-seen = c_f.
lw_date = ll_file_tab-createdate.
write lw_date to ll_file_list-mod_date
using edit mask c_editm_dt.
*-----------------------------------------------------------------------
* Form search_loc_pc
*-----------------------------------------------------------------------
form search_loc_pc tables fti_file_list structure zxis_0x_file
using fuw_path type any
fuw_file type any.
data:
li_file_tab type standard table of file_info,
li_folder_list type standard table of zxis_0x_file.
data:
ll_file_list type zxis_0x_file,
ll_folder_list type zxis_0x_file,
ll_file_tab type file_info.
data:
lw_count type i,
lw_chag_name type zxis_dirname,
lw_path_name type string,
lw_file_name type string,
lw_date type char8,
lw_list type abap_bool value c_x.
clear: fti_file_list.
refresh: fti_file_list.
lw_chag_name = fuw_path.
lw_file_name = fuw_file.
if lw_chag_name is initial.
lw_chag_name = c_win_root.
endif.
ll_folder_list-dirname = lw_chag_name.
append ll_folder_list to li_folder_list.
clear: ll_folder_list.
lw_path_name = lw_chag_name.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ll_file_list-dirname = lw_path_name.
ll_file_list-name = ll_file_tab-filename.
ll_file_list-type_id = c_d.
ll_file_list-file_id = c_dirc.
ll_file_list-type = 'Directory'(006).
ll_file_list-len = ll_file_tab-filelength.
ll_file_list-mtime = ll_file_tab-createtime.
ll_file_list-date = ll_file_tab-createdate.
ll_file_list-mod_time = ll_file_tab-createtime.
ll_file_list-seen = c_f.
lw_date = ll_file_tab-createdate.
write lw_date to ll_file_list-mod_date
using edit mask c_editm_dt.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ll_file_list-dirname = lw_path_name.
ll_file_list-name = ll_file_tab-filename.
ll_file_list-type_id = c_f.
ll_file_list-file_id = c_firc.
ll_file_list-type = 'File'(001).
ll_file_list-len = ll_file_tab-filelength.
ll_file_list-mtime = ll_file_tab-createtime.
ll_file_list-date = ll_file_tab-createdate.
ll_file_list-mod_time = ll_file_tab-createtime.
ll_file_list-seen = c_f.
lw_date = ll_file_tab-createdate.
write lw_date to ll_file_list-mod_date
using edit mask c_editm_dt.
*-----------------------------------------------------------------------
* Form get_folders
*-----------------------------------------------------------------------
form get_folders tables fti_file_list structure zxis_0x_file
using fuw_path type any.
data:
li_file_tab type standard table of file_info,
li_folder_list type standard table of zxis_0x_file.
data:
ll_folder_list type zxis_0x_file,
ll_file_tab type file_info.
data:
lw_count type i,
lw_path_name type string,
lw_file_name type string,
lw_list type abap_bool value c_x.
lw_path_name = fuw_path.
lw_file_name = c_wlchar.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form check_path_name
*-----------------------------------------------------------------------
form check_path_name changing fcw_path_name type any
fcw_file_name type any.
data:
ll_file_list type zxis_0x_file.
data:
lw_file_type type char10,
lw_errno type char3,
lw_errmsg type char40,
lw_length type i,
lw_length1 type i.
if fcw_path_name is initial.
if sy-opsys = 'Windows NT'(009).
fcw_path_name = c_win_root.
elseif sy-opsys = c_aix.
fcw_path_name = c_slash.
elseif sy-opsys = c_unix.
fcw_path_name = c_slash.
endif.
else.
if sy-opsys = 'Windows NT'(009).
if fcw_path_name+1(2) <> c_wroot.
clear: fcw_path_name.
fcw_path_name(3) = c_win_root.
endif.
elseif sy-opsys = c_aix.
if fcw_path_name(1) <> c_slash.
concatenate
c_slash
fcw_path_name
into fcw_path_name.
endif.
elseif sy-opsys = c_unix.
if fcw_path_name(1) <> c_slash.
concatenate
c_slash
fcw_path_name
into fcw_path_name.
endif.
endif.
endif.
if lw_errno <> 0.
* No such file or directory
if lw_errno = c_err2.
if sy-opsys = 'Windows NT'(009).
fcw_path_name = c_win_root.
elseif sy-opsys = c_aix.
fcw_path_name = c_slash.
elseif sy-opsys = c_unix.
fcw_path_name = c_slash.
endif.
* Access Error
message id c_msgig_fsev type c_msgty_s number c_msgno_003
with lw_errmsg.
else.
if lw_file_type = 'directory'(005).
lw_length = strlen( fcw_path_name ).
lw_length1 = lw_length - 1.
endif.
endif.
endif.
endif.
*-----------------------------------------------------------------------
* Form filename_useable
*-----------------------------------------------------------------------
form filename_useable using fuw_file_name type any
fuw_file_useable type any.
data:
lw_name type char300.
lw_name = fuw_file_name.
if lw_name(4) = c_core.
fuw_file_useable = c_sap_no.
else.
fuw_file_useable = c_sap_yes.
endif.
*-----------------------------------------------------------------------
* Form date_time_tz
*-----------------------------------------------------------------------
form date_time_tz using fuw_file_mtime type any
fuw_file_mod_time type any
fuw_file_mod_date type any.
data:
lw_opcode type x,
lw_timestamp type i,
lw_date type d,
lw_time type t,
lw_tz type systzonlo,
lw_timestring type char10,
lw_abapstamp type char14,
lw_abaptstamp type timestamp.
lw_timestamp = fuw_file_mtime.
if sy-zonlo = space.
lw_tz = sy-tzone.
concatenate c_utc lw_tz into lw_tz.
else.
lw_tz = sy-zonlo.
endif.
lw_opcode = c_3.
lw_abaptstamp = lw_abapstamp.
if sy-subrc <> 0.
lw_date = lw_abapstamp(8).
lw_time = lw_abapstamp+8.
endif.
*-----------------------------------------------------------------------
* Form split_name
*-----------------------------------------------------------------------
form split_name changing fcw_path_name type any
fcw_file_name type any.
data:
lw_subrc type sysubrc.
fcw_file_name = fcw_path_name.
clear: lw_subrc, fcw_path_name.
if sy-subrc is initial.
w_strlen = sy-fdpos + 1.
concatenate
fcw_path_name
fcw_file_name(w_strlen)
into fcw_path_name.
else.
lw_subrc = sy-subrc.
endif.
endwhile.
*-----------------------------------------------------------------------
* Form split_lname
*-----------------------------------------------------------------------
form split_lname changing fcw_path_name type any
fcw_file_name type any.
data:
lw_subrc type sysubrc.
fcw_file_name = fcw_path_name.
clear: lw_subrc, fcw_path_name.
if sy-subrc is initial.
w_strlen = sy-fdpos + 1.
concatenate
fcw_path_name
fcw_file_name(w_strlen)
into fcw_path_name.
else.
lw_subrc = sy-subrc.
endif.
endwhile.
*-----------------------------------------------------------------------
* Form tree_prepare
*-----------------------------------------------------------------------
form tree_prepare .
data:
ll_node type t_node,
ll_node_layout type lvc_s_layn.
data:
lw_node_text type lvc_value,
lw_node_key type lvc_nkey,
lw_relationship type i.
lw_node_key = space.
lw_node_text = c_slash.
lw_relationship = c_0.
ll_node_layout-isfolder = c_x.
ll_node_layout-expander = c_x.
ll_node_layout-dragdropid = w_handle_tree.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_tree->frontend_update.
*-----------------------------------------------------------------------
* Form local_tree_prepare
*-----------------------------------------------------------------------
form local_tree_prepare .
data:
ll_drv type t_drv,
ll_node type t_node,
ll_node_layout type lvc_s_layn.
data:
lw_node_text type lvc_value,
lw_node_key type lvc_nkey,
lw_relationship type i.
loop at i_drv into ll_drv.
clear: lw_node_key, lw_node_text, lw_relationship, ll_node_layout.
lw_node_text = ll_drv-desc.
lw_relationship = c_0.
ll_node_layout-isfolder = c_x.
ll_node_layout-expander = c_x.
ll_node_layout-dragdropid = w_handle_tree.
ll_node_layout-n_image = '@G6@'.
ll_node_layout-exp_image = '@G6@'.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_treel->frontend_update.
w_lnode_key = ll_node-node_key.
*-----------------------------------------------------------------------
* Form getto_dest_path
*-----------------------------------------------------------------------
form getto_dest_path using fuw_path type char200
changing fcw_key type tv_nodekey.
types:
begin of lt_path_tab,
dirname type localfile,
end of lt_path_tab.
data:
li_path_tab type standard table of lt_path_tab.
data:
ll_node type t_node,
ll_path_tab type lt_path_tab.
data:
lw_path type localfile,
lw_ppath type localfile,
lw_file type char1 value c_wlchar,
lw_node_key type tv_nodekey.
* Get path
loop at li_path_tab into ll_path_tab.
concatenate
lw_path
ll_path_tab-dirname
c_slash
into lw_path.
condense lw_path no-gaps.
* Find Path
w_find_path = lw_path.
if lw_ppath is initial.
lw_ppath = c_slash.
endif.
* Find Routine
perform get_file_list using lw_path
lw_file.
if sy-subrc is initial.
lw_node_key = ll_node-node_key.
endif.
* Add Folders
perform add_node using lw_node_key.
lw_ppath = lw_path.
endloop.
if w_src is initial.
* Set ALV Display Layout
perform set_grid_layout.
endif.
* Change node
if lw_node_key is not initial.
fcw_key = lw_node_key.
elseif w_node_key is not initial.
fcw_key = w_node_key.
endif.
*-----------------------------------------------------------------------
* Form expand_node
*-----------------------------------------------------------------------
form expand_node using fuw_key type tv_nodekey.
data:
lw_node_key type tv_nodekey.
lw_node_key = fuw_key.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_tree->frontend_update.
*-----------------------------------------------------------------------
* Form expand_local_node
*-----------------------------------------------------------------------
form expand_local_node using fuw_key type tv_nodekey.
data:
lw_node_key type tv_nodekey.
lw_node_key = fuw_key.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_treel->frontend_update.
*-----------------------------------------------------------------------
* Form node_double_click
*-----------------------------------------------------------------------
form node_double_click using fuw_node_key type tv_nodekey.
data:
ll_node type t_node,
ll_file_list type zxis_0x_file.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar,
lw_node_key type tv_nodekey.
lw_node_key = fuw_node_key.
if sy-subrc is initial.
lw_path_name = ll_node-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
* Find Path
w_find_path = lw_path.
w_file_path = lw_path.
w_dysp_path = lw_path.
* Find Routine
perform get_file_list using lw_path
lw_file.
* Add Folders
perform add_node using lw_node_key.
endif.
endif.
*-----------------------------------------------------------------------
* Form lnode_double_click
*-----------------------------------------------------------------------
form lnode_double_click using fuw_node_key type tv_nodekey.
data:
ll_node type t_node,
ll_file_list type zxis_0x_file.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar,
lw_node_key type tv_nodekey.
lw_node_key = fuw_node_key.
if sy-subrc is initial.
if ll_node-dirname is not initial.
lw_path_name = ll_node-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
concatenate
lw_path_name
ll_node-name
c_back_slash
into lw_path.
else.
lw_path = ll_node-drive.
endif.
* Find Path
w_find_path = lw_path.
w_file_path = lw_path.
w_dysp_path = lw_path.
* Find Routine
perform get_loc_file_list using lw_path
lw_file.
* Add Folders
perform local_add_node using lw_node_key.
endif.
endif.
*-----------------------------------------------------------------------
* Form set_search_pattern
*-----------------------------------------------------------------------
form set_search_pattern .
* Initialize Screen
clear:
i_file_list, i_file_list_d, w_dct, i_node, i_log_list, i_kpath,
i_buftab_t, i_query_table, i_html.
w_perf = c_r.
w_srcd = c_x.
if w_loc is initial.
w_find_path = w_file_path.
else.
w_find_path = w_path_name.
clear:
i_file_list, i_file_list_d, w_dct, i_nodel, i_log_listl, i_kpath,
i_buftab_t, i_query_table, i_html.
endif.
*-----------------------------------------------------------------------
* Form set_lsearch_pattern
*-----------------------------------------------------------------------
form set_lsearch_pattern .
* Initialize Screen
clear:
i_file_list, i_file_list_d, w_dct, i_nodel, i_log_listl, i_kpath,
i_buftab_t, i_lquery_table, i_html.
w_find_path = w_file_path.
w_perf = c_f.
w_srcl = w_srcd = c_x.
*-----------------------------------------------------------------------
* Form expand_no_children
*-----------------------------------------------------------------------
form expand_no_children.
data:
ll_node type t_node.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar.
if sy-subrc is initial.
lw_path_name = ll_node-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
concatenate
lw_path_name
ll_node-name
c_slash
into lw_path.
* Find Path
w_file_path = lw_path.
w_find_path = lw_path.
* Find Routine
perform get_file_list using lw_path
lw_file.
* Add Folders
perform add_node using w_node_key.
endif.
*-----------------------------------------------------------------------
* Form lexpand_no_children
*-----------------------------------------------------------------------
form lexpand_no_children.
data:
ll_node type t_node.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar.
if sy-subrc is initial.
if ll_node-dirname is not initial.
lw_path_name = ll_node-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
concatenate
lw_path_name
ll_node-name
c_back_slash
into lw_path.
else.
lw_path = ll_node-drive.
endif.
* Find Path
w_file_path = lw_path.
w_find_path = lw_path.
* Find Routine
perform get_loc_file_list using lw_path
lw_file.
* Add Folders
perform local_add_node using w_lnode_key.
endif.
*-----------------------------------------------------------------------
* Form double_click_handler
*-----------------------------------------------------------------------
form double_click_handler using fuw_e_row type lvc_s_row
fuw_e_column type lvc_s_col
fuw_es_row_no type lvc_s_roid.
data:
ll_file_list_d type zxis_0x_file_d.
*-----------------------------------------------------------------------
* Form handle_grid_double_click
*-----------------------------------------------------------------------
form handle_grid_double_click using fuw_e_row type lvc_s_row
fuw_e_column type lvc_s_col
fuw_es_row_no type lvc_s_roid.
data:
ll_node type t_node,
ll_file_list type zxis_0x_file,
ll_file_list_d type zxis_0x_file_d.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar,
lw_node_key type tv_nodekey.
if sy-subrc is initial.
read table i_node into ll_node
with key name = ll_file_list_d-name
dirname = ll_file_list_d-dirname.
if sy-subrc is initial.
lw_node_key = ll_node-node_key.
else.
lw_node_key = w_node_key.
endif.
endif.
if ll_file_list_d-type_id = c_d.
lw_path_name = ll_file_list_d-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
concatenate
lw_path_name
ll_file_list_d-name
c_slash
into lw_path.
* Find Path
w_find_path = lw_path.
w_file_path = lw_path.
w_dysp_path = lw_path.
* Find Routine
perform get_file_list using lw_path
lw_file.
* Add Folders
if w_action <> c_search.
perform add_node using lw_node_key.
endif.
endif.
concatenate
ll_file_list_d-dirname
ll_file_list_d-name
into lw_path_name.
* Show File
perform display_file using lw_path_name
ll_file_list_d.
endif.
*-----------------------------------------------------------------------
* Form handle_lgrid_double_click
*-----------------------------------------------------------------------
form handle_lgrid_double_click using fuw_e_row type lvc_s_row
fuw_e_column type lvc_s_col
fuw_es_row_no type lvc_s_roid.
data:
ll_node type t_node,
ll_file_list type zxis_0x_file,
ll_file_list_d type zxis_0x_file_d.
data:
lw_length type i,
lw_length1 type i,
lw_path_name type localfile,
lw_path type localfile,
lw_file type char1 value c_wlchar,
lw_node_key type tv_nodekey.
if sy-subrc is initial.
read table i_nodel into ll_node
with key name = ll_file_list_d-name
dirname = ll_file_list_d-dirname.
if sy-subrc is initial.
lw_node_key = ll_node-node_key.
else.
lw_node_key = w_lnode_key.
endif.
endif.
if ll_file_list_d-type_id = c_d.
lw_path_name = ll_file_list_d-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
concatenate
lw_path_name
ll_file_list_d-name
c_back_slash
into lw_path.
* Find Path
w_find_path = lw_path.
w_file_path = lw_path.
w_dysp_path = lw_path.
* Find Routine
perform get_loc_file_list using lw_path
lw_file.
* Add Folders
if w_action <> c_search.
perform local_add_node using lw_node_key.
endif.
endif.
concatenate
ll_file_list_d-dirname
ll_file_list_d-name
into lw_path_name.
* Show File
perform display_loc_file using lw_path_name
ll_file_list_d.
endif.
*-----------------------------------------------------------------------
* Form add_node
*-----------------------------------------------------------------------
form add_node using fuw_node_key type lvc_nkey.
data:
ll_node type t_node,
ll_node_layout type lvc_s_layn,
ll_file_list type zxis_0x_file.
data:
lw_node_key type lvc_nkey,
lw_rnode_key type lvc_nkey,
lw_relationship type int4,
lw_node_text type lvc_value,
lw_length type i,
lw_path_name type localfile.
lw_path_name = ll_file_list-dirname.
lw_length = strlen( lw_path_name ).
if lw_length > 1.
translate lw_path_name using c_trslash.
condense lw_path_name.
endif.
lw_node_key = fuw_node_key.
lw_relationship = cl_gui_column_tree=>relat_last_child.
lw_node_text = ll_file_list-name.
ll_node_layout-isfolder = c_x.
ll_node_layout-expander = c_x.
ll_node_layout-dragdropid = w_handle_tree.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_tree->frontend_update.
endloop.
*-----------------------------------------------------------------------
* Form local_add_node
*-----------------------------------------------------------------------
form local_add_node using fuw_node_key type lvc_nkey.
data:
ll_node type t_node,
ll_node_layout type lvc_s_layn,
ll_file_list type zxis_0x_file.
data:
lw_node_key type lvc_nkey,
lw_rnode_key type lvc_nkey,
lw_relationship type int4,
lw_node_text type lvc_value,
lw_length type i,
lw_path_name type localfile.
lw_path_name = ll_file_list-dirname.
lw_length = strlen( lw_path_name ).
if lw_length > 1.
translate lw_path_name using c_trslashl.
condense lw_path_name.
endif.
lw_node_key = fuw_node_key.
lw_relationship = cl_gui_column_tree=>relat_last_child.
lw_node_text = ll_file_list-name.
ll_node_layout-isfolder = c_x.
ll_node_layout-expander = c_x.
ll_node_layout-dragdropid = w_handle_tree.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
* Send data to frontend
call method o_treel->frontend_update.
endloop.
*-----------------------------------------------------------------------
* Form add_table_lines
*-----------------------------------------------------------------------
form add_table_lines .
data:
ll_log_list type zxis_0x_file.
*-----------------------------------------------------------------------
* Form add_ltable_lines
*-----------------------------------------------------------------------
form add_ltable_lines .
data:
ll_log_list type zxis_0x_file.
*-----------------------------------------------------------------------
* Form display_file
*-----------------------------------------------------------------------
form display_file using fuw_path_name type localfile
ful_file_list type zxis_0x_file_d.
data:
lw_platform type i,
lw_subrc type sysubrc.
* Returns Platform
call method cl_gui_frontend_services=>get_platform
receiving
platform = lw_platform
exceptions
error_no_gui = 1
cntl_error = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Deletes a File
if ful_file_list-file_id = 'ANY'.
concatenate w_dest_path ful_file_list-name '.txt'
into w_file_dest.
else.
concatenate w_dest_path ful_file_list-name c_dot
ful_file_list-file_id
into w_file_dest.
endif.
* Deletes a File
call method cl_gui_frontend_services=>file_delete
exporting
filename = w_file_dest
changing
rc = lw_platform
exceptions
file_delete_failed = 1
cntl_error = 2
error_no_gui = 3
file_not_found = 4
access_denied = 5
unknown_error = 6
not_supported_by_gui = 7
wrong_parameter = 8
others = 9.
if sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Transfer File
perform gui_transf_unix_pc using fuw_path_name
ful_file_list
changing lw_subrc.
if lw_subrc is initial.
if ful_file_list-file_id = 'ANY'.
concatenate w_dest_path ful_file_list-name '.txt'
into w_file_dest.
else.
concatenate w_dest_path ful_file_list-name c_dot
ful_file_list-file_id
into w_file_dest.
endif.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_i number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*-----------------------------------------------------------------------
* Form display_loc_file
*-----------------------------------------------------------------------
form display_loc_file using fuw_path_name type localfile
ful_file_list type zxis_0x_file_d.
data:
lw_platform type i.
* Returns Platform
call method cl_gui_frontend_services=>get_platform
receiving
platform = lw_platform
exceptions
error_no_gui = 1
cntl_error = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
w_file_dest = fuw_path_name.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_i number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*-----------------------------------------------------------------------
* Form get_dest_dir
*-----------------------------------------------------------------------
form get_dest_dir.
data:
lw_dir type char200,
lw_directory type string,
lw_rc type i.
clear: w_returns.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
call method cl_gui_cfw=>flush.
lw_dir = w_returns.
endif.
concatenate
w_returns
c_back_slash
into w_return.
endif.
if w_return is not initial.
w_dest_path = w_return.
else.
lw_directory = c_ctmp.
*-----------------------------------------------------------------------
* Form gui_transf_unix_pc
*-----------------------------------------------------------------------
form gui_transf_unix_pc using fuw_path_name type localfile
ful_file_list type zxis_0x_file_d
changing fcw_subrc type any.
data:
lw_file_path type char200.
if fcw_subrc is initial.
* Transfer file localy
perform save_local using ful_file_list
space
changing fcw_subrc.
endif.
*-----------------------------------------------------------------------
* Form open_file
*-----------------------------------------------------------------------
form open_file using fuw_file type any
ful_file_list type zxis_0x_file_d
changing fcw_subrc type any.
data:
ll_buftab_t type t_buftab_t.
if ful_file_list-type_f = c_bin.
* Open in binary mode
open dataset fuw_file for input in binary mode.
else.
* Open in text mode
open dataset fuw_file for input in text mode encoding default.
endif.
if sy-subrc <> 0.
* Error opening the file
fcw_subrc = c_1.
message id c_msgig_fsev type c_msgty_i number c_msgno_017
with fuw_file.
else.
do.
read dataset fuw_file into ll_buftab_t.
if sy-subrc = 0.
append ll_buftab_t to i_buftab_t.
elseif sy-subrc = 4.
append ll_buftab_t to i_buftab_t.
exit.
endif.
enddo.
endif.
*-----------------------------------------------------------------------
* Form save_local
*-----------------------------------------------------------------------
form save_local using ful_file_list type zxis_0x_file_d
fuw_file type any
changing fcw_subrc type any.
data:
lw_filetp type char10.
if fuw_file is initial.
if ful_file_list-file_id = 'ANY'.
concatenate w_dest_path ful_file_list-name '.txt'
into w_file_dest.
else.
concatenate w_dest_path ful_file_list-name c_dot
ful_file_list-file_id
into w_file_dest.
endif.
else.
w_file_dest = fuw_file.
endif.
lw_filetp = ful_file_list-type_f.
if i_buftab_t[] is not initial.
* Download Data to Client PC
call method o_gui_serv->gui_download
exporting
filename = w_file_dest
filetype = lw_filetp
confirm_overwrite = c_x
changing
data_tab = i_buftab_t
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
others = 24.
if sy-subrc <> 0.
fcw_subrc = c_1.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
*-----------------------------------------------------------------------
* Form upload_local
*-----------------------------------------------------------------------
form upload_local using ful_file_list type zxis_0x_file_d
fuw_file type any
changing fcw_subrc type any.
data:
lw_filetp type char10.
w_file_dest = fuw_file.
lw_filetp = ful_file_list-type_f.
clear: i_buftab_t.
refresh: i_buftab_t.
if sy-subrc <> 0.
fcw_subrc = c_1.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " upload_local
*-----------------------------------------------------------------------
* Form search_prepare
*-----------------------------------------------------------------------
form search_prepare .
data:
li_events type standard table of cntl_simple_event.
data:
ll_event type cntl_simple_event.
data:
lw_repid type sy-repid,
lw_dynnr type sy-dynnr,
lw_ext type i value '300'.
lw_repid = sy-repid.
lw_dynnr = sy-dynnr.
w_dct = c_x.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Register event
ll_event-eventid = o_html_control->m_id_sapevent.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Set Events
call method o_html_control->set_registered_events
exporting
events = li_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form lsearch_prepare
*-----------------------------------------------------------------------
form lsearch_prepare .
data:
li_events type standard table of cntl_simple_event.
data:
ll_event type cntl_simple_event.
data:
lw_repid type sy-repid,
lw_dynnr type sy-dynnr,
lw_ext type i value '300'.
lw_repid = sy-repid.
lw_dynnr = sy-dynnr.
w_dct = c_x.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Register event
ll_event-eventid = o_html_control->m_id_sapevent.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Set Events
call method o_html_control->set_registered_events
exporting
events = li_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form html_prepare
*-----------------------------------------------------------------------
form html_prepare.
data:
ll_html type char255.
data:
lw_find_path type char200.
*-----------------------------------------------------------------------
* Form html_show
*-----------------------------------------------------------------------
form html_show .
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Shows the Web page for the URL specified
call method o_html_control->show_url
exporting
url = w_html_line
exceptions
cntl_error = 1
cnht_error_not_allowed = 2
cnht_error_parameter = 3
dp_error_general = 4
others = 5.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*-----------------------------------------------------------------------
* Form back_to_tree
*-----------------------------------------------------------------------
form back_to_tree .
clear:
w_act, w_srcd, w_search_path, i_file_list, i_node,
i_log_list, i_kpath, i_buftab_t, i_query_table, i_html.
*-----------------------------------------------------------------------
* Form back_to_loc_tree
*-----------------------------------------------------------------------
form back_to_loc_tree .
clear:
w_loc, w_srcd, w_search_path, w_srcl, i_file_list, i_nodel,
i_log_listl, i_kpath, i_buftab_t, i_lquery_table, i_html.
* Display Local PC
perform display_local.
*-----------------------------------------------------------------------
* Form folder_search
*-----------------------------------------------------------------------
form folder_search .
data:
ll_query_table type w3query.
data:
lw_search_ptrn type char200,
lw_file_path type char200.
w_act = c_x.
w_dct = c_x.
clear: ll_query_table.
read table i_query_table into ll_query_table
with key name = c_folder.
clear: ll_query_table.
read table i_query_table into ll_query_table
with key name = c_searchl.
if lw_search_ptrn ca c_errptrn.
* The use of the fallowing characters is not allowed:
message id c_msgig_fsev type c_msgty_i number c_msgno_000
with 'The use of the fallowing characters is not allowed:'(010)
c_errptrn.
else.
if lw_file_path is not initial
and lw_search_ptrn is not initial.
* Search File
perform search_results using lw_file_path
lw_search_ptrn.
endif.
endif.
*-----------------------------------------------------------------------
* Form loc_folder_search
*-----------------------------------------------------------------------
form loc_folder_search .
data:
ll_query_table type w3query.
data:
lw_search_ptrn type char200,
lw_file_path type char200.
w_loc = c_x.
w_dct = c_x.
clear: ll_query_table.
read table i_lquery_table into ll_query_table
with key name = c_folder.
if lw_search_ptrn ca c_errptrn.
* The use of the fallowing characters is not allowed:
message id c_msgig_fsev type c_msgty_i number c_msgno_000
with 'The use of the fallowing characters is not allowed:'(010)
c_errptrn.
else.
if lw_file_path is not initial
and lw_search_ptrn is not initial.
* Search File
perform local_search using lw_file_path
lw_search_ptrn.
endif.
endif.
*-----------------------------------------------------------------------
* Form search_results
*-----------------------------------------------------------------------
form search_results using fuw_search_path type any
fuw_search_ptrn type any.
data:
li_file_list type standard table of zxis_0x_file.
data:
lw_path_name type char200.
w_path_name = fuw_search_path.
if sy-opsys = c_unix
or sy-opsys = c_aix.
clear: w_search_path, w_search_name,
i_server_data.
refresh: i_server_data, i_file_list, i_file_list_d.
w_search_path = fuw_search_path.
w_search_name = fuw_search_ptrn.
concatenate
c_findl
w_search_path
c_dname
w_search_name
c_dprint
into w_unixcomm separated by space.
loop at i_server_data.
lw_path_name = i_server_data-line.
perform split_name changing lw_path_name
w_file_name.
w_search_path = fuw_search_path.
w_search_name = fuw_search_ptrn.
concatenate
c_dirl
c_at
w_search_path
w_search_name
c_at
c_ss
into w_unixcomm.
translate w_unixcomm using c_atsp.
loop at i_server_data.
clear: w_file_name.
clear: i_file_list.
append lines of li_file_list to i_file_list.
* Prepare layout
perform prepare_display_layout.
clear: i_file_list.
*-----------------------------------------------------------------------
* Form local_search
*-----------------------------------------------------------------------
form local_search using fuw_search_path type any
fuw_search_ptrn type any.
data:
li_file_list type standard table of zxis_0x_file.
* Search in Local PC
perform search_loc_pc tables li_file_list
using w_search_path
w_search_name.
clear: i_file_list.
append lines of li_file_list to i_file_list.
sort i_file_list by dirname name ascending.
* Prepare layout
perform prepare_display_layout.
clear: i_file_list.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " local_search
*-----------------------------------------------------------------------
* Form assign_fields
*-----------------------------------------------------------------------
form assign_fields .
data:
ll_file_list_d type zxis_0x_file_d.
data:
lw_row type i,
lw_value type char200,
lw_col type i,
lw_path_name type localfile,
lw_length type i,
lw_length1 type i.
clear:
w_file_name, w_file_path, w_file_path_name.
lw_path_name = ll_file_list_d-dirname.
lw_length = strlen( lw_path_name ).
lw_length1 = lw_length - 1.
* Get path
if ll_file_list_d-type_id = c_d.
* For Server Paths
if ll_file_list_d-seen = c_r.
if lw_path_name+lw_length1(1) <> c_slash.
if sy-opsys = c_aix or sy-opsys = c_unix.
lw_path_name+lw_length(1) = c_slash.
endif.
endif.
concatenate
lw_path_name
ll_file_list_d-name
c_slash
into w_file_path.
w_file_path_name = w_file_path.
concatenate
lw_path_name
ll_file_list_d-name
c_back_slash
into w_file_path.
endif.
w_file_name = ll_file_list_d-name.
w_file_path = lw_path_name.
endif.
if o_tree_contl is bound.
call method o_tree_contl->free
exceptions
cntl_error = 1
cntl_system_error = 2
others = 3.
if sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
endif.
*-----------------------------------------------------------------------
*& Form display_local_pc
*-----------------------------------------------------------------------
form display_local_pc .
if w_loc is initial.
* Returns Platform
call method cl_gui_frontend_services=>get_platform
receiving
platform = w_platform
exceptions
error_no_gui = 1
cntl_error = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
* Display Local PC
perform display_local.
endif.
*-----------------------------------------------------------------------
* Form display_local
*-----------------------------------------------------------------------
form display_local .
data:
li_events type standard table of cntl_simple_event.
data:
ll_drv type t_drv,
ll_event type cntl_simple_event.
data:
lw_repid type sy-repid,
lw_dynnr type sy-dynnr,
lw_flag type as4flag,
lw_ext type i value '300'.
* Free containers
call method o_tree_cont->free.
call method o_tree_contl->free.
else.
lw_repid = sy-repid.
lw_dynnr = sy-dynnr.
w_loc = c_x.
clear: i_file_list.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
lw_flag = c_x.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Add Folders
perform local_add_node using w_lnode_key.
if w_src is initial.
* Initiate Drag & Drop
perform start_drad_drop.
* Header click
ll_event-eventid = cl_gui_column_tree=>eventid_header_click.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Expand no Children
ll_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
ll_event-appl_event = c_x.
append ll_event to li_events.
* Set Events
call method o_treel->set_registered_events
exporting
events = li_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
*-----------------------------------------------------------------------
* Form handle_tree_on_drop
*-----------------------------------------------------------------------
form handle_tree_on_drop
using fuw_node_key type lvc_nkey
changing fco_object type ref to cl_dragdropobject.
data:
ll_node type t_node.
data:
lw_folder_name type char200,
lw_path_name type char200,
lw_target_path type char200.
if o_dataobj->l_file_list_d-seen = c_r.
if lw_path_name <> c_slash.
shift lw_path_name right deleting trailing space.
if lw_path_name+199(1) = c_slash.
lw_path_name+199(1) = space.
endif.
shift lw_path_name left deleting leading space.
if ll_node-name = lw_folder_name
and lw_target_path = o_dataobj->l_file_list_d-dirname.
* Cannot Copy or Move to the same Folder!
message id c_msgig_fsev type c_msgty_s number c_msgno_000
with 'Cannot Copy or Move to the same Folder!'(015).
call method fco_object->abort.
else.
clear: w_dd_target_name.
endif.
*-----------------------------------------------------------------------
* Form handle_ltree_on_drop
*-----------------------------------------------------------------------
form handle_ltree_on_drop
using fuw_node_key type lvc_nkey
changing fco_object type ref to cl_dragdropobject.
data:
ll_node type t_node.
data:
lw_folder_name type char200,
lw_path_name type char200,
lw_target_path type char200.
if o_dataobj->l_file_list_d-seen = c_r.
if lw_path_name <> c_slash.
shift lw_path_name right deleting trailing space.
if lw_path_name+199(1) = c_slash.
lw_path_name+199(1) = space.
endif.
shift lw_path_name left deleting leading space.
perform split_name changing lw_path_name
lw_folder_name.
else.
lw_folder_name = lw_path_name.
endif.
elseif o_dataobj->l_file_list_d-seen = c_f.
if lw_path_name <> c_win_root.
shift lw_path_name right deleting trailing space.
if lw_path_name+199(1) = c_back_slash.
lw_path_name+199(1) = space.
endif.
shift lw_path_name left deleting leading space.
if ll_node-name = lw_folder_name
and lw_target_path = o_dataobj->l_file_list_d-dirname.
* Cannot Copy or Move to the same Folder!
message id c_msgig_fsev type c_msgty_s number c_msgno_000
with 'Cannot Copy or Move to the same Folder!'(015).
call method fco_object->abort.
else.
clear: w_dd_target_name.
*-----------------------------------------------------------------------
* Form on_drag_handler
*-----------------------------------------------------------------------
form on_drag_handler using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
ll_file_list_d type zxis_0x_file_d.
*-----------------------------------------------------------------------
* Form handle_grid_on_drop
*-----------------------------------------------------------------------
form handle_grid_on_drop using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
ll_file_list_d type zxis_0x_file_d.
data:
lw_folder_name type char200,
lw_path_name type char200,
lw_target_path type char200.
if o_dataobj->l_file_list_d-seen = c_r.
w_dest = c_r.
if ll_file_list_d-dirname = o_dataobj->l_file_list_d-dirname.
* Cannot Copy or Move to the same Folder!
message id c_msgig_fsev type c_msgty_s number c_msgno_000
with 'Cannot Copy or Move to the same Folder!'(015).
call method fco_object->abort.
else.
clear: w_dd_target_name.
endif.
if ll_file_list_d-dirname = o_dataobj->l_file_list_d-dirname.
* Cannot Copy or Move to the same Folder!
message id c_msgig_fsev type c_msgty_s number c_msgno_000
with 'Cannot Copy or Move to the same Folder!'(015).
call method fco_object->abort.
else.
clear: w_dd_target_name.
endif.
endif.
data:
ll_file_list_d type zxis_0x_file_d.
if ll_file_list_d-type_id = c_d.
* For security reasons Drag & Drop is only permitted for Files
message id c_msgig_fsev type c_msgty_s number c_msgno_000
with 'For security reasons Drag & Drop'(013)
'is only permitted for Files!'(014).
call method fco_object->abort.
elseif ll_file_list_d-type_id = c_f.
* Create and fill dataobject for events ONDROP and ONDROPCOMPLETE
create object o_dataobj.
move ll_file_list_d to o_dataobj->l_file_list_d.
*-----------------------------------------------------------------------
* Form on_dropcomplete_handler
*-----------------------------------------------------------------------
form on_dropcomplete_handler
using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
ll_file_list_d type zxis_0x_file_d.
endif.
*-----------------------------------------------------------------------
* Form on_grid_dropcomplete
*-----------------------------------------------------------------------
form on_grid_dropcomplete
using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
lw_path_name type char200,
lw_subrc type sysubrc.
* Catch-Statement to make sure drag&drop-Operation is aborted properly
catch system-exceptions move_cast_error = 1.
o_dataobj ?= fco_object->object.
concatenate
o_dataobj->l_file_list_d-dirname
o_dataobj->l_file_list_d-name
into lw_path_name.
* Find Routine
perform get_file_list using o_dataobj->l_file_list_d-dirname
c_wlchar.
endif.
endif.
endif.
endcatch.
*-----------------------------------------------------------------------
* Form on_grid_dropcompletf
*-----------------------------------------------------------------------
form on_grid_dropcompletf
using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
lw_path_name type char200,
lw_subrc type sysubrc.
o_dataobj ?= fco_object->object.
concatenate
o_dataobj->l_file_list_d-dirname
o_dataobj->l_file_list_d-name
into lw_path_name.
* Find Path
w_find_path = o_dataobj->l_file_list_d-dirname.
w_file_path = o_dataobj->l_file_list_d-dirname.
* Find Routine
perform get_file_list using o_dataobj->l_file_list_d-dirname
c_wlchar.
* Set ALV Display Layout
perform set_grid_layout.
endif.
endif.
endif.
endcatch.
*-----------------------------------------------------------------------
* Form on_lgrid_dropcompletr
*-----------------------------------------------------------------------
form on_lgrid_dropcompletr
using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
lw_path_name type char200,
lw_source_file type string,
lw_rc type i,
lw_subrc type sysubrc.
o_dataobj ?= fco_object->object.
concatenate
o_dataobj->l_file_list_d-dirname
o_dataobj->l_file_list_d-name
into lw_path_name.
if lw_subrc is initial.
* Copy file data
perform save_file using w_dd_target_name
o_dataobj->l_file_list_d
changing lw_subrc.
endif.
lw_source_file = lw_path_name.
* Deletes a File
call method cl_gui_frontend_services=>file_delete
exporting
filename = lw_source_file
changing
rc = lw_rc
exceptions
file_delete_failed = 1
cntl_error = 2
error_no_gui = 3
file_not_found = 4
access_denied = 5
unknown_error = 6
not_supported_by_gui = 7
wrong_parameter = 8
others = 9.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Find Path
w_find_path = o_dataobj->l_file_list_d-dirname.
w_file_path = o_dataobj->l_file_list_d-dirname.
* Find Routine
perform get_loc_file_list using o_dataobj->l_file_list_d-dirname
c_wlchar.
endif.
endif.
endcatch.
*-----------------------------------------------------------------------
* Form on_lgrid_dropcomplete
*-----------------------------------------------------------------------
form on_lgrid_dropcomplete
using ful_row type lvc_s_row
ful_column type lvc_s_col
ful_row_no type lvc_s_roid
changing fco_object type ref to cl_dragdropobject.
data:
lw_path_name type char200,
lw_source_file type string,
lw_rc type i,
lw_subrc type sysubrc.
* Catch-Statement to make sure drag&drop-Operation is aborted properly
catch system-exceptions move_cast_error = 1.
o_dataobj ?= fco_object->object.
concatenate
o_dataobj->l_file_list_d-dirname
o_dataobj->l_file_list_d-name
into lw_path_name.
lw_source_file = lw_path_name.
* Deletes a File
call method cl_gui_frontend_services=>file_delete
exporting
filename = lw_source_file
changing
rc = lw_rc
exceptions
file_delete_failed = 1
cntl_error = 2
error_no_gui = 3
file_not_found = 4
access_denied = 5
unknown_error = 6
not_supported_by_gui = 7
wrong_parameter = 8
others = 9.
if sy-subrc <> 0.
message id sy-msgid type c_msgty_s number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Find Path
w_find_path = o_dataobj->l_file_list_d-dirname.
w_file_path = o_dataobj->l_file_list_d-dirname.
* Find Routine
perform get_loc_file_list using o_dataobj->l_file_list_d-dirname
c_wlchar.
endif.
endif.
endcatch.
*-----------------------------------------------------------------------
* Form save_file
*-----------------------------------------------------------------------
form save_file using fuw_file type any
ful_file_list type zxis_0x_file_d
changing fcw_subrc type any.
data:
ll_buftab_t type t_buftab_t.
data:
lw_answer type char1.
if i_buftab_t[] is initial.
fcw_subrc = c_1.
else.
if ful_file_list-type_f = c_bin.
* Open in binary mode
open dataset fuw_file for input in binary mode.
else.
* Open in text mode
open dataset fuw_file for input in text mode encoding default.
endif.
if sy-subrc <> 0.
lw_answer = c_2.
fcw_subrc = c_2.
endif.
endif.
if sy-subrc <> 0.
fcw_subrc = c_1.
else.
loop at i_buftab_t into ll_buftab_t.
transfer ll_buftab_t to fuw_file.
*-----------------------------------------------------------------------
* Form save_loc_file
*-----------------------------------------------------------------------
form save_loc_file using fuw_file type any
ful_file_list type zxis_0x_file_d
changing fcw_subrc type any.
data:
lw_answer type char1,
lw_file type string,
lw_result type abap_bool,
lw_source_file type string,
lw_target_file type string.
lw_file = fuw_file.
if sy-subrc <> 0.
lw_answer = c_2.
fcw_subrc = c_2.
endif.
endif.
lw_target_file = fuw_file.
lw_result = c_x.
* Copies a File
call method o_gui_serv->file_copy
exporting
source = lw_source_file
destination = lw_target_file
overwrite = lw_result
exceptions
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
disk_full = 4
access_denied = 5
file_not_found = 6
destination_exists = 7
unknown_error = 8
path_not_found = 9
disk_write_protect = 10
drive_not_ready = 11
not_supported_by_gui = 12
others = 13.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
else.
fcw_subrc = c_2.
endif.
*-----------------------------------------------------------------------
* Form set_sort
*-----------------------------------------------------------------------
form set_sort using fuw_field1 type any
fuw_field2 type any
fuw_field3 type any
fuw_field4 type any
fuw_order type any.
data:
ll_sort type lvc_s_sort.
data:
lw_up type char1,
lw_down type char1.
*-----------------------------------------------------------------------
* Form get_local_drive
*-----------------------------------------------------------------------
form get_local_drive changing fcw_drive type string.
data:
ll_drv type t_drv.
data:
lw_abcde type syabcde,
lw_drv type char3 value ' :\',
lw_tra type char2 value 'A ',
lw_trb type char2 value 'B ',
lw_trn type char2.
lw_abcde = sy-abcde.
translate lw_abcde using lw_tra.
translate lw_abcde using lw_trb.
condense lw_abcde no-gaps.
clear: i_drv.
clear: lw_trn.
lw_trn(1) = w_drive(1).
translate lw_abcde using lw_trn.
condense lw_abcde no-gaps.
if sy-subrc = 0.
call method cl_gui_cfw=>flush.
if w_type is not initial.
ll_drv-drive = w_drive.
ll_drv-type = w_type.
if ll_drv-type = c_fixed.
ll_drv-desc = 'Local Disk (#)'(025).
replace c_card with ll_drv-drive(2) into ll_drv-desc.
elseif ll_drv-type = c_cdrom.
ll_drv-desc = 'CDROM Drive (#)'(026).
replace c_card with ll_drv-drive(2) into ll_drv-desc.
elseif ll_drv-type = c_remote.
ll_drv-desc = 'Remote Drive (#)'(027).
replace c_card with ll_drv-drive(2) into ll_drv-desc.
endif.
*-----------------------------------------------------------------------
* Form check_local_tree
*-----------------------------------------------------------------------
form check_local_tree .
if w_srcl is initial.
clear: w_loc.
* Display Local PC
perform display_local.
else.
* Prepare Grid Output
perform grid_prepare.
perform lsearch_prepare.
* Prepare HTML Output
w_find_path = w_lpath_name.
perform html_prepare.
* Display HTML
perform html_show.
endif.
endif.
PBO-Modules Include
- LZXIS_X_00_FILE_SERVICESO01
*----------------------------------------------------------------------*
***INCLUDE LZXIS_X_00_FILE_SERVICESO01 .
*----------------------------------------------------------------------*
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
* Module status_0100 OUTPUT
*-----------------------------------------------------------------------
module status_0100 output.
*-----------------------------------------------------------------------
* Module output_prepare OUTPUT
*-----------------------------------------------------------------------
module output_prepare output.
if w_act is initial.
* Get File System Data
if i_file_list[] is initial.
w_server_path = w_file_path.
* Add Folders
perform add_node using w_nnode_key.
* Check Local
perform check_local_tree.
* Display HTML
perform html_show.
* Display Local PC
perform display_local.
else.
perform lsearch_prepare.
* Display HTML
perform html_show.
endif.
endif.
elseif w_perf = c_f.
* Prepare Grid Output
perform grid_prepare.
perform lsearch_prepare.
* Display HTML
perform html_show.
endif.
endif.
PAI-Modules Include
- LZXIS_X_00_FILE_SERVICESI01
*----------------------------------------------------------------------*
***INCLUDE LZXIS_X_00_FILE_SERVICESI01 .
*----------------------------------------------------------------------*
*-----------------------------------------------------------------------
* Author: António César Date: 28/01/2009
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
* Module user_command_0100 INPUT
*-----------------------------------------------------------------------
module user_command_0100 input.
case ok_code.
when c_cont.
when c_locl.
* Display Local PC
perform display_local_pc.
endcase.
*-----------------------------------------------------------------------
* Module exit_0100 INPUT
*-----------------------------------------------------------------------
module exit_0100 input.
perform free_control.
endmodule. " exit_0100 INPUT
The creation should be easy, but if you have any It will be a hell of a mess for you to copy the code
questions or suggestions for improvement please from here though as PDF files don’t retain much
drop me a mail, you can find it at the very of the formatting spaces or even page breaks!!!
beginning of this document.