‎2007 Jul 19 3:13 PM
Hello all,
i am using this statement to save my data file to Application Server:
OPEN DATASET l_file_name FOR OUTPUT
IN
LEGACY
TEXT MODE
FILTER 'compress'
IGNORING CONVERSION ERRORS
REPLACEMENT CHARACTER '$'
CODE PAGE g_sap_code_page.
LOOP AT lt_text_table.
TRANSFER lt_text_table TO l_file_name.
ENDLOOP.
CLOSE DATASET l_file_name.
___________________________________________________
IN THIS MY CODE PAGE IS 'iso_8859-1'.
In this i am getting a dump which says:
Short Text:
File "l_file_name" is not open.
What happened?
Error in the ABAP Application Program
The current ABAP program "YSL_DWH_PROCESSING" had to be termininated
because it has
come across a statement that unfortunately cannot be executed.
and when i do not use Filter "compress" in my code it works fine
please help:)
‎2007 Jul 19 3:17 PM
Hi Surmeet,
Try using BINARY mode and see if it works.
Regards,
Ravi
‎2007 Jul 19 3:17 PM
Hi,
Try like this:
open dataset v_file for output in text mode encoding default.
if sy-subrc eq 0.
loop at git_mara.
transfer git_mara to v_file.
endloop.
close dataset v_file.
endif.
clear : git_mara[].
Regards,
Bhaskar
‎2007 Jul 19 3:30 PM
‎2007 Jul 19 3:17 PM
Hi,
see following code :
*Create First Data Set
perform open_dataset using dataset1.
transfer text-001 to dataset1.
loop at i_contracts1.
transfer i_contracts1 to dataset1.
if i_contracts1-ebeln+0(1) ca '0123456789'.
cnt1 = cnt1 + i_contracts1-ebeln.
endif.
endloop.
perform close_dataset using dataset1.
&----
FORM open_dataset USING P_DATASET.
open dataset p_dataset for output in text mode.
if sy-subrc <> 0.
write: / text-e00, sy-subrc.
stop.
endif.
ENDFORM. " open_dataset
FORM close_dataset USING P_DATASET.
close dataset p_dataset.
ENDFORM. " close_dataset
Reward points if helpful
Regards.
Srikanta Gope
‎2007 Jul 19 3:29 PM
Hello friends,
i need to encode as well as compress my data also
with niary mode i cant have encoded data
‎2007 Jul 19 3:35 PM
What is the OS of your APPLICATION Server?IS it Unix or Windows or nything else?
‎2007 Jul 19 3:37 PM
hi ravi,
how cn i know the Os of application server?
i dont know:(
‎2007 Jul 19 4:03 PM
‎2007 Jul 19 4:15 PM
It is valid for only OS that use something called Pipes concept and in the help they have mentioned Unix and Windows only.
Did you try to capture the actual nessage by using message addition for the open dataset statement? That way , you can atleast find what was the message that was raised.
Regards,
ravi
‎2007 Jul 19 4:27 PM
hi ravi,
the problem is at times it gets executed fine and at times it doesnt
so the code is ok
nd yes i have analysed the DUBP, it says that the file is not open i.e. the file that i open doesnt gt opened
‎2007 Jul 19 3:32 PM
hi sumeet
try this.....
open dataset p_file for output in text/binary mode.
if sy-subrc eq 0.
loop at itab.
transfer itab to p_file.
endloop.
close dataset v_file.
endif.
clear : itab[].
REWARD IF USEFUL...!!
‎2007 Jul 19 3:36 PM
‎2007 Jul 20 7:40 AM
hi sumeet
sy-subrc = 8...it indicate us that there is no list currently present right...so let us try it in different manner
************************
Download
************************
report zdowntex.
parameters:
p_report like sy-repid,
p_file like rlgrap-filename,
p_lang like sy-langu.
data: it_text like textpool occurs 100 with header line.
start-of-selection.
read textpool p_report into it_text language p_lang.
if sy-subrc = 0.
call function 'WS_DOWNLOAD'
exporting
filename = p_file
filetype = 'DAT'
tables
data_tab = it_text
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
write: / 'ws_download : ', sy-subrc.
else.
write: / 'read textpool : ', sy-subrc.
endif.
************************
Upload
************************
report zuplotex.
parameters:
p_report like sy-repid,
p_file like rlgrap-filename,
p_lang like sy-langu.
data: it_text like textpool occurs 100 with header line.
start-of-selection.
call function 'GUI_UPLOAD'
exporting
filename = p_file
filetype = 'DAT'
tables
data_tab = it_text
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
if sy-subrc = 0.
insert textpool p_report from it_text language p_lang.
write: / 'insert textpool : ', sy-subrc.
else.
write: / 'gui_upload : ', sy-subrc.
endif.
jus check whether the list id present or not...
REWARD IF USEFULL..!!!