cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Bapi Return message in View (Urgent !)

Former Member
0 Kudos

Hi

I Have a Bapi which doesn't have any data but there are some return messages.

How to display these return messages in a webdynpro view

is there any tutorial or code so that i can get the return messages from Bapi and display in Bapi

I already mapped bapi to custom controller and then custom controller to View.

in customer controller i am excuting this bapi and i am calling this bapis method in views on action Go button, but i need to display all the return messages.

com.sap.package4.Bapireturn ret1 = input1.getOutput().getReturn();

String var1 = ret1.getMessage();

msgMgr1.reportSuccess(var1);

after excution i am getting null pointer exception

is there any solution..

Regards,

Murali

Message was edited by: Murali Manohar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Murali:

Have you solved this problem? I've got the same problem with you. I can get the output value from the BAPI, but can't get the return value.

If you know why, can you let me known? Thanks a million!

Regards,

Xiaoming

Former Member
0 Kudos

Hi Murli,

Write following code for dispalying Return message.

String message = wdcontext.currentReturnElement().getMessage();

msgMgr1.reportSuccess(message);

Here, Return is your node in which you are getting your return message.

If it still gives null pointer exception then put this code inside following if statement.

if(wdcontext.currentReturnElement() != null)

{

}

Regards,

Bhavik

Former Member
0 Kudos

Please post the complete stacktrace.

Armin

Former Member
0 Kudos

Murali,

Open layout tab of the view. Right click on "Root UI Cotainer" select "Apply template" Select table, Click 'Next'. Select the bapi return Node.

After the execution of Bapi, u would see the complete return structure in a view.