Application Development and Automation 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: 
Read only

SUBMIT statement

Former Member
0 Likes
576

Hello All,

I am using SUBMIT to call a program from within another program.

My requirement is to capture the MESSAGES thrown by the called program in the calling program.

Here is the code snippet:


DATA: list_tab TYPE TABLE OF abaplist.
Data: begin of wa_text,
      c type c,
      end of wa_text,
      t_text like standard TABLE OF wa_text.

Submit zkh_called_prog EXPORTING LIST TO MEMORY and return.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    LISTOBJECT       = list_tab
 EXCEPTIONS
   NOT_FOUND        = 1
   OTHERS           = 2
          .
 
CALL FUNCTION 'LIST_TO_TXT'
 EXPORTING
   LIST_INDEX               = -1
  TABLES
    LISTTXT                  = t_text
   LISTOBJECT               = list_tab
* EXCEPTIONS
*   EMPTY_LIST               = 1
*   LIST_INDEX_INVALID       = 2
*   OTHERS                   = 3
          .

IF sy-subrc = 0.
  CALL FUNCTION 'WRITE_LIST'
    TABLES
      listobject = list_tab.
ENDIF.

By this I am able to get the output of WRITE statements in the t_text internal table. But I am not able to get the Error/ Status Messages in this table.

Can anyone suggest a way of capturing the messages in the calling program

Regards,

Khushboo

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
525

As u r submitting a z prog. so u can change the prog. in a way, that all the message (type S,E,W) can be stored in an internal table. and then export that table to a memory id.

Now from calling program after submit statement simply import that table from the memory id and do the further processing.

Regards,

Joy.

3 REPLIES 3
Read only

Former Member
0 Likes
525

Hi khushbu.

better u try like this.

submit callingprogram

with s_spart in s_spart

with p_spmon eq p_spmon

and return.

u have to take care taht the parameters must be same....in the calling and called program.

then capture msg.

reward points if found helpful

thnx

prashant

Read only

Former Member
0 Likes
526

As u r submitting a z prog. so u can change the prog. in a way, that all the message (type S,E,W) can be stored in an internal table. and then export that table to a memory id.

Now from calling program after submit statement simply import that table from the memory id and do the further processing.

Regards,

Joy.

Read only

Former Member
0 Likes
525

hi here you can get the values from the return parameters in the submit statement