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: 

Fetch the data from one R3 system(ztable) into other R3 system (Ztables)

Former Member
0 Kudos
124

Hi All,

My requirment is like, i have few tables (ztables) in one R/3 system (client 400), i need to get these ztable's data into another R/3 system (client 500) ztables.

Regard

Anees

9886358645

8 REPLIES 8

ferry_lianto
Active Contributor
0 Kudos
101

Hi,

You can use FM RFC_READ_TABLE to read table data from other R3 system.

Regards,

Ferry Lianto

0 Kudos
101

Hi Ferry ,

I got this FM RFC_READ_TABLE but i dont have any documentation how to use this FM.

It will be a grate help from u if u provide me with details with example" How to use this module"

Waiting for ur +ve responce

Regard

Anees

former_member194669
Active Contributor
0 Kudos
101

Hi,

Make a select with client (MANDT) to select statement.

eg.

ELECT * FROM USR02 CLIENT SPECIFIED WHERE MANDT = T000-MANDT AND

BNAME = USER.

or use fm RFC_READ_TABLE (it have limitation of 500 character length)

and update into client 500

0 Kudos
101

HI a®s and All,

Thanks for ur prompt reply to my question.

I am using the FM

RFC_READ_TABLE

to read the data from particular tables. As u told it has the limitation of 500 character length, here i have one doubt,

when this FM will not work, if i have more fields or when i have more record.

Waiting for bur response

Anees jawad

9886358645

ferry_lianto
Active Contributor
0 Kudos
101

Hi Anees,

Please check this sample codes from other thread.


REPORT Z_RFC_COPY_ALL_EES MESSAGE-ID ZP.

TABLES: PA0003,
T582A.

DATA: SOURCE LIKE PERNR-PERNR,
DBNAME LIKE DD02L-TABNAME VALUE 'PA0003',
TEXT(80) TYPE C VALUE 'Copying infotype',
SYS(3) TYPE C VALUE 'DHR'.

DATA BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE PA0003.
DATA END OF ITAB.

DATA OPTIONS LIKE RFC_DB_OPT OCCURS 0 WITH HEADER LINE.
DATA FIELDS LIKE RFC_DB_FLD OCCURS 0 WITH HEADER LINE.

DATA INFOTYPE LIKE ZSEL OCCURS 0 WITH HEADER LINE.

DATA TAB LIKE TAB512 OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF IT.
INCLUDE STRUCTURE ZSEL.
DATA END OF IT.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) TEXT-003.
DATA: SOURCE1 LIKE PA0003-PERNR.
SELECTION-SCREEN COMMENT 46(5) TEXT-004.
DATA: SOURCE2 LIKE PA0003-PERNR.
SELECTION-SCREEN END OF LINE.
PARAMETERS SOURCE_C LIKE T000-MANDT OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: DESTIN LIKE PERNR-PERNR OBLIGATORY,
DESTIN_C LIKE SY-MANDT DEFAULT SY-MANDT OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'DESTIN_C'.
SCREEN-INPUT = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

START-OF-SELECTION.
IF SOURCE_C(1) EQ '2'.
SYS = 'qa'.
ELSEIF SOURCE_C(1) EQ '3'.
SYS = 'P'.
ELSE.
SYS = 'D'.
ENDIF.
MOVE TEXT-005 TO OPTIONS.
CONCATENATE OPTIONS ' ''' SOURCE_C '''' INTO OPTIONS.
APPEND OPTIONS.
CALL FUNCTION 'RFC_READ_TABLE'
DESTINATION SYS
EXPORTING
QUERY_TABLE = DBNAME
TABLES
OPTIONS = OPTIONS
FIELDS = FIELDS
DATA = TAB
EXCEPTIONS
TABLE_NOT_AVAILABLE = 1
TABLE_WITHOUT_DATA = 2
OPTION_NOT_VALID = 3
FIELD_NOT_VALID = 4
NOT_AUTHORIZED = 5
DATA_BUFFER_EXCEEDED = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE E099 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

IF SOURCE2 IS INITIAL.
MOVE SOURCE1 TO SOURCE2.
ENDIF.

LOOP AT TAB.
ITAB = TAB.
IF ITAB-PERNR GE SOURCE1 AND
ITAB-PERNR LE SOURCE2.
SELECT * FROM PA0003 WHERE PERNR EQ ITAB-PERNR.
ENDSELECT.
CHECK SY-SUBRC NE 0.
APPEND ITAB.
ENDIF.
ENDLOOP.

LOOP AT ITAB.
CALL FUNCTION 'Z_REMOTE_EE_COPY'
DESTINATION SYS
EXPORTING
SRC_PERNR = ITAB-PERNR
SRC_CLIENT = SOURCE_C
TABLES
INFOTYPE = INFOTYPE
EXCEPTIONS
EE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE E099 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
LOOP AT INFOTYPE.
MOVE-CORRESPONDING INFOTYPE TO IT.
IT-MANDT = SY-MANDT.
IT-PERNR = DESTIN.
CLEAR DBNAME.
CONCATENATE 'PA' IT-INFTY INTO DBNAME.
INSERT INTO (DBNAME) CLIENT SPECIFIED VALUES IT.
CLEAR TEXT.
CONCATENATE 'Copying infotype'
T582A-INFTY
'from'
SOURCE
'to'
DESTIN
INTO TEXT
SEPARATED BY SPACE.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = TEXT
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
WRITE:/ SY-SUBRC.
ENDIF.
ENDLOOP.
ENDIF.
DESTIN = DESTIN + 1.
ENDLOOP.

MESSAGE I099 WITH 'Copy completed'.

Regards,

Ferry Lianto

0 Kudos
101

Hi Ferry Lianto

Here we need to creat the RFC destination using the T-CODE SM59 <b>?</b>

If yes then we can use

CALL FUNCTION 'RFC_READ_TABLE' DESTINATION <b>DEST_NAME</b> <b>?</b>

Waiting for ur responce

Regard

Anees.

0 Kudos
101

Check my weblog...It might help you -;)

<a href="/people/alvaro.tejadagalindo/blog/2006/03/16/taking-good-care-of-z-data good care of Z Data</a>

Greetings,

Blag.

Former Member
0 Kudos
101

Thanks All

I have created my Own RFC to get the record from other R/3 system.

Regards

Anees

9886358645