‎2011 Apr 05 8:18 AM
Hi Guys,
I have a FM whose import parameter structure need to be changed, Is it possible?
1. I dont want to make the parameter as CHANGING or EXPORTING because this fm is called dynamicallly in many programs.
2. I dont want to change the Import parameter structure as PASS BY VALUE because the changed value is not passed to the calling program.
regards,
Prabhu
‎2011 Apr 05 10:19 AM
Hi Prabhu,
If i understand you correctly, you have a parameter which is an "Import" parameter to the function, and you want to change the value of this parameter within the FM and get it back to the calling program. Also you do not want to add another changing/export parameter as this would change the interface and cause problem to other programs which are already using this.
As you have aptly put you cannot get the value back by changing it to pass by value and you cannot change it by using pass by reference.
Possible solutions,
1) Add an export/changing parameter and mark it as optional, export parameters are always optional, by this you would not be changing the interface and the other programs will still continue to work.
2) If this FM is not a RFC and not being used by remote systems, then you can export the value that you need inside the FM and import it in the calling program.
Let me know, if i have missed out on anything.
Regards,
Chen
‎2011 Apr 05 10:19 AM
Hi Prabhu,
If i understand you correctly, you have a parameter which is an "Import" parameter to the function, and you want to change the value of this parameter within the FM and get it back to the calling program. Also you do not want to add another changing/export parameter as this would change the interface and cause problem to other programs which are already using this.
As you have aptly put you cannot get the value back by changing it to pass by value and you cannot change it by using pass by reference.
Possible solutions,
1) Add an export/changing parameter and mark it as optional, export parameters are always optional, by this you would not be changing the interface and the other programs will still continue to work.
2) If this FM is not a RFC and not being used by remote systems, then you can export the value that you need inside the FM and import it in the calling program.
Let me know, if i have missed out on anything.
Regards,
Chen
‎2011 Apr 05 10:35 AM
Hi,
if this is a SAP standard fm then you mustn't change it. If it is a custom fm then you should define a new exporting parameter, where you can pass back the changed value. You can call the fm with the same program field for the importing and exporting parameter!
Additional info: For all exporting parameters are optional, you will not have any problems with the dynamic calls of this fm!
Regards,
Klaus
Edited by: Klaus Babl on Apr 5, 2011 11:48 AM