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: 

Submit - Handle error message

former_member216168
Active Participant
0 Kudos

Does anyone know if it's possible to handle error messages is submit statement?

I need it because I'm using submit inside a loop, and when error message occurs, it stops.

  LOOP AT t_customer INTO w_customer.

    cl_salv_bs_runtime_info=>set( EXPORTING display  = abap_false

                                            metadata = abap_false

                                            data     = abap_true ).

    SUBMIT rfdkli41

      WITH kunnr = w_customer-kunnr

      WITH kkber = p_kkber

      WITH rasid = p_rasid

      WITH xc30  = p_xc30

      WITH horda = p_horda

    EXPORTING LIST TO MEMORY AND RETURN.

  ....


Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi. It is not possible to catch error messages using SUBMIT, use call transaction instead and get error messages in an internal table.

7 REPLIES 7

raphael_almeida
Active Contributor
0 Kudos

Thiago,

For SUBMIT not. You can do is put a Try Catch.


Warm regards,


Raphael Pacheco.

0 Kudos

Thanks, but I have already test it before post here

Any other suggestion?

0 Kudos

Hummm... Another way is check if this "object" has been completely exported.


Sorry for indicate to you the statement "Try - Catch", this statement does not work in these cases.


Warm regards,


Raphael Pacheco.



Former Member
0 Kudos

Hi. It is not possible to catch error messages using SUBMIT, use call transaction instead and get error messages in an internal table.

0 Kudos

Thanks! I changed and it worked!

Juwin
Active Contributor
0 Kudos

Hi Mauro,

But, his original requirement to get back the list in memory will not work through CALL TRANSACTION, correct?

So, I think it is better to submit the program as a job and retrieve the list from the spool. Since job is run in a different session, even if the job cancels due to an error, the original program execution will not be stopped.

Thanks,

Juwin

0 Kudos

I thought the same, but after test I checked that worked