10-12-2007 7:40 AM
Hi All,
I have an ABAP code that write some records to a flat file. Am getting a DATASET_WRITE_ERROR when this program is run.
in ST22 i checked for any info that could be of help.
The Error Text is: "No Space left on device"
Error code: 28.
Now i want to know after writing how many records did the program threw the error.
I have a counter named WRITE_CTR. <b>Is there any way in the debug mode I can check for the value of WRITE-CTR just before the program terminated ?</b> checking the value of counter each time a record is written is not practical as there are almost 40k records in total.
In ST22 i checked the section "Chosen Variables". unfortunately this counter's value is not listed there.
Please let me know if there is any way i can see the contents of a field just before a short dump is generated.
Otherwise is there any option during debug that i can set a breakpoint on a statement when the field WRITE-CTR=<some value> say when WRITE-CTR = 30000 ?
Thanks in advance,
Rit
10-12-2007 7:55 AM
Hi Rithesh,
Use Try block and catch the exception the Catch block. This will make sure that the code will not dump (due to space constraint on device). By doing this, if you put a breakpoint at the place where you write data to file in application server, you might be able to know which all records have been written before the exceptionn is caught/dump happens.
Thanks,
Vijay.
<b>PLZ reward points if helpful.</b>
10-12-2007 7:55 AM
Hi Rithesh,
Use Try block and catch the exception the Catch block. This will make sure that the code will not dump (due to space constraint on device). By doing this, if you put a breakpoint at the place where you write data to file in application server, you might be able to know which all records have been written before the exceptionn is caught/dump happens.
Thanks,
Vijay.
<b>PLZ reward points if helpful.</b>
10-12-2007 8:04 AM
Ok. Havent used Try..Catch in ABAP. I'll try using that. That should be a better way. Thanks.
I think it throws the error only after 20 or 30000 records are written. So its not possible to set a breakpoint where it writes to file and check which all records are written.
I wanted to know if there's any way to know the value of a filed just before the error is thrown. In the 'Watch' feature i saw an option to select a field and then give a comparison operator and all. Do you know how to use that ? Will that help me to break the execution when a field value equals a limit ? Just wondering what the Watch option is for!!
Regrads,
rit
10-12-2007 8:08 AM
Hi Rithesh,
Can you tell where exactly the code is dumping? Is it dumping at Open Dataset or within the loop where you are using the transfer stmt?
Regards,
Vijay
10-12-2007 8:14 AM
Hi Vijay,
Yes, its within the loop. In the loop i use TRANSFER statement to copy a single record to the OUTPUTFILE. before transfering each record i increment a counter WRITE-CTR.
Thanks,
10-12-2007 8:18 AM
Hi,
Try this out. After the code dumps, click on debugging button on the top, and check the value of write-ctr...not sure whether this will work.
Thanks
Vijay
10-12-2007 8:27 AM
Wow!!! It shows me some value. i guess its the value of that field just before the code dump.
Thanks a million
my ignorance. ve been trying to find this out for quite some time.
Thank you,
Rithesh