on 03-08-2010 2:09 PM
Hi,
I have to implement following requirement:
My program generates a report for the user and the user can choose which data he wants to have.
Depending on the user decissions, I have to use different RFC - Functions to get the data.
I have the name of the RFC Function und I want to call the RFC Function with this name dynamically.
For example:
rfcName = "Z_FUNC_1";
rfc = get the object for Z_FUNC_1 somehow. This is my problem
rfc.execute();
Is there any way how to solve this? I know that I can solve this like this, but this is not the flexible way that i want:
if (whichRFC == 1) {
Z_Func_1_input rfc = new Z_Func_input();
}
.
.
.
rfc.execute();
Any ideas?
Best regards,
Peter
Hi Peter
For your task it'd be better to use native JCO API instead of the static WebDynpro RFC models. With JCO 2.0 or JCo 3.0 you can dynamically invoke any BAPI you want.
BR, Siarhei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter
Inspect the link and all round: http://help.sap.com/saphelp_nwpi711/helpdata/en/46/fb807cc7b46c30e10000000a1553f7/content.htm
BR, Siarhei
Dear Peter,
There are how many RFC models are you going to make? In my opinion it would be too tedious and redundant as you have to create diifferent models fo each RFC.
Instead of this you may create a single RFC and in that you can call your required RFC depending on the user selection.
It will simplify your application as well as your task.
Hope it helps!!
Warm Regards
Upendra Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
ok, this is a good idea. I have to talk it over with the ABAP developer.
But I wonder if there is a way to call a RFC Function dynamic. In PHP I would have done it in this way:
$dynObj = "TestObj";
eval("\$myobj = new {$dynObj}();");
I s there a way in Webdynpro the achieve this?
Best regards,
Peter
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.