on 09-01-2006 4:13 PM
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
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.