on 12-09-2004 2:14 PM
Hi all,
here is the scenario:
I'm writing a program which post some kind of documents into SAP based on a flat input file with data. To post the document I'm using a complex function module. Results from post are tracked into some log-file.
Problem is:
Sometimes, due to incorrect input data, function module returns an error messages directly into a system line, but not in an output message from the FM. That brokes my flow and I'm unable to proceed with next record from my flat file.
Question is:
Is it possible to prevent error message occurance into a system line? I would like to get the error, if possible, and to pass it to my log-file instead.
Any help would be highly appreciated.
Many thanks in advance.
Regards,
Ivaylo
Anand:
Pleae mail to me also.
id : suresh_karan@rediffmail.com
Thanks in Advance
Suresh Babu Karanam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You might want to try calling that function module in background task or in separate task. Otherwise, I don't think you can skip that error messages that does not raise exception in the function module you call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nablan,
thanks for the suggestion. This would also broke my scenario, isn't it? I'm in a loop, and I need some step finished before to start the next one - which is not possible in case of NEW or BACKGROUND TASK.
Furthermore, FM has a CHANGING parameters - RC (returnCode) - which couldn't be accessed in case of NEW TASK or BACKGROUND TASK - there is no possibility to get CHANGING parameters in such type of CALL. So how would I get the result from the FM - means operation?
Ok, scenario seems to be not so clear. That's the way I fould until now. Perhaps I should deal with own FM which calls the original one in some way, or so... don't have a clear idea how to proceed in different way.
Any suggestions?
Thanks in advance.
Regards,
Ivaylo
If it raises an exception you can catch it.
cx_root is the root class for exceptions.
DATA: ex TYPE REF TO CX_ROOT.
TRY.
call fm.
...
CATCH cx_root INTO ex.
ENDTRY.
message = cx_root->get_text( ).
-
If it helps please give points.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the old code is
CATCH SYSTEM-EXCEPTIONS except1 = rc1 ... exceptn = rcn.
....
ENDCATCH.
But it only catches the exceptions in current level. So
if you call any FM between catch - endcatch it will not catch the exception.
As far as I know there is no exception class in (4.6C) .
It is a new concept and works in (4.7)
Sorry I cannot help
Exactly the same scenario explained in the 'A Programmer's Guide to the New Exception Handling Concept in ABAP' article, which available in SDN. You can find it via Search.
If you lucky the FM returns with a message table, like BAPIs, otherwise it will dump. This is the problem with the classical error handling, this is why class-based exception handling is much more flexible. The mentioned CX_.. class is an exception class.
You can find all the details in the article.
Regards,
Peter
Peter, unfortunately the link:
returns error: 404 Die angeforderte Ressource ist nicht verfügbar.
which perhaps means document unavailable. I've found one more link, it's also broken.
Could you please pass me here a working link?
Thanks,
Ivaylo
Hi Anand,
thanks for the proposal. Could you please pass it to me at:
ivaylo.mutafchiev@vbs.bg
Thanks in advance.
Ivaylo
P.S. Forget it! The article is accessible at SapPro Journal (www.sappro.com) web site and I just downloaded it.
(for those who are interested, this site needs subscription)
Thanks.
Ivaylo
Message was edited by: Ivaylo Mutafchiev
Eddy,
It's not stupid remark at all for me
Unfortunately, the FM I'm calling is not mine, but a 'native' IS-Oil one (in fact, there are two of them I'm calling in my program, named 'OIGI_LOADING_CREATE' and 'OIGI_DEL_CONF_CREATE') and, as I mentioned in the root of this thread, they are complex enough - in some cases they even poped-up some screen(s) - like QCI Controle, etc...
Sorry, your proposal is not an option in this case...
Thanks anyway.
Regards,
Ivaylo
Ramki --
well, these FMs are part of the FuGr 'OIGI > TD RFC Create/change Shipment', part of a dev.class 'OIG > TD Transport and Distribution',
application component 'IS-OIL-DS-TD > Transportation and Distribution',
software component 'IS-OIL > IS-OIL 46C'.
It seems it is released for customer, isn't it? As I mentioned (or not? it doesn't behave as a 'normal' BAPI - there are lots of error messages tracked into a system message line instead of FM-interface, and there is even a situation, when in some mess in an input data, pop-up screen/s occurs.
Perhaps that's the way I should follow - to open a customer message at oss.
Thanks,
Ivaylo
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.