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: 

Passing SAP messages from Bapi

Former Member
0 Kudos

Hi all.

I have created a BAPI. In this, There are some messages which are type I and some which are type E. Now this bapi has to integrate with EP. Will these messages be passed on to EP as it is or do I have to do something special about it. Please help

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The messages, if populated will be passed to EP. While integrating the BAPI with EP the error table parameter in the BAPI interface needs to be mapped in the EP program.

~Kiran

4 REPLIES 4

Former Member
0 Kudos

The messages, if populated will be passed to EP. While integrating the BAPI with EP the error table parameter in the BAPI interface needs to be mapped in the EP program.

~Kiran

0 Kudos

Here is a part of the code which I did in my bapi to pop up the message:

loop at T_BAPI_ENTERTAINMENT_IMPORT2.

if T_BAPI_ENTERTAINMENT_IMPORT2-amount > T_BAPI_ENTERTAINMENT_EXPORT-BET01.

message 'Amount cannot be greater than basic salary' type 'E'.<<<<<<<<<<

else.

ITAB_zentertainment-persno = BAPI_PERSNO.

ITAB_zentertainment-ZMONTH = t_BAPI_ENTERTAINMENT_IMPORT2-ZMONTH.

ITAB_zentertainment-ZYEAR = T_BAPI_ENTERTAINMENT_IMPORT2-ZYEAR.

ITAB_zentertainment-AMOUNT = t_BAPI_ENTERTAINMENT_IMPORT2-AMOUNT.

ITAB_zentertainment-CURRENCY = t_BAPI_ENTERTAINMENT_IMPORT2-CURRENCY.

INSERT INTO ZENTERTAINMENT VALUES ITAB_ZENTERTAINMENT.

concatenate 'Claim for the month ' t_BAPI_ENTERTAINMENT_IMPORT2-ZMONTH space space 'Inserted' into var separated by space.

message var type 'I' . "with 'Claim for the month Inserted'. <<<<<<<<<<

endif.

endloop.

Please let me know what to do with respect to the code above.

Thanks

0 Kudos

Instead of issuing messages directly in the BAPI using the <u><i>Message i000(xx) with "This is an information message"</i></u> statement populate the message in a table of type BAPIRET2.

For this you need to perform the below steps:

1. Define a TABLES parameter RETURN which refers to BAPIRET2 in the BAPI interface

2. Populate this table with all the messages.

RETURN-TYPE = 'I'

RETURN-ID = 'XX'

RETURN-NUMBER = '000'

RETURN-MESSAGE = ''This is an information message'

APPEND RETURN.

Hope this clarifies...

~Kiran

Message was edited by: Kiran Raorane

0 Kudos

Its not clear to me.....:-(