Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to pass Hardcoded values from Form to Function Module

Hi All,

I am creating a form which will fetch the Material Details (Material Number and Material Desc) for a given Material Group ()eg. COMPNB,COMPSFT) etc.

I have imported the model and created a Custom Controller.

In the view I have created a DropDownByKey for Material Group. This has been binded to a Simple Type (Local Dictionary) which contains the Material Group code and Desc as key value pair eg COMPNB-->Computer Notebook.

Also, the plant has been hardcoded as 0002 in the View.

Now the thing is, how should I pass these parameters (Material Group and Plant) to the funtion module.

Please let me know.


Nikhil Bansal

Former Member
Former Member replied


Firstly get the value that has been selected from the dropdown by using the code

String matcode = wdContext.currentMaterialNode.getMaterialgrpCode();

String matdesc = wdContext.currentMaterialNode.getMaterialDesc();

next create an instance

fun_module_name_Input model = new fun_module_name_Input();

then create an element of this

IPrivateview_name.I_fn_module_name_InputElement element = wdContext.node_fun_module_name_Input.create__fun_module_name_InputElement(model);

then bind it


now set the value of the element to pass it to function module and execute it



For hard code value u can write



the values will be passed to the function module as input and the FM will be executed.



Message was edited by:

prasy p

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question