Skip to Content
avatar image
Former Member

No data from a RFC imported in a Web Dynpro project

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 28, 2005 at 04:34 AM

    Hi Ramien,

    add message bar to your application and try using WDDynamicRFCException instead of Exception.

    You may get useful information from the exception.

    NEx

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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....

  • Dec 28, 2005 at 04:37 AM

    Hi Ramien,

    Please try to print following attribute.

    wdContext.nodeEmpl_Data_InputElement().size()

    If RFC is executed properly, then only wdContext.nodeEmpl_Data_InputElement().size() will have some values (even zero), otherwise this node will be having null values.

    Also, have you tested RFC from SAP logon pad? does it executes properly with the given parameter?

    Does your SAP tables contain data? Are you pointing to the correct client?

    If you try to test your RFC on the same client where your JCo is pointing and it gives you proper results, then I don't see any reason why you should not get data populated in WebDynpro.

    Please revert back with the updated status.

    Ashutosh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ashutosh,

      I wrote wdContext.nodeEmpl_Data_InputElement().size()

      and it returned 1 after the RFC execution, what does it mean? is it returning 1 element?, or it's a return code?

      >have you tested RFC from SAP logon pad?

      Yes I used the SE37 and passed "GRAMIREZ" as imput parameter and RFC returns exactly one record what is ok.

      >Does your SAP tables contain data?

      Yes, the RFC returns a record(called from the SE37 transaction).

      >Are you pointing to the correct client?

      I tested it in the content administrator of the SLD, and the RFC responses well to the ping and test commands.

      Thanks in advance.

      Ramien.-