on 12-28-2005 3:13 AM
Hi all,
I'm experimentig an issue in an app that calls a RFC, the RFC is returning nothing, no message, no error, no data. I tested the RFC in R3 and is doing what is supposed to do, it was tested also in the SLD content manager and it responses well to the ping and test command.
This is what am i doing in the component controller called Rgsm_Reload_Comp
this in the wdDoInit:
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
{
//@@begin wdDoInit()
try {
Z_Ep_Ess_Gral_Get_Empl_Data_Input input = new Z_Ep_Ess_Gral_Get_Empl_Data_Input();
input.setP_Usrid("GRAMIREZ");
wdContext.nodeEmpl_Data_Input().bind(input);
wdContext.currentEmpl_Data_InputElement().setP_Usrid("GRAMIREZ");
//input.setP_Usrid(wdContext.currentEmpl_Data_InputElement().getP_Usrid().trim());
} catch (Exception e) {
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("Error al inicializar la RFC de datos personales " + e.getMessage(), true);
}
//@@end
}
This in the execute Bapi method called from the view:
//@@begin javadoc:executeBapGetDataEmpl()
/** Declared method. */
//@@end
public void executeBapGetDataEmpl( )
{
//@@begin executeBapGetDataEmpl()
//Traemos los datos del empleado comunicandonos con la RFC Z_Ep_Ess_Gral_Get_Empl_Data
try {
wdContext.currentEmpl_Data_InputElement().modelObject().execute();
wdContext.nodeEmpl_Data_Output().nodeHr_Personal_Out().invalidate();
} catch (Exception e1) {
msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("Error al inicializar la RFC de datos personales " + e1.getMessage(), true);
}
//@@end
}
And last this in the Rgsm_Reload_ComView the view controller, the action to call the execute method in the component controller:
//@@begin javadoc:onActionfindEmployee(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionfindEmployee(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionfindEmployee(ServerEvent)
wdThis.wdGetRgsm_Reload_CompController().executeBapGetDataEmpl();
//@@end
}
I've followed all steps in online tutorials I found, but I don't know what is wrong, if somebody can help me on this I'll really appreciate it.
Best regards,
Ramien.-
Message was edited by: Ramien Rosillo
Hi Ramien,
add message bar to your application and try using WDDynamicRFCException instead of Exception.
You may get useful information from the exception.
NEx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ramien,
this is your execute method:
//@@begin javadoc:executeBapGetDataEmpl()
/** Declared method. */
//@@end
public void executeBapGetDataEmpl( )
{
//@@begin executeBapGetDataEmpl()
//Traemos los datos del empleado comunicandonos con la RFC Z_Ep_Ess_Gral_Get_Empl_Data
try {
wdContext.currentEmpl_Data_InputElement().modelObject().execute();
wdContext.nodeEmpl_Data_Output().nodeHr_Personal_Out().invalidate();<----???
} catch (Exception e1) {
msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("Error al inicializar la RFC de datos personales " + e1.getMessage(), true);
}
//@@end
}
After executing the model, you shouldn´t call
wdContext.nodeEmpl_Data_Output().nodeHr_Personal_Out().invalidate();
. If you call the invalidate methode of the Hr_PersonalOut node, you are deleting all the entries inside and maybe thats why you don´t get any result?!Kind regards,
Mehmet
Hi Mehmet thanks for replly,
Do you mean to invalidate the nodeEmpl_Data_Output() like this?
wdContext.nodeEmpl_Data_Output().invalidate();
This is how my code looks like:
//@@begin javadoc:executeBapGetDataEmpl()
/** Declared method. */
//@@end
public void executeBapGetDataEmpl( )
{
//@@begin executeBapGetDataEmpl()
//Traemos los datos del empleado comunicandonos con la RFC Z_Ep_Ess_Gral_Get_Empl_Data
try {
wdContext.currentEmpl_Data_InputElement().modelObject().execute();
wdContext.nodeEmpl_Data_Output().invalidate();
} catch (WDDynamicRFCExecuteException e) {
msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("WDDynamicRFCExecuteException: Error al inicializar la RFC de datos personales " + e.getMessage(), true);
} catch (Exception e1) {
msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("Exception: Error al inicializar la RFC de datos personales " + e1.getMessage(), true);
}
//@@end
}
If you have any other suggestion I will really apreciate it.
Ramien.-
Hello Ramien,
yes you´re right.
wdContext.nodeEmpl_Data_Output()
is the node, where you´re result are saved. If this node is your toplevel Output Node, and you call "invalidate()" on this node after callingwdContext.currentEmpl_Data_InputElement().modelObject().execute();
method, all the data that you get from your BAPI is deleted. So maybe you get some data from your BAPI, but after you get your data through calling the blablabla.execute()-Methode, you delete your entries through callingwdContext.nodeEmpl_Data_Output()
. So if you comment this statement and redeploy, you should get the desired results from your BAPI?!Kind regards,
Mehmet
I think while passing the input to rfc from Web Dynpro your are missing the leading zeros.
If u run from SE37, it works perfectly even without leading zeros. But this is not the same from Web Dynpro.
Also, return result from RFC(something of bapiret2) and print it on portal. It gives you good clue on what is happening behind.
Pls let us know the result.
BAPIRET2 is a structure defined in ABAP Dictionary. That structure represents the execution result. You can return the result of your RFC Z_Ep_Ess_Gral_Get_Empl_Data.
Some of the integer inputs(e.g engagement number - AUFNR) may start with zeros like 000XXXXXX. In that case passing XXXXXX from R3 may work and may not work from from portal. In that case you have to give 000XXXXXX.
This is applicable only when it is number.
Are you sure that you need to pass "string" for <i>P_Usrid</i>?
Modify your RFC to Return the result of function execution and print on portal.
Hi Shah, to print the wdContext.nodeEmpl_Data_InputElement().size() in the webdynpro just code this lines in a method
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException("Size: " +wdContext.nodeInput().size(), true);
About setting the RFC in debug mode, was an ABPER expert parthner who made it. He just leaved the office few minutes ago, I could gladly answer you when he returns.
Hope this helps.
Ramien.-
Message was edited by: Ramien Rosillo
Hi Kranthi,
Yes I'm pretty sure of the input parameter, because P_Userid y conformed by first letter Name and followed with complete last name I.E "RROSILLO".
Also I've found in a note how to activate log details in the Was I set it to all instead ERROR (as default shipped). On one of log files I found an exception:
#1.5#001083FDED3400950000008900005CE9000409021814BBD4#1135804505426#com.sap.tc.webdynpro.progmodel.context.Node#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.context.Node.getParentElement#J2EE_GUEST#192##cssapq01.corp_I10_95141350#Guest#0325f1a077e711dabfea001083fded34#ID\#(cssapq01_I10_09)ID1950194550DB11983431035475623143End.d41a077077e611dac48e001083fded34##0#0#Debug##Java###: retrieving parent element#1#Node(Rgsm_Reload_CompView.Empl_Data_Input.Output.Hr_Personal)# #1.5#001083FDED3400950000008A00005CE9000409021814CB9A#1135804505430#com.sap.tc.webdynpro.serverimpl.core.localization.AbstractResourceHandler#sap.com/tcwddispwda#com.sap.tc.webdynpro.serverimpl.core.localization.AbstractResourceHandler.getString#J2EE_GUEST#192##cssapq01.corp_I10_95141350#Guest#0325f1a077e711dabfea001083fded34#ID\#(cssapq01_I10_09)ID1950194550DB11983431035475623143End.d41a077077e611dac48e001083fded34##0#0#Info##Java###resourceBundle=, locale=, key=, string=#4#java.util.PropertyResourceBundle@70086665#en#MESSAGE_AREA_ACC_DESCRIPTION#Message Area# #1.5#001083FDED3400950000008B00005CE9000409021814E2BA#1135804505436#com.sap.tc.webdynpro.progmodel.context.Node#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.context.Node.getParentElement#J2EE_GUEST#192##cssapq01.corp_I10_95141350#Guest#0325f1a077e711dabfea001083fded34#ID\#(cssapq01_I10_09)ID1950194550DB11983431035475623143End.d41a077077e611dac48e001083fded34##0#0#Debug##Java###: retrieving parent element#1#Node(Rgsm_Reload_Comp.Empl_Data_Input.Output.Hr_Personal)# #1.5#001083FDED3400950000008C00005CE9000409021814EACA#1135804505438#com.sap.tc.webdynpro.clientserver.cal.ClientManager#sap.com/tcwddispwda#com.sap.tc.webdynpro.clientserver.cal.ClientManager#J2EE_GUEST#192##cssapq01.corp_I10_95141350#Guest#0325f1a077e711dabfea001083fded34#SAPEngine_Application_Thread[impl:3]_53##0#0#Path##Plain###Exiting method# #1.5#001083FDED3400950000008D00005CE9000409021814ECDE#1135804505439#com.sap.tc.webdynpro.services.sal.util.cache.GlobalCache#sap.com/tcwddispwda#com.sap.tc.webdynpro.services.sal.util.cache.GlobalCache.releaseStringBufferCache#J2EE_GUEST#192##cssapq01.corp_I10_95141350#Guest#0325f1a077e711dabfea001083fded34#SAPEngine_Application_Thread[impl:3]_53##0#0#Debug##Plain###released# #1.5#001083FDED340044000000FA00005CE90004090218A54537#1135804514898#com.sap.engine.library.monitor.mapping.ccms.Trace##com.sap.engine.library.monitor.mapping.ccms.Trace######876ae77077e411da8dc1001083fded34#SAPEngine_System_Thread[impl:5]_78##0#0#Error##Plain###RegisterNode</Applications/KM Collaboration/SCF/Service Connectors>: com.sap.engine.library.monitor.mapping.ccms.CcmsConnectorException: 95141350: Invalid configuration group for node'/Applications/KM Collaboration/SCF/Service Connectors' (APP.KM.Collaboration.SCF.ConfiguredConnectors, max. 40 characters)# #1.5#001083FDED34007E0000000300005CE90004090219854FA9#1135804529581#com.sap.tc.webdynpro.serverimpl.wdc.locking.LockingService##com.sap.tc.webdynpro.serverimpl.wdc.locking.LockingService.lock#J2EE_GUEST#192####ce7be36077e611da9ab6001083fded34#Thread[Finalizer,8,system]##0#0#Info##Plain###Unlocked all.# After reducing the size of the Rgsm_Reload_Comp.Empl_Data_Input.Output.Hr_Personal node to Rgsm_Reload_Comp.Input.Output.Hr less than 40 car. I get this lines in the same file (defaultTrace.0.trc) #1.5#001083FDED34006A0000004D00001B7900040902F81A15BF#1135808263880#com.sap.tc.webdynpro.progmodel.context.Node#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.context.Node.exit#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Java###: exiting#1#Node(Rgsm_Reload_Comp.Input.Output)# #1.5#001083FDED34006A0000004E00001B7900040902F81A1790#1135808263880#com.sap.tc.webdynpro.progmodel.context.Node#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.context.Node.clearElements#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Plain###Node(Rgsm_Reload_Comp.Input.Output): cleared elements# #1.5#001083FDED34006A0000004F00001B7900040902F81A1956#1135808263881#com.sap.tc.webdynpro.progmodel.context.Node#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.context.Node.exit#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Java###: exiting#1#Node(Rgsm_Reload_Comp.Input.Output.Hr)# #1.5#001083FDED34006A0000005000001B7900040902F81A397F#1135808263889#com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModel#sap.com/tcwddispwda#com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModel.JcoClientManagementWDP#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Info##Plain###successfully released IWDJCOClientConnection to pool for Model: class com.cts.rgsm.wd.Rgsm_Reload_Model - ConnectionInfo: com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection@41061b68# #1.5#001083FDED34006A0000005100001B7900040902F81A3DC9#1135808263890#com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModel#sap.com/tcwddispwda#com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModel.JcoClientManagementWDP#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Info##Plain###successfully released IWDJCOClientConnection to pool for Model: class com.cts.rgsm.wd.Rgsm_Reload_Model - ConnectionInfo: com.sap.mw.jco.JCO$Client@4f41c0ac# #1.5#001083FDED34006A0000005200001B7900040902F81A4075#1135808263891#com.sap.tc.webdynpro.services.session.Monitor#sap.com/tcwddispwda#com.sap.tc.webdynpro.services.session.Monitor#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Plain###Destroying scope for Application com.cts.rgsm.app.AppGetEmployee# #1.5#001083FDED34006A0000005300001B7900040902F81A42DA#1135808263891#com.sap.tc.webdynpro.services.session.Monitor#sap.com/tcwddispwda#com.sap.tc.webdynpro.services.session.Monitor#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Plain###Removing Application com.cts.rgsm.app.AppGetEmployee# #1.5#001083FDED34006A0000005400001B7900040902F81AA07E#1135808263915#com.sap.tc.webdynpro.clientserver.cal.ClientWindow#sap.com/tcwddispwda#com.sap.tc.webdynpro.clientserver.cal.ClientWindow.removeApplicationWindow#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Debug##Java###Removed application window with ID=, status=.#2#Id8e7544b077ef11da91b9001083fded340#true#
#1.5#001083FDED34006A0000005500001B7900040902F81AA473#1135808263916#com.sap.tc.webdynpro.sessionmanagement#sap.com/tcwddispwda#com.sap.tc.webdynpro.sessionmanagement.ApplicationWindow.destroy()#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Info##Java###Destroyed ApplicationWindow with ID=.#1#Id8e7544b077ef11da91b9001083fded340# #1.5#001083FDED34006A0000005600001B7900040902F81AA719#1135808263917#com.sap.tc.webdynpro.clientserver.cal.ClientApplication#sap.com/tcwddispwda#com.sap.tc.webdynpro.clientserver.cal.ClientApplication.exit#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Info##Plain###ClientApplication destroyed ID: FNOL instanceCounter: 0# #1.5#001083FDED34006A0000005700001B7900040902F81AAA3F#1135808263918#com.sap.tc.webdynpro.sessionmanagement#sap.com/tcwddispwda#com.sap.tc.webdynpro.sessionmanagement.ClientApplication.exit()#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#ID\#(cssapq01_I10_09)ID1641170050DB10933063800664331447End.8e7544b077ef11da91b9001083fded34##0#0#Info##Java###Destroyed ClientApplication with ID= and name=. Reason was #3#FNOL#com.cts.rgsm.app.AppGetEmployee#Exception#
#1.5#001083FDED34006A0000005800001B7900040902F81AACA2#1135808263918#com.sap.tc.webdynpro.clientserver.cal.ClientManager#sap.com/tcwddispwda#com.sap.tc.webdynpro.clientserver.cal.ClientManager#J2EE_GUEST#192####c4793da077ef11daa094001083fded34#SAPEngine_Application_Thread[impl:3]_34##0#0#Path##Plain###Exiting method#
Could this help?
Ramien.-
We found the problem:
This is what we were doing at fist:
String P_Usrid = new String("GRAMIREZ");
Z_Ep_Ess_Gral_Get_Empl_Data_Input input = new Z_Ep_Ess_Gral_Get_Empl_Data_Input();
wdContext.nodeInput().bind(input);
input.setP_Usrid(P_Usrid);
wdContext.nodeInput().currentInputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
That way we could not get any data from the RFC.
The solution was:
To retreave the data we needed to create an instance of the output node or our model like this:
wdContext.nodeOutput().invalidate();
Z_Ep_Ess_Gral_Get_Empl_Data_Output output = input.getOutput();
List persDataList = output.getHr_Personal();
Zhr_Datos_Per persData = (Zhr_Datos_Per) persDataList.get(0); //Because we're interested only in the first row of collection.
manager.reportSuccess("Personnel number " + persData.getPernr());
Thanks to all....
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.