2016 Aug 02 12:16 PM
Hello experts,
I am facing a requirement to generate an email on Usage Decision of user. I chose to do this using user exit: QEVA0010 and
Function Module: SO_NEW_DOCUMENT_SEND_API1. It works perfectly in my Dev system but when I transported the code to QAS, the FM started generating X_ERROR exception. I read that it is not advisable to to commit from within a user so I followed the below steps from:
SO_NEW_DOCUMENT_SEND_API1 not working | SCN
Again, this works perfectly fine in my dev landscape but raises the exception in my QAS. The system seems to be configured to send emails as a previously user exit implemented in CS02 is generating an email. I would be very grateful if you could guide me in the right direction as I have been stuck with this problem for quite some time now.
This is the call to SO_NEW_DOCUMENT_SEND_API1 within my z_fm:
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = MAILDATA
DOCUMENT_TYPE = 'RAW'
"PUT_IN_OUTBOX = 'X'
"COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
OBJECT_HEADER = MAILTXT1
OBJECT_CONTENT = MAILTXT
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
RECEIVERS = RECLIST
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
2016 Aug 03 8:54 PM
+1 to Gaurav, stop using this FM.
However, since it worked in one environment and not in the other then it's not a far stretch to assume that the problem is not with ABAP code. Reach to your Basis admin and check if emails work in general. Also check that parameters for FM are correct and you can always use debugger to get more details.
Hello experts,
I am facing a requirement to generate an email on Usage Decision of user. I chose to do this using user exit: QEVA0010 and
Function Module: SO_NEW_DOCUMENT_SEND_API1. It works perfectly in my Dev system but when I transported the code to QAS, the FM started generating X_ERROR exception. I read that it is not advisable to to commit from within a user so I followed the below steps from:
SO_NEW_DOCUMENT_SEND_API1 not working | SCN
Again, this works perfectly fine in my dev landscape but raises the exception in my QAS. The system seems to be configured to send emails as a previously user exit implemented in CS02 is generating an email. I would be very grateful if you could guide me in the right direction as I have been stuck with this problem for quite some time now.
This is the call to SO_NEW_DOCUMENT_SEND_API1 within my z_fm:
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = MAILDATA
DOCUMENT_TYPE = 'RAW'
"PUT_IN_OUTBOX = 'X'
"COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
OBJECT_HEADER = MAILTXT1
OBJECT_CONTENT = MAILTXT
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
RECEIVERS = RECLIST
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
2016 Aug 03 8:42 AM
Hi,
Have you tried using class CL_BCS, instead of FM SO_NEW_DOCUMENT_SEND_API1??
2016 Aug 03 9:02 AM
Yes I have and I faced the same issue.
As mentioned, there is a previous implementation for CS02 and this uses CL_BCS Class in a z-function module so I called this fm within my user exit and it worked fine on the dev system but in QAS, mail does not reach SOST.
2016 Aug 03 8:54 PM
+1 to Gaurav, stop using this FM.
However, since it worked in one environment and not in the other then it's not a far stretch to assume that the problem is not with ABAP code. Reach to your Basis admin and check if emails work in general. Also check that parameters for FM are correct and you can always use debugger to get more details.
2016 Aug 04 2:38 AM
Anything a bit more specific would be really helpful. As stated before, mails are working in general but having tried CL_BCS gives the same output although it works fine in another user-exit in CS02 (I used the same z-fm that is already implemented for my trial).
What could be the basis issue? What should I look out for in debugging?
2016 Aug 04 5:07 AM
Dear Hashsham,,
i agree with Jelena, better to contact your Basis to fix the email setting for SAP, because you said, your program worked in DEV system.
Regards,
Yance
2016 Aug 04 7:17 AM
And while you're waiting for Basis, rewrite your program (again?) to use the CL_BCS classes. Why bother sticking with an obsolete FM that is always problematic.
2016 Aug 04 7:41 PM
Hashsham Maneri wrote:
What could be the basis issue? What should I look out for in debugging?
Sorry but it seems like now you want SCN to do not just your but also your Basis admin's job. I'm sure there are tons of SCN posts out there on 1001 possible email issue and you both have Google access, so figure it out.
2016 Aug 05 5:52 AM
It was not my intention to get mine or anyone else's job done at all but two programs are already sending emails in the QAS system so I am a bit confused with the issue. Anyways thank you for the input Jelena and everyone else for that matter. I have marked your answers as helpful.