cancel
Showing results for 
Search instead for 
Did you mean: 

bapi code

Former Member
0 Kudos

Hi All,

I am new to this webdynpro for java code. I have 2 bapi's. Can anyone explain me what this code does.

public void wdDoInit()

{

//@@begin wdDoInit()

//Create a new element in node

//Bapi_Flbooking_Createfromdata_Input

Bapi_Flbooking_Createfromdata_Input input =new Bapi_Flbooking_Createfromdata_Input();

wdContext.nodeBapi_Flbooking_Createfromdata_Input().bind(input);

//Create a new element in node Booking_Data

input.setBooking_Data(new Bapisbonew()); (explain this particular line also)

//Create a new element in node

//Bapi_Flight_Checkavailibility_Input

Bapi_Flight_Checkavailibility_Input inputAvailibility =

new Bapi_Flight_Checkavailibility_Input();

wdContext.nodeBapi_Flight_Checkavailibility_Input().bind(inputAvailibility);

Regards,

Subashini.J

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What is Bapisbonew() in the below line of code?

input.setBooking_Data(new Bapisbonew());

Regards,

Subashini.J

Former Member
0 Kudos

Bapisbonew is the name of the class which is associated with the Booking_Data node

Former Member
0 Kudos

Hi Subashini,

If you are not having a single value as import parameter to RFC and instead you are having table then you would be having a corresponding structure and the new Bapisbonew() is the object that would be required to set for that input element.

eg. You need to pass "P1" and "P2" as a table to your input node.

Bapisbonew ele = new Bapisbonew();

ele.set<attributevalue>("P1");

ele.set<attributevalue>("P2");

And now add this element to the input node element

input.set(ele);

Regards,

Murtuza

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Subashini,

<b>Bapi_Flbooking_Createfromdata_Input input =new Bapi_Flbooking_Createfromdata_Input();</b>creates an intance of your input Bapi node that would be required to provide input to bapi and will return you the ouptut within the output node within this node.

<b>wdContext.nodeBapi_Flbooking_Createfromdata_Input().bind(input);</b>The new element created by you is now binded to the context Bapi_Flbooking_Createfromdata_Input node.

<b>input.setBooking_Data(new Bapisbonew());</b>

This is the input value that you are providing to your BAPI.

Regards,

Murtuza

<b></b>