01-18-2012 7:31 AM
Hello,
what is the MAximum lenght of a File name in TCODE AL11.
i have a program which upload data in AL11 in a Directory but some of the File name get truncated like mention below as I Am using the FM FILE_GET_NAME to get the File name.
Also I am Converting them first to PDF format and uploading them in the directiry, but some file name gets trucated.
12/09/2011 02:31:35 Administ 115,776 5804000041_20100510_IT00739320158_COATESLORILLEUXMüREKKEP.P
12/12/2011 04:53:18 Administ 115,776 5804000041_IT00739320158_COATES LORILLEUX MüREKKEP.P
12/12/2011 04:54:37 Administ 115,776 5804000042_20100510_IT00739320158_COATES LORILLEUX MüREKKEP.P
And i need the extensionn .PDF as it is required. Kindly Help
Thanks
Solanki Ritesh
01-18-2012 7:45 AM
How you are defining the file path?
You can try with this:
DATA: BEGIN OF i_file OCCURS 100,
path TYPE sxpgcolist-parameters,
file TYPE string,
END OF i_file.
01-18-2012 8:34 AM
Hi Lokesh,
I am using g_file_name TYPE file_name,
I am using the Following code to insert where g_file_name I get from
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = c_log_file
eleminate_blanks = space
parameter_1 = g_par
IMPORTING
file_name = g_file_name
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
g_retcode = sy-subrc.
ENDIF.
ENDIF.
G_par is calculated based on Inv_num_postdate_VAtnum_Custname.
OPEN DATASET g_file_name FOR OUTPUT IN BINARY MODE.
IF sy-subrc = 0.
LOOP AT i_tlines INTO wa_tlines_line.
TRANSFER wa_tlines_line TO g_file_name.
ENDLOOP.
CLOSE DATASET g_file_name.
ENDIF.
But it truncates the file name like this
9126000019_20120110_IT00879330033_OFFICINE GRAFICHE NOVARA 1901 SPA.p
it shud be
9126000019_20120110_IT00879330033_OFFICINE GRAFICHE NOVARA 1901 SPA.pdf
Thanks
01-18-2012 7:58 AM
The below code can work with long file names in a UNIX based app server. Just replace lv_dir value with the directory where you want to list the file names.
You can increase the length 1023 if you want still longer file names listed
DATA: BEGIN OF itab OCCURS 0,
line(1023),
END OF itab.
DATA: lv_command(128) VALUE 'ls',
lv_dir(128) VALUE '/usr/tmp'.
* The below system command will return the output of ls in itab
CONCATENATE lv_command lv_dir INTO lv_command SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command
ID 'TAB' FIELD itab-*sys*.
If you application server is Windows based then just change the command variable lv_command like below
DATA: BEGIN OF itab OCCURS 0,
line(1023),
END OF itab.
DATA: lv_command(128) VALUE 'dir /B',
lv_dir(128) VALUE 'C:\WINDOWS\Temp'.
* The below system command will return the output of dir /B in itab
CONCATENATE lv_command lv_dir INTO lv_command SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command
ID 'TAB' FIELD itab-*sys*.
01-18-2012 8:12 AM