05-26-2006 2:11 AM
Hi,
can anyone tell me the RFC name (forgot it!,returning to ABAP programming after couple of years gap)that can be used to execute RFC's by passing the RFC name as a parameter.
Thanks.
05-26-2006 8:08 AM
Hi,
no special RFC Function needed, you can use a variable as name in the CALL FUNCTION statement!
Matthias
05-26-2006 3:54 AM
what u need excatly?
RFC 's are of three types
THE DESTINATION <DEST> should be set in sm59 and that name should be fiven the place of <DEST>.
1. synchronous:
syntax:
CALL FUNCTION <FN NAME> DESTINATION <DEST>.
when ever a fn module is called, current program is stopped and the control goes to the fn module and after the fn module is executed, control returns back to the program.
2. asynchronous :
CALL FUNCTION <FN NAME> DESTINATION <DEST> STARTING NEW TASK.
the use of asynchronous is , the fn can be executed in a separate task with out disturbing the flow of current program.
3. transactional : TRFC is used because, even if the destination is not available, it waits for a certain period of time and once it is available it works.
CALL FUNCTION <FN NAME> DESTINATION <DEST> BACKGROUND TASK.
05-26-2006 8:08 AM
Hi,
no special RFC Function needed, you can use a variable as name in the CALL FUNCTION statement!
Matthias
05-26-2006 7:25 PM
Thanks Matthias.
But how do you then get the results back especially I'm interested in executing them and dumping their table results in a file.
05-26-2006 7:34 PM
Even though you are using a variable for the function module name, you still have to provide the signature(interface), which really doesn't it make it dynamic, right?
report zrich_0001.
data: fc_external(30) type c value 'CONVERT_DATE_TO_EXTERNAL'.
data: fc_internal(30) type c value 'CONVERT_DATE_TO_INTERNAL'.
data: datum1(10) type c.
data: datum2 type sy-datum.
call function fc_external
exporting
date_internal = sy-datum
importing
date_external = datum1.
write:/ datum1.
call function fc_internal
exporting
date_external = datum1
importing
date_internal = datum2.
write:/ datum2.
Regards,
Rich Heilman
05-28-2006 12:42 AM
Hi,
There is no such generic function as the parameters of each of the RFC's will be different.
In the source system of the RFC get the pattern in the SE38 and copy that pattern of that function to the system from where you want to initiate the call and add a extra clause of DESTINATION 'RFC_DEST' to it. You need to declare the parameters as variables in your system which will be of the same type as that in the function.
This will make a call and get the results for you. Once done, you can use CL_GUI_FRONTEND_SERVICES->GUI_DOWNLOAD method to download the values to a file on the desktop. If you want a file on the app server, use the OPEN DATASET, TRANSFER, CLOSE DATASET statements to create the file with the contents.
Regards,
Ravi
Note : Please mark all the helpful answers and close the thread if the question is answered. You just will have to mark the Problem solved star against the answer that helped you the most.