on 07-01-2005 7:00 AM
Hi,
I'm new at this so I may be doing things completely wrong.
I have two models based on adaptive RFC.
The first populates a list of Org Units. (Orgeh_Out)
The user then selectes multiple Org Units from this list.
I want to use the selected Org Units as Input for the second RFC which will display the personnel numbers in the selected Org Units. (Orgeh_Tab_In)
Model 1 works fine but I am having difficulty in populating the Org Unit input table for the second model.
public void RFCPernrFill( )
{
//@@begin RFCPernrFill()
Z_Wd_Pernr_Input pernrInput = new Z_Wd_Pernr_Input();
wdContext.nodePernrList().bind(pernrInput);
int orgCount = wdContext.nodeOrgeh_Out().size();
for (int i=0; i<orgCount; i++) {
if (wdContext.nodeOrgeh_Out().isMultiSelected(i)) {
IOrgeh_OutElement thisOrgUnit = wdContext.nodeOrgeh_Out().getOrgeh_OutElementAt(i);
Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
String st = String.valueOf(thisOrgUnit);
tmpOrgTab.setOrgeh(st); //<-- Causes error but will only accept a String
pernrInput.addOrgeh_Tab_In(tmpOrgTab);
}
}
I don't understand why tmpOrgTab.setOrgeh will only accept a String and not the 'thisOrgUnit' variable.
i.e. why couldn't I say tmpOrgTab.setOrgeh(thisOrgUnit) ?
The command tmpOrgTab.setOrgeh(st); causes an error however if I hard code a Org Unit tmpOrgTab.setOrgeh("5000011"); it works. The error I get is :
Type conversion error, field ORGEH, complex type class com.sap.com.testing.pernrlist.model1.Zwd_Orgeh
Hi Richard,
Why don't you use WDCopyService.copyCorresponding() method ?
You could then replace your tmpOrgTab.setOrgeh(st); with:
WDCopyService.copyCorresponding(thisOrgUnit, tmpOrgTab)
Hope this help !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Bharathwaj, unfortunatley your solution still gives me the same error - thanks anyway.
Vilish, can you tell me how to view the console. Do I have to go into debug mode ?
TWM, your solution worked - thank you !!
Ravi I would appreciate it if you could look at my proxy and tell me how you would have done the same thing.
My RFC only has no import or export parameters. It only has two "tables". One is called Orgeh_out and is a table with a structure of type ZWD_ORGEH which has one component ORGEH of type ORGEH. This is the table I want to populate. The other table in the RFC is called Pernr_tab and has a structure of type ZWD_PERNR which also has one component PERNR of type PERSNO.
How can I send you the proxy classes generated, do I send you the code from the "implementtation" of the model ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Can you give me the structure of the proxy classes generated. I will give you the working code :).
The lines of code
Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
String st = String.valueOf(thisOrgUnit);
tmpOrgTab.setOrgeh(st); //<-- Causes error but will only accept a String
pernrInput.addOrgeh_Tab_In(tmpOrgTab);
There is a structure in your RFC called ZWD_ORGEH.
Instantiate this like you have done.
Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
Now the following line of code
tmpOrgTab.setOrgeh(st)
Here you say it is only accepting a string. But what i feel is that you would have another internal structure and u need to instantiate that.
Anyway if you just send me the proxy classes generated i will be able to help you in your code.
Also give me the structure of the RFC.
Meanwhile check this link
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/ef... web dynpro - adaptive rfc models
The above link will also give you some input to your prob.
regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Spinks,
First see what value the variable 'st' has ;
String st = String.valueOf(thisOrgUnit);
try
System.out.Println(st);
And see the value of st in console.
I think this doesn't contain a proper value
Rgds,
Vilish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The last error because u r trying to use valueOf for that complex object.
Instead of this ...String st = String.valueOf(thisOrgUnit);
try
String st = thisOrgUnit.toString();
and set the value then using st....
regards
Bharathwaj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.