02-27-2007 4:39 AM
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
02-27-2007 4:42 AM
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
02-27-2007 4:42 AM
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
02-27-2007 4:52 AM
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
02-27-2007 5:10 AM
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
02-27-2007 5:25 AM