2009 Oct 08 8:34 AM
Hi experts,
i am working on creating a text file in Application server using OPNDATASET. i have codes as below:
path = /user/sap/data/txt
OPEN DATASET path FOR OUTPUT IN text MODE .
loop at t_cmex.
transfer t_cmex to path.
endloop.
close dataset path.
but when the open data statment executes its gving sy-subrc = 8 and not creating the file.
plz help me with the same.
mahesh
2009 Oct 08 11:38 AM
Hi,
The file path is case sensitive. Declare it as follows:
data : input type cffile-filename obligatory default '/usr/sap/work/BPFILES.txt'.
Hi experts,
i am working on creating a text file in Application server using OPNDATASET. i have codes as below:
path = /user/sap/data/txt
OPEN DATASET path FOR OUTPUT IN text MODE .
loop at t_cmex.
transfer t_cmex to path.
endloop.
close dataset path.
but when the open data statment executes its gving sy-subrc = 8 and not creating the file.
plz help me with the same.
mahesh
2009 Oct 08 8:48 AM
Hi,
How are you declaring the variable path? Also check if you have appropriate authorizatoin for creating a file.
Vikranth
2009 Oct 08 8:48 AM
Hi,
Your filepath seems to be incomplete, I suggest you to set your path with an explicit file extension such as;
path = /user/sap/data/test.txt
And make sure that necessary authorizations have been granted to write on that filepath.
I hope it helps.
Ozcan.
2009 Oct 08 9:31 AM
Hi,
data: V_PHYFIL_CSV like V_EXCEL_STRING value
'
Sapbwgrp\rice\IN\inv\BI_Cycle_Count.csv'.
OPEN DATASET v_phyfil_csv FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
See this is working at my end, check out for the file path.
Thanks,
Krishna
2009 Oct 08 11:31 AM
Hi Mahesh,
You can try like below. At least you can come to know what causing the problem.
Thanks
Venkat.O
DATA : msg TYPE string.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE msg.
IF sy-subrc NE 0.
WRITE msg.
ELSE.
"Your code
ENDIF.
2009 Oct 08 11:38 AM
Hi,
The file path is case sensitive. Declare it as follows:
data : input type cffile-filename obligatory default '/usr/sap/work/BPFILES.txt'.
2009 Oct 08 12:48 PM
Hi mahesh,
loop at tcmex.
concatenate tcmex-field1
tcmex-field2
tcmex-field3
into v_string separated
by cl_abap_char_utilities=>horizontal_tab.
transfer v_string to path.
endloop.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |