on 08-01-2007 10:42 PM
Hi gurus!!
I created a WD project:
- created a model with reference to a ZBAPI
- created a Component
- created a Custom Controller with 2 nodes: one to the INPUT class of the model, and the other to the OUTPUT class of the model
- created a View Main
- created a View Result
- bind the context of view Main to the INPUT node of the custom controller
- bind the context of view Result to the OUTPUT node of the custom controller
- At the end I have 2 views of the same component related to the same custom controller, and this custom controller related to both the INPUT and OUTPUT classes of the main model
- added the fields to the corresponding views
- on the view Main:
public void wdDoInit()
{
//@@begin wdDoInit()
Bapi_header_getdetail = new Zbapi_Wty_Header_Getdetail_Input();
wdContext.nodeInput().bind(Bapi_header_getdetail);
//@@end
}
- added a button to the view Main, and on the action:
public void onActionBuscar(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionBuscar(ServerEvent)
try {
Bapi_header_getdetail.execute();
wdThis.wdFirePlugToResult();
} catch (Exception ex) {
ex.printStackTrace();
}
//@@end
}
- added a viewset to the Main window, and embedded both views to the viewset.
- created the inbound and outbound plugs to the corresponding views
- created a project, deploy and run
I execute the app, push the button, but no values are displayed on the results view.
I verified the bapi, it's getting executed and is returning the values correctly, but still they're not getting displayed. I made sure of that, because I have the bapi create a text file on the server with the values it found, so I know for sure it's getting executed correctly.
I wonder if there's some step I might have missed.
The BAPI has 2 import parameters, and a Z structure as an export parameter.
Does anyone have a clue what might be the error!?
Thanx
Jesus
Hi Jesus,
I think BAPI is not executing properly. Check the size of Output Node.
Try this.
public void onActionBuscar(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionBuscar(ServerEvent)
try {
wdContext.currentZbapi_Wty_Header_Getdetail_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("Output Node Size : "+wdContext. nodeOutput().size());
wdThis.wdFirePlugToResult();
} catch (Exception ex) {
ex.printStackTrace();
}
//@@end
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jesus,
You created 2 nodes in the custom controller - bound 1 to the input and 1 to the output.
Is the output node created inside the input node?
I have always seen, that 1 node Input is created and inside that the output node is created.
But the way you have written, it appears that you have created 2 root nodes - for input and output.
Thanks
Hi
Check whether u have set the cardinality property of the attributes and nodes correctly
Regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.