‎2014 Jun 05 7:28 AM
Hi All,
Using the syntax READ REPORT , I can read the source code of a report into an internal table (in same system).
However what if I need to read the source code of System B from System A.
Are there any RFC which we can use to read the source code of a report in two different systems which are connected.
Thanks,
Faiz
‎2014 Jun 05 7:53 AM
Hi,
Try
FUNCTION 'RPY_PROGRAM_READ'
Regards.
TYPES: tp_include_tab TYPE TABLE OF rpy_repo .
TYPES: tp_source_extended_tab TYPE TABLE OF abaptxt255 .
*----------------------------------------------------------------------*
FORM do_rpy_program_read
USING
program TYPE program
rfcdest TYPE rfcdest
CHANGING
it_include TYPE tp_include_tab
it_source_extended TYPE tp_source_extended_tab .
CALL FUNCTION 'RPY_PROGRAM_READ' DESTINATION rfcdest
EXPORTING
language = 'E'
program_name = program
with_includelist = 'X'
* ONLY_SOURCE = ' '
* ONLY_TEXTS = ' '
read_latest_version = 'X'
* WITH_LOWERCASE = ' '
* IMPORTING
* PROG_INF =
TABLES
include_tab = it_include
* SOURCE = it_source
source_extended = it_source_extended
* TEXTELEMENTS =
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4
.
IF sy-subrc NE 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM . "do_rpy_program_read
*----------------------------------------------------------------------*
‎2014 Jun 05 7:45 AM
HI faizur,
you can use the Tcode SE39 to see the codes of different server.Usually this tcode is used to compare the source code of different system.
Or you can use Program RS_WB_SPLIT_EDITOR.
Regards,
Sivaganesh
‎2014 Jun 05 7:53 AM
Hi,
Try
FUNCTION 'RPY_PROGRAM_READ'
Regards.
TYPES: tp_include_tab TYPE TABLE OF rpy_repo .
TYPES: tp_source_extended_tab TYPE TABLE OF abaptxt255 .
*----------------------------------------------------------------------*
FORM do_rpy_program_read
USING
program TYPE program
rfcdest TYPE rfcdest
CHANGING
it_include TYPE tp_include_tab
it_source_extended TYPE tp_source_extended_tab .
CALL FUNCTION 'RPY_PROGRAM_READ' DESTINATION rfcdest
EXPORTING
language = 'E'
program_name = program
with_includelist = 'X'
* ONLY_SOURCE = ' '
* ONLY_TEXTS = ' '
read_latest_version = 'X'
* WITH_LOWERCASE = ' '
* IMPORTING
* PROG_INF =
TABLES
include_tab = it_include
* SOURCE = it_source
source_extended = it_source_extended
* TEXTELEMENTS =
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4
.
IF sy-subrc NE 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM . "do_rpy_program_read
*----------------------------------------------------------------------*
‎2014 Jun 05 7:54 AM
Faizurrehman,
Yes RFC is required to get data.Better way is to create the Function Module as RFC and than write all code of report in Function module and take the output in tables parameter . If you want data from system B so you have to create Function Module on system B and than create your report program on system A and use following syntax to call RFC FM
"lv_rfc: Name of RFC FM that is on system A
"lv_destination:RFC destination which has been created through SM59 for system B
CALL FUNCTION lv_rfc_name DESTINATION lv_destination
EXPORTING
e_field = e_field
IMPORTING
return = return
TABLES
data = data
EXCEPTIONS
system_failure = 1000 MESSAGE lv_exc_msg
communication_failure = 1001 MESSAGE lv_exc_msg
OTHERS = 1002.
Hope this will help.
thanks & Regards,
Muhammad Shahezad