on 04-09-2007 5:43 AM
Hi All,
I am facing the following proble while executing a custom BAPI which is returning data from a Z table. I have following context structure :
<b>Zbapiformdata1_Input
Formdata (import parameters value node)
Formname
Usertype
Output
Formdata1(export parameter value node)
Approver
Description
Steps
Return
Code
.
.
.
Type</b>
This is what I have written in my component controller wdDoInit
<i>Zbapiformdata1_Input input = new Zbapiformdata1_Input();
wdContext.nodeZbapiformdata1_Input().bind(input);
input.setFormdata(new Zformdata());
wdContext.currentFormdataElement().setFormname("Form1");
wdContext.currentFormdataElement().setUsertype("Approver");</i>
and this is what I had written in a method called inside the onAction event of a button this method is in my component controller
<i>try {
wdContext.currentZbapiformdata1_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("Bapi Executed Successfully"
wdContext.currentFormdata1Element().getDescription()" import parameters "
wdContext.currentFormdataElement().getFormname()" and "
+wdContext.currentFormdataElement().getUsertype());
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
wdComponentAPI.getMessageManager().reportException("Exception in executing BAPI"
e" and "e.getMessage()" and "+e.getLocalizedMessage(), true);
}</i>
When I test this BAPI in backend on setting the import parameters as form1 and approver the BAPI is returning the desired data but when I a setting the same in front end the BAPI is returning the data which it returns when no import parameter is set.
and the message manager shows following:
<i><b>Bapi Executed Successfully import parameters Form1 and Approver</b></i>
Kindly help.
Regards
Sid
HI siddharth,
I guess u need to set that import parameter to the modelobject.
For that u need to add this step in onAction:
"wdContext.currentXXX_InputElement().modelObject().setFormname(
wdContext.currentFormdataElement().getFormname);"
Try this.It may help.
Regards,
Lavanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The bapi requires data in uppercase only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here in your structure says direct input params to the BAPI But why u sent the input like this.setFormdata(new Zformdata());
This means the input is passing as method input params.
If the input is direct value attributes avail on the current context model node u can pass like this.
Zbapiformdata1_Input input = new Zbapiformdata1_Input();
wdContext.nodeZbapiformdata1_Input().bind(input);
// if you passing your input as node u can pass like this.
input.setFormdata(ram);
Zformdata() ram = new Zformdata();
ram.setsetFormname("Form1");
ram.setUsertype("Approver");
// otherwise these two inputs are direct inputs then
Zbapiformdata1_Input input = new Zbapiformdata1_Input();
wdContext.nodeZbapiformdata1_Input().bind(input);
input.setFormname("Form1");
input.setUsertype("Approver");
next call the execute method();
//wdContext.currentFormdataElement().setFormname("Form1");
//wdContext.currentFormdataElement().setUsertype("Approver");
Thanks
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi siddharth,
try to create bapi object instance in onActionMethod,and set the import parameters in the same onActionMethod.
if there is any luck please let me know
Thanks,
Balaji.B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.