Application Development and Automation 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: 
Read only

aRFC Testing issue!

Former Member
0 Likes
969

hi!

i have to do RFC testing!

the demo code:

DATA:NAME(20) TYPE C,

LINEKEY(20) TYPE C.

DO 2 TIMES.

LINEKEY = SY-INDEX.

CONDENSE LINEKEY.

CONCATENATE 'LINEKEY' LINEKEY INTO LINEKEY.

NAME = LINEKEY.

CALL FUNCTION 'ZARFCTEST'

DESTINATION 'DEV120'

STARTING NEW TASK NAME

EXPORTING

linekey = linekey

EXCEPTIONS

COMMUNICATION_FAILURE = 1

SYSTEM_FAILURE = 2.

ENDDO.

and RFC FUNCTION CODE:

tables:ZTEST_TEST.

ZTEST_TEST-LINEKEY = numkey.

ZTEST_TEST-CTIME = SY-UZEIT.

ztest_test-cdate = sy-datum.

insert ztest_test.

CALL FUNCTION 'RZL_SLEEP'

EXPORTING

SECONDS = 5

EXCEPTIONS

ARGUMENT_ERROR = 1

OTHERS = 2.

the report runing and result in table just exist one line:

LINKEY1 data.

when to do insert into LINEKY2 the insert statement return 4!

i don't know what happened!

who can tell me why insert LINEKEY2 data can't be successfully!

thank you very much!

8 REPLIES 8
Read only

Former Member
0 Likes
924

You need to clear the string before the second do..enddo.

do

...

clear linekey.

enddo.

Read only

Former Member
0 Likes
924

check your key fields in table ZTEST_TEST ..

also clear LINEKEY ..

DO 2 TIMES.

CLEAR : LINEKEY.

LINEKEY = SY-INDEX.

CONDENSE LINEKEY.

CONCATENATE 'LINEKEY' LINEKEY INTO LINEKEY.

NAME = LINEKEY.

CALL FUNCTION 'ZARFCTEST'

DESTINATION 'DEV120'

STARTING NEW TASK NAME

EXPORTING

linekey = linekey

EXCEPTIONS

COMMUNICATION_FAILURE = 1

SYSTEM_FAILURE = 2.

ENDDO.

Read only

Former Member
0 Likes
924

thank you very much!

i add clear statement but the result not change

Read only

0 Likes
924

USE

CONCATENATE 'LINEKEY' LINEKEY INTO LINEKEY SEPARATED BY SPACE.

Read only

Former Member
0 Likes
924

Hi,

Use Commit Work. This might help you.

Read only

Former Member
0 Likes
924

thank you very much !

but all methods can't valid!

Read only

0 Likes
924

You may have to define the call as sunchronous or asynchronous, define it as asynchronous with MODE = ....

Read only

Former Member
0 Likes
924

hi

i can't find call function have parameter about MODE!

can you give some demo code !

thank you very much!