on 01-19-2012 10:47 AM
Dear Friends,
I am passing data from portal to rfc,i am using following codes but data is not passing from portal to RFC.
Zepa_Pacer_Excel_Input excel=new Zepa_Pacer_Excel_Input();
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
Zpacer zpacer_obj = new Zpacer();
zpacer_obj.setAcccode(wdContext.currentContextElement().getCombinationCode());
zpacer_obj.setFaceqn(wdContext.currentContextElement().getFacEqn());
zpacer_obj.setAuthby(wdContext.currentContextElement().getApprover());
zpacer_obj.setRemarks(wdContext.currentContextElement().getRemarks());
zpacer_obj.setRosdate(wdContext.currentContextElement().getROSDate());
zpacer_obj.setReqstdate(wdContext.currentContextElement().getRqstdDate());
zpacer_obj.setRqnstatus(wdContext.currentContextElement().getRqnStatus());
zpacer_obj.setRqnno(wdContext.currentContextElement().getReqnNo());
zpacer_obj.setTotamnt(wdContext.currentContextElement().getTotal());
excel.setP_Pacer(zpacer_obj);
try
{
wdContext.currentZepa_Pacer_Excel_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdContext.nodeP_Pacer().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Thanks & Regards,
Smruti Ranjan Moharana
Hi,
The code is modified slightly..........
check this code and let me know if any issue...............
Zepa_Pacer_Excel_Input excel=new Zepa_Pacer_Excel_Input();
Zpacer zpacer_obj = new Zpacer();
zpacer_obj.setAcccode(wdContext.currentContextElement().getCombinationCode());
zpacer_obj.setFaceqn(wdContext.currentContextElement().getFacEqn());
zpacer_obj.setAuthby(wdContext.currentContextElement().getApprover());
zpacer_obj.setRemarks(wdContext.currentContextElement().getRemarks());
zpacer_obj.setRosdate(wdContext.currentContextElement().getROSDate());
zpacer_obj.setReqstdate(wdContext.currentContextElement().getRqstdDate());
zpacer_obj.setRqnstatus(wdContext.currentContextElement().getRqnStatus());
zpacer_obj.setRqnno(wdContext.currentContextElement().getReqnNo());
zpacer_obj.setTotamnt(wdContext.currentContextElement().getTotal());
excel.setP_Pacer(zpacer_obj);
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
try
{
wdContext.nodeZepa_Pacer_Excel_Input().currentZepa_Pacer_Excel_InputElement().modelObject().execute();
}
catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Thanks
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Maksim,
Thanks a lot for your valuable reply,i am finding the data in form of xml output like.
<P_PACER><RQNSTATUS></RQNSTATUS><RQNNO>ZK00009989</RQNNO><FACEQN></FACEQN><REMARKS></REMARKS><ACCCODE>SR01 MECCMU77 000000 K1000</ACCCODE><ROSDATE>14/12/2002</ROSDATE><TOTAMNT>121.04</TOTAMNT><REQSTDATE>14/12/2002</REQSTDATE><AUTHBY>MSM11</AUTHBY></P_PACER>
But my problem is that i have to pass the data from portal page to rfc then it will convert the data into excel format and store in user defined location.please suggest your valuable advice.
Thanks & Regards,
Smruti Ranjan Moharana
Dear Maskim,
i am explaining from scratch in my rfc one structure is there and one table is there
structure name is zpacer and table is zpacer-_Item.
when i am passing the value to rfc through structure like zpacer by following code.
Zepa_Pacer_Excel_Input excel=new Zepa_Pacer_Excel_Input();
Zpacer zpacer_obj = new Zpacer();
zpacer_obj.setAcccode(wdContext.currentContextElement().getCombinationCode());
zpacer_obj.setFaceqn(wdContext.currentContextElement().getFacEqn());
zpacer_obj.setAuthby(wdContext.currentContextElement().getApprover());
zpacer_obj.setRemarks(wdContext.currentContextElement().getRemarks());
zpacer_obj.setRosdate(wdContext.currentContextElement().getROSDate());
zpacer_obj.setReqstdate(wdContext.currentContextElement().getRqstdDate());
zpacer_obj.setRqnstatus(wdContext.currentContextElement().getRqnStatus());
zpacer_obj.setRqnno(wdContext.currentContextElement().getReqnNo());
zpacer_obj.setTotamnt(wdContext.currentContextElement().getTotal());
excel.setP_Pacer(zpacer_obj);
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
try
{
wdContext.nodeZepa_Pacer_Excel_Input().currentZepa_Pacer_Excel_InputElement().modelObject().execute();
}
catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
it is not hitting the rfc again
when i am trying pass data through table like
Zpacer_Item z1=new Zpacer_Item();
z1.setXXX(wdContext.currentItemElement.getXXX());
.......................................
...........................................
excel.setPgit_Pacer(z1)------->showing error abstract data and red mark is pointing under setPgit_Pacer()
Dear Maskim, please guide me to do that then it will be a great help to me.
Thanks &Regards,
Smruti Ranjan
Dear Smruti,
Your code looks fine to me.
Zepa_Pacer_Excel_Input excel=new Zepa_Pacer_Excel_Input();
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
Zpacer zpacer_obj = new Zpacer();
zpacer_obj.setAcccode(wdContext.currentContextElement().getCombinationCode());
zpacer_obj.setFaceqn(wdContext.currentContextElement().getFacEqn());
zpacer_obj.setAuthby(wdContext.currentContextElement().getApprover());
zpacer_obj.setRemarks(wdContext.currentContextElement().getRemarks());
zpacer_obj.setRosdate(wdContext.currentContextElement().getROSDate());
zpacer_obj.setReqstdate(wdContext.currentContextElement().getRqstdDate());
zpacer_obj.setRqnstatus(wdContext.currentContextElement().getRqnStatus());
zpacer_obj.setRqnno(wdContext.currentContextElement().getReqnNo());
zpacer_obj.setTotamnt(wdContext.currentContextElement().getTotal());
excel.setP_Pacer(zpacer_obj);
// Try to add the value to to excel object like excel.add......(zpacer_obj); instead of excel.setP_Pacer(zpacer_obj); and test it
try {
excel.execute();
//invalidate output node here
} catch (WDDynamicRFCExecuteException e) {
wdComponentAPI.getMessageManager().reportException("WDDynamicRFCExecuteException: "+e.getMessage(),false);
}catch(Exception ex){
wdComponentAPI.getMessageManager().reportException("Exception: " +ex.getMessage(),false);
}finally{
wdContext.currentZepa_Pacer_Excel_InputElement().modelObject().modelInstance().disconnectIfAlive();
}
You can try to check the available methods for adding the Zpacer object to the RFC Zepa_Pacer_Excel_Input. You can try excel.add......(zpacer_obj); if available in place of excel.setP_Pacer(zpacer_obj);
Please refer to [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8f90|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8f90]
Hope it will helps
Best Regards
Arun Jaiswal
it is not hitting the rfc again
Did you print both XML's - from model class and output as I posted earlier? This will give you idea whether RFC was executed because output XML will be blank otherwise.
when i am trying pass data through table like
Zpacer_Item z1=new Zpacer_Item();
z1.setXXX(wdContext.currentItemElement.getXXX());
.......................................
...........................................
excel.setPgit_Pacer(z1)------->showing error abstract data and red mark is pointing under setPgit_Pacer()
To pass the table you have to create a list:
Zpacer_Item z1=new Zpacer_Item();
z1.setXXX(wdContext.currentItemElement.getXXX());
Zpacer_Item.Zpacer_Item_List z1List = new Zpacer_Item.Zpacer_Item_List();
z1List.add(z1);
excel.setPgit_Pacer(z1List);
Dear maksim,
Thanks a lot for your valuable reply,but now the problem is under Zepa_Pacer_Excel_Input
pgit_Pacer and Pgit_Pacer_in is there, after binding data is available to Pgit_Pacer_in but it is not available to Pgit_Pacer,
when i am using.
wdComponetAPI.getMessageManager.report............("xxxx"+wdContext.nodePgit_Pacer.getXXX()) it is throughing null pointer exception.
but in case of
wdComponetAPI.getMessageManager.report............("xxxx"+wdContext.nodePgit_Pacer_in.getXXX() ) it is printing the data in my view please guide me to proceed why data is not available through Pgit_Pacer.
Thanks & Regards,
Smruti Ranjan
write this staement just before your try block
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
modify the code like below
Zepa_Pacer_Excel_Input excel=new Zepa_Pacer_Excel_Input();
Zpacer zpacer_obj = new Zpacer();
zpacer_obj.setAcccode(wdContext.currentContextElement().getCombinationCode());
zpacer_obj.setFaceqn(wdContext.currentContextElement().getFacEqn());
zpacer_obj.setAuthby(wdContext.currentContextElement().getApprover());
zpacer_obj.setRemarks(wdContext.currentContextElement().getRemarks());
zpacer_obj.setRosdate(wdContext.currentContextElement().getROSDate());
zpacer_obj.setReqstdate(wdContext.currentContextElement().getRqstdDate());
zpacer_obj.setRqnstatus(wdContext.currentContextElement().getRqnStatus());
zpacer_obj.setRqnno(wdContext.currentContextElement().getReqnNo());
zpacer_obj.setTotamnt(wdContext.currentContextElement().getTotal());
excel.setP_Pacer(zpacer_obj);
wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);
try
{
wdContext.currentZepa_Pacer_Excel_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdContext.nodeP_Pacer().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.