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: 

How can Get SAP SYSTEM MESSAGES Dynamically

Former Member
0 Kudos

i developed a report program and from that call one bdc program and pass the data to that. I can get bdc messages but how can i get SAP SYSTEM MESSAGES dynamically if possible how to store it.

thanks in advance,

your reply will get good points.

From Maran,India.

2 REPLIES 2

Former Member
0 Kudos

Hi Maran,

You can use the followin code after call transaction;

Make sure that u add the message option during call transaction

DATA: i_messtab TYPE TABLE OF BDCMSGCOLL.

CALL TRANSACTION p_tcode USING p_bdcdata

OPTIONS FROM l_params

MESSAGES INTO i_messtab.

LOOP AT i_messtab INTO wa_messtab.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = wa_messtab-msgid

lang = sy-langu

no = wa_messtab-msgnr

v1 = wa_messtab-msgv1

v2 = wa_messtab-msgv2

v3 = wa_messtab-msgv3

v4 = wa_messtab-msgv4

IMPORTING

msg = l_message

  • EXCEPTIONS

  • not_found = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Saji.

Message was edited by: Sajith Hari

former_member183804
Active Contributor
0 Kudos

Hello Maram,

can you please explain the kind of system messages? In case you refer to the shortdumps a possible approach might be the do the dbc call via a rfc invocation. In case of a shortdump you will get an according response.

Regards

Klaus