2006 Sep 14 2:04 PM
Hi experts,
I know there is a FM to read a directory from App.server
is RZL_READ_DIR_LOCAL and RZL_READ_DIR. It uses a structure FILE_TBL of type SALFLDIR.This contains a field called "Name" of 32 characters.Suppose if a file in App.server contains more than 32 characters will this FM reads that?I think it reads that but the extension of file or some part of file will miss.So after reading that if read from that file using read dataset which does't conatins extension because of size of that field will it read?...
Can any body tell me What is the alternative for this?
2006 Sep 14 2:18 PM
Hi,
you can use the follow code:
REPORT zdirtest.
DATA lv_dir TYPE rsmrgstr-path VALUE '/usr/sap/trans/data'.
DATA: wa_files TYPE rsfillst,
it_files LIKE TABLE OF wa_files.
START-OF-SELECTION.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = lv_dir
filenm = '*'
TABLES
file_list = it_files
EXCEPTIONS
access_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE /1 'Error! :-('.
ELSE.
LOOP AT it_files INTO wa_files.
WRITE: /1 wa_files-name,
wa_files-len.
ENDLOOP.
ENDIF.
rgds
anver
Hi experts,
I know there is a FM to read a directory from App.server
is RZL_READ_DIR_LOCAL and RZL_READ_DIR. It uses a structure FILE_TBL of type SALFLDIR.This contains a field called "Name" of 32 characters.Suppose if a file in App.server contains more than 32 characters will this FM reads that?I think it reads that but the extension of file or some part of file will miss.So after reading that if read from that file using read dataset which does't conatins extension because of size of that field will it read?...
Can any body tell me What is the alternative for this?
2006 Sep 14 2:10 PM
2006 Sep 14 2:15 PM
Use the below FM:
DATA: lcl_directory TYPE char128,
constants: c_mask TYPE char9 VALUE ',.,..'.
lcl_directory = ''/local/data/interface/A28/DM/OUT'.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = lcl_directory
filemask = c_mask
IMPORTING
serverfile = p_f2
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000(zmm) WITH text-039.
flg_app = 'X'.
ENDIF.
Regards,
Prakash.
2006 Sep 14 2:18 PM
Hi,
you can use the follow code:
REPORT zdirtest.
DATA lv_dir TYPE rsmrgstr-path VALUE '/usr/sap/trans/data'.
DATA: wa_files TYPE rsfillst,
it_files LIKE TABLE OF wa_files.
START-OF-SELECTION.
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = lv_dir
filenm = '*'
TABLES
file_list = it_files
EXCEPTIONS
access_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE /1 'Error! :-('.
ELSE.
LOOP AT it_files INTO wa_files.
WRITE: /1 wa_files-name,
wa_files-len.
ENDLOOP.
ENDIF.
rgds
anver
2006 Sep 14 3:00 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |