01-12-2009 8:38 PM
Hello friends-Any help will be greatly appreciated.
I am trying to execute the following command in SAP 6.0 in the START-OF-SELCTION section. Even though I have the OPEN DATASET staement I am still getting the ABAP dump with error DATASET_NOT_OPEN.
please see the code below:
file_usp = '
fla-file-04\Groups\Common\Data\masterdata_products\us_products_.txt'.
OPEN DATASET file_USP FOR OUTPUT IN TEXT MODE encoding default.
concatenate 'MATNR'
'LDATE'
'DDATE'
into string separated by ','.
TRANSFER string to file_USP.
CLOSE DATASET file_USP.
01-12-2009 9:05 PM
>
> file_usp = '
fla-file-04\Groups\Common\Data\masterdata_products\us_products_.txt'.
You cannot access server *
fla-file-04* directly I think (?)
I don't know how to do it but you can search forum.
01-12-2009 8:53 PM
You have to make sure that sy-subrc = 0 after the OPEN DATASET command.
You may have mistyped the name of the file. Remember - it is case sensitive.
Rob
01-12-2009 9:14 PM
01-12-2009 9:17 PM
>
> I checked. No spelling or case issue. Its identical everywhere
Yes, but the program still doesn't test sy-subrc to see if the OPEN actually worked.
Rob
01-12-2009 9:05 PM
>
> file_usp = '
fla-file-04\Groups\Common\Data\masterdata_products\us_products_.txt'.
You cannot access server *
fla-file-04* directly I think (?)
I don't know how to do it but you can search forum.
01-12-2009 9:15 PM
I have access to the server. I can access it if I enter the path in Start-Run
01-12-2009 9:23 PM
Hi Syed..
OPEN DATASET file_USP FOR OUTPUT IN TEXT MODE encoding default.
if sy-subrc eq 0. "<<<<<<<<<<check
concatenate 'MATNR'
'LDATE'
'DDATE'
into string separated by ','.
TRANSFER string to file_USP.
CLOSE DATASET file_USP.
else.
exit.
endif.
01-12-2009 9:41 PM
Even better would be to catch the exceptions that the OPEN statement throws instead of checking for sy-subrc to be non zero.
Have a look at the keyword documentation of the OPEN DATASET. At the bottom you will find what exceptions you can catch.
try.
open dataset ....
catch...
This way you will know exactly why the file failed to open.
regards,
Advait