on 05-16-2008 9:49 AM
Hi SDNers,
i need to get the education details of a employee from r3 and display it in a table and if needed i need to update that education details back to r3.
i have writen the rfc for getting and modify the education data,
i am able to get the data and displaying in the table but when i click update button its not updating
what could be the problem.
Any help
Thank you,
Regards
Vijai
Hi
thanks for replys
please find the code which i have wrtten in WDJ
here i will explain where i place the code
1. This code is generated default in CController
public void wdDoInit()
{
//@@begin wdDoInit()
//$$begin Service Controller(1036100810)
wdContext.nodeZrfc_Change_Education_Data_Input().bind(new Zrfc_Change_Education_Data_Input());
//$$end
//$$begin Service Controller(96206476)
wdContext.nodeZrfc_Get_Education_Data_Input().bind(new Zrfc_Get_Education_Data_Input());
//$$end
//@@end
}
2.This code is generated default to display data in table
public void executeZrfc_Get_Education_Data_Input( )
{
//@@begin executeZrfc_Get_Education_Data_Input()
//$$begin Service Controller(-1237939107)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
wdContext.currentZrfc_Get_Education_Data_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
//$$end
//@@end
}
3.This code is generated default to modify r3 data
public void executeZrfc_Change_Education_Data_Input( )
{
//@@begin executeZrfc_Change_Education_Data_Input()
//$$begin Service Controller(-270265608)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
wdContext.currentZrfc_Change_Education_Data_InputElement().modelObject().execute();
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
//$$end
//@@end
}
4. *Vcontroller
Code written by me in the view controller*
public void wdDoInit()
{
//@@begin wdDoInit()
wdThis.wdGetEducationCompController().executeZrfc_Get_Education_Data_Input();
//@@end
}
5.
Code written by me in the view controller to update, this action i have assign to button
public void onActionUpdate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionUpdate(ServerEvent)
wdThis.wdGetEducationCompController().executeZrfc_Change_Education_Data_Input();
//@@end
}
please any help
thankyou,
regards
Vijai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijai,
Can you tell us about your logic you have used in Change RFC? Is it that you are accepting all records which are to be updated in table structure and updating the required table? Correct me if I am wrong:
You get all the records which are under Output node of Get RFC. Now you want to update all records which you get using modify RFC.
One more thing I want is can you specify whole node structure of both Zrfc_Change_Education_Data_Input and Zrfc_Get_Education_Data_Input.
Regards,
Gopal
Hi Vijai,
Don't know whether this will solve problem. But you can try following:
In wdDoInit of Service Controller method add following code:
Instead of
wdContext.nodeZrfc_Change_Education_Data_Input().bind(new Zrfc_Change_Education_Data_Input());
write following code
executeZrfc_Get_Education_Data_Input();
Zrfc_Change_Education_Data_Input input = new Zrfc_Change_Education_Data_Input();
for (int i=0;i<wdContext.nodeItPa0022().size();i++){
IPublicEducationCompController.IItPa0022Element ele = wdContext.nodeItPa0022().getItPa0022ElemntAt(i);
ItPa0022_Chg changeEle = new ItPa0022_Chg();
//Copy all values from ItPa002 to ItPa022_Chg - You can try with WDCopy Service also. I don't have
//any idea how to use it
changeEle.setAedtm(ele.getAedtm());
changeEle.setAnzeh(ele.getAnzeh());
//////////////////////////////////////////////////Do for all fields of Table ItPa022//////////
input.addItPa022_Chg(changeEle);
}
wdContext.nodeZrfc_Change_Education_Data_Input().bind(input);
Comment code written in wdDoinit of View
//Commented line - wdThis.wdGetEducationCompController().executeZrfc_Get_Education_Data_Input();
I hope you are showing all data in view which are mapped to attributes of ItPa0022 node.
Regards,
Gopal
Edited by: Gopal on May 16, 2008 8:12 PM
what exactly is not working:
Your button,
Calling of RFC
Updating the db table?
Is RFC correctly filled, can you check this at R/3 side by debugging?
Do you have any exceptions, return codes, are you using return structure BAPIRET2 for messages?
Try and be a bit more clear...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the DB table is updated from the R/3 side, u need to check for the Data that is being sent to R/3. Checked whether the data is being set in the proper way, means check whether all the mandatory parameters are being passed to the R/3 from frontend. Put a print message at the Model Execution and check whether the RFC is being executed or not from frontend.
regards,
Lakshmi.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.