Skip to Content
0
Former Member
Apr 09, 2009 at 09:42 AM

WRITE statement invalid in aRFC calling program 'PERFORMING ON END OF TASK'

20 Views

Hi Experts,

I find the WRITE statement in aRFC calling program doesn't work. Please check the coding here:

DATA:

flag(1),

lt_spfli TYPE spfli_tab,

ls_spfli TYPE spfli,

lv_sys TYPE sy-sysid,

CALL FUNCTION 'ZREAD_SPFLI_INTO_TABLE'

DESTINATION 'DEST50'

STARTING NEW TASK 'T1'

PERFORMING rec ON END OF TASK

EXPORTING

id = 'LH '

EXCEPTIONS

communication_failure = 1

system_failure = 2.

WAIT UNTIL NOT flag IS INITIAL.

FORM rec USING t.

IF t EQ 'T1'.

RECEIVE RESULTS FROM FUNCTION 'ZREAD_SPFLI_INTO_TABLE'

IMPORTING

itab = lt_spfli

sys = lv_sys

EXCEPTIONS

communication_failure = 1

system_failure = 2

OTHERS = 3.

CASE sy-subrc.

WRITE: / 'Connected to system: ', lv_sys.

LOOP AT lt_spfli INTO ls_spfli.

WRITE: / ls_spfli-carrid, ls_spfli-connid, ls_spfli-cityfrom, ls_spfli-cityto.

ENDLOOP.

flag = 'X'.

WHEN 1 OR 2.

WRITE: / 'Error'.

WHEN 3.

WRITE: / 'Not found'.

ENDCASE.

ENDIF.

ENDFORM. "rec