Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Catching all message errors after submit

Former Member
0 Kudos
818

Hello!

Now I'll try to explain my situation.

I have report which generating two message errors:

MESSAGE E080(MM). "error N.1

MESSAGE S305(M3). "error N.2

Also, I have my own function module that submiting this report like this:

submit (REPNAME) with selection-table seltab

exporting list to memory

and return.

I'm using extended syntax(default exception ERROR_MESSAGE) of call function to catch message errors from submit:

call function FM

exceptions ERROR_MESSAGE.

if sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty " We have a message!

NUMBER sy-msgno

INTO msg_text.

write: 'Error', msg_txt.

endif.

After all of this, I can't really get what I want.

There are two problems:

1) The first error in report show me a report selection screen with error message of the type 'E' in a status bar, but I don't need this. Also, I caught this error with my FM and that is good.

2) The second error show me nothing, but I can't get the error message with my FM.

Can anybody help me with that?

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos
242

Hi Vitaly,

and when you change your fm to submit report

in batch , so that you get all error in job log:

1) fm job_open

2) submit Z123...

USER 'XYZ'

with...

3) fm job_close

4) fm BP_JOBLOG_READ

regards Andreas

8 REPLIES 8

Former Member
0 Kudos
242

Hi,

If the report you have developed is a customized one then you can handle this problem very simply.

In your report when ever there is an error condition happens to occur then do populate it an internal table and before you come back export it to memory.

now in your FM import the same and check the contents of the internal table and if it is not initial then raise error_message exception.

now loop at the internal table outside the FM and display the message.

Regards,

Jagath.

0 Kudos
242

Thank you for your suggestion, but this problem is not problem of one report. There are may be many no customized reports with different message errors and I have to catch all of them.

andreas_mann3
Active Contributor
0 Kudos
243

Hi Vitaly,

and when you change your fm to submit report

in batch , so that you get all error in job log:

1) fm job_open

2) submit Z123...

USER 'XYZ'

with...

3) fm job_close

4) fm BP_JOBLOG_READ

regards Andreas

0 Kudos
242

to Andreas Mann

Thank you for your advise, but I still have one problem - everytime I get selection screen of the report with message error type 'E' even in the job mode.

0 Kudos
242

As a continue for my last message:

I've tried to suppress report selection screen with error by next call:

submit (REPNAME) with selection-table seltab

to sap-spool

user 'USER_ND' via job 'SUBMIT_REPORT' number jc

and return.

USER_ND - is 'system' type of user, i.e. dialog-free user.

But I still have selection screen while 'E' error! What is it? What I'm doing wrong?

Former Member
0 Kudos
242

Hi,

If there are lot of places where in you might raise an error then it will be advisable to send a mail to SAP shared folder so that at each and every point where ever you raise error you can post a mail with a relevant message from the program being submitted.

Regards,

Jagath

0 Kudos
242

to Jagathguru Chandrasekharan

You mean that I need to send mail every time I want to send an error in report? If so, I can't modify reports. I don't really know what report I will call next time.

0 Kudos
242

..

Edited by: Koteswar Rao Arvapally on Nov 13, 2009 2:32 AM