06-30-2008 1:03 PM
Hi experts,
I have been trying to upload some data to the application server using the following FM
CALL FUNCTION 'ARCHIVFILE_TABLE_TO_SERVER'
EXPORTING
TARGETPATH = '/INTERFACE/BILLINGS/Test1.pdf'
length = 10
tables
archivobject = t_line
EXCEPTIONS
ERROR_FILE = 1
OTHERS = 2
When I look into the directory if my pdf was properly uploaded using AL11, there is no problem, I can see the file called Test1.pdf; now if I replace '/INTERFACE/BILLINGS/Test1.pdf'' by wlv_filepath where wlv_filepath is a variable that contains the SAME path as the one I wrote above, I cannot see my file in AL11 !
Debugging the FM showed me that the OPEN DATASET statement returned sy-subrc = 8.
Can anyone help me find the solution to this problem? My goal is to be able to assign any filepath contained in that variable onto the app server.
Proper answers will be rewarded for sure.
C.K.
06-30-2008 1:45 PM
Hi Cedric,
can you please declared as a STRING
W_FILE_PATH TYPE STRING.
and try.
and follow the below code
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
client = sy-mandt
logical_path = c_svfdir
file_name = w_file_name (give your path)
IMPORTING
file_name_with_path = i_physical_fname
EXCEPTIONS
path_not_found = 1
missing_parameter = 2
operating_system_not_found = 3
file_system_not_found = 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.
CONCATENATE `/tmp/` i_file_name INTO i_physical_fname.
OPEN DATASET i_physical_fname FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
LOOP AT itb_csv.
TRANSFER itb_csv TO i_physical_fname.
ENDLOOP.
CLOSE DATASET i_physical_fname.
it is full for you
THANKS & REGARDS,
bhupal.
06-30-2008 1:11 PM
Hi Cedric,
Please tell me how you have declared that variable.
Regards,
Mamta Gupta.
06-30-2008 1:15 PM
Hi,
I have declared the variable as followed :
DATA:
wlv_filename TYPE SAPB-SAPPFAD.
06-30-2008 1:53 PM
I tried your code by using variable.
Here it is working fine.
Please check the below code, if you missed something.
data: wlv_filepath type SAPB-SAPPFAD value
'/INTERFACE/BILLINGS/Test1.pdf'.
start-of-selection.
CALL FUNCTION 'ARCHIVFILE_TABLE_TO_SERVER'
EXPORTING
TARGETPATH = wlv_filepath
length = 10
tables
archivobject = t_line
EXCEPTIONS
ERROR_FILE = 1
OTHERS = 2.
Regards,
Mamta.
06-30-2008 1:45 PM
Hi Cedric,
can you please declared as a STRING
W_FILE_PATH TYPE STRING.
and try.
and follow the below code
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
client = sy-mandt
logical_path = c_svfdir
file_name = w_file_name (give your path)
IMPORTING
file_name_with_path = i_physical_fname
EXCEPTIONS
path_not_found = 1
missing_parameter = 2
operating_system_not_found = 3
file_system_not_found = 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.
CONCATENATE `/tmp/` i_file_name INTO i_physical_fname.
OPEN DATASET i_physical_fname FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
LOOP AT itb_csv.
TRANSFER itb_csv TO i_physical_fname.
ENDLOOP.
CLOSE DATASET i_physical_fname.
it is full for you
THANKS & REGARDS,
bhupal.