on 04-25-2008 5:31 AM
hi,
i am doing small application by using Model. that is calling BAPI from R/3 system. but i am not able to get data from the back end system. please suggest me regarding this problem
thanx
tanvi
hi tanvi,
first check the context mapping whether u did correctly or not.
and then write the execute method in the component controller. after that call that execute method in the view.
make sure that u have to initialize BAPIs in the "init" method of component controller
forExample:
executeBAPIname()
{
wdContext.ComponentControllername.contextnode.execute();
}
then call this execute method in the view like..
wdthis.wdComponentcontrollercontext.executeBAPIname();
follow this procedure then u will get data from the backend. and make sure that your JCO connection should be in enable mode
thank's
Anusha.T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
steps:
1) create Model
2) bind Model to component controller ( you can use data modeler.) 2.1) open data modeler; if your model is not there, you can add by clicking add existing model;
2.2) create data link between model and controller, it will open map dialog.
2.3) click and drag BAPI_xxx_Input to context of controller and select all nodes inside
- if there is any duplicate nodes, just rename it.
3) map context to view controller
3.1) map input parameters separately ( which takes value for IMPORT to BAPI. select only that fields
3.2) do map for output (exact node which contains BAPI output)
coding:
1) in component controller you need to instantiate model and bind to context
BAPI_xxx_Input my_input = new BAPI_xxx_input();
wdContext.nodeBAPI_xxx_Input my_input().bind( my_input);
2) create a method in the component controller so that we can execute it from any of views used.
try{
wdContext.currentBAPI_xxx_Input my_input().modelObject().execute();
}catch(WDRFCException e) {
e.printStackTrace();
}
wdContext.node<ExactOutput>().invalidate();
// this stmt will reflect new values
3) Go to view and bind values to UI Elements
in wdDoInit()
IPrivate<Comp_Name>View.I<ExactOutput>Element input = wdContext.create<BAPI_xxx_Input>Element();
// see if this may demand model instance as parameter
wdContext.node<BAPI_xxx_Input>().addElement( input);
4) In OnAction you just executes the component controller method
wdThis.wdGet<Com_Name>Controller().executeMyBapi();
// executeMyBapi() is the method contains the mentioned try..catch code
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You hav to excute the model,by using this method:
wdContext.currenBAPI_NAME_Element().modelObject().execute();
Regards,
LG
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 | |
10 | |
10 | |
10 | |
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.