cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging application...

Former Member
0 Kudos

How do I find the data returned from an RFC call in the variables tree in the debug perspective? Is it inside the wdContext node? I start traversing the tree forever, but can't find the data.

Thanks,

John

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you can store the values returned by the RFC through an ArrayList while the For Loop executing.

for each iteration the values would be stored in the List

using the following code,

String str=wdContext.current<RFCOutput>Element().get<attribute>();

<ArrayListObject>.add(str);

in the debugging perspective you can check the <ArrayListObject> or you can also check the String "str".

Former Member
0 Kudos

I have first/last name inputfields on my view. When the user clicks the filter button, it calls this method on the view:


public void onActionfilterAppraisers(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent ) {
   String fname = wdContext.currentContextElement().getFname();
   String lname = wdContext.currentContextElement().getLname();
   wdThis.wdGetFeedbackAppraisalCustContController().executeFilterAppraisers(fname, lname);
   List filterResults = wdContext.currentBapi_Employee_Getlist_InputElement().modelObject().getEmployee_List();
   if (filterResults != null) {
      Iterator iter = filterResults.iterator();
      ISimpleTypeModifiable myType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("appraiser");
      IModifiableSimpleValueSet values = myType.getSVServices().getModifiableSimpleValueSet();	
      String names = "";
      while (iter.hasNext()) {
         Bapiemp_Ls obj = (Bapiemp_Ls)iter.next();
         if (obj!=null) {
            values.put(obj.getPernr(), obj.getEname());
         }
      }
   }
}

The third line is a call to a method on the controller to execute the ABAP function in R3. Here is the code:


public void executeFilterAppraisers( java.lang.String fname, java.lang.String lname ) {
   try {
      Bapi_Employee_Getlist_Input input = new Bapi_Employee_Getlist_Input(); 
      wdContext.nodeBapi_Employee_Getlist_Input().bind(input);
      input.setSur_Name_Seark(fname);
      input.setLst_Name_Seark(lname);
      input.setObject_Id("00000000");
      input.setSearch_Date(new java.sql.Date(new java.util.Date().getTime()));
      wdContext.currentBapi_Employee_Getlist_InputElement().modelObject().execute();
      wdContext.nodeOutput().invalidate();
   } catch (Exception e) {
      e.printStackTrace();
   }
}

After the controller method is called, the List is null. The function isn't throwing an exception. Is there a way for me to figure out why it isn't returning data? Also, let's say it does return data, where in the variables tree in the debug perspective would I look to find the data that was returned?

Thanks,

John

Former Member
0 Kudos

Hi John,

why do you use the folwing code to get the data returned by the RFC?

wdContext.currentBapi_Employee_Getlist_InputElement().modelObject().getEmployee_List();

use

wdContext.current<BapiOutput>Element.get<attributeName>();

Former Member
0 Kudos

Okay, I changed the code to this:

List filterResults = wdContext.currentGetlist_outputElement().modelObject().getEmployee_List();

Getlist_output is what I called the output node in the BAPI function I added to the context. The list is still null. I can call the R3 function in a SAPGUI and get results. How can I test why data isn't being returned on the web dynpro side?

John

Former Member
0 Kudos

Hi john,

can you tell me what are all the outputs the Bapi returns?

and can you send the Bapi node structure?

Former Member
0 Kudos

Here is the bapi node structure:


-Bapi_Employee_Getlist_Input
  -getlist_output
    -Employee_List
      job_id
      name
      etc.
    object_id
    job_name
    etc.

Former Member
0 Kudos

Hi,

Here the getList_output is the Output node for the Bapi.

so you can get the results from this node.

that is, wdContext.currentGetlist_ouputElement().get<attribute>();

like you can get all the values returned by the bapi.