Skip to Content
0
Jun 29, 2023 at 07:35 AM

BTP ABAP Environmet: How to output error message in job log?

176 Views

Hi community,

I am developing application jobs in BTP ABAP Environnment as per the document below.

https://help.sap.com/docs/btp/sap-business-technology-platform/application-jobs

I would like to output a meaningful message in the Job Details screen if the job failes.

image.png

What I am doing is, in the if_apj_rt_exec_object~execute method raise an exception with textid.

  METHOD if_apj_rt_exec_object~execute.
    DATA(lo_cons_main) = NEW zcl_cons_stock_main( ).

    TRY.
        lo_cons_main->process( ).
      CATCH zcx_consignment_stock INTO DATA(lx_error).
        RAISE EXCEPTION NEW cx_apj_rt_content( textid = CORRESPONDING #( lx_error->if_t100_message~t100key ) ).
    ENDTRY.

  ENDMETHOD.

However, I only see the fixed message of "An error occurred. Please create an incident on component ."

How can I transfer messages from the business logic to the job log?

Best regards,

Mio Yasutake

Attachments

image.png (55.0 kB)