cancel
Showing results for 
Search instead for 
Did you mean: 

Data is not passing from webdynprojava to rfc

smruti_moharana
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

smruti_moharana
Participant
0 Kudos

Dear GentleMens,

Thanks a lot for quick reply but it is not working.the same out put.

Thanks,

Smruti Ranjan Moharana

Former Member
0 Kudos

can you post the init method code of this RFC operation

former_member182372
Active Contributor
0 Kudos

How do you know that data is not passing? Double confirm that:


try 
{
wdComponentAPI.getMessageManager().reportSuccess( excel.toXML() );
	excel.execute();
wdComponentAPI.getMessageManager().reportSuccess( excel.getOutput().toXML() );
}
catch (WDDynamicRFCExecuteException e) 
{
	...
}

smruti_moharana
Participant
0 Kudos

Dear Senon,

in init() there is no code related to this rfc,

i have written all the relavent code in method export toexcel.

thanks a lot for u r quick response.

Thanks,

Smruti

smruti_moharana
Participant
0 Kudos

Dear makim,

After putting some breakpoints in rfc i came to know that it is not hitting the rfc after execution of my export toexcel method by tselecting button in webdynprojava.

Thanks & Regards,

smruti

former_member182372
Active Contributor
0 Kudos

So did you add that code that I suggested? What`s the output?

smruti_moharana
Participant
0 Kudos

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

former_member182372
Active Contributor
0 Kudos

So, you do see the data coming into the model class? Are you sure data is not intercepted before functional module body? Something like conversion routine?

smruti_moharana
Participant
0 Kudos

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

p330068
Active Contributor
0 Kudos

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

former_member182372
Active Contributor
0 Kudos

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);

smruti_moharana
Participant
0 Kudos

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

former_member182372
Active Contributor
0 Kudos

Smruti, post the context structure (nodes and subnodes) for the model you ara using

smruti_moharana
Participant
0 Kudos

Dear Mak,

Thanks a lot for your guidance the issue is resolved.

Thanks & Regards,

S ranjan

Answers (1)

Answers (1)

Former Member
0 Kudos

write this staement just before your try block

wdContext.nodeZepa_Pacer_Excel_Input().bind(excel);

Former Member
0 Kudos

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();

}