5 Replies Latest reply: Feb 2, 2012 2:32 AM by Guest RSS

Skip errors at SUBMIT statement

Stratos Tsantilogiannis
Currently Being Moderated

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!

  • Re: Skip errors at SUBMIT statement
    Krishnendu Laha
    Currently Being Moderated

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

    • Re: Skip errors at SUBMIT statement
      Stratos Tsantilogiannis
      Currently Being Moderated

      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 ?

      • Re: Skip errors at SUBMIT statement
        Rob Burbank
        Currently Being Moderated

        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

      • Re: Skip errors at SUBMIT statement
        Currently Being Moderated

        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

  • Re: Skip errors at SUBMIT statement
    Currently Being Moderated

    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.

Actions