10-02-2013 1:29 PM
Hi guys,
I using the method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG to export data out of an ALV into a csv-file. Generally it works but if the number of rows are larger then approximately 10.000 then I get a dump:
Fehleranalyse
In dem Programm "CL_GUI_FRONTEND_SERVICES======CP" wurde durch eine
RAISE-Anweisung die Exception
(Ausnahmebedingung) "CNTL_ERROR" ausgelöst.
Da die Exception nicht durch ein in der Aufrufhierarchie darüber-
liegendes Programm abgefangen ist, wurde die Verarbeitung abgebrochen.
Kurztext zur Ausnahmebedingung:
Eine ausführliche Dokumentation der Ausnahmebedingung finden Sie
über Transaktion SE37 (Funktionsbibliothek). Den gerufenen
Funktionsbaustein können Sie der Anzeige der aktiven Aufrufe
entnehmen.
115 FULLPATH = FULLPATH
116 EXCEPTIONS
117 OTHERS = 1.
118 ELSE.
119 CALL METHOD HANDLE->CALL_METHOD
120 EXPORTING
121 METHOD = 'FileSaveDialogEx'
122 P_COUNT = 7
123 P1 = WINDOW_TITLE
124 P2 = DEFAULT_EXTENSION
125 P3 = DEFAULT_FILE_NAME
126 P4 = FILTER
127 P5 = INITIAL_DIRECTORY
128 P6 = BWITHENCODING
129 P7 = BPROMPT_ON_OVERWRITE
130 QUEUE_ONLY = ' '
131 IMPORTING
132 RESULT = FULLPATH
133 EXCEPTIONS
134 OTHERS = 1.
135
136 CALL METHOD CL_GUI_CFW=>FLUSH
137 EXCEPTIONS
138 CNTL_SYSTEM_ERROR = 1
139 CNTL_ERROR = 2
140 others = 3.
141 ENDIF.
142
143 *handle exceptions......................................................
144 IF SY-SUBRC <> 0.
>>> RAISE CNTL_ERROR.
146 ENDIF.
Any ideas how I can solve this problem?
Cheers
Robert
10-02-2013 2:37 PM
Hi
You need to manage that excption (CNTL_ERROR) in your program
Max
10-02-2013 2:40 PM
AFAIK CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG only return a file name and its full path. Check your parameters (type and value) and if correct, you could reinstall your SAP GUI ?
Regards,
Raymond
10-02-2013 3:01 PM
Hi Raymond,
is there another way? In general it works so I could use a workaround. I guess it has to do with the volume that I want to export into to CSV-file. If I just export e.g. 7000 to 8000 rows than it is OK. Any other solution?
Kind regards
Robert
10-02-2013 3:12 PM
Remarks
In either case, you have to CATCH those kinds of errors in a TRY/ENDTRY block, so you could receive the long text associated and display it at screen.
TRY.
" your code
CATCH cx_root INTO oref. " or be more specific...
text200 = oref->get_text( ).
MESSAGE i042(zfsb) WITH text200+0(50) text200+50(50) text200+100(50) text200+150(50) DISPLAY LIKE 'E'.
EXIT.
ENDTRY.
Regards,
Raymond
10-02-2013 3:13 PM
Hi
Just as Raymond said the method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG is to find out the file, you should use CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD to save the file.
So it's strange the error is linked to the size of the file, because here you aren't downloading the file
Now you should mange the exceptions in order to prevent the dump and give more details on when you call CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
Max
10-08-2013 4:01 PM
Hi,
thanks for your usefull input but the error didn't appear anymore. I didn't change anything. I don't know why but it is working fine now. Maybe it had something to do with the cache !?!
Strange but I am happy that is is running now.
Kind regards
Robert