2014 Mar 03 10:36 AM
Hello
I have a batch job running and I have an error coming during some validation logic.
The problem is I need to continue the batch job when this error message comes and it should not cancel the batch job as it is doing currently but display that error message in batch job log, there are more similar error messages coming in job log and job gets finished, but when my error message comes job gets cancelled.
I cannot give it as info message as it will give wrong idea about message type.
Is there any FM by which we can add message in job log?
2014 Mar 03 3:56 PM
Hi All
Issue is resolved
I had to create a new FM with exception specifically as 'ERROR_MESSAGE'.
Thanks everyone for helping !
Hello
I have a batch job running and I have an error coming during some validation logic.
The problem is I need to continue the batch job when this error message comes and it should not cancel the batch job as it is doing currently but display that error message in batch job log, there are more similar error messages coming in job log and job gets finished, but when my error message comes job gets cancelled.
I cannot give it as info message as it will give wrong idea about message type.
Is there any FM by which we can add message in job log?
2014 Mar 03 10:39 AM
Hi Karan
When a program is run in batch job this is how we do. We add information message. Seconldy if you are not happy with this way you can create a log samea s visible in SLG1
Nabheet
2014 Mar 03 10:47 AM
Already there are error messages which are getting displayed in Job log and they are returned as hard error messages only in the program, but in my case job gets cancelled but not in there case.
And i see error messages are displayed as Error messages only in job log with processing continued till end and not cancelled.
Please see screenshot
2014 Mar 03 10:53 AM
Hi Karan -
Is the message with message class 'ZVSC' is the message that you are showing as type 'E' ?
If that is the case then you can put a condition
IF sy-batch is initial.
MESSAGE E<messageno>(ZVSC).
ELSE.
MESSAGE I<messageno>(ZVSC).
endif.
The above code is just an example. You can do your coding as for your requirement.
2014 Mar 03 10:58 AM
message with class 'ZVSC' is not shown by me.
I have only shown info message(third one in message log) which I want to display as 'E' and not 'I'
2014 Mar 03 1:08 PM
If you will throw an error mesasge the processing will stop. One of the option you can use is
message e001 into lv_message.
write /message
Nabheet
2014 Mar 03 10:45 AM
Hi Karan,
if it is your custom program through you are creating job, then you can change your message
like shown below
if sy-batch = 'X'.
Message 'Error in updating data ' type 'I'.
endif.
2014 Mar 03 10:50 AM
Sanjeev I have done that but problem is I do not want to give that as Information message but Error message only and continue processing.
If you see in screenshot 3rd message is given by me as information and you can see error messages also 6th and 7th and job continued till it is finished
Basically I want that 'I' to be displayed as 'E'.
2014 Mar 03 10:57 AM
Hi Change the code as shown below
if sy-batch = 'X'.
Message 'Error in updating data ' type 'I' DISPLAY LIKE 'E'.
endif.
2014 Mar 03 11:00 AM
this will not display message as 'E' in log, but as 'I' only.
already tried that
2014 Mar 03 11:10 AM
Hi karan,
i am sorry, i just misses that you are showing it as a log.
Let me see your issue more specifically.
2014 Mar 03 11:14 AM
Hi Karan,
Instead of raising error message why you cant try with ALV for all the messages ?
Thanks & Regards,
Arun
2014 Mar 03 11:31 AM
Hi Aruna
Job is run thru standard SAP transaction for Shipment document create and we have some enhancements from where messages are coming, cannot display them in ALV
2014 Mar 03 12:08 PM
2014 Mar 03 1:09 PM
Hello KC,
Have you tried ROLLBACK WORK after the error message.
Regards,
Thanga
2014 Mar 03 1:28 PM
Thanga Prakash error message will stop the processing no rollback work will work
2014 Mar 03 1:47 PM
2014 Mar 03 2:05 PM
Nabheet
As I showed in screenshot it is possible to show error message in Job log and continue but I am not able to find a solution how ?
2014 Mar 03 2:07 PM
Only available solution with job log seems to be the sending of an error message and then its handling it with an error_message exception option. (*)
So you may be required to develop
But if the main report is a standard you should not be allowed to do that, changing the type of message without any other change would then allows execution of the "transactions".
In which customer-exit/BAdI is this message raised ?
Regards,
Raymond
(*) Read MESSAGE documentation : Messages in background processing
2014 Mar 03 2:14 PM
I am using a user exit so anyhow I can use FM in that.
Can you tell me how to handle with FM
2014 Mar 03 3:56 PM
Hi All
Issue is resolved
I had to create a new FM with exception specifically as 'ERROR_MESSAGE'.
Thanks everyone for helping !
2015 Mar 27 3:39 PM
Hi,
I am also having similar requirement, can you please share code of your new FM ?
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |