‎2011 Jan 24 11:59 AM
Hello Gurus,
I am using SUBMIT <REPORT> command inside a loop of my calling report. For one record the SUBMIT <report> is throwing an eror message due to which my report is getting stopped by displaying the error message.
My requirement is to skip the record if there is any error in SUBMIT <report> and process rest of the records.
Please help me out.
‎2011 Jan 24 12:01 PM
Hi Bharat,
Dont throw the error in your report, When an error entry exists if needed take a log like creating a file. then instead of throwing error message just bypass the code which needs to be executed if a correct entry comes to the report.
Thanks,
Vinayaka SJ
‎2011 Jan 24 12:01 PM
Hi Bharat,
Dont throw the error in your report, When an error entry exists if needed take a log like creating a file. then instead of throwing error message just bypass the code which needs to be executed if a correct entry comes to the report.
Thanks,
Vinayaka SJ
‎2011 Jan 24 12:11 PM
Hi Vinayaka,
The report i am calling using submit command is standard report. The error message is thrown by this standard report.
‎2011 Jan 24 12:15 PM
Hi,
Then you need to write the logic of checking correct/wrong record before SUBMIT.
Thanks,
Vinayaka SJ
‎2011 Jan 25 5:57 AM
There are many validations done on in the report that is called using submit command. I cant put all the validations inside my report. Is there ny other way to skip the error records in submit command.
‎2011 Feb 02 3:52 PM
Hi Bharath,
I'm currently facing a similar problem with SUBMIT: when calling a standard report an information pop-up is displayed saying that archived documents were found, and i need to skip it. Could you find a way to solve it?
Regards,
mr
‎2011 Feb 02 4:52 PM
Hi Bharath Kumar Siripurapu,
if you let us know the name of the submitted report and some business context, very probably a solution is near. Same applies to @Manuel RodrÃguez.
After getting the solution, you may decide if you can use it generally forall problems of this kind - rarely vice versa.
Regards,
Clemens
‎2011 Feb 02 5:19 PM
Hi,
I find an idea proposed by Vasanth in [this post|]. I'll try it and comment results here.
My context is:
- A BAPI calling (via SUBMIT) a copy of report RFITEMAP (trn. FBL1N) that exports results to memory.
- RFITEMAP returns an information message when archived documents were found.
- An external program calling the BAPI gets an error when the information message from RFITEMAP arises.
Regards,
mr.
‎2011 Feb 02 6:14 PM
Hi All,
We can copy stanadard report to Custom report and delete unneccary messages which we dont need and call SUBMIT ZPROGRAM.
Thanks,
Srikanth.A
‎2011 Feb 04 12:05 PM
Hi,
[Vasanth's idea|] regarding doing a CALL FUNCTION IN BACKGRUOND TASK does work, unless you need to get back some information from the SUBMIT, as export parameters can't be set when using IN BACKGRUOND TASK.
As i need to get data from the SUBMIT, i'll keep looking for other alternatives, so other ideas are still welcome...
Regards,
mr.
‎2011 Feb 04 4:23 PM
Hi,
Vasanth's idea regarding doing a CALL FUNCTION IN BACKGRUOND TASK does work, unless you need to get back some information from the SUBMIT, as export parameters can't be set when using IN BACKGRUOND TASK.
As i need to get data from the SUBMIT, i'll keep looking for other alternatives, so other ideas are still welcome...
Regards,
mr.
Hi Manuel,
Try calling report in background task like below:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = c_name "this name can be any name defined in constants(you do not have to create a job name anywhere in system or SM36)
IMPORTING
jobcount = w_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
*" Job opened successfully
IF sy-subrc EQ c_0.
*" Call program to process IDoc
SUBMIT ZSubmit WITH <any value> " e.g. p_field1 EQ <value>
VIA JOB c_name NUMBER w_number
AND RETURN.
[Note: In ZSubmit report you can send the data to calling program through ABAP memory i.e. Use EXPORT parameter to export data
Ex: constants: c_memory(7) type c value 'MEMORY1'.
At the end of ZSubmit report, before returning to the calling program write below statement:
EXPORT i_message TO MEMORY ID c_memory1.]
*" Successful processing of IDoc
IF sy-subrc EQ c_0.
"Here you can import data from ZSubmit report
import i_message from memory id c_memory1.
After retrieving the data, free the memory otherwise it will affect the performance of your report:
Free memory id c_memory1.
*" Close the job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_number
jobname = c_name
strtimmed = c_x
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
ENDIF.
Hope this helps!
Regards,
Saba
‎2011 Feb 04 4:42 PM
Hi Saba,
Thanks for the answer.
I was just exploring a solution of this kind... I'll post results here.
Despite all there should be an easier way of doing a synchronous call to a process in background mode, shouldn`t?
Regards,
mr.
‎2011 Feb 10 6:23 PM
Hi all,
Finally i can get working a solution calling a process via SUBMIT...VIA JOB in a synchronous way, based on Saba's suggestion, but using EXPORT/IMPORT FROM DATABASE instead of IMPORT/EXPORT FROM MEMORY (this doesn't work when the SUBMIT is VIA JOB becouse a new work process is used and memory SGA/SPA parameters doesn´t work cross process). I also added a control for job finalization using FM BP_JOB_CHECKSTATE, so data import is made only when job finishes ok.
Thanks all for the ideas and tips!
Regards,
mr.
‎2013 Jan 22 4:15 AM
Hi Manuel,
Can you please share the code snippet?
Thanks
prabaharan
‎2011 Feb 02 6:07 PM
If you don't mind about the error than Submit <Report> is raising, then you could use following structure:
try
submit <Report>
endtryHope this help you, let us know about it.
‎2011 Feb 02 6:31 PM
My bad: My last comment was focused on a raising error, but not a popup error.
For avoiding your loop stopped by this kind, the option
SUBMIT <Report> AND RETURN.creates a new internal session to run your <Report> and the loop continues without pause.
‎2011 Feb 03 10:33 AM
Hi Antonio,
I'm actually doing the SUBMIT with AND RETURN option, and popup information message is being displayed anyway.
Thanks anyway.
Regards,
mr.
‎2015 Apr 02 5:33 PM
try this. add the code via job 'name' number 123
SUBMIT 'PROGRAM'
VIA job 'JOB' NUMBER 123
AND RETURN.
This will run the program on background and will skip any message