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: 

Skip errors at SUBMIT statement

Former Member
0 Kudos

Hello gurus,

I have a very simple problem, which i cannot solve it! i hope you ll help me.

All i want is to call a programm (report) or a transaction in a loop statement, and when an error occurs, i want to log it somewhere and go to the next line. How is this possible in ABAP?

Thanks in advance!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You could try BDC calls using CALL TRANSACTION.

Sample:


CALL TRANSACTION (tcode) USING    (bdc_table)
                              MODE 'N'
                              UPDATE 'S'
                              MESSAGES  INTO i_lmesstab.

i_lmesstab contains the messages (error/status/etc) encountered during the BDC call.

i_lmesstab should be of TYPE STANDARD TABLE OF bdcmsgcoll.

Hope this helped.

5 REPLIES 5

krishnendu_laha
Active Contributor
0 Kudos

I think if you run the program in background, message will be logged in job log...please try.

0 Kudos

It ll be loged but it will not skip it..

so only with call transaction you can do this ?

and what if a programm is not assigned with a transaction code ?

0 Kudos

Well, it still won't skip the error. I think the only solution is to modify the called program to skip errors and continue when called by your program.

Rob

0 Kudos

Hi!

Errors are in place so that the transaction will not continue. What's the use in continuing if you have errors in data? (",)

With CALL TRANSACTION, you get to log all messages encountered by the call transaction statement.

You could also use SUBMIT (program) ... AND RETURN statement but I think this will only give you the last error message that terminated the call through SY-SUBRC check.

Also, if you are using LOOP statement to process a lot of transaction like


LOOP AT itab INTO wa.
  ...
  CALL TRANSACTION...
  IF sy-subrc IS INITIAL.
    "Transaction ended most probably successfully.
  ENDIF.
  "Check the iMessageTab for the messages encountered
ENDLOOP.

The next line of the internal table itab gets processed anyway regardless if the previous call was successful or not.

Edited by: Michael.Sumaya on Feb 2, 2012 9:32 AM

Former Member
0 Kudos

You could try BDC calls using CALL TRANSACTION.

Sample:


CALL TRANSACTION (tcode) USING    (bdc_table)
                              MODE 'N'
                              UPDATE 'S'
                              MESSAGES  INTO i_lmesstab.

i_lmesstab contains the messages (error/status/etc) encountered during the BDC call.

i_lmesstab should be of TYPE STANDARD TABLE OF bdcmsgcoll.

Hope this helped.