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: 

Catch message from submit abap report

0 Kudos

I would like to catch message from submit abap report.

Example in abap program

REPORT zprog00.

PARAMETERS p_test TYPE i DEFAULT 2.

START-OF-SELECTION.

IF p_test > 1.

MESSAGE e000(38) WITH 'More than one'.

ENDIF.

and in Function module

SUBMIT zprog00

WITH p_test EQ '3'

EXPORTING LIST TO MEMORY

AND RETURN.

    • <--- In this step I would like to catch error message from Program zprog00*

Thank

1 REPLY 1

Former Member
0 Kudos

Hi,

try this:


  DATA LIST_OBJ TYPE TABLE OF ABAPLIST.
  DATA LIST_ASC TYPE TABLE OF CHAR255.
*
  SUBMIT ZTEST EXPORTING LIST TO MEMORY AND RETURN.
*
  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      LISTOBJECT = LIST_OBJ
    EXCEPTIONS
      NOT_FOUND  = 1
      OTHERS     = 2.
*
  CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
      LISTASCI           = LIST_ASC
      LISTOBJECT         = LIST_OBJ
    EXCEPTIONS
      EMPTY_LIST         = 1
      LIST_INDEX_INVALID = 2
      OTHERS             = 3.

and have a look into list_asc.

Regards, Dieter