cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Parameters from InputField to BAPI

StefanReitz
Explorer
0 Kudos

Dear Forum,

i'm stuck with my WebDynpro Java-Application. I want to create a Salesorder via BAPI_SALESORDER_CREATEFROMDAT2.

It works fine as long as i hard-code the Values like that:

<i>public void executeBapi_Salesorder_Createfromdat2_Input( )

{

Bapi_Salesorder_Createfromdat2_Input SO = new Bapi_Salesorder_Createfromdat2_Input();

Bapi_Transaction_Commit_Input Commit = new Bapi_Transaction_Commit_Input();

Bapisdhd1 OrderHeader = new Bapisdhd1();</i>

<i>OrderHeader.setDoc_Type("</i><b>TA</b><i>");</i>

...

<i>SO.setOrder_Header_In(OrderHeader);</i>

... same procedure for Partner/Item-Data

Actually i want to create Input Fields where the User is able to select the neccessary values per Dropdown. I know that there are 3 Possibilities (SVS, EVS, OVS or even the Generic Search Help via Plug-In).

I really don't understand how the parameters are passed to the Context. Is it happening in both Controller AND void Action - Method?

If i create InputFields by Dropdown, how are the Values inserted in the Context? Btw, every time i create Input Fields they are blanked out...

I'd be very glad if anyone yould help me with this.

Kind Regards

Stefan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use the DropDownByIndex UI element. Create a node and bind the element of that node to the UIelement.

You can populate the Dropdown by fetching it from the backend.

After populating the dropdown, create an action for the OnSelect event of the UI element.

In that write the following code:

String element = wdContext.nodeXYX.getXYZelement();

now if you want to pass the selected value to the back end, set the input parameter by this value 'element'.

Former Member
0 Kudos

Hi Stefan,

If you are getting the values from the back end then create an UI element DropDownByIndex and bind it to the model node and while passing it to the back end get the selected value and pass it the input.

wdContext.current<InputElement>.set<attribute>(wdContext.node<nodeName>.

current<NodeElement>.get<attribute>());

Regards,

Jhansi