Skip to Content
0
Former Member
Jun 04, 2010 at 03:51 AM

Error when calling CLIPBOARD_IMPORT

593 Views

hi all,

i have the following BDC call and process the return message. It is wokrng fine at foreground.

When execute In background, the write statement return only "Error when calling CLIPBOARD_IMPORT".

please advise what could be the mistake i have made? thanks.

CALL TRANSACTION tcode USING bdcdata
                   MODE   ctumode
                   UPDATE cupdate
                   MESSAGES INTO messtab.
  l_subrc = sy-subrc.

  CLEAR i_message.
  REFRESH i_message.

  LOOP AT messtab.
    SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
                              AND   arbgb = messtab-msgid
                              AND   msgnr = messtab-msgnr.
    IF sy-subrc = 0.
      l_mstring = t100-text.

      IF l_mstring CS '&1'.
        REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
        REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
        REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
        REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
      ELSE.
        REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
        REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
        REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
        REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
      ENDIF.
      CONDENSE l_mstring.

      w_message-msgtyp = messtab-msgtyp.
      w_message-mstring = l_mstring(250).
*     APPEND w_message TO i_message.
      WRITE: /02 w_message-mstring.
      CLEAR w_message.
    ELSE.
      w_message-mstring = messtab.
*      APPEND w_message TO i_message.
      WRITE: /02 w_message-mstring.
      CLEAR w_message.
    ENDIF.

  ENDLOOP.