on 04-04-2007 10:49 AM
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.
Regards
Nikhil Bansal
Hi,
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
wdContext.node_fun_module_name_Input.bind(element);
now set the value of the element to pass it to function module and execute it
element.setMaterialcode(matcode);
element.setMaterialDesc(matdesc);
For hard code value u can write
element.setMaterialcode("COMP");
wdContext.node__fun_module_name_Input().current___fun_module_name_InputElement().modelObject().execute();
the values will be passed to the function module as input and the FM will be executed.
Regards,
Prasy
Message was edited by:
prasy p
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasy,
Thanks for the reply. It solved my problem.
Ok, I need a little more help from you. When the user selects the Material Group, the data is fetched in a ItemListBox.
I have two buttons
1. Add
2. Remove
The user can select Item from the ItemListBox and Add to the TextEdit. Also the user can deselect the Items from the TextEdit.
Can you provide some help in this regard.
Also I want that when user has not selected any Material Group (i.e. there is no data in the ItemListBox) then the buttons (Add and Remove) should be disabled.
When data is fetched then only the buttons should be activated.
Regards
Nikhil Bansal
Hi Nikhil,
You can use setXXX("0002");
This can be placed after your bind code for ur model.
Eg:
Bapi_Material_SaveData_Input input = new Bapi_Material_SaveData_Input ();
wdcontext.nodeBapi_Material_SaveData_Input.bind(input);
input.setMaterial("1000");
Regards,
Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.