cancel
Showing results for 
Search instead for 
Did you mean: 

How can I call a FM in WDA?

Former Member
0 Kudos

Hi All,

Plz tell me, How can I call a function module in WDA.

I have an Inputfield and a attribut under a node. I have a FM, too.

I need to call the FM in a Method.

How can I do it?

thx

Best Regards

Shuo

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

For eg, if you want to display the result of FM in webdynpro input field.

IN wddoinit method of view that is created by you,

DATA:

node_node1 TYPE REF TO if_wd_context_node,

elem_node1 TYPE REF TO if_wd_context_element,

stru_node1 TYPE wd_this->element_node1 ,

item_attr1 type string.

    • You can use pattern to call the FM

CALL FUNCTION 'FUNCTION_NAME_XXXX'

importing

var1 = item_attr1

.

    • YOu can use webdynpro code wizard to generate this code. ( read attribute )

  • navigate from <CONTEXT> to <NODE1> via lead selection

node_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).

  • get element via lead selection

elem_node1 = node_node1->get_element( ).

  • get single attribute

elem_node1->set_attribute(

EXPORTING

name = `ATTR1`

value = item_attr1 ).

If you want more information please go through the tutorials available in sdn or visit

help.sap.com and search for webdynpro abap.

Thanks,

Prashanth

Former Member
0 Kudos

Hi Prashanth,

That was great.

Thanks Prashanth.

Best Regards.

Shuo

Former Member
0 Kudos

HI,

For more code sample on webdynpro, please check the following URL.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94a...;

Former Member
0 Kudos

Hi,

Calling of FM is same like as you call in normal programs.

After getting the data from FM, you have to bind the the structure to the node or set the the value to the attribute which is used for your inputfield.

Thanks,

Prashanth

Former Member
0 Kudos

Hi Prashanth,

thanks for your Answer, can you write that details.

Thx a lot,

Shuo