Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Includes of any object Via RFC

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member226519
Active Contributor
0 Kudos

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.

5 REPLIES 5

mithun_shetty4
Contributor
0 Kudos

create a custom one with the same import and export parameters as the normal one

0 Kudos

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.

former_member212713
Contributor
0 Kudos

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.

0 Kudos

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 .

former_member226519
Active Contributor
0 Kudos

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.