Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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

Former Member
Former Member replied

Hi,

The addition "end of task" will execute the RFC in the update WP i.e after COMMIT statement.

The write staement will not be effective in such case as updates run indepandent of GUI.

Hope it helps,

-Raj

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question