Application Development and Automation 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: 
Read only

Skip Error message in submit report

Former Member
0 Likes
10,311

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,114

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

17 REPLIES 17
Read only

Former Member
0 Likes
6,115

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

Read only

0 Likes
6,114

Hi Vinayaka,

The report i am calling using submit command is standard report. The error message is thrown by this standard report.

Read only

0 Likes
6,114

Hi,

Then you need to write the logic of checking correct/wrong record before SUBMIT.

Thanks,

Vinayaka SJ

Read only

0 Likes
6,114

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.

Read only

0 Likes
6,114

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

Read only

Clemenss
Active Contributor
0 Likes
6,114

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

Read only

Former Member
0 Likes
6,114

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.

Read only

Former Member
0 Likes
6,114

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

Read only

Former Member
0 Likes
6,114

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.

Read only

Former Member
0 Likes
6,114

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

Read only

Former Member
0 Likes
6,114

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.

Read only

Former Member
0 Likes
6,114

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.

Read only

0 Likes
6,114

Hi Manuel,

Can you please share the code snippet?

Thanks

prabaharan

Read only

Former Member
6,114

If you don't mind about the error than Submit <Report> is raising, then you could use following structure:

  try
   submit <Report>
  endtry

Hope this help you, let us know about it.

Read only

0 Likes
6,114

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.

Read only

0 Likes
6,114

Hi Antonio,

I'm actually doing the SUBMIT with AND RETURN option, and popup information message is being displayed anyway.

Thanks anyway.

Regards,

mr.

Read only

Former Member
0 Likes
6,114

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