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 to get the displayed message when using FM: ABAP4_CALL_TRANSACTION

Former Member
0 Kudos

Hi, 

I am calling FM ABAP4_CALL_TRANSACTION from MS-Excel.  This FM works perfectly for me except the system messages that SAP returns are not always understandable or intituative.  My question is there another FM or Table that I can use to convert the data from MESS_TAB to a more meaningful message for the users?

Examples listed below:

Normal T-Code MessageFM Message in MESS_TABReal Meaning
Fill in all required entry fieldsCOBL-RMVCT         Field COBL-RMVCT is a required field
Document 400000000 was posted in 1304000000000 130Document 400000000 was posted successfully

Thanks for your Help

1 ACCEPTED SOLUTION

tkaess
Participant
0 Kudos

Hi Karim,

when you have the parameter to generate the message, you can use the following RFC function module:

BAPI_MESSAGE_GETDETAIL

The module has the following interface:

*"*"Lokale Schnittstelle:

*"  IMPORTING

*"     VALUE(ID) LIKE  BAPIRET2-ID

*"     VALUE(NUMBER) LIKE  BAPIRET2-NUMBER

*"     VALUE(LANGUAGE) LIKE  BAPITGA-LANGU DEFAULT SY-LANGU

*"     VALUE(TEXTFORMAT) LIKE  BAPITGA-TEXTFORMAT

*"     VALUE(LINKPATTERN) LIKE  BAPITGA-LINKMASK OPTIONAL

*"     VALUE(MESSAGE_V1) LIKE  BAPIRET2-MESSAGE_V1 OPTIONAL

*"     VALUE(MESSAGE_V2) LIKE  BAPIRET2-MESSAGE_V2 OPTIONAL

*"     VALUE(MESSAGE_V3) LIKE  BAPIRET2-MESSAGE_V3 OPTIONAL

*"     VALUE(MESSAGE_V4) LIKE  BAPIRET2-MESSAGE_V4 OPTIONAL

*"  EXPORTING

*"     VALUE(MESSAGE) LIKE  BAPIRET2-MESSAGE

*"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2

*"  TABLES

*"      TEXT STRUCTURE  BAPITGB OPTIONAL

Best regards

Thomas

6 REPLIES 6

Former Member
0 Kudos

Hi Karim,

Create a wrapper RFC which calls your RFC, and there you can add your logic to transform certain messages.

Regards,

Shravan

Former Member
0 Kudos

Hi Karim,

Did you try with the function module

FORMAT_MESSAGE.

Regards,

Ramya R

0 Kudos

Thanks Ramya,

Do you know if there is a Remote enabled version of FM FORMAT_MESSAGE?  If it is not remote enabled I will not be able to use it and I am unable to have any new development made to our system.  I can possibly look up the message in table T100.

0 Kudos

Hi Karim,

I thought that you need to transform the messages completely. That is why I suggested a wrapper RFC. FORMAT_MESSAGE is a normal FM. You can mimic it pretty easily though.

Regards,

Shravan

tkaess
Participant
0 Kudos

Hi Karim,

when you have the parameter to generate the message, you can use the following RFC function module:

BAPI_MESSAGE_GETDETAIL

The module has the following interface:

*"*"Lokale Schnittstelle:

*"  IMPORTING

*"     VALUE(ID) LIKE  BAPIRET2-ID

*"     VALUE(NUMBER) LIKE  BAPIRET2-NUMBER

*"     VALUE(LANGUAGE) LIKE  BAPITGA-LANGU DEFAULT SY-LANGU

*"     VALUE(TEXTFORMAT) LIKE  BAPITGA-TEXTFORMAT

*"     VALUE(LINKPATTERN) LIKE  BAPITGA-LINKMASK OPTIONAL

*"     VALUE(MESSAGE_V1) LIKE  BAPIRET2-MESSAGE_V1 OPTIONAL

*"     VALUE(MESSAGE_V2) LIKE  BAPIRET2-MESSAGE_V2 OPTIONAL

*"     VALUE(MESSAGE_V3) LIKE  BAPIRET2-MESSAGE_V3 OPTIONAL

*"     VALUE(MESSAGE_V4) LIKE  BAPIRET2-MESSAGE_V4 OPTIONAL

*"  EXPORTING

*"     VALUE(MESSAGE) LIKE  BAPIRET2-MESSAGE

*"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2

*"  TABLES

*"      TEXT STRUCTURE  BAPITGB OPTIONAL

Best regards

Thomas

Former Member
0 Kudos

Thanks Thomas!  Thats exactly what I was looking for.