Skip to Content
0
Dec 24, 2007 at 10:30 AM

Sending Mail error

33 Views

Dear All,

I am working on user-exit IMRC0001 for measuring point.

Basically my requirement is that when ever Meas Reading increases the target value a notification should get generated (this part i have done successfully) and a mail should be sent to the concern person, now the problem is that i m not able to send the mail i m using the FM SO_NEW_DOCUMENT_SEND_API1

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = git_maildata

DOCUMENT_TYPE = 'RAW'

PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

IMPORTING

SENT_TO_ALL = git_flag

NEW_OBJECT_ID = git_objid

tables

  • OBJECT_HEADER =

OBJECT_CONTENT = git_content[]

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = git_reciever[]

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Now if i marks the COMMIT_WORK = 'X' it gives dump ' Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK. '

and if i doesn't give it doesnt send the mail.

What should i do the same scenerio if i run in a report program its running fine but in user exit it is giving dumb.

Please help me!!

Edited by: Rachit Khanna on Dec 24, 2007 11:30 AM