cancel
Showing results for 
Search instead for 
Did you mean: 

how to capture BAPI response in SAP PI and send the BAPI response as mail to the specify User

sukhsimran_singh
Explorer
0 Kudos

Hi experts,

I have a Soap(xml) to  RFC(BAPI) sync scenario. I am using standard BAPI :  BAPI_ACC_GL_POSTING

The interface is working fine and we are getting desired result. BAPI is sending the response whether the values are maintained in the table to not and if the values are not maintained the BAPI will send Response with field Type as "E" as Error and will send "S" in case of successful. There is no failure in either case in terms of SAP PI. Both the responses are successfully in terms of XI perspective.

My requirement is whenever the BAPI sends a response with the field as type "E", I have to send a mail to the list of specified user and whenever the response the  BAPI sends a response with the field as type "S" , I don't have to send any mail.

Please note that I am working on SAP PI 7.0 and I have not used any Email adapter till now in my interface. Looking forward for any UDF that can help.

3rd Party(SOAP) xml----> PI---> (ECC) BAPI  (Request)

BAPI (Response)---> PI----> 3rd Party (xml)

Please guide and any help will be rewarded with points.

Thanks,

Sukhsimran

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Sukhsimran,

You can change the endpoint BAPI and to use a Z RFC or ABAP proxy in which you call first the BAPI and later you can send the email directly in ABAP code Sending Mails - Home Page - ABAP Development - SCN Wiki

This solution can be easy to ABAP developer and you won't need almost any change in your scenario, however i prefer Haresh approximation.

Regards.

Answers (4)

Answers (4)

sukhsimran_singh
Explorer
0 Kudos

Hi all,

Thanks for all your expert advices. The above functionality is achieved with the help of the ABAP developers as suggested by Iñaki Vila and if this functionality was not implement  by ABAP developers I would have gone with the approach suggest by Hareesh Gampa.

Thanks and Regards,

Sukhsimran

former_member193376
Active Contributor
0 Kudos

Hi,

You do not need to do any settings from Pi, rightly suggested by Chaitanya, you can check the response, if it is E the email can be sent from your ECC system.

check this note : 455140
- Configuration of e-mail, fax, paging or SMS using SMTP

Regards.

Saiyog

chaitanya_sudha
Explorer
0 Kudos

Hi Sukhsimran,

When the BAPI response is type "E" then you can trigger mail from backend system.

Regards,

Chaitanya.

former_member184720
Active Contributor
0 Kudos

You can have this validation in the response mapping and trigger the email accordingly.

Something like this -

Mail without email adapter? Part - I - Process Integration - SCN Wiki