2011 Dec 20 5:30 AM
Hi,
My requirement is to read all includes of any object . I know there are Function Modules 'RS_GET_ALL_INCLUDES' and 'GET_INCLUDES' to get Include List . But these are not remote enabled . I want remote enabled function module to get Includes of an object, exist at the target system.
Thanks & Regards,
Sachin
2011 Dec 20 10:30 AM
Dangerous but possible:
write your code locally line by line into an ITAB.
pass that ITAB via RFC with function module RFC_ABAP_INSTALL_AND_RUN to the remote system, it will return the output list.
simple example:
data: begin of rec,
zeile(72),
end of rec.
data: w_msg like sy-msgv1,
it_rep like rec occurs 0 with header line,
it_list like rec occurs 0 with header line.
parameters: p_rfcdes like rfcdes-rfcdest.
*
start-of-selection.
refresh it_rep.
clear it_rep.
append 'REPORT YP_DVB_0071 .' to it_rep.
append 'tables: pa0001.' to it_rep.
append 'select single * from ....' to it_rep.
append 'if sy-subrc = 0.' to it_rep.
append ' write: / ' to it_rep.
append ' else.' to it_rep.
append ' write: / sy-subrc.' to it_rep.
append 'endif.' to it_rep.
*
call function 'RFC_ABAP_INSTALL_AND_RUN'
destination p_rfcdes
exporting
mode = 'F'
programname = '<<RFC1>>'
importing
errormessage = w_msg
tables
program = it_rep
writes = it_liste.
end-of-selection.
write : / w_msg.
skip.
loop at it_liste.
write: / it_liste.
endloop.
2011 Dec 20 5:34 AM
create a custom one with the same import and export parameters as the normal one
2011 Dec 20 6:24 AM
I cannot create custom Function Module as it is a kind of a development that is common to all of our customers.
I can only use Standard Function Module.
2011 Dec 20 7:47 AM
You can create new FM type of RFC.
And It has imports / tables etc. parameters same RS_GET_ALL_INCLUDES FM.
You should call RS_GET_ALL_INCLUDES fm with new FM Parameters.
And You should add authorization object before call RS_GET_ALL_INCLUDES.
If Dev. has authorization then call FM.
otherwise you can return error.
Best regards.
2011 Dec 20 8:46 AM
If I create any Custom Function Module, I have to Import first to the customer's system. Then only it can be called via RFC . Customer wont allow to import it in his system. He only allow us to connect to there system via RFC .
2011 Dec 20 10:30 AM
Dangerous but possible:
write your code locally line by line into an ITAB.
pass that ITAB via RFC with function module RFC_ABAP_INSTALL_AND_RUN to the remote system, it will return the output list.
simple example:
data: begin of rec,
zeile(72),
end of rec.
data: w_msg like sy-msgv1,
it_rep like rec occurs 0 with header line,
it_list like rec occurs 0 with header line.
parameters: p_rfcdes like rfcdes-rfcdest.
*
start-of-selection.
refresh it_rep.
clear it_rep.
append 'REPORT YP_DVB_0071 .' to it_rep.
append 'tables: pa0001.' to it_rep.
append 'select single * from ....' to it_rep.
append 'if sy-subrc = 0.' to it_rep.
append ' write: / ' to it_rep.
append ' else.' to it_rep.
append ' write: / sy-subrc.' to it_rep.
append 'endif.' to it_rep.
*
call function 'RFC_ABAP_INSTALL_AND_RUN'
destination p_rfcdes
exporting
mode = 'F'
programname = '<<RFC1>>'
importing
errormessage = w_msg
tables
program = it_rep
writes = it_liste.
end-of-selection.
write : / w_msg.
skip.
loop at it_liste.
write: / it_liste.
endloop.