cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the return values from the backend BAPI

Former Member
0 Kudos

Hi,

I am very new to Web Dynpro for Java programming. I need some help with the following.

Our ABAP developers developed a BAPI which accepts input value in the form of a structure and returns the output in the form of a structure.

I am developing an application using Web Dynpro for Java, to call the custom BAPI . I don't know how to send the input field values in the form of a structure. If it is just an input field I know how to set the input field values before calling the execute method on the model.

Could any one of you please provide me a piece of sample code to set the input values to the bapi import parameters.

And also please let me know how to read the values of the output which was returned in the form of a structure (not the tables).

Thanks in advance.

Regards

Srini

View Entire Topic
Former Member
0 Kudos

Hi,

Context

Bapibank_getList

Bapibank_getList_Input

_BankKey

_MaxRows

|_Bapi_bank_getList_Output

|_BankName

|_BankCountry

Create a local node in the same structure as of RFC node imported

public void ExecuteBankDetails( )
{
  Bapi_bank_getList  list = new bapi_bank_getlist();
   
   bapi_bank_getlist_input input = new bapi_bank_getlist_input();
   input.setbankkey(wdcontext.currentvninputelement().getbankkey);
   input.setmaxrows(wdcontext.currentvninputelement().getrows);
   list.setbapi_bank_getlist_input(input);
  
   wdcontext.nodeBapi_bank_getList().bind(list);

  wdcontext.currentBapi_bank_getListElement().modelObject().execute();
  wdcontext.nodebapi_bank_getlist_output().invalidate();
  wdContext.currentBapi_bank_getListElement().modelObject().modelInstance().disconnectIfAlive();
  
  //copying the RFC output to local node binded to view table
  if(!wdContext.nodebapi_bank_getlist_output().isEmpty())
  {
	WDCopyService.copyElements(wdContext.nodebapi_bank_getlist_output(),wdContext.nodevnBankListOutput());
  }

Regards,

Bala Baskaran.S